public void ComesFrom(Station station, bool isFrom) { var service = TestSchedules.CreateService(); var clapham = service.Details.Locations[1]; var stop = new ResolvedServiceStop(service, clapham); if (isFrom) { Assert.True(stop.ComesFrom(station)); Assert.NotNull(stop.FoundFromStop); } else { Assert.False(stop.ComesFrom(station)); Assert.Null(stop.FoundFromStop); } }
public void ComesFromWithNoAssociation() { var service = TestSchedules.CreateService(); var clapham = service.Details.Locations[1]; var stop = new ResolvedServiceStop(service, clapham); Assert.True(stop.ComesFrom(TestStations.Surbiton)); Assert.False(stop.Association.IsIncluded); Assert.Equal(IncludedAssociation.NoAssociation, stop.Association); }
public void ComesFromIsFalseIfNotPublicDeparture(string activity, bool expected) { var service = TestSchedules.CreateService(); var waterloo = service.Details.Locations[3]; var clapham = service.Details.Locations[1] as ScheduleStop; clapham.Activities = new Activities(activity); var stop = new ResolvedServiceStop(service, waterloo); Assert.Equal(expected, stop.ComesFrom(clapham.Station)); Assert.Equal(expected, stop.FoundFromStop != null); }