From 910fb81e53e6dff3a5bb40f5ea6f7871e50bc295 Mon Sep 17 00:00:00 2001 From: mbdavid Date: Fri, 24 Jan 2020 18:04:54 -0300 Subject: [PATCH] DefaultThreadCurrentUICulture --- LiteDB.Tests/Engine/Collation_Tests.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/LiteDB.Tests/Engine/Collation_Tests.cs b/LiteDB.Tests/Engine/Collation_Tests.cs index c06b253ee..5adaecf29 100644 --- a/LiteDB.Tests/Engine/Collation_Tests.cs +++ b/LiteDB.Tests/Engine/Collation_Tests.cs @@ -73,9 +73,9 @@ public void Culture_Ordinal_Sort() [Fact] public void Create_Database_Using_Current_Culture() { - CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fi"); + CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("fi"); - using(var e = new LiteEngine()) + using (var e = new LiteEngine()) { var d = e.Pragma("COLLATION"); @@ -84,13 +84,11 @@ public void Create_Database_Using_Current_Culture() } [Fact] - public void Change_Database_Culture() + public void Change_Thread_Culture() { using(var f = new TempFile()) { - var current = CultureInfo.CurrentCulture; - - CultureInfo.CurrentCulture = new CultureInfo("fi"); + CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("fi"); // store in database using "fi" culture using (var e = new LiteEngine(f.Filename)) @@ -99,9 +97,9 @@ public void Change_Database_Culture() } // change current culture do "en-GB" - CultureInfo.CurrentCulture = new CultureInfo("en-gb"); + CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-gb"); - using(var e = new LiteEngine(f.Filename)) + using (var e = new LiteEngine(f.Filename)) { foreach(var id in data) { @@ -110,9 +108,6 @@ public void Change_Database_Culture() doc["_id"].AsString.Should().Be(id); } } - - // back to local culture - CultureInfo.CurrentCulture = current; } }