Refactor folder structure
This commit is contained in:
28
src/Test/Ghost.Test.Core/TestRunner.cs
Normal file
28
src/Test/Ghost.Test.Core/TestRunner.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Ghost.Test.Core;
|
||||
|
||||
public class TestRunner
|
||||
{
|
||||
public static void Run<T>()
|
||||
where T : ITest, new()
|
||||
{
|
||||
var test = new T();
|
||||
test.Setup();
|
||||
test.Run();
|
||||
test.Cleanup();
|
||||
}
|
||||
|
||||
public static void Run<T>(int iteration)
|
||||
where T : ITest, new()
|
||||
{
|
||||
var test = new T();
|
||||
test.Setup();
|
||||
|
||||
iteration = iteration < 1 ? 1 : iteration;
|
||||
for (var i = 0; i < iteration; i++)
|
||||
{
|
||||
test.Run();
|
||||
}
|
||||
|
||||
test.Cleanup();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user