Skip to content

Commit 8a7725a

Browse files
zeahmedeerhardt
authored andcommitted
Refactored scenario tests (issue dotnet#32) (dotnet#52)
* Refectored scenario tests according to #Bug 240688: Scenarios has a class Top5Scenarios with 2 scenarios defined * Moved 'TrainAndPredictHousePriceModelTest' to separate file. This closes issue dotnet#32
1 parent f0beeee commit 8a7725a

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

test/Microsoft.ML.Tests/Scenarios/Scenario_HousePricePrediction.cs renamed to test/Microsoft.ML.Tests/Scenarios/HousePricePredictionTests.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using Microsoft.ML.Models;
56
using Microsoft.ML.Runtime.Api;
67
using Microsoft.ML.TestFramework;
8+
using Microsoft.ML.Trainers;
9+
using Microsoft.ML.Transforms;
710
using Xunit;
811
using Xunit.Abstractions;
912

1013
namespace Microsoft.ML.Scenarios
1114
{
12-
public partial class Top5Scenarios : BaseTestClass
15+
public partial class ScenariosTests : BaseTestClass
1316
{
1417
/*
1518
A real-estate firm Contoso wants to add a house price prediction to their ASP.NET/Xamarin application.
@@ -121,7 +124,7 @@ public class HousePricePrediction
121124
public float Price;
122125
}
123126

124-
public Top5Scenarios(ITestOutputHelper output) : base(output)
127+
public ScenariosTests(ITestOutputHelper output) : base(output)
125128
{
126129
}
127130
}

test/Microsoft.ML.Tests/Scenarios/Scenario_TrainPredictionModel.cs renamed to test/Microsoft.ML.Tests/Scenarios/HousePriceTrainAndPredictionTests.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

55
using Microsoft.ML.Models;
6+
using Microsoft.ML.Runtime.Api;
7+
using Microsoft.ML.TestFramework;
68
using Microsoft.ML.Trainers;
79
using Microsoft.ML.Transforms;
810
using Xunit;
11+
using Xunit.Abstractions;
912

1013
namespace Microsoft.ML.Scenarios
1114
{
12-
public partial class Top5Scenarios
15+
public partial class ScenariosTests
1316
{
1417
[Fact(Skip = "Missing data set. See https://github.com/dotnet/machinelearning/issues/3")]
1518
public void TrainAndPredictHousePriceModelTest()
@@ -70,4 +73,3 @@ public void TrainAndPredictHousePriceModelTest()
7073
}
7174
}
7275
}
73-

test/Microsoft.ML.Tests/Scenarios/TrainAndPredictIrisModelTest.cs renamed to test/Microsoft.ML.Tests/Scenarios/IrisPlantClassificationTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.ML.Scenarios
1212
{
13-
public partial class Top5Scenarios
13+
public partial class ScenariosTests
1414
{
1515
[Fact]
1616
public void TrainAndPredictIrisModelTest()

test/Microsoft.ML.Tests/Scenarios/Scenario3_SentimentPrediction.cs renamed to test/Microsoft.ML.Tests/Scenarios/SentimentPredictionTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Microsoft.ML.Scenarios
1515
{
16-
public partial class Top5Scenarios
16+
public partial class ScenariosTests
1717
{
1818
public const string SentimentDataPath = "wikipedia-detox-250-line-data.tsv";
1919
public const string SentimentTestPath = "wikipedia-detox-250-line-test.tsv";

0 commit comments

Comments
 (0)