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..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 @@ -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) @@ -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 adc63fd..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 @@ -85,16 +85,17 @@ 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 { } - @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 { }