diff options
author | Serghei Cebotari <serghei@cebotari.ru> | 2023-12-29 11:24:23 +0300 |
---|---|---|
committer | Serghei Cebotari <serghei@cebotari.ru> | 2023-12-29 11:24:23 +0300 |
commit | 7e22efde3f3be8d9f39856eb704d438feae8eb0f (patch) | |
tree | abacfa6f3309b27457ccb35a17cf75659ce4ba40 /RhSolutions.ML.Tests/RhSolutionsTests.cs | |
parent | 3be0df94c032b945af803d5056fb01df7af417f3 (diff) |
Implement Data driven tests
Diffstat (limited to 'RhSolutions.ML.Tests/RhSolutionsTests.cs')
-rw-r--r-- | RhSolutions.ML.Tests/RhSolutionsTests.cs | 29 |
1 files changed, 0 insertions, 29 deletions
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<Product, TypePrediction> _predEngine; - - public RhSolutionsTests() - { - RhSolutionsMLBuilder.RebuildModel(); - _mlContext = new MLContext(seed: 0); - ITransformer loadedNodel = _mlContext.Model.Load(_dataPath, out var _); - _predEngine = _mlContext.Model.CreatePredictionEngine<Product, TypePrediction>(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 |