Exemplo n.º 1
0
        public static void TestUndoMultiple()
        {
            RacingKingsChessGame game = new RacingKingsChessGame();
            string initial            = game.GetFen();

            game.MakeMove(new Move("F2", "D4", Player.White), true);
            game.MakeMove(new Move("A2", "B3", Player.Black), true);
            game.MakeMove(new Move("D4", "B2", Player.White), true);
            game.MakeMove(new Move("D1", "B2", Player.Black), true);
            Assert.AreEqual(4, game.Undo(4));
            Assert.AreEqual(initial, game.GetFen());
            Assert.AreEqual(Player.White, game.WhoseTurn);
        }
Exemplo n.º 2
0
        public static void TestIsNotWinner()
        {
            RacingKingsChessGame game = new RacingKingsChessGame("4K3/2k5/8/8/8/8/1rbnNBR1/qrbnNBRQ b - - 11 6");

            game.MakeMove(new Move("C7", "C8", Player.Black), true);
            Assert.False(game.IsWinner(Player.Black));
            Assert.False(game.IsWinner(Player.White));
        }
Exemplo n.º 3
0
        public static void TestIsWinnerWhite1()
        {
            RacingKingsChessGame game = new RacingKingsChessGame("5K2/1k6/8/8/8/8/1rbnNBR1/qrbnNBRQ b - - 11 6");

            Assert.False(game.IsWinner(Player.White));

            game.MakeMove(new Move("B7", "C7", Player.Black), true);
            Assert.True(game.IsWinner(Player.White));
        }
Exemplo n.º 4
0
        public static void TestUndoMove()
        {
            RacingKingsChessGame game = new RacingKingsChessGame();
            string initial            = game.GetFen();

            game.MakeMove(new Move("F2", "D4", Player.White), true);
            Assert.True(game.Undo());
            Assert.AreEqual(initial, game.GetFen());
            Assert.AreEqual(Player.White, game.WhoseTurn);
        }