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

            return(eventsToFilter.ApplyFilter(eventsList));
        }