public Plateau create_boundary(Coordinates coordinates)
 {
     var plateau = Instance.Create<Plateau>();
     plateau.coordinates.point_x = coordinates.point_x;
     plateau.coordinates.point_y = coordinates.point_y;
     return plateau;
 }
 public void setup()
 {
     rover = Instance.Create<Rover>();
     coordinates = new Coordinates { point_x = 3, point_y = 2 };
     plateau = new Plateau { coordinates = new Coordinates { point_x = 5, point_y = 5 } };
     direction = 'n';
 }
            public void should_return_a_new_instance_with_given_coordinates()
            {
                var plateau_factory = new PlateauFactory();
                var actual_coordinates = new Coordinates {point_x = 5, point_y = 5};
                var result = plateau_factory.create_boundary(actual_coordinates);

                Assert.AreEqual(result.coordinates.point_x, actual_coordinates.point_x);
                Assert.AreEqual(result.coordinates.point_y, actual_coordinates.point_y);
            }
 public void setup()
 {
     rover = Instance.Create<Rover>();
     plateau = new Plateau { coordinates = new Coordinates { point_x = 5, point_y = 5 } };
     coordinates = new Coordinates { point_x = 1, point_y = 2 };
     direction = 'n';
     instructions = "LMLMLMLMM";
     result = rover.deploy().at(coordinates).@in(plateau).facing_towards(direction).move_using(instructions);
 }
 public void navigate_rover(Coordinates coordinates, Plateau plateau, char direction, string instructions)
 {
     try
     {
         var rover = Instance.Create<Rover>();
         rover.deploy().at(coordinates).@in(plateau).facing_towards(direction).move_using(instructions);
         show_current_coordinates(rover, default_console);
     }
     catch (Exception ex)
     {
         default_console.WriteLine(ex.Message);
     }
 }
 public void setup()
 {
     coordinates = new Coordinates { point_x = 1, point_y = 1 };
     rover = new Rover { Coordinates = coordinates, Heading = Compass.north };
     rover_move = new RoverMove();
 }
 public void rover_positions(out Coordinates coordinates, out char direction)
 {
     default_console.WriteLine("Deploy Robot coordinates and direction to point to in the format of '1 2 N'");
     rover_position_and_direction(default_console.ReadLine, out coordinates, out direction);
 }
 public void setup()
 {
     rover = Instance.Create<Rover>();
     coordinates = new Coordinates { point_x = 1, point_y = 2 };
 }
Esempio n. 9
0
 public Plateau()
 {
     coordinates = new Coordinates();
 }
 public void setup()
 {
     plateau_factory = MockRepository.GenerateMock<IPlateauFactory>();
     coordinates = new Coordinates();
     plateau_tasks = new PlateauTasks(plateau_factory);
 }
 public IRoverInPlateau at(Coordinates coordinates)
 {
     rover_to_deploy.Coordinates = coordinates;
     return new RoverInPlateau(rover_to_deploy);
 }