8000 Create virtual methods on user context by daniel-pons · Pull Request #280 · optimizely/csharp-sdk · GitHub
[go: up one dir, main page]

Skip to content

Create virtual methods on user context #280 8000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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
daniel-pons committed Sep 8, 2021
commit 3fbdfcf21f9eacf18705bedc1c1e8c3347c8f2a9
1 change: 1 addition & 0 deletions OptimizelySDK.Tests/OptimizelySDK.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<Compile Include="TestBucketer.cs" />
<Compile Include="BucketerTest.cs" />
<Compile Include="ProjectConfigTest.cs" />
<Compile Include="TestSetup.cs" />
<Compile Include="UtilsTests\ConditionParserTest.cs" />
<Compile Include="UtilsTests\EventTagUtilsTest.cs" />
<Compile Include="UtilsTests\ExceptionExtensionsTest.cs" />
Expand Down
25 changes: 25 additions & 0 deletions OptimizelySDK.Tests/TestSetup.cs
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
}
}
}
0