Methods such as FirstDayOfWeek specify an optional parameter "startingDayOfWeek" of type DayOfWeek which affects the result of the calculation. If this isn't specified, it uses CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek which could vary depending on what machine the tests are run on.
Since the result varies with the machine's culture but the inputs don't, and the tests were created on a machine using a culture with a different start of week than mine, the tests failed.
Added an additional parameter to the test inputs and set the inputs to DayOfWeek.Sunday since the tests passed when CultureInfo.InvariantCulture.DateTimeFormat.FirstDayOfWeek was passed and that was its value.
Methods such as
FirstDayOfWeek
specify an optional parameter "startingDayOfWeek" of typeDayOfWeek
which affects the result of the calculation. If this isn't specified, it usesCultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek
which could vary depending on what machine the tests are run on.Since the result varies with the machine's culture but the inputs don't, and the tests were created on a machine using a culture with a different start of week than mine, the tests failed.
Added an additional parameter to the test inputs and set the inputs to
DayOfWeek.Sunday
since the tests passed whenCultureInfo.InvariantCulture.DateTimeFormat.FirstDayOfWeek
was passed and that was its value.