File tree Expand file tree Collapse file tree
androidTest/java/com/simonesestito/shopsqueue
test/java/com/simonesestito/shopsqueue Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,4 +88,9 @@ dependencies {
8888
8989 // Firebase
9090 implementation " com.google.firebase:firebase-messaging:$versions . firebaseFcm "
91+
92+ // Testing libs
93+ testImplementation " junit:junit:$versions . junit "
94+ androidTestImplementation " androidx.test.ext:junit:$versions . junitExt "
95+ androidTestImplementation " androidx.test.espresso:espresso-core:$versions . espresso "
9196}
Original file line number Diff line number Diff line change 1+ package com .simonesestito .shopsqueue ;
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+
13+ /**
14+ * Instrumented test, which will execute on an Android device.
15+ *
16+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+ */
18+ @ RunWith (AndroidJUnit4 .class )
19+ public class ExampleInstrumentedTest {
20+ @ Test
21+ public void useAppContext () {
22+ // Context of the app under test.
23+ Context appContext = InstrumentationRegistry .getInstrumentation ().getTargetContext ();
24+
25+ assertEquals ("com.simonesestito.shopsqueue" , appContext .getPackageName ());
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ package com .simonesestito .shopsqueue ;
2+
3+ import org .junit .Test ;
4+
5+ import static org .junit .Assert .*;
6+
7+ /**
8+ * Example local unit test, which will execute on the development machine (host).
9+ *
10+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11+ */
12+ public class ExampleUnitTest {
13+ @ Test
14+ public void addition_isCorrect () {
15+ assertEquals (4 , 2 + 2 );
16+ }
17+ }
Original file line number Diff line number Diff line change @@ -38,4 +38,8 @@ versions.firebaseFcm = '20.1.7'
3838versions. licensesPlugin = ' 0.10.2'
3939versions. licensesLib = ' 17.0.0'
4040
41+ versions. junit = ' 4.12'
42+ versions. junitExt = ' 1.1.1'
43+ versions. espresso = ' 3.2.0'
44+
4145ext. versions = versions
You can’t perform that action at this time.
0 commit comments