From a80c047f04d79cece5ee8d3f1b56733779cef2f0 Mon Sep 17 00:00:00 2001 From: Larry7939 <70442964+Larry7939@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:26:05 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[Fix]=201=EB=8B=A8=EA=B3=84=20=EB=AF=B8?= =?UTF-8?q?=EC=85=98=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/repository/DefaultGithubProfileRepositoryTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/test/java/com/malibin/study/github/data/repository/DefaultGithubProfileRepositoryTest.kt b/app/src/test/java/com/malibin/study/github/data/repository/DefaultGithubProfileRepositoryTest.kt index 4bf8e8a..a533b87 100644 --- a/app/src/test/java/com/malibin/study/github/data/repository/DefaultGithubProfileRepositoryTest.kt +++ b/app/src/test/java/com/malibin/study/github/data/repository/DefaultGithubProfileRepositoryTest.kt @@ -93,7 +93,7 @@ internal class DefaultGithubProfileRepositoryTest { val actualResult = defaultGithubProfileRepository.getGithubProfile("name1") //then assertAll( - { assertThat(actualResult).isEqualTo(Result.success(gitHubProfile))}, + { assertThat(actualResult.getOrNull()).isEqualTo(gitHubProfile)}, { coVerify(exactly = 1) { fakeLocalGithubProfileSource.getGithubProfile("name1") } } ) } From 8a0c10052a95b8ba116f72dfa18248ff0707aa1d Mon Sep 17 00:00:00 2001 From: Larry7939 <70442964+Larry7939@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:28:34 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[Setting]=20=EB=88=84=EB=9D=BD=EB=90=9C=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 7fe4e7e..9ecf161 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,6 +69,8 @@ dependencies { testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4' testImplementation 'com.google.truth:truth:1.1.3' testImplementation 'io.mockk:mockk:1.13.2' + // okhttp mock web server + testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1' // Instrumentation test androidTestImplementation "androidx.test:runner:1.5.2" @@ -79,4 +81,6 @@ dependencies { androidTestImplementation 'io.mockk:mockk:1.13.2' androidTestImplementation 'de.mannodermaus.junit5:android-test-core:1.3.0' androidTestRuntimeOnly 'de.mannodermaus.junit5:android-test-runner:1.3.0' + // for context in instrumentation test + androidTestImplementation 'androidx.test:core:1.5.0' } From 80569b0bf461155c71a63f9410604c37b9beeb83 Mon Sep 17 00:00:00 2001 From: Larry7939 <70442964+Larry7939@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:33:57 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[Docs]=203=EB=8B=A8=EA=B3=84=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=AA=A9=EB=A1=9D=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe78b7c..126cfd2 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,7 @@ ## 🎲 2단계 1. loadGithubProfile 메소드 호출 성공 시 GithubProfile을 가져온다. -2. loadGithubProfile 메소드 호출 실패 시 isError의 value 가 True가 된다. \ No newline at end of file +2. loadGithubProfile 메소드 호출 실패 시 isError의 value 가 True가 된다. + +## 🎲 3단계 +1. 올바른 패키지 명을 반환한다. \ No newline at end of file From 4da8352f7f09d3d280c88ae38f00c7b9dd7cd6c1 Mon Sep 17 00:00:00 2001 From: Larry7939 <70442964+Larry7939@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:34:37 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[Feat]=20ExampleInstrumentedTest=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/github/ExampleInstrumentedTest.kt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/androidTest/java/com/malibin/study/github/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/malibin/study/github/ExampleInstrumentedTest.kt index eba15b0..562464d 100644 --- a/app/src/androidTest/java/com/malibin/study/github/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/com/malibin/study/github/ExampleInstrumentedTest.kt @@ -1,24 +1,21 @@ package com.malibin.study.github import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* /** * Instrumented test, which will execute on an Android device. * * See [testing documentation](http://d.android.com/tools/testing). */ -@RunWith(AndroidJUnit4::class) + class ExampleInstrumentedTest { @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.malibin.study.github", appContext.packageName) + fun `올바른_패키지_명을_반환한다`() { + //when + val actualResult = InstrumentationRegistry.getInstrumentation().targetContext + //then + assertEquals("com.malibin.study.github", actualResult.packageName) } }