public void GetNextDate_DayOfWeek_Inexact()
        {
            MonthlyRecurrency monthly = new MonthlyRecurrency(new DateTime(2011, 4, 01), new DateTime(2011, 11, 30), 3, DayOfWeek.Monday, DayIndex.Third);
            Assert.AreEqual(new DateTime(2011, 4, 1), monthly.StartDate);
            Assert.AreEqual(new DateTime(2011, 4, 18), monthly.GetFirstDate());
            Assert.AreEqual(new DateTime(2011, 4, 18), monthly.GetNextDate(new DateTime(2011, 1, 1)));
            Assert.AreEqual(new DateTime(2011, 4, 18), monthly.GetNextDate(new DateTime(2011, 4, 17)));

            Assert.AreEqual(new DateTime(2011, 7, 18), monthly.GetNextDate(new DateTime(2011, 4, 18)));
            Assert.AreEqual(new DateTime(2011, 7, 18), monthly.GetNextDate(new DateTime(2011, 4, 19)));
            Assert.AreEqual(new DateTime(2011, 7, 18), monthly.GetNextDate(new DateTime(2011, 5, 1)));
            Assert.AreEqual(new DateTime(2011, 7, 18), monthly.GetNextDate(new DateTime(2011, 6, 1)));
            Assert.AreEqual(new DateTime(2011, 7, 18), monthly.GetNextDate(new DateTime(2011, 7, 17)));
        }
        public void GetNextDate_DayOfMonth_Inexact()
        {
            MonthlyRecurrency monthly = new MonthlyRecurrency(new DateTime(2011, 1, 1), 4, 1, 15);
            Assert.AreEqual(new DateTime(2011, 1, 1), monthly.StartDate);
            Assert.AreEqual(new DateTime(2011, 1, 15), monthly.GetFirstDate());
            Assert.AreEqual(new DateTime(2011, 1, 15), monthly.GetNextDate(new DateTime(2011, 1, 1)));
            Assert.AreEqual(new DateTime(2011, 1, 15), monthly.GetNextDate(new DateTime(2011, 1, 14)));

            Assert.AreEqual(new DateTime(2011, 2, 15), monthly.GetNextDate(new DateTime(2011, 1, 15)));
            Assert.AreEqual(new DateTime(2011, 2, 15), monthly.GetNextDate(new DateTime(2011, 1, 16)));
            Assert.AreEqual(new DateTime(2011, 2, 15), monthly.GetNextDate(new DateTime(2011, 2, 14)));

            Assert.AreEqual(new DateTime(2011, 3, 15), monthly.GetNextDate(new DateTime(2011, 2, 15)));
            Assert.AreEqual(new DateTime(2011, 3, 15), monthly.GetNextDate(new DateTime(2011, 2, 16)));
            Assert.AreEqual(new DateTime(2011, 3, 15), monthly.GetNextDate(new DateTime(2011, 3, 14)));

            Assert.AreEqual(new DateTime(2011, 4, 15), monthly.GetNextDate(new DateTime(2011, 3, 15)));
            Assert.AreEqual(new DateTime(2011, 4, 15), monthly.GetNextDate(new DateTime(2011, 3, 16)));
            Assert.AreEqual(new DateTime(2011, 4, 15), monthly.GetNextDate(new DateTime(2011, 4, 14)));

            Assert.IsNull(monthly.GetNextDate(new DateTime(2011, 4, 15)));
        }