public void TestPieceGetMoves() { var target = new King(true, "Cc3"); var board = new Board(); var tempList = new List<String> { "Cc4", "Bc4", "Dc4", "Cc2", "Bc2", "Dc2", "Cb3", "Bb3", "Db3", "Cd3", "Bd3", "Dd3", "Bc3", "Dc3", "Cd4", "Bd4", "Dd4", "Cb4", "Bb4", "Db4", "Cd2", "Bd2", "Dd2", "Cb2", "Bb2", "Db2" }; Assert.AreEqual(tempList, target.GetMoves(board)); }
public void TestPieceGetMovesWithTakeable() { var target = new King(true, "Cc3"); var board = new Board(); board.GetCell("Cb4").AddPiece(new Pawn(false, "Cb4")); board.GetCell("Dc4").AddPiece(new Pawn(false, "Dc4")); board.GetCell("Cc4").AddPiece(new Pawn(false, "Cc4")); board._blackPieces.Add(board.GetCell("Cb4").GetPiece()); board._blackPieces.Add(board.GetCell("Dc4").GetPiece()); board._blackPieces.Add(board.GetCell("Cc4").GetPiece()); var tempList = new List<String> { "Cc4", "Bc4", "Cc2", "Bc2", "Dc2", "Cb3", "Bb3", "Db3", "Cd3", "Bd3", "Dd3", "Bc3", "Dc3", "Cd4", "Bd4", "Cb4", "Bb4", "Cd2", "Bd2", "Dd2", "Cb2", "Bb2", "Db2" }; Assert.AreEqual(tempList, target.GetMoves(board)); }