use of com.google.android.apps.common.testing.ui.espresso.ViewFinder in project double-espresso by JakeWharton.
the class ViewFinderImplTest method testGetView_missing.
@UiThreadTest
public void testGetView_missing() {
ViewFinder finder = new ViewFinderImpl(Matchers.<View>nullValue(), testViewProvider);
try {
finder.getView();
fail("No children should pass that matcher!");
} catch (NoMatchingViewException expected) {
}
}
use of com.google.android.apps.common.testing.ui.espresso.ViewFinder in project double-espresso by JakeWharton.
the class ViewFinderImplTest method testGetView_present.
@UiThreadTest
public void testGetView_present() {
ViewFinder finder = new ViewFinderImpl(sameInstance(nestedChild), testViewProvider);
assertThat(finder.getView(), sameInstance(nestedChild));
}
use of com.google.android.apps.common.testing.ui.espresso.ViewFinder in project double-espresso by JakeWharton.
the class ViewFinderImplTest method testGetView_multiple.
@UiThreadTest
public void testGetView_multiple() {
ViewFinder finder = new ViewFinderImpl(Matchers.<View>notNullValue(), testViewProvider);
try {
finder.getView();
fail("All nodes hit that matcher!");
} catch (AmbiguousViewMatcherException expected) {
}
}
use of com.google.android.apps.common.testing.ui.espresso.ViewFinder in project double-espresso by JakeWharton.
the class ViewFinderImplTest method testFind_offUiThread.
public void testFind_offUiThread() {
ViewFinder finder = new ViewFinderImpl(sameInstance(nestedChild), testViewProvider);
try {
finder.getView();
fail("not on main thread, should die.");
} catch (IllegalStateException expected) {
}
}
Aggregations