Beispiel #1
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();
        }
Beispiel #2
0
        public void ShouldSelectEventsWithSpecifiedtitleWhenThereAreAlmostEqual()
        {
            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("=", "test1");
            Events            filteredList   = eventsToFilter.ApplyFilter(newEvents);
            List <Event>      expectedList   = new List <Event>
            {
                { new Event("2015/11/15", "two", "test1") },
            };

            Utils.AssertAreEqual(filteredList, expectedList);
        }
Beispiel #3
0
        public void ShouldSelectEventsWithAnothertitle()
        {
            Events newEvents = new Events
            {
                { new Event("2015/01/01", "one", "test") },
                { new Event("2015/11/15", "two", "another") },
                { new Event("2015/11/15", "three", "test2") }
            };

            DescriptionFilter eventsToFilter = new DescriptionFilter("!=", "another");
            Events            filteredList   = eventsToFilter.ApplyFilter(newEvents);
            List <Event>      expectedList   = new List <Event>
            {
                { new Event("2015/01/01", "one", "test") },
                { new Event("2015/11/15", "three", "test2") }
            };

            Utils.AssertAreEqual(filteredList, expectedList);
        }