public static Dictionary <char, Func <RoverPosition> > GetCommands(RoverBase roverBase) { return(new Dictionary <char, Func <RoverPosition> > { { 'L', () => roverBase.LeftSpin() }, { 'R', () => roverBase.RightSpin() }, { 'M', () => roverBase.MoveForward() } }); }
public void GetRoboticRover_WhenInitialPointIs1_2_N_ShouldGetCardinalPointCallsOnceWithN() { //arrange _consoleReader.ReadLine().Returns("1 2 N"); //act RoverBase roverBase = _inputReader.GetRover(); //assert _cardinalPointFactory.Received(1).GetCardinalPoint('N'); }
public IList <RoverBase> GetRovers(int roverCount) { IList <RoverBase> rovers = new List <RoverBase>(roverCount); for (int i = 0; i < roverCount; i++) { RoverBase roverBase = GetRover(); roverBase.MovePattern = GetRoverMovePattern(); rovers.Add(roverBase); } return(rovers); }
public RoverSimulator(RoverBase rover) { Rover = rover; }
public override void InitializeRovers() { Rover = GetRover(InitialPosition, Path); Context.AddRover(Rover); }