public void PlateauShouldBeTwoDigitCommandSeparatedBySpace(string command) { //Act Plateau plateau = _helper.ToPlateau(command); //Assert Assert.IsNotNull(plateau); Assert.AreEqual($"{plateau.X} {plateau.Y}", command); }
public IEnumerable <string> SendCommands([FromBody] Command command) { try { var plateau = _parse.ToPlateau(command.Plateau); var rovers = new List <string>(); foreach (var rover in command.Rovers) { var position = _parse.ToRover(rover.Position); var movements = _parse.ToMovemenent(rover.Movement); var result = _squad.Deploy(plateau, position, movements); rovers.Add(_parse.ToString(result)); } return(rovers); } catch (Exception ex) { _logger.LogError("Failed to deploy rover!", ex); return(null); } }