cs-codex-dist-tests/Tests/CodexContinuousTests/TestFactory.cs

13 lines
400 B
C#
Raw Normal View History

namespace ContinuousTests
{
public class TestFactory
{
public ContinuousTest[] CreateTests()
{
var types = GetType().Assembly.GetTypes();
var testTypes = types.Where(t => typeof(ContinuousTest).IsAssignableFrom(t) && !t.IsAbstract);
return testTypes.Select(t => (ContinuousTest)Activator.CreateInstance(t)!).ToArray();
}
}
}