public void Initialize() { _pilot = new Pilot(1, "Ayrton Senna"); _pilot.AddLap(new Lap(1, 42.20, new TimeSpan(0, 0, 05, 00, 00), new TimeSpan(18, 00, 00))); _pilot.AddLap(new Lap(2, 52.60, new TimeSpan(0, 0, 04, 00, 00), new TimeSpan(18, 05, 00))); _pilot.AddLap(new Lap(3, 31.20, new TimeSpan(0, 0, 03, 20, 10), new TimeSpan(18, 09, 00))); }
public Race ConvertLinesToObjects(string[] lines) { var race = new Race(); foreach (string line in lines) { string[] data = Regex.Split(line, @"\s{1,}"); Pilot pilot = this.CreatePilot(race, data); Lap lap = this.CreateLap(data); pilot.AddLap(lap); } return(race); }