Ejemplo n.º 1
0
        public void CannotSetCommandListUntilRobotHasStartingLocation()
        {
            var commandList = new List <RobotCommand>();
            var robot       = new WarriorRobot();

            Assert.Throws <WarriorRobot.StartLocationNotSetException>(() => robot.ExecuteCommandList(commandList));
        }
Ejemplo n.º 2
0
        public void CanStartARobotOnAnArenaPosition()
        {
            var robot = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
            robot.StartAt(SimpleVector());
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 6
0
        public void CannotStartARobotWhenNoArenaUploaded()
        {
            var robot = new WarriorRobot();

            Assert.Throws <WarriorRobot.ArenaNotUploadedException>(() => robot.StartAt(SimpleVector()));
        }
Ejemplo n.º 7
0
        public void CanUploadArenaToRobot()
        {
            var robot = new WarriorRobot();

            robot.UploadArena(new Arena(1, 1));
        }
Ejemplo n.º 8
0
 public void CanCreateAWarriorRobot()
 {
     var robot = new WarriorRobot();
 }