You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix#436 Flaky test: UnitsNet.Tests.UnitSystemTests.PositiveInfinityFormatting
Fixes#436
Added `UnitSystemFixture` class which is a `CollectionDefinition` class used to group test classes:
1. that rely on manipulating CultureInfo. See #436
2. to avoid accessing static prop DefaultToString in parallel from multiple tests:
a. UnitSystemTests.DefaultToStringFormatting()
b. LengthTests.ToStringReturnsCorrectNumberAndUnitWithCentimeterAsDefualtUnit()
Changes in this PR:
- `UnitSystemTests.GetDefaultAbbreviationFallsBackToUsEnglishCulture`: Set CultureInfo properties back to their original values.
- Specify `InvariantCulture` on the following `UnitSystemTests` tests:
1. `NegativeInfinityFormatting`
2. `PositiveInfinityFormatting`
- Applied `[Collection(nameof(UnitSystemFixture)]` attribute to test classes that:
- Sets `UnitSystem.DefaultCulture`
- Originally uses `[Collection("DefaulToString")]` that also depends on `CultureInfo`
- Only one `Collection` attribute per test class.
- Updated to `xunit` and `xunit.runner.visualstudio` to v2.3.1 (was v2.3.0-beta4-build3742)
- To have the [CollectionDefinition(DisableParallelization = true)] feature. See https://xunit.github.io/releases/2.3-beta5
* Removed `InvariantCulture`
Removed `InvariantCulture` on the following `UnitSystemTests` tests:
1. `NegativeInfinityFormatting`
2. `PositiveInfinityFormatting`
* Specified InvariantCulture in InfinityFormatting Tests
Copy file name to clipboardExpand all lines: UnitsNet.Serialization.JsonNet.CompatibilityTests/UnitsNet.Serialization.JsonNet.CompatibilityTests.csproj
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@
20
20
<!--Get the latest released version of UnitsNet.Serialization.JsonNet in Nuget-->
0 commit comments