Exemplo n.º 1
0
 public void IsStandartVisitorSetRightPlayerStatsWhenCoomandDown()
 {
     var visitor = new StandartMoveVisitor();
     visitor.SetVisitCommand("d");
     PrivateObject po = new PrivateObject(visitor);
     var result = po.GetField("command");
     Assert.AreEqual("d", result);
 }
Exemplo n.º 2
0
        public void IsStandartVisitorVisitthCommandUp()
        {
            var visitor = new StandartMoveVisitor();
            var player = new Player();
            var board = Board.Instance;
            board.ReplaceSymbol(2, 3, SymbolFactory.GetSymbol(SymbolsEnum.EmptySpace));
            player.SetScore(0);
            player.SetX(3);
            player.SetY(3);

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

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