Skip to content

Commit 040e08f

Browse files
committed
Restore culture in test.
1 parent c8d6661 commit 040e08f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/UnitSystemTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public void AllUnitAbbreviationsImplemented([Values("", "en-US", "nb-NO", "ru-RU
5757
[Test]
5858
public void ToStringRoundsToTwoDecimals()
5959
{
60-
var originalCulture = Thread.CurrentThread.CurrentUICulture;
60+
var currentUiCulture = Thread.CurrentThread.CurrentUICulture;
61+
var currentCulture = Thread.CurrentThread.CurrentCulture;
6162
try
6263
{
6364
// CurrentCulture affects number formatting, such as comma or dot as decimal separator.
@@ -73,7 +74,8 @@ public void ToStringRoundsToTwoDecimals()
7374
}
7475
finally
7576
{
76-
Thread.CurrentThread.CurrentUICulture = originalCulture;
77+
Thread.CurrentThread.CurrentUICulture = currentUiCulture;
78+
Thread.CurrentThread.CurrentCulture = currentCulture;
7779
}
7880
}
7981

0 commit comments

Comments
 (0)