-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): Run tests on English culture Set the current thread cultu…
…re to english, as for systems on others cultures, some tests were failing.
- Loading branch information
1 parent
8a3fcc7
commit c770664
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using NUnit.Framework; | ||
using System.Globalization; | ||
using System.Threading; | ||
|
||
namespace OptimizelySDK.Tests | ||
{ | ||
[SetUpFixture] | ||
public class TestSetup | ||
{ | ||
[SetUp] | ||
public void Init() | ||
{ | ||
/* There are some issues doing assertions on tests with floating point numbers using the .ToString() | ||
* method, as it's culture dependent. EG: TestGetFeatureVariableValueForTypeGivenFeatureFlagIsNotEnabledForUser, | ||
* assigning the culture to English will make this kind of tests to work on others culture based systems. */ | ||
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); | ||
} | ||
|
||
[TearDown] | ||
public void Cleanup() | ||
{ | ||
// Empty, but required: https://nunit.org/nunitv2/docs/2.6.4/setupFixture.html | ||
} | ||
} | ||
} |