public void Should_correctly_enumerate_german_federal_public_holidays_required_by_law(int year) { //expected DateOnly[] expected = { Holidays.NewYear(year), Holidays.GoodFriday(year), Holidays.EasterSunday(year), Holidays.EasterMonday(year), Holidays.LabourDay(year), Holidays.AscensionOfJayZ(year), Holidays.WhitMonday(year), Holidays.GermanReunificationDay(year), Holidays.JayZ1(year), Holidays.JayZ2(year) }; //actual var actual = Holidays.GermanPublicHolidays(year, GermanState.Bund); //compare var isOkay = expected.Except(actual).None() && actual.Except(expected).None(); Assert.True(isOkay); }
///------------------------------------------------------------------------------------------------- /// <summary> /// USA full observance calendar with typical workday configurations. Includes USA Federal /// plus and Groundhog day, Mothers day, Fathers Day, Good Friday, Easter Sunday, Halloween, /// Saint Patrick's Day. /// </summary> /// /// <example> /// <code> /// // using ThisDate.DefinedCalendars.USA; /// Calendars.UsaObservance(); /// </code> /// </example> ///------------------------------------------------------------------------------------------------- public static void UsaObservance() { Holidays.NewYearsDay(true, false, true); Holidays.MartinLutherKingDay(true); Holidays.PresidentsDay(true); Holidays.MemorialDay(true); Holidays.IndependenceDay(true, true, true); Holidays.LaborDay(true); Holidays.ColumbusDay(false); Holidays.VeteransDay(false, true, true); Holidays.ThanksgivingDay(true); Holidays.ChristmasDay(true, true, true); Holidays.Weekends(); Holidays.ValentinesDay(false); Holidays.MothersDay(false); Holidays.FathersDay(false); Holidays.GoodFriday(false); Holidays.EasterSunday(false); Holidays.GroundhogDay(false); Holidays.Halloween(false); Holidays.SaintPatrickDay(false); }
public void Should_correctly_calculate_easter_sunday(int year, DateOnly expected) { var actual = Holidays.EasterSunday(year); Assert.Equal(expected, actual); }