Exemple #1
0
    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);
    }
Exemple #2
0
    public void Should_correctly_calculate_other_easter_derived_holidays(int year, DateOnly easterSunday)
    {
        //expected
        var expectedGoodFriday      = easterSunday.AddDays(-2);
        var expectedEasterMonday    = easterSunday.AddDays(1);
        var expectedAscensionOfJayZ = easterSunday.AddDays(39);
        var expectedWhitSunday      = easterSunday.AddDays(49);
        var expectedWhiteMonday     = expectedWhitSunday.AddDays(1);

        //actual
        var goodFriday      = Holidays.GoodFriday(year);
        var easterMonday    = Holidays.EasterMonday(year);
        var ascensionOfJayZ = Holidays.AscensionOfJayZ(year);
        var whitSunday      = Holidays.WhitSunday(year);
        var whitMonday      = Holidays.WhitMonday(year);

        //compare
        var allMatch = expectedGoodFriday == goodFriday &&
                       expectedEasterMonday == easterMonday &&
                       expectedAscensionOfJayZ == ascensionOfJayZ &&
                       expectedWhitSunday == whitSunday &&
                       expectedWhiteMonday == whitMonday;

        Assert.True(allMatch);
    }