public void TestExplosions()
        {
            Piece[][] board = new Piece[8][]
            {
                new Piece[8] { o, o, o, o, kb, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, pw, qb, o, o, o },
                new Piece[8] { o, o, o, bw, pb, o, o, o },
                new Piece[8] { o, o, o, o, o, o, nw, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, o, kw, o, o, o }
            };

            AtomicChessGame game = new AtomicChessGame(board, Player.White);
            Assert.AreEqual(game.ApplyMove(new Move("G3", "E4", Player.White), true), MoveType.Move | MoveType.Capture);

            Piece[][] expected = new Piece[8][]
            {
                new Piece[8] { o, o, o, o, kb, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, pw, o, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, o, o, o, o, o },
                new Piece[8] { o, o, o, o, kw, o, o, o }
            };
            Piece[][] actual = game.GetBoard();
            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void TestExplosions()
        {
            Piece[][] board = new Piece[8][]
            {
                new Piece[8] {
                    o, o, o, o, kb, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, pw, qb, o, o, o
                },
                new Piece[8] {
                    o, o, o, bw, pb, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, nw, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, kw, o, o, o
                }
            };

            AtomicChessGame game = new AtomicChessGame(board, Player.White);

            Assert.AreEqual(game.ApplyMove(new Move("G3", "E4", Player.White), true), MoveType.Move | MoveType.Capture);

            Piece[][] expected = new Piece[8][]
            {
                new Piece[8] {
                    o, o, o, o, kb, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, pw, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, o, o, o, o
                },
                new Piece[8] {
                    o, o, o, o, kw, o, o, o
                }
            };
            Piece[][] actual = game.GetBoard();
            Assert.AreEqual(expected, actual);
        }