From 7e22efde3f3be8d9f39856eb704d438feae8eb0f Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Fri, 29 Dec 2023 11:24:23 +0300 Subject: Implement Data driven tests --- RhSolutions.ML.Tests/RhSolutionsTests.cs | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 RhSolutions.ML.Tests/RhSolutionsTests.cs (limited to 'RhSolutions.ML.Tests/RhSolutionsTests.cs') diff --git a/RhSolutions.ML.Tests/RhSolutionsTests.cs b/RhSolutions.ML.Tests/RhSolutionsTests.cs deleted file mode 100644 index 4e91342..0000000 --- a/RhSolutions.ML.Tests/RhSolutionsTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -using RhSolutions.ML.Lib; - -namespace RhSolutions.ML.Tests; - -public abstract class RhSolutionsTests -{ - protected static string _appPath = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) ?? "."; - protected static string _dataPath = Path.Combine(_appPath, "..", "..", "..", "..", "Models", "model.zip"); - protected MLContext _mlContext; - protected PredictionEngine _predEngine; - - public RhSolutionsTests() - { - RhSolutionsMLBuilder.RebuildModel(); - _mlContext = new MLContext(seed: 0); - ITransformer loadedNodel = _mlContext.Model.Load(_dataPath, out var _); - _predEngine = _mlContext.Model.CreatePredictionEngine(loadedNodel); - } - - public void Execute(string name, string expectedGroup) - { - Product p = new() - { - Name = name - }; - var prediction = _predEngine.Predict(p); - Assert.That(prediction.Type, Is.EqualTo(expectedGroup)); - } -} \ No newline at end of file -- cgit v1.2.3