示例#1
0
        public void PawnTwoCellsNot()
        {
            var from = new Position("a3");
            var to = new Position("a5");
            var s = new ChessState();
            s[from] = new ChessPiece { Player = new Player(1) };
            var m = new PawnMoveTemplate();

            Assert.IsFalse(m.CanApply(from, to, s));
        }
示例#2
0
        public void PawnUp()
        {
            var from = new Position("a2");
            var to = new Position("a3");
            var s = new ChessState();
            s[from] = new ChessPiece {Player = new Player(1)};
            var m = new PawnMoveTemplate();

            Assert.IsTrue(m.CanApply(from,to,s));
        }
示例#3
0
        public void PawnTwoCellsBlack()
        {
            var from = new Position("a7");
            var to = new Position("a5");
            var s = new ChessState();
            s[from] = new ChessPiece { Player = new Player(2) };
            var m = new PawnMoveTemplate();

            Assert.IsTrue(m.CanApply(from, to, s));
        }