Skip to content

Commit e46698e

Browse files
committed
Revert "Remove tests"
1 parent e017f1c commit e46698e

4 files changed

Lines changed: 53 additions & 0 deletions

File tree

app/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
}

versions.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,8 @@ versions.firebaseFcm = '20.1.7'
3838
versions.licensesPlugin = '0.10.2'
3939
versions.licensesLib = '17.0.0'
4040

41+
versions.junit = '4.12'
42+
versions.junitExt = '1.1.1'
43+
versions.espresso = '3.2.0'
44+
4145
ext.versions = versions

0 commit comments

Comments
 (0)