public void TestTryMoveKing_CommandKingUpLeft2() { ChessboardManager chessboardManager = new ChessboardManager(); ChessPiece chessPieceBefore = chessboardManager.GetChessPiece('K'); bool success = chessboardManager.TryMoveKing("KUL"); Assert.IsTrue(success); ChessPiece chessPieceAfter = chessboardManager.GetChessPiece('K'); Assert.AreEqual(chessPieceBefore.Row - 1, chessPieceAfter.Row, "King position is incorrect."); Assert.AreEqual(chessPieceBefore.Col - 1, chessPieceAfter.Col, "King position is incorrect."); }
public void TestTryMovePawn_CommandPawnDownRight2() { ChessboardManager chessboardManager = new ChessboardManager(); ChessPiece chessPieceBefore = chessboardManager.GetChessPiece('A'); bool success = chessboardManager.TryMovePawn("ADR"); Assert.IsTrue(success); ChessPiece chessPieceAfter = chessboardManager.GetChessPiece('A'); Assert.AreEqual(chessPieceBefore.Row + 1, chessPieceAfter.Row, "Pawn position is incorrect."); Assert.AreEqual(chessPieceBefore.Col + 1, chessPieceAfter.Col, "Pawn position is incorrect."); }
public void TestGetChessPiece_ThrowsException() { ChessboardManager chessboardManager = new ChessboardManager(); ChessPiece chessPiece = chessboardManager.GetChessPiece('E'); }