示例#1
0
        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);
        }
示例#2
0
        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();
        }
示例#3
0
 public static Events GetFilteredListByDescription(Events eventsList, string criteria, string value)
 {
     DescriptionFilter eventsToFilter = new DescriptionFilter(Utils.ParseFilteringCriteria(criteria), value);
     return eventsToFilter.ApplyFilter(eventsList);
 }
示例#4
0
        public static Events GetFilteredListByDescription(Events eventsList, string criteria, string value)
        {
            DescriptionFilter eventsToFilter = new DescriptionFilter(Utils.ParseFilteringCriteria(criteria), value);

            return(eventsToFilter.ApplyFilter(eventsList));
        }