From 3ec4d8147b171adec917314c5b9d072f069c1588 Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Sun, 10 Apr 2022 14:20:51 +0300 Subject: [PATCH 1/2] Fixing missing code snippet and wrong DisplayName --- codekata/core.again.instructionset.md | 12 ++++++++++++ .../showcase/core/integration/AuthIntegrationTest.kt | 2 +- .../core/integration/CodeKataAuthIntegrationTest.kt | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/codekata/core.again.instructionset.md b/codekata/core.again.instructionset.md index debe86b..2412f79 100644 --- a/codekata/core.again.instructionset.md +++ b/codekata/core.again.instructionset.md @@ -249,6 +249,18 @@ fun networkInputError(authScenario: AuthScenario) = runTest { Assertions.assertEquals(null, fakeUserDataLocalStorage.session) verifyZeroInteractions(mockSessionExpirationListener) } + +//... +companion object { +//... + @JvmStatic + fun networkErrorArguments() = Stream.of( + Arguments.of(AuthScenario.GenericError(username = "a", password = "b")), + Arguments.of(AuthScenario.UnexpectedJsonAsSuccessResponse(username = "a", password = "b")), + Arguments.of(AuthScenario.MalformedJsonAsSuccessResponse(username = "a", password = "b")), + Arguments.of(AuthScenario.MissingFieldJson(username = "a", password = "b")) + ) +} ``` ### 5. `loginInvalidCredentials` diff --git a/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt b/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt index 6d31dc5..7b06a12 100644 --- a/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt +++ b/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt @@ -130,7 +130,7 @@ class AuthIntegrationTest : KoinTest { verifyZeroInteractions(mockSessionExpirationListener) } - @DisplayName("GIVEN no session WHEN user is logging in THEN they get session") + @DisplayName("GIVEN invalid credentials response WHEN user is logging in THEN they get proper error") @Test fun loginInvalidCredentials() = runTest { mockServerScenarioSetup.setScenario(AuthScenario.InvalidCredentials(username = "usr", password = "sEc"), validateArguments = true) diff --git a/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt b/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt index adc63fd..6020b08 100644 --- a/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt +++ b/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt @@ -85,7 +85,7 @@ class CodeKataAuthIntegrationTest : KoinTest { fun networkInputError(authScenario: AuthScenario) = runTest { } - @DisplayName("GIVEN no session WHEN user is logging in THEN they get session") + @DisplayName("GIVEN invalid credentials response WHEN user is logging in THEN they get proper error") @Test fun loginInvalidCredentials() = runTest { } @@ -94,6 +94,7 @@ class CodeKataAuthIntegrationTest : KoinTest { @Test fun logout() = runTest { } + @DisplayName("GIVEN logged in user WHEN user is login out THEN content is cleared") @Test fun logoutReleasesContent() = runTest { From 964df92ce94b4f336d130f54b1d71f815d215995 Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Sun, 10 Apr 2022 14:22:25 +0300 Subject: [PATCH 2/2] Fix typos in DisplayName --- .../test/showcase/core/integration/AuthIntegrationTest.kt | 4 ++-- .../showcase/core/integration/CodeKataAuthIntegrationTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt b/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt index 7b06a12..db3f5ff 100644 --- a/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt +++ b/core/src/test/java/org/fnives/test/showcase/core/integration/AuthIntegrationTest.kt @@ -144,7 +144,7 @@ class AuthIntegrationTest : KoinTest { verifyZeroInteractions(mockSessionExpirationListener) } - @DisplayName("GIVEN logged in user WHEN user is login out THEN they no longer have a session") + @DisplayName("GIVEN logged in user WHEN user is logging out THEN they no longer have a session") @Test fun logout() = runTest { mockServerScenarioSetup.setScenario(AuthScenario.Success(username = "usr", password = "sEc"), validateArguments = true) @@ -158,7 +158,7 @@ class AuthIntegrationTest : KoinTest { verifyZeroInteractions(mockSessionExpirationListener) } - @DisplayName("GIVEN logged in user WHEN user is login out THEN content is cleared") + @DisplayName("GIVEN logged in user WHEN user is logging out THEN content is cleared") @Test fun logoutReleasesContent() = runTest { mockServerScenarioSetup.setScenario(AuthScenario.Success(username = "usr", password = "sEc"), validateArguments = true) diff --git a/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt b/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt index 6020b08..9ad8625 100644 --- a/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt +++ b/core/src/test/java/org/fnives/test/showcase/core/integration/CodeKataAuthIntegrationTest.kt @@ -90,12 +90,12 @@ class CodeKataAuthIntegrationTest : KoinTest { fun loginInvalidCredentials() = runTest { } - @DisplayName("GIVEN logged in user WHEN user is login out THEN they no longer have a session and content is cleared") + @DisplayName("GIVEN logged in user WHEN user is logging out THEN they no longer have a session and content is cleared") @Test fun logout() = runTest { } - @DisplayName("GIVEN logged in user WHEN user is login out THEN content is cleared") + @DisplayName("GIVEN logged in user WHEN user is logging out THEN content is cleared") @Test fun logoutReleasesContent() = runTest { }