コード例 #1
0
        public void NotAllowsMoveAnotherPlayerUnblockedCard_IfCardBlocked()
        {
            var moveAnotherPlayerCardForwardBehaviour = new MoveAnotherPlayerCardForwardBehaviour();
            var boardMap = $@"  +-------------------------------+
                                +InProgress|InTesting |Completed+
                                +-------------------------------+
                                +Ivan*     |          |         +
                                +          |          |         +
                                +-------------------------------+";
            var board    = Create.Board.FromMap(boardMap);

            Assert.False(moveAnotherPlayerCardForwardBehaviour.CanApply("Ivan", board, CoinSide.Tails));
        }
コード例 #2
0
        public void AllowsMoveAnotherPlayerUnblockedCard_IfDropTailsAndWipLimitNotExceed()
        {
            var moveAnotherPlayerCardForwardBehaviour = new MoveAnotherPlayerCardForwardBehaviour();
            var wipLimit = Create.WipLimit.WithLimit(1).Build();
            var boardMap = $@"  +-------------------------------+
                                +InProgress|InTesting |Completed+
                                +-------------------------------+
                                +Vova      |          |         +
                                +          |          |         +
                                +-------------------------------+";
            var board    = Create.Board.FromMap(boardMap);

            Assert.True(moveAnotherPlayerCardForwardBehaviour.CanApply("Ivan", board, CoinSide.Tails));
        }
コード例 #3
0
        public void NotAllowsMoveAnotherPlayerUnblockedCard_IfDropTailsAndWipLimitExceed()
        {
            var moveAnotherPlayerCardForwardBehaviour = new MoveAnotherPlayerCardForwardBehaviour();
            var boardMap = $@"  +-------------------------------+
                                +InProgress|InTesting |Completed+
                                +-------------------------------+
                                +Vova      |Ivan      |         +
                                +          |          |         +
                                #-------------------------------#
                                +Limit:1   |Limit:1   |         +";
            var board    = Create.Board.FromMap(boardMap);

            Assert.False(moveAnotherPlayerCardForwardBehaviour.CanApply("Ivan", board, CoinSide.Tails));
        }
コード例 #4
0
        public void MoveAnotherPlayerUnblockedCard_IfCardUnblocked()
        {
            var moveAnotherPlayerCardForwardBehaviour = new MoveAnotherPlayerCardForwardBehaviour();
            var boardMap = $@"  +-------------------------------+
                                +InProgress|InTesting |Completed+
                                +-------------------------------+
                                +Vova      |          |         +
                                +          |          |         +
                                +-------------------------------+";
            var board    = Create.Board.FromMap(boardMap);

            var newBoard = moveAnotherPlayerCardForwardBehaviour.Apply("Ivan", board, CoinSide.Tails);

            Assert.True(moveAnotherPlayerCardForwardBehaviour.CanApply("Ivan", board, CoinSide.Tails));
            AssertBoard.Equals($@"+-------------------------------+
                                  +InProgress|InTesting |Completed+
                                  +-------------------------------+
                                  +          |Vova      |         +
                                  +          |          |         +
                                  +-------------------------------+", newBoard);
        }