internal static IFilter Filter() { int response; IFilter filter; response = GetNumber(1, 4); switch (response) { case 1: filter = new DepartBeforeArriveFilter(); break; case 2: filter = new LongGroundTimeFilter(); break; case 3: filter = new MultiSegmentFilter(); break; case 4: filter = new PastDepartFilter(); break; default: filter = new DepartBeforeArriveFilter(); break; } return(filter); }
public void EmptyExcludeTest() { MultiSegmentFilter filter = new MultiSegmentFilter(); var test = MultiSegmentList(); var result = filter.Exclude(test); Assert.Empty(result); }
public void EmptyIncludeTest() { MultiSegmentFilter filter = new MultiSegmentFilter(); var test = SingleSegmentList(); var result = filter.Include(new HashSet <Flight>(), test); Assert.Empty(result); }
public void IncludeValidTest() { MultiSegmentFilter filter = new MultiSegmentFilter(); var test = SingleSegmentList().ToList(); var multi = MultiSegmentList(); test.AddRange(multi); var result = filter.Include(new HashSet <Flight>(), test); Assert.Equal(result, multi); }
public void ExcludeValidTest() { MultiSegmentFilter filter = new MultiSegmentFilter(); var single = SingleSegmentList(); var multi = MultiSegmentList(); var test = new List <Flight>(single); test.AddRange(multi); var result = filter.Exclude(test); Assert.Equal(result, single); }