沉迷草猫不能自拔,坐等vol.3~~
android studio 上面自带的单元测试不会用,先记录一下
ExampleInstrumentedTest.java中就是
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.bz0209.myapplication", appContext.getPackageName());
}
@Test
public void Save(){
Context appContext = InstrumentationRegistry.getTargetContext();
FileService fs = new FileService(appContext);
assertEquals(true, fs.Save("one"));
}
@Test
public void Read(){
Context appContext = InstrumentationRegistry.getTargetContext();
FileService fs = new FileService(appContext);
assertEquals("one", fs.Read());
}
}
嘛,虽然这么说,但是什么意思我确实不是很明白啊