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
♻️🧪Use CultureScope in tests to revert CurrentCulture changes
Use `CultureScope` instead of try-catch, simpler syntax.
Add `CultureScope` to some test cases that previously did not revert their changes to CurrentCulture, to avoid flaky tests.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ var oneKg = Mass.FromKilograms(1);
98
98
99
99
// ToString() uses CurrentCulture for abbreviation language number formatting. This is consistent with the behavior of the .NET Framework,
100
100
// where DateTime.ToString() uses CurrentCulture for the whole string, likely because mixing an english date format with a russian month name might be confusing.
101
-
Thread.CurrentThread.CurrentCulture=russian;
101
+
CultureInfo.CurrentCulture=russian;
102
102
stringkgRu=oneKg.ToString(); // "1 кг"
103
103
104
104
// ToString() with specific culture and custom string format pattern
0 commit comments