From 05bcb1c2e93959741360ab52d75151a50feb80da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=9B=9B=E6=B4=81?= <1126388959@qq.com>
Date: Thu, 24 Oct 2019 11:11:52 +0800
Subject: [PATCH] First
---
.../sj/raise2/ExampleInstrumentedTest.java | 27 +++++++++++++++++++
.../java/hunnu/sj/raise2/MainActivity.java | 14 ++++++++++
.../java/hunnu/sj/raise2/ExampleUnitTest.java | 17 ++++++++++++
3 files changed, 58 insertions(+)
create mode 100644 app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java
create mode 100644 app/src/main/java/hunnu/sj/raise2/MainActivity.java
create mode 100644 app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java
diff --git a/app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java b/app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..42907f6
--- /dev/null
+++ b/app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package hunnu.sj.raise2;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("hunnu.sj.raise2", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/java/hunnu/sj/raise2/MainActivity.java b/app/src/main/java/hunnu/sj/raise2/MainActivity.java
new file mode 100644
index 0000000..ee9d6d9
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise2/MainActivity.java
@@ -0,0 +1,14 @@
+package hunnu.sj.raise2;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ }
+}
diff --git a/app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java b/app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java
new file mode 100644
index 0000000..cc1a678
--- /dev/null
+++ b/app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package hunnu.sj.raise2;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file