forked from DotNet4Neo4j/Neo4jClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCultureInfoSetupFixture.cs
25 lines (21 loc) · 998 Bytes
/
CultureInfoSetupFixture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Globalization;
using System.Threading;
namespace Neo4jClient.Tests
{
public class CultureInfoSetupFixture
{
//SetCultureToSomethingNonLatinToEnsureCodeUnderTestDoesntAssumeEnAu()
public static readonly CultureInfo CultureInfo = new CultureInfo("zh-CN");
public static void SetDeterministicCulture()
{
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = CultureInfo;
}
public CultureInfoSetupFixture()
{
// Issue https://bitbucket.org/Readify/neo4jclient/issue/15/take-cultureinfo-into-account-for-proper
// The idea is to minimize developer mistake by surprising culture-info assumptions. This may not be the best setup for culture-dependent
// tests. The alternative of introducing test base class is deliberately not taken because deriving from it is another assumption by itself.
SetDeterministicCulture();
}
}
}