public void GetPreviousDayCountLessThan1Exception()
        {
            int            dayCount       = 0;
            DateProjection dateProjection = DateProjection(dayCount);

            Assert.That(() => dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Throws.TypeOf <InvalidOperationException>());
        }
        public void GetPrevious()
        {
            int            dayCount       = 2;
            DateProjection dateProjection = DateProjection(dayCount);

            Assert.That(dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Is.EqualTo(new DateTime(2017, 2, 26)));
        }
        public void GetPreviousDayOfWeekIsNoneException()
        {
            int weekCount = 2;
            EDaysOfWeekFlags daysOfWeek     = EDaysOfWeekFlags.None;
            DateProjection   dateProjection = DateProjection(weekCount, daysOfWeek);

            Assert.That(() => dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Throws.TypeOf <InvalidOperationException>());
        }
        public void GetPrevious()
        {
            int weekCount = 2;
            EDaysOfWeekFlags daysOfWeek     = EDaysOfWeekFlags.Monday;
            DateProjection   dateProjection = DateProjection(weekCount, daysOfWeek);

            Assert.That(dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Is.EqualTo(new DateTime(2017, 2, 20)));
        }
Пример #5
0
        public void GetPreviousDayOfMonthLessThan1Exception()
        {
            EMonth         month          = EMonth.February;
            int            dayOfMonth     = 0;
            DateProjection dateProjection = DateProjection(month, dayOfMonth);

            Assert.That(() => dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Throws.TypeOf <InvalidOperationException>());
        }
Пример #6
0
        public void GetPrevious()
        {
            EMonth         month          = EMonth.February;
            int            dayOfMonth     = 31;
            DateProjection dateProjection = DateProjection(month, dayOfMonth);

            Assert.That(dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Is.EqualTo(new DateTime(2016, 2, 29)));
        }
        public void GetPreviousMonthCountLessThan1Exception()
        {
            int            monthCount     = 0;
            int            dayOfMonth     = 31;
            DateProjection dateProjection = DateProjection(monthCount, dayOfMonth);

            Assert.That(() => dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Throws.TypeOf <InvalidOperationException>());
        }
        public void GetPrevious()
        {
            int            monthCount     = 3;
            int            dayOfMonth     = 31;
            DateProjection dateProjection = DateProjection(monthCount, dayOfMonth);

            Assert.That(dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Is.EqualTo(new DateTime(2016, 11, 30)));
        }
        public void GetPrevious()
        {
            EMonth         month          = EMonth.March;
            EWeeksInMonth  weeksInMonth   = EWeeksInMonth.Second;
            EDaysOfWeekExt daysOfWeek     = EDaysOfWeekExt.Monday;
            DateProjection dateProjection = DateProjection(month, weeksInMonth, daysOfWeek);

            Assert.That(dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Is.EqualTo(new DateTime(2016, 3, 14)));
        }
        public void GetPreviousMonthCountLessThan1Exception()
        {
            int            monthCount     = 0;
            EWeeksInMonth  weeksInMonth   = EWeeksInMonth.Second;
            EDaysOfWeekExt daysOfWeek     = EDaysOfWeekExt.Monday;
            DateProjection dateProjection = DateProjection(monthCount, weeksInMonth, daysOfWeek);

            Assert.That(() => dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Throws.TypeOf <InvalidOperationException>());
        }
        public void GetPrevious()
        {
            int            monthCount     = 3;
            EWeeksInMonth  weeksInMonth   = EWeeksInMonth.Second;
            EDaysOfWeekExt daysOfWeek     = EDaysOfWeekExt.Monday;
            DateProjection dateProjection = DateProjection(monthCount, weeksInMonth, daysOfWeek);

            Assert.That(dateProjection.GetPrevious(new DateTime(2017, 2, 28)), Is.EqualTo(new DateTime(2016, 12, 12)));
        }