Exemplo n.º 1
0
        public void KillPawn()
        {
            Pawn p = new Pawn(Figures.Figure.FigureColor.White);
            Pawn pb = new Pawn(Figures.Figure.FigureColor.Black);

            Assert.AreEqual(true, p.CanKill(new CellMove("e3-d4")));
            Assert.AreEqual(false, p.CanKill(new CellMove("e3-e4")));
            Assert.AreEqual(false, p.CanKill(new CellMove("f3-e2")));
            Assert.AreEqual(false, p.CanKill(new CellMove("e3-g1")));

            Assert.AreEqual(true, pb.CanKill(new CellMove("b7-a6")));
            Assert.AreEqual(true, pb.CanKill(new CellMove("b7-c6")));
            Assert.AreEqual(false, pb.CanKill(new CellMove("c6-a5")));
            Assert.AreEqual(false, pb.CanKill(new CellMove("b7-a8")));
        }
Exemplo n.º 2
0
        public void MovePawn()
        {
            Pawn p = new Pawn(Figures.Figure.FigureColor.White);
            Assert.AreEqual(true, p.CanMove(new CellMove("e2-e4")));
            Assert.AreEqual(false, p.CanMove(new CellMove("e2-e5")));
            Assert.AreEqual(false, p.CanMove(new CellMove("e2-a3")));
            Assert.AreEqual(true, p.CanMove(new CellMove("a2-a3")));
            Assert.AreEqual(false, p.CanMove(new CellMove("b5-b7")));

            Pawn pb = new Pawn(Figures.Figure.FigureColor.Black);
            Assert.AreEqual(false, pb.CanMove(new CellMove("e2-e4")));
            Assert.AreEqual(true, pb.CanMove(new CellMove("b7-b6")));
            Assert.AreEqual(false, pb.CanMove(new CellMove("b4-b2")));
            Assert.AreEqual(false, pb.CanMove(new CellMove("a5-b4")));
            Assert.AreEqual(true, pb.CanMove(new CellMove("g4-g3")));
        }