Skip to content

Commit

Permalink
reset culture (dotnet#3730)
Browse files Browse the repository at this point in the history
  • Loading branch information
srsaggam authored and Dmitry-A committed Aug 22, 2019
1 parent 88cea06 commit c07fe1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/mlnet.Tests/TrainerGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ public void CultureInvariantTest()
Pipeline pipeline = new Pipeline(new PipelineNode[] { node });

//Set culture to deutsch.
var currentCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");

CodeGenerator codeGenerator = new CodeGenerator(pipeline, null, null);
var actual = codeGenerator.GenerateTrainerAndUsings();

Thread.CurrentThread.CurrentCulture = currentCulture;
string expectedTrainerString = "LightGbm(learningRate:0.1f,numberOfLeaves:1,labelColumnName:\"Label\",featureColumnName:\"Features\")";
Assert.AreEqual(expectedTrainerString, actual.Item1);
Assert.IsNull(actual.Item2);
Expand Down

0 comments on commit c07fe1f

Please sign in to comment.