示例#1
0
        public void WhenPieceAnimation_IsComplete_PieceState_IsSelectable()
        {
            GamePiecePM systemUnderTest = CreateSystem();

            systemUnderTest.ViewModel.SetProperty(GamePiecePM.IS_ON_PROPERTY, Color.yellow);

            systemUnderTest.OnAnimationComplete();

            MockPiece.Received().State = GamePieceStates.Selectable;
        }
示例#2
0
        public void WhenChainCanceled_PiecesInChain_AreFailed()
        {
            systemUnderTest.Chain = new List <IGamePiece>();
            IGamePiece mockPiece = Substitute.For <IGamePiece>();

            systemUnderTest.Chain.Add(mockPiece);

            systemUnderTest.CancelChain();

            mockPiece.Received().PieceFailedMatch();
        }
示例#3
0
        public void WhenProcessingChain_IfChainDoesNotMatchAnyMonster_PiecesFailedMatch_IsCalled()
        {
            IGamePiece        mockPiece = Substitute.For <IGamePiece>();
            List <IGamePiece> chain     = new List <IGamePiece>()
            {
                mockPiece
            };

            MonsterManager.DoesMoveMatchAnyCurrentMonsters(Arg.Any <List <IGamePiece> >()).Returns(false);

            systemUnderTest.Process(chain);

            mockPiece.Received().PieceFailedMatch();
        }