public void ApplyHigherPriorityBehavior_IfTheyAllApplicable() { var getNewCardBehaviour = new GetNewCardBahaviour(); var moveOwnCardBehaviour = new MoveOwnCardForwardBehaviour(); var behaviours = new List <PlayerBehaviourContainer> { new PlayerBehaviourContainer(priority: 1, behaviour: getNewCardBehaviour), new PlayerBehaviourContainer(priority: 2, behaviour: moveOwnCardBehaviour), }; var playerBehaviour = Create.PlayerBehavoiur .WithTailsBehaviours(behaviours) .Build(); var boardMap = $@" +-------------------------------+ +InProgress|InTesting |Completed+ +-------------------------------+ +Ivan | | + + | | + +-------------------------------+"; var board = Create.Board.FromMap(boardMap); var newBoard = playerBehaviour.Apply("Ivan", board, CoinSide.Tails); Assert.True(getNewCardBehaviour.CanApply("Ivan", board, CoinSide.Tails)); Assert.True(moveOwnCardBehaviour.CanApply("Ivan", board, CoinSide.Tails)); AssertBoard.Equals($@"+-------------------------------+ +InProgress|InTesting |Completed+ +-------------------------------+ +Ivan | | + +Ivan | | + +-------------------------------+", newBoard); }
public void NotAllowMoveOwnUnblockedCard_IfNoOwnUnblockdCards() { var moveOwnCardBehaviour = new MoveOwnCardForwardBehaviour(); var boardMap = $@" +-------------------------------+ +InProgress|InTesting |Completed+ +-------------------------------+ +Ivan* | | + + | | + +-------------------------------+"; var board = Create.Board.FromMap(boardMap); Assert.False(moveOwnCardBehaviour.CanApply("Ivan", board, CoinSide.Tails)); }
public void AllowMoveOwnUnblockedCard_WipLimitNotExceed() { var moveOwnCardBehaviour = new MoveOwnCardForwardBehaviour(); var wipLimit = Create.WipLimit.WithLimit(1).Build(); var boardMap = $@" +-------------------------------+ +InProgress|InTesting |Completed+ +-------------------------------+ +Ivan | | + + | | + +-------------------------------+"; var board = Create.Board.FromMap(boardMap); Assert.True(moveOwnCardBehaviour.CanApply("Ivan", board, CoinSide.Tails)); }
public void MoveOwnUnblockedCard_IfOwnCardUnblocked() { var moveOwnCardBehaviour = new MoveOwnCardForwardBehaviour(); var boardMap = $@" +-------------------------------+ +InProgress|InTesting |Completed+ +-------------------------------+ +Ivan | | + + | | + +-------------------------------+"; var board = Create.Board.FromMap(boardMap); var newBoard = moveOwnCardBehaviour.Apply("Ivan", board, CoinSide.Tails); Assert.True(moveOwnCardBehaviour.CanApply("Ivan", board, CoinSide.Tails)); AssertBoard.Equals($@"+-------------------------------+ +InProgress|InTesting |Completed+ +-------------------------------+ + |Ivan | + + | | + +-------------------------------+", newBoard); }