-
Notifications
You must be signed in to change notification settings - Fork 400
Closed
Description
This only happens very rarely on AppVeyor (first time I can think of), but @gojanpaolo reports it happens all the time on his setup. I assume this is due to manipulating static values in other tests, such as:
GetDefaultAbbreviationFallsBackToUsEnglishCulture()
{
var zuluCulture = new CultureInfo("zu-ZA");
CultureInfo.CurrentCulture = CultureInfo.CurrentUICulture = zuluCulture;
https://ci.appveyor.com/project/angularsen/unitsnet/build/724/tests
UnitsNet.Tests.UnitSystemTests.PositiveInfinityFormatting
Assert.Equal() Failure
↓ (pos 0)
Expected: ∞ m
Actual: Infinity m
↑ (pos 0)
The following:
Console.WriteLine(double.PositiveInfinity.ToString(CultureInfo.InvariantCulture));
Console.WriteLine(double.PositiveInfinity.ToString(new CultureInfo("zu-ZA")));
/* Prints:
Infinity
∞
*/
So the fix is likely one or both of:
- Ensure tests that rely on manipulating CultureInfo or other static values are NOT run in parallel (can xunit selectively configure this?)
- Set CultureInfo properties back to their original values so it doesn't pollute other tests in same test class (I think all tests in one class are run in the same app domain and share static values)
Metadata
Metadata
Assignees
Labels
No labels