androidx.test.runner.AndroidJUnit4 Java Examples
The following examples show how to use
androidx.test.runner.AndroidJUnit4.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AndroidAnnotatedBuilderTest.java From android-test with Apache License 2.0 | 6 votes |
@Test public void successfullyCreateAndroidRunner() throws Exception { final Runner mockedRunner = mock(Runner.class); AndroidAnnotatedBuilder ab = new AndroidAnnotatedBuilder(mockRunnerBuilder, mockAndroidRunnerParams) { @Override public Runner buildAndroidRunner(Class<? extends Runner> runnerClass, Class<?> testClass) throws Exception { assertEquals(runnerClass, AndroidJUnit4.class); assertEquals(testClass, RunWithAndroidJUnit4Class.class); return mockedRunner; } }; // attempt to create a runner for a class annotated with @RunWith(AndroidJUnit4.class) Runner runner = ab.runnerForClass(RunWithAndroidJUnit4Class.class); assertEquals(0, runner.testCount()); }