public static void TestIsCheckmated() { CrazyhouseChessGame game = new CrazyhouseChessGame("r2q1r2/ppp4p/2np1Pp1/8/4P1Pk/6bP/PB3bPq/R6K/Pprnnnbpp w - - 76 39"); Assert.True(game.IsCheckmated(Player.White)); Assert.False(game.IsStalemated(Player.White)); }
public static void TestIsStalemated() { CrazyhouseChessGame game = new CrazyhouseChessGame("rnbqkbnr/pppppppp/8/5K2/8/8/ppp1qppp/rnb2bnr/pp w kq - 98 71"); Assert.True(game.IsStalemated(Player.White)); Assert.False(game.IsCheckmated(Player.White)); }
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))); }