How to unit-test interface's static method with instrumentation test?
I tried testing(Android Test) with following code; simplified for explanation.
But AndroidStudio said "Empty test suite."
In the case same code with local unit test(it meeans test code is located in test/java), test result was GREEN.
Why does only android-test fail?
and how to write android-test code for interface static method?
test target:
public interface SampleInterface {
static String methodA(){
return "foobar";
}
}
test code:
@RunWith(AndroidJUnit4.class)
public class SampleInterfaceTest {
@Test
public void methodA() {
Assert.assertThat(SampleInterface.methodA(), is("foobar"));
}
}
message.
Started running tests
Test running failed: Instrumentation run failed due to 'java.lang.IllegalArgumentException'
Empty test suite.