コード例 #1
0
        public void ShouldNotListEventsFromSpecifiedDate()
        {
            Events newEvents = new Events {
                { new Event("2015/01/01", "one", "test") },
                { new Event("2015/11/15", "two") },
            };

            string[] inputArgs = { "/search", "date", "=", "2015/10/01" };

            Events filteredList = Dispenser.GetFilteredListByDate(newEvents, "=", "2015/10/01", "");

            filteredList.ShouldBeEmpty();
        }
コード例 #2
0
        public void ShouldListOlderEventsFromSpecifiedDate()
        {
            Events newEvents = new Events {
                { new Event("2015/01/01", "one", "test") },
                { new Event("2015/11/15", "two") },
            };

            List <Event> expectedList = new List <Event>
            {
                { new Event("2015/01/01", "one", "test") },
            };
            Events filteredList = Dispenser.GetFilteredListByDate(newEvents, "older", "2015/09/01", "");

            Utils.AssertAreEqual(filteredList, expectedList);
        }
コード例 #3
0
        public void ShouldListEventsFromSpecifiedPeriod()
        {
            Events newEvents = new Events {
                { new Event("2015/10/11", "one", "test") },
                { new Event(DateTime.Now.ToShortDateString(), "today", "today test") }
            };

            List <Event> expectedList = new List <Event> {
                { new Event("2015/10/11", "one", "test") }
            };

            Events filteredList = Dispenser.GetFilteredListByDate(newEvents, "<>", "2015/09/01", "2015/10/30");

            Utils.AssertAreEqual(filteredList, expectedList);
        }