File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
src/androidTest/java/com/talkable/demo Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ android {
1616 compileSdkVersion 34
1717 defaultConfig {
1818 applicationId " com.talkable.demo"
19- minSdkVersion 16
19+ minSdkVersion 19
2020 targetSdkVersion 34
2121 versionCode 34
2222 versionName " 0.5.3"
@@ -39,6 +39,6 @@ dependencies {
3939 implementation fileTree(include : [' *.jar' ], dir : ' libs' )
4040 implementation project(path : ' :sdk' )
4141 implementation ' com.google.android.material:material:1.0.0'
42- implementation ' androidx.legacy:legacy-support-v4 :1.0.0 '
43- testImplementation ' junit:junit:4.12 '
42+ androidTestImplementation ' androidx.test.ext:junit :1.2.1 '
43+ androidTestImplementation ' androidx.test.espresso:espresso-core:3.6.1 '
4444}
Original file line number Diff line number Diff line change 11package com .talkable .demo ;
22
33import android .app .Application ;
4- import android .test .ApplicationTestCase ;
4+ import androidx .test .core .app .ApplicationProvider ;
5+ import org .junit .Test ;
6+ import static org .junit .Assert .*;
57
68/**
7- * <a href="http ://d .android.com/tools/testing/testing_android.html ">Testing Fundamentals</a>
9+ * <a href="https ://developer .android.com/studio/test ">Testing Fundamentals</a>
810 */
9- public class ApplicationTest extends ApplicationTestCase <Application > {
10- public ApplicationTest () {
11- super (Application .class );
11+
12+ public class ApplicationTest {
13+ @ Test
14+ public void testApplication () {
15+ // Getting the application context using AndroidX ApplicationProvider
16+ Application app = ApplicationProvider .getApplicationContext ();
17+ assertNotNull (app ); // Assert that the Application context is not null
1218 }
1319}
You can’t perform that action at this time.
0 commit comments