public string BeginRace(string racerOneUsername, string racerTwoUsername) { IRacer racerOne = racers.FindBy(racerOneUsername); IRacer racerTwo = racers.FindBy(racerTwoUsername); if (racerOne is null) { throw new ArgumentException($"Racer {racerOneUsername} cannot be found!"); } if (racerTwo is null) { throw new ArgumentException($"Racer {racerTwoUsername} cannot be found!"); } return(map.StartRace(racerOne, racerTwo)); }
public string BeginRace(string racerOneUsername, string racerTwoUsername) { IRacer oneRacer = racers.FindBy(racerOneUsername); IRacer twoRacer = racers.FindBy(racerTwoUsername); if (oneRacer is null) { throw new ArgumentException($"Racer {racerOneUsername} cannot be found!"); } if (twoRacer is null) { throw new ArgumentException($"Racer {racerTwoUsername} cannot be found!"); } return(map.StartRace(oneRacer, twoRacer)); }
public string BeginRace(string racerOneUsername, string racerTwoUsername) { IRacer racerOne = racers.FindBy(racerOneUsername); IRacer racerTwo = racers.FindBy(racerTwoUsername); if (racerOne is null) { throw new ArgumentException(string.Format(ExceptionMessages.RacerCannotBeFound, racerOneUsername)); } if (racerTwo is null) { throw new ArgumentException(string.Format(ExceptionMessages.RacerCannotBeFound, racerTwoUsername)); } string result = map.StartRace(racerOne, racerTwo); return(result); }