/// <summary> /// Gather all services /// </summary> /// <param name="onDate"></param> /// <param name="filter"></param> /// <param name="dayBoundary"></param> /// <returns>All services for day</returns> /// <remarks>Reuses standard Gather functionality, setting starting index to 0 and config to get all (actually lots) </remarks> public ResolvedServiceStop[] AllServices(DateTime onDate, GatherConfiguration.GatherFilter filter, Time dayBoundary) { var first = FindNearestTime(dayBoundary); var config = new GatherConfiguration(0, 0, true, filter); var gatherer = new ScheduleGatherer(this, config, _arrivalsOrDepartures); return gatherer.Gather(first.index, onDate.Date); }
public void GatherSingleServiceAfter() { var schedule = CreateMockSchedule(); var gatherer = new ScheduleGatherer(schedule, GathererConfig.OneService, TimesToUse.Departures); var services = gatherer.Gather(2, TestDate); Assert.Single(services); var stop = services[0].Stop.Stop as ScheduleStop; Assert.Equal(TestStations.Surbiton, stop.Station); Assert.Equal(TestSchedules.TenFifteen, stop.Departure); }
private ResolvedServiceStop[] GatherServices(int startIdx, DateTime onDate, GatherConfiguration config) { var gatherer = new ScheduleGatherer(this, config, _arrivalsOrDepartures); return gatherer.Gather(startIdx, onDate); }