public void daysNotAllowed_notValidTest() { DayOfWeek today = DateTime.Now.DayOfWeek; int day = (int)today + 1; DaysNotAllowedPurchasePolicy policy = new DaysNotAllowedPurchasePolicy(new int[] { day }, MOCK_NAME_FOR_DESCRIPTION); Assert.False(policy.IsValidPurchase(cart1With5)); }
public void daysNotAllowed_multpleDays_validTest() { DayOfWeek today = DateTime.Now.DayOfWeek; int day = (int)today + 2 == 8 ? 1 : (int)today + 2; int day2 = (int)today + 3 == 8 ? 1 : (int)today + 3; DaysNotAllowedPurchasePolicy policy = new DaysNotAllowedPurchasePolicy(new int[] { day, day2 }, MOCK_NAME_FOR_DESCRIPTION); Assert.True(policy.IsValidPurchase(cart1With5)); }