Last active
January 20, 2023 19:30
-
-
Save doridori/4acb19b6ac4e965552ba6961e1bc9054 to your computer and use it in GitHub Desktop.
Application as a function blog post code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun reduce(action: Action, state: State): Effect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `GIVEN user is logged in WHEN app moves to the background THEN user is logged out`() { | |
Case.given(State(user = LoggedInUser(username = "Dori"))) | |
.andWhen(ApplicationBackgrounded) | |
.then { newState -> | |
assertThat(newState.user).isOfType(AnonomousUser) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment