Ejemplo n.º 1
0
 public void IsDiagonalMoveVisitorSetRightPlayerStatsWhenCoomandDown()
 {
     var visitor = new DiagonalMoveVisitor();
     visitor.SetVisitCommand("dl");
     PrivateObject po = new PrivateObject(visitor);
     var result = po.GetField("command");
     Assert.AreEqual("dl", result);
 }
Ejemplo n.º 2
0
        public void IsStandartVisitorVisitWithCommandUpRight()
        {
            var visitor = new DiagonalMoveVisitor();
            var player = new Player();
            var board = Board.Instance;
            board.ReplaceSymbol(2, 4, SymbolFactory.GetSymbol(SymbolsEnum.EmptySpace));
            player.SetScore(0);
            player.SetX(3);
            player.SetY(3);

            visitor.SetVisitCommand("ur");
            visitor.Visit(player);

            Assert.AreEqual(1, player.GetScore());
            Assert.AreEqual(2, player.GetX());
            Assert.AreEqual(4, player.GetY());
        }