public void SetUp()
 {
     _ruleset = GetRuleSet();
     _board   = Substitute.For <IChessBoard>();
     _board.IsLegalBoardPosition(0, 0).ReturnsForAnyArgs(true);
     _board.IsStraightClearPathBetween(0, 0, 0, 0).ReturnsForAnyArgs(true);
 }
Ejemplo n.º 2
0
        public void Is_Straight_Clear_Path_Between_Returns_True_On_Clear_Path_X_Equals_C()
        {
            var pawn = Substitute.For <IChessPiece>();

            _chessBoard.Add(pawn, 0, 0, pawn.Color);
            Assert.That(_chessBoard.IsStraightClearPathBetween(pawn.XCoordinate, pawn.YCoordinate, pawn.XCoordinate, _chessBoard.Height - 1), Is.True);
        }
 public bool IsMoveValid(IChessBoard board, Move move)
 {
     return(board.IsStraightClearPathBetween(move.StartingX, move.StartingY, move.EndingX, move.EndingY));
 }