lyl_branch
Oowisho 2 months ago
parent 298bcd03f0
commit 46c2cce37c

@ -0,0 +1,32 @@
package net.micode.notes;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Android
*
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
/**
*
*
*/
@Test
public void useAppContext() {
// 获取被测应用的上下文
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
// 验证应用包名是否符合预期
// 包名是应用的唯一标识符通常在build.gradle文件中定义
assertEquals("net.micode.notes", appContext.getPackageName());
}
}
Loading…
Cancel
Save