public void ShouldSelectEventsWithASpecifiedTitle() { Events newEvents = new Events { {new Event ( "2015/01/01", "one", "test") }, {new Event("2015/11/15", "two") }, {new Event("2015/11/15", "three","test2") } }; DescriptionFilter eventsToFilter = new DescriptionFilter("=", "test2"); Events filteredList = eventsToFilter.ApplyFilter(newEvents); List<Event> expectedList = new List<Event> { {new Event("2015/11/15", "three","test2") } }; Utils.AssertAreEqual(filteredList, expectedList); }
public void ShouldSelectNothingWhenSpecifiedtitleIsNotMatching() { Events newEvents = new Events { {new Event ( "2015/01/01", "one", "test") }, {new Event("2015/11/15", "two","test1") }, {new Event("2015/11/15", "three","test2") } }; DescriptionFilter eventsToFilter = new DescriptionFilter("=", "testul"); Events filteredList = eventsToFilter.ApplyFilter(newEvents); filteredList.ShouldBeEmpty(); }
public static Events GetFilteredListByDescription(Events eventsList, string criteria, string value) { DescriptionFilter eventsToFilter = new DescriptionFilter(Utils.ParseFilteringCriteria(criteria), value); return eventsToFilter.ApplyFilter(eventsList); }
public static Events GetFilteredListByDescription(Events eventsList, string criteria, string value) { DescriptionFilter eventsToFilter = new DescriptionFilter(Utils.ParseFilteringCriteria(criteria), value); return(eventsToFilter.ApplyFilter(eventsList)); }