Projet Darts  0.2
BTS SNIR LaSalle Avignon 2020
ExampleInstrumentedTest.java
Aller à la documentation de ce fichier.
1 package projet.lasalle84.darts;
2 
3 import android.content.Context;
4 
5 import androidx.test.platform.app.InstrumentationRegistry;
6 import androidx.test.ext.junit.runners.AndroidJUnit4;
7 
8 import org.junit.Test;
9 import org.junit.runner.RunWith;
10 
11 import static org.junit.Assert.*;
12 
18 @RunWith(AndroidJUnit4.class)
20  @Test
21  public void useAppContext() {
22  // Context of the app under test.
23  Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 
25  assertEquals("projet.lasalle84.darts", appContext.getPackageName());
26  }
27 }