Ejemplo n.º 1
0
        public void Day_of_month_preference_determines_correct_result()
        {
            int         preferenceDay = 5;
            IPreference preference    = new DayOfMonthPreference(preferenceDay);

            for (int d = 1; d <= 28; d++)
            {
                if (d == preferenceDay)
                {
                    preference.SendOnDate(new DateTime(2020, 1, d)).ShouldBeTrue($"Testing day {d} from preference {preferenceDay}");
                }
                else
                {
                    preference.SendOnDate(new DateTime(2020, 1, d)).ShouldBeFalse($"Testing day {d} from preference {preferenceDay}");
                }
            }
        }
Ejemplo n.º 2
0
        public void Day_of_month_preference_validates_the_contructor_arg()
        {
            IPreference preferenceLessThanLowerBound = new DayOfMonthPreference(-1);

            preferenceLessThanLowerBound.SendOnDate(new DateTime(2020, 1, 1)).ShouldBeTrue();
            IPreference preferenceGreaterThanUpperBound = new DayOfMonthPreference(40);

            preferenceGreaterThanUpperBound.SendOnDate(new DateTime(2020, 1, 28)).ShouldBeTrue();
        }