public void Initialize() { CheckPlateauValues(_plateauManager); var addAnotherRover = false; do { CheckRoverPositionValues(_roverManager); string roverCommandsInput = CheckRoverCommandValues(_roverManager); _roverCommandsManager.CommandList = roverCommandsInput; _plateauManager.RoverManagerList.Add(_roverManager); Console.WriteLine(Messages.Information.AddAnotherRover); var addAnotherRoverInput = Console.ReadLine(); addAnotherRover = addAnotherRoverInput.ToUpper() == "Y" ? true : false; } while (addAnotherRover); _plateauManager.Process(); _plateauManager.Print(); Console.ReadLine(); }
public void TestMethod(string testname, IPlateauManager plateauManager, string[] position) { plateauManager.Process(); string[] positionList = new string[plateauManager.RoverManagerList.Count]; for (int i = 0; i < plateauManager.RoverManagerList.Count; i++) { positionList[i] = $"{plateauManager.RoverManagerList[i].Rover.Position.CoordinateX} {plateauManager.RoverManagerList[i].Rover.Position.CoordinateY} {plateauManager.RoverManagerList[i].Rover.Position.Direction.ToString().Substring(0, 1)}"; } Assert.Equal(positionList, position); }