Skip to content

Commit

Permalink
DefaultThreadCurrentUICulture
Browse files Browse the repository at this point in the history
  • Loading branch information
mbdavid committed Jan 24, 2020
1 parent ed0aef5 commit 910fb81
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions LiteDB.Tests/Engine/Collation_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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))
Expand All @@ -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)
{
Expand All @@ -110,9 +108,6 @@ public void Change_Database_Culture()
doc["_id"].AsString.Should().Be(id);
}
}

// back to local culture
CultureInfo.CurrentCulture = current;
}
}

Expand Down

0 comments on commit 910fb81

Please sign in to comment.