diff options
Diffstat (limited to 'RhSolutions.ML.Tests/DatasetBase.cs')
-rw-r--r-- | RhSolutions.ML.Tests/DatasetBase.cs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/RhSolutions.ML.Tests/DatasetBase.cs b/RhSolutions.ML.Tests/DatasetBase.cs deleted file mode 100644 index 904bab3..0000000 --- a/RhSolutions.ML.Tests/DatasetBase.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections; - -namespace RhSolutions.ML.Tests; -public abstract class DatasetBase : IEnumerable -{ - protected virtual string FileName {get;set;} = string.Empty; - public IEnumerator GetEnumerator() - { - string path = Path.Combine("..", "..", "..", "TestData", $"{FileName}.csv"); - using FileStream stream = new(path, FileMode.Open, FileAccess.Read); - StreamReader reader = new(stream); - string? inputLine = reader.ReadLine(); - while (inputLine != null) - { - var data = inputLine.Split(';'); - yield return new Product { Name = data[0], Type = data[1] }; - inputLine = reader.ReadLine(); - } - reader.Close(); - stream.Close(); - } -} |