public void CanTransitionStateMachineFromPayingToGameOver()
        {
            var             displayHandler = MockDisplayHandler.Object;
            const GameState gameState      = GameState.Playing;

            var stateMachine = new StateMachineGameState(gameState, displayHandler);

            stateMachine.Fire(GameStateTrigger.StopGame);

            const GameState expectedState = GameState.GameOver;
            var             actualState   = stateMachine.State;

            Assert.Equal(expectedState, actualState);
            MockDisplayHandler.Verify(mock => mock.DisplayMessage(It.IsAny <string>()), Times.Once);
        }
        public void CanTransitionStateMachineFromThirdPieceToFourthPiece()
        {
            var            displayHandler   = MockDisplayHandler.Object;
            const WorldMap worldMapPosition = WorldMap.ThirdPieceVerticalPipe;

            var stateMachine = new WorldMapStateMachine(worldMapPosition, displayHandler);

            stateMachine.Fire(PlayerMovement.Forward);

            const WorldMap expectedWorldMapPosition = WorldMap.FourthPieceVerticalT;
            var            actualWorldMapPosition   = stateMachine.State;

            Assert.Equal(expectedWorldMapPosition, actualWorldMapPosition);
            MockDisplayHandler.Verify(mock => mock.DisplayMessage(It.IsAny <string>()), Times.Once);
        }
        public void CanTransitionStateMachineFromFifthPieceToSixthPiece()
        {
            var            displayHandler   = MockDisplayHandler.Object;
            const WorldMap worldMapPosition = WorldMap.FifthPieceHorizontalPipe;

            var stateMachine = new WorldMapStateMachine(worldMapPosition, displayHandler);

            stateMachine.Fire(PlayerMovement.Right);

            const WorldMap expectedWorldMapPosition = WorldMap.SixthPieceFlippedLeftAngle;
            var            actualWorldMapPosition   = stateMachine.State;

            Assert.Equal(expectedWorldMapPosition, actualWorldMapPosition);
            MockDisplayHandler.Verify(mock => mock.DisplayMessage(It.IsAny <string>()), Times.Once);
        }
        public void CanTransitionStateMachineFromEleventhPieceToTwelfthPiece()
        {
            var            displayHandler   = MockDisplayHandler.Object;
            const WorldMap worldMapPosition = WorldMap.EleventhPieceFlippedRightAngle;

            var stateMachine = new WorldMapStateMachine(worldMapPosition, displayHandler);

            stateMachine.Fire(PlayerMovement.Forward);

            const WorldMap expectedWorldMapPosition = WorldMap.TwelfthPieceExit;
            var            actualWorldMapPosition   = stateMachine.State;

            Assert.Equal(expectedWorldMapPosition, actualWorldMapPosition);
            MockDisplayHandler.Verify(mock => mock.DisplayMessage(It.IsAny <string>()), Times.Once);
        }