Created
August 3, 2020 20:26
-
-
Save sandeshbodake/930f46bcc04beff81a7e7cee57003317 to your computer and use it in GitHub Desktop.
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
| package test.kotlin | |
| import main.kotlin.WHBEvent | |
| import main.kotlin.WHBState | |
| import main.kotlin.WHBStateMachine | |
| import org.assertj.core.api.Assertions.assertThat | |
| import org.junit.jupiter.api.BeforeEach | |
| import org.junit.jupiter.api.DisplayName | |
| import org.junit.jupiter.api.Tag | |
| import org.junit.jupiter.api.Test | |
| @Tag("unitTest") | |
| class WHBStateMachineTest { | |
| private lateinit var stateMachine: WHBStateMachine | |
| @BeforeEach | |
| fun configureSystemUnderTest() { | |
| stateMachine = WHBStateMachine() | |
| } | |
| @Test | |
| @DisplayName("Should return initial state") | |
| fun initialTest(){ | |
| assertThat(stateMachine.whbStateMachine.state).isEqualTo(WHBState.Bed) | |
| } | |
| @Test | |
| @DisplayName("Should changed proper state on particular transaction ") | |
| fun transitionState() { | |
| val transaction = stateMachine.whbStateMachine.transition(WHBEvent.Wake) | |
| assertThat(stateMachine.whbStateMachine.state).isEqualTo(WHBState.Home) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment