summaryrefslogtreecommitdiff
path: root/RhSolutions.ML.Tests/TestBase.cs
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2024-01-12 00:03:18 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2024-01-12 00:03:18 +0300
commitf27bf369cfcc28a47e10a5ccae1a474f286ef18f (patch)
tree9da79b0241cdce34fa5a5defd3399f98df462faf /RhSolutions.ML.Tests/TestBase.cs
parente0931c2e5f3f4897a634e5f8de015370bf010628 (diff)
Remove tests
Diffstat (limited to 'RhSolutions.ML.Tests/TestBase.cs')
-rw-r--r--RhSolutions.ML.Tests/TestBase.cs36
1 files changed, 0 insertions, 36 deletions
diff --git a/RhSolutions.ML.Tests/TestBase.cs b/RhSolutions.ML.Tests/TestBase.cs
deleted file mode 100644
index 04bc4a3..0000000
--- a/RhSolutions.ML.Tests/TestBase.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-namespace RhSolutions.ML.Tests;
-
-public abstract class TestBase
-{
- 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 TestBase()
- {
- _mlContext = new MLContext(seed: 0);
- ITransformer loadedModel = _mlContext.Model.Load(_dataPath, out var _);
- _predEngine = _mlContext.Model.CreatePredictionEngine<Product, TypePrediction>(loadedModel);
- }
-
- public void Execute(string name, string expectedGroup)
- {
- Product p = new()
- {
- Name = name
- };
- var prediction = _predEngine.Predict(p);
- Assert.That(prediction.Type, Is.EqualTo(expectedGroup));
- }
-
- public void Execute(Product expected)
- {
- Product actual = new()
- {
- Name = expected.Name
- };
- var prediction = _predEngine.Predict(actual);
- Assert.That(prediction.Type, Is.EqualTo(expected.Type));
- }
-}