Merge pull request #72 from fknives/core-again-fixes
Fixing missing code snippet and wrong DisplayName
This commit is contained in:
commit
8659488b6a
3 changed files with 19 additions and 6 deletions
|
|
@ -249,6 +249,18 @@ fun networkInputError(authScenario: AuthScenario) = runTest {
|
||||||
Assertions.assertEquals(null, fakeUserDataLocalStorage.session)
|
Assertions.assertEquals(null, fakeUserDataLocalStorage.session)
|
||||||
verifyZeroInteractions(mockSessionExpirationListener)
|
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`
|
### 5. `loginInvalidCredentials`
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ class AuthIntegrationTest : KoinTest {
|
||||||
verifyZeroInteractions(mockSessionExpirationListener)
|
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
|
@Test
|
||||||
fun loginInvalidCredentials() = runTest {
|
fun loginInvalidCredentials() = runTest {
|
||||||
mockServerScenarioSetup.setScenario(AuthScenario.InvalidCredentials(username = "usr", password = "sEc"), validateArguments = true)
|
mockServerScenarioSetup.setScenario(AuthScenario.InvalidCredentials(username = "usr", password = "sEc"), validateArguments = true)
|
||||||
|
|
@ -144,7 +144,7 @@ class AuthIntegrationTest : KoinTest {
|
||||||
verifyZeroInteractions(mockSessionExpirationListener)
|
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
|
@Test
|
||||||
fun logout() = runTest {
|
fun logout() = runTest {
|
||||||
mockServerScenarioSetup.setScenario(AuthScenario.Success(username = "usr", password = "sEc"), validateArguments = true)
|
mockServerScenarioSetup.setScenario(AuthScenario.Success(username = "usr", password = "sEc"), validateArguments = true)
|
||||||
|
|
@ -158,7 +158,7 @@ class AuthIntegrationTest : KoinTest {
|
||||||
verifyZeroInteractions(mockSessionExpirationListener)
|
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
|
@Test
|
||||||
fun logoutReleasesContent() = runTest {
|
fun logoutReleasesContent() = runTest {
|
||||||
mockServerScenarioSetup.setScenario(AuthScenario.Success(username = "usr", password = "sEc"), validateArguments = true)
|
mockServerScenarioSetup.setScenario(AuthScenario.Success(username = "usr", password = "sEc"), validateArguments = true)
|
||||||
|
|
|
||||||
|
|
@ -85,16 +85,17 @@ class CodeKataAuthIntegrationTest : KoinTest {
|
||||||
fun networkInputError(authScenario: AuthScenario) = runTest {
|
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
|
@Test
|
||||||
fun loginInvalidCredentials() = runTest {
|
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
|
@Test
|
||||||
fun logout() = runTest {
|
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
|
@Test
|
||||||
fun logoutReleasesContent() = runTest {
|
fun logoutReleasesContent() = runTest {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue