public TestRouter( TestTargetRegistry testTargets, TestDefinitionRegistry testDefinitions, string pathBase = "/tests") : base(pathBase) { this.pathBase = pathBase ?? throw new ArgumentNullException(nameof(pathBase)); this.testDefinitions = testDefinitions ?? throw new ArgumentNullException(nameof(testDefinitions)); this.testTargets = testTargets ?? throw new ArgumentNullException(nameof(testTargets)); }
public static IServiceCollection AddPeakyTests( this IServiceCollection builder, Action <TestTargetRegistry> configure = null, IEnumerable <Type> testTypes = null) { builder.TryAddSingleton(c => { var registry = new TestTargetRegistry(c); configure?.Invoke(registry); return(registry); }); builder.TryAddSingleton(c => new TestDefinitionRegistry(testTypes)); builder.TryAddTransient <ITestPageRenderer>(c => new TestPageRenderer()); return(builder); }