I have recently began writing tests for Android using the espresso library.Here I have three tests.The first test is to check if a snackbar appears when searching with blank text.The second is a search for a restaraunt not in the database.Finally I have a test that checks if there is an internet connection.Can anyone verify that my tests are doing what I intend them to do and if there is anything I am missing or doing wrong?    public class MainScreenTest {    //Rules are interceptors which are executed for each test method    //and will run before any set up code in the @Before method    @Rule   public ActivityTestRule<MainScreen> mainScreenActivityTestRule =            new ActivityTestRule<MainScreen>(MainScreen.class);    @Test    public void testSearchWithBlankText() throws Exception{        Espresso.onView(withId(R.id.searchEditText)).perform(typeText(),pressImeActionButton());        Espresso.onView(withText(R.string.invalidSearch))                .check(matches(isDisplayed()));    }    @Test    public void testSearchWithInvalidRestaurant() throws Exception{        Espresso.onView(withId(R.id.searchEditText))                .perform(typeText(Hoffman),pressImeActionButton());        Espresso.onView(withId(R.id.noResultsTV)).check(matches(withText(No results, try another restaurant)));    }    @Test    public void testWhenInternetIsAvailable() throws Exception{        Context context = mainScreenActivityTestRule.getActivity().getBaseContext();        ConnectivityManager cm = (ConnectivityManager)                context.getSystemService(Context.CONNECTIVITY_SERVICE);        boolean isConnected = cm.getActiveNetworkInfo().isConnectedOrConnecting();        Assert.assertEquals(true, isConnected);    }}
Espresso tests that check if Snackbar is displayed and if there is an internet connection
java;unit testing;android;junit