示例#1
0
        public void CanStartARobotOnAnArenaPosition()
        {
            var robot = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
            robot.StartAt(SimpleVector());
        }
示例#2
0
        public void CanProvideCommandsToRobot()
        {
            var commandList = new List <RobotCommand>();
            var robot       = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
            robot.StartAt(SimpleVector());
            robot.ExecuteCommandList(commandList);
        }
示例#3
0
        public void CanReportARobotsPosition()
        {
            var startPosition = SimpleVector();

            var robot = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
            robot.StartAt(startPosition);

            RobotVector reportedPosition = robot.ReportPosition();

            Assert.That(reportedPosition, Is.EqualTo(startPosition));
        }
示例#4
0
        public void ExecutingASingleCommandUpdatesThePositionAsExpected()
        {
            var startPosition = new RobotVector(new Position(0, 0), Heading.North);

            var robot = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
            robot.StartAt(startPosition);

            var commandList = new List <RobotCommand>();

            commandList.Add(new MoveForwards());
            robot.ExecuteCommandList(commandList);

            RobotVector reportedPosition = robot.ReportPosition();

            Assert.That(startPosition, Is.Not.EqualTo(reportedPosition));
        }
示例#5
0
        public void CanUploadArenaToRobot()
        {
            var robot = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
        }