Example #1
0
        public void Should_Elapse_When_Day_Is_OutOfBounds_Of_Month()
        {
            // This essentially means that we can do last of the month values by setting the 31st
            MonthlyEvent e = new MonthlyEvent(31);

            Assert.AreEqual(1, e.ElapsedEvents(new DateTime(2019, 2, 15), new DateTime(2019, 3, 15)));
        }
Example #2
0
        public void Should_WrapNextYear()
        {
            MonthlyEvent e = new MonthlyEvent(31);

            Assert.AreEqual(3, e.ElapsedEvents(new DateTime(2019, 12, 15), new DateTime(2020, 3, 15)));
        }
Example #3
0
        public void Should_ElapseTwice_Ending_ExactlyOneMonth_Apart()
        {
            MonthlyEvent e = new MonthlyEvent(15);

            Assert.AreEqual(2, e.ElapsedEvents(new DateTime(2019, 1, 15), new DateTime(2019, 2, 15)));
        }
Example #4
0
        public void Should_ElapseOnce_On_SameDay()
        {
            MonthlyEvent e = new MonthlyEvent(15);

            Assert.AreEqual(1, e.ElapsedEvents(new DateTime(2019, 1, 15), new DateTime(2019, 1, 15)));
        }
Example #5
0
        public void Should_ElapseTwice()
        {
            MonthlyEvent e = new MonthlyEvent(2);

            Assert.AreEqual(2, e.ElapsedEvents(new DateTime(2019, 1, 1), new DateTime(2019, 2, 15)));
        }
Example #6
0
        public void Should_ElapseOnce()
        {
            MonthlyEvent e = new MonthlyEvent(2);

            Assert.AreEqual(1, e.ElapsedEvents(new DateTime(2019, 1, 1), new DateTime(2019, 1, 28)));
        }