Ejemplo n.º 1
0
 public void ExecuteCommandCenterHavingSingleRover()
 {
     this.marsRoverCommandCenter.NumberOfRovers = 1;
     this.marsRoverCommandCenter.AddMarsRoverInstructions(new MarsRoverInstructions
     {
         RoverPosition         = new MarsRoverParser("1 2 N")
         , CommandInstructions = RoverCommandUtility.GetRoverCommands("R")
     });
     Assert.AreEqual("1 2 E", MarsRoverParser.GetMarsRoverPositions(this.marsRoverCommandCenter.Execute()));
 }
Ejemplo n.º 2
0
 public void ExecuteCommandCenterHavingTwoRovers()
 {
     this.marsRoverCommandCenter.NumberOfRovers = 2;
     this.marsRoverCommandCenter.AddMarsRoverInstructions(new MarsRoverInstructions
     {
         RoverPosition = new MarsRoverParser("1 1 N")
         ,
         CommandInstructions = RoverCommandUtility.GetRoverCommands("R")
     });
     this.marsRoverCommandCenter.AddMarsRoverInstructions(new MarsRoverInstructions
     {
         RoverPosition = new MarsRoverParser("3 3 N")
         ,
         CommandInstructions = RoverCommandUtility.GetRoverCommands("R")
     });
     Assert.AreEqual("1 1 E" + System.Environment.NewLine + "3 3 E", MarsRoverParser.GetMarsRoverPositions(this.marsRoverCommandCenter.Execute()));
 }
Ejemplo n.º 3
0
 public void ExecuteCommandCenterHavingTwoRoversPositionOverLapping()
 {
     this.marsRoverCommandCenter.NumberOfRovers = 2;
     this.marsRoverCommandCenter.AddMarsRoverInstructions(new MarsRoverInstructions
     {
         RoverPosition = new MarsRoverParser("1 1 N")
         ,
         CommandInstructions = RoverCommandUtility.GetRoverCommands("MMRMM")
     });
     this.marsRoverCommandCenter.AddMarsRoverInstructions(new MarsRoverInstructions
     {
         RoverPosition = new MarsRoverParser("3 3 N")
         ,
         CommandInstructions = RoverCommandUtility.GetRoverCommands("R")
     });
     //We will not move the rover if poistion is overlapping
     Assert.AreEqual("1 1 N" + System.Environment.NewLine + "3 3 E", MarsRoverParser.GetMarsRoverPositions(this.marsRoverCommandCenter.Execute()));
 }