Esempio n. 1
0
 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');
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public RoverSimulator(RoverBase rover)
 {
     Rover = rover;
 }
Esempio n. 5
0
 public override void InitializeRovers()
 {
     Rover = GetRover(InitialPosition, Path);
     Context.AddRover(Rover);
 }