ExampleInstrumentedTest.java

774 B · raw

1package com.getcapacitor.myapp;23import static org.junit.Assert.*;45import android.content.Context;6import androidx.test.ext.junit.runners.AndroidJUnit4;7import androidx.test.platform.app.InstrumentationRegistry;8import org.junit.Test;9import org.junit.runner.RunWith;1011/**12 * Instrumented test, which will execute on an Android device.13 *14 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>15 */16@RunWith(AndroidJUnit4.class)17public class ExampleInstrumentedTest {1819    @Test20    public void useAppContext() throws Exception {21        // Context of the app under test.22        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();2324        assertEquals("com.getcapacitor.app", appContext.getPackageName());25    }26}