public static void TestIsInCheck() { CrazyhouseChessGame game = new CrazyhouseChessGame("rnbqkb1r/p1p2ppp/5p2/1B1p4/3P4/8/PPP2PPP/RNBQK1NR/PNp b KQkq - 9 5"); Assert.True(game.IsInCheck(Player.Black)); Assert.False(game.IsInCheck(Player.White)); Assert.False(game.IsCheckmated(Player.Black)); }
public static void TestNotCheckmatedAndIsValidDrop() { CrazyhouseChessGame game = new CrazyhouseChessGame("rnbqkbnr/1pppp2p/5p2/6pQ/1p1PP3/8/PBP2PPP/RN2KBNR/p b KQkq - 9 5"); Assert.True(game.IsInCheck(Player.Black)); Assert.False(game.IsCheckmated(Player.Black)); Assert.True(game.IsValidDrop(new Drop(new Pawn(Player.Black), new Position("G6"), Player.Black))); Assert.False(game.IsValidDrop(new Drop(new Pawn(Player.Black), new Position("B5"), Player.Black))); Assert.False(game.IsValidDrop(new Drop(new Knight(Player.Black), new Position("G6"), Player.Black))); }