コード例 #1
0
ファイル: BotTests.cs プロジェクト: etidalgo/run-a-bot
        public void VerifyLeftRightAction(Direction.DirectionType startOrientation, BotAction turnAction, Direction.DirectionType endOrientation)
        {
            Board board = new Board(5, 5);
            BotTest bot = new BotTest(board);
            bot._SetCoordinates(2, 2);
            bot._SetOrientation(startOrientation); 

            turnAction.Apply(bot);
            Assert.AreEqual(endOrientation, bot.Orientation);
        }
コード例 #2
0
ファイル: BotTests.cs プロジェクト: etidalgo/run-a-bot
 public void VerifyMoveAction(Tuple<int,int> start, Direction.DirectionType orientation, Tuple<int, int> end)
 {
     Board board = new Board(5, 5);
     BotTest bot = new BotTest(board);
     bot._SetCoordinates(start.Item1, start.Item2);
     bot._SetOrientation(orientation);
     BotActionMove action = new BotActionMove();
     action.Apply(bot);
     Assert.AreEqual(end.Item1, bot.X);
     Assert.AreEqual(end.Item2, bot.Y);
 }