mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-01-10 00:29:23 +00:00
63ef445a78
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
32 lines
832 B
C#
32 lines
832 B
C#
// <copyright file="Tests.cs" company="Adrian Conlon">
|
|
// Copyright (c) Adrian Conlon. All rights reserved.
|
|
// </copyright>
|
|
namespace Fuse
|
|
{
|
|
using System.Collections.Generic;
|
|
|
|
public class Tests<T>
|
|
where T : Fuse.IRegisterState, new()
|
|
{
|
|
private readonly Lines lines;
|
|
|
|
public Tests(string path) => this.lines = new Lines(path);
|
|
|
|
public Dictionary<string, Test<T>> Container { get; } = new Dictionary<string, Test<T>>();
|
|
|
|
public void Read() => this.lines.Read();
|
|
|
|
public void Parse()
|
|
{
|
|
while (!this.lines.EndOfFile)
|
|
{
|
|
var test = new Test<T>();
|
|
if (test.TryParse(this.lines))
|
|
{
|
|
this.Container.Add(test.Description, test);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|