Ejemplo n.º 1
0
        public void CaptureMove()
        {
            var s = new GameState(5, 5);
            var from = new Position(1, 1);
            var to = new Position(2, 2);
            s[from] = new Piece();
            var movingPiece = s[from];
            s[to] = new Piece();
            var m = new ConcreteMove(from, to);

            m.Apply(s);

            Assert.AreEqual(s[to], movingPiece);
        }
Ejemplo n.º 2
0
        public void SimpleMove()
        {
            var s = new GameState(5, 5);
            var from = new Position(1, 1);
            var to = new Position(2, 2);
            s[from] = new Piece();
            var movingPiece = s[from];
            var m = new ConcreteMove(from, to);

            m.Apply(s);

            Assert.IsTrue(s[from].IsEmpty);
            Assert.AreNotEqual(s[from], movingPiece);
            Assert.AreEqual(s[to], movingPiece);
        }