/// <summary> /// /// </summary> /// <param name="builder"></param> /// <returns></returns> public static TestKitBuilder UseLocalRunner(this TestKitBuilder builder) { builder.ServiceCollection.AddHttpClient(); builder.ServiceCollection.AddScoped<IRunnerExecutor, LocalRunnerExecutor>(); return builder; }
/// <summary> /// /// </summary> /// <param name="builder"></param> /// <returns></returns> public static TestKitBuilder UseInfrastructure(this TestKitBuilder builder) { builder.ServiceCollection.AddScoped <IAppInfoRepository, AppInfoRepository>(); builder.ServiceCollection.AddScoped <IAppEnvRepository, AppEnvRepository>(); builder.ServiceCollection.AddScoped <IApiInfoRepository, ApiInfoRepository>(); builder.ServiceCollection.AddScoped <ITestCaseRepository, TestCaseRepository>(); builder.ServiceCollection.AddScoped <IIntegrationTestRepository, IntegrationTestRepository>(); return(builder); }
/// <summary> /// /// </summary> /// <param name="services"></param> /// <param name="configure"></param> public static void AddTestKit(this IServiceCollection services, Action <TestKitBuilder> configure = null) { var builder = new TestKitBuilder(services); configure?.Invoke(builder); services.AddScoped <TestRunner>(); services.AddScoped <IAppInfoService, AppInfoService>(); services.AddScoped <IAppEnvService, AppEnvService>(); services.AddScoped <IApiInfoService, ApiInfoService>(); }
public static TestKitBuilder UseQuery(this TestKitBuilder builder) { builder.ServiceCollection.AddScoped <AppInfoQuery>(); return(builder); }
public static void UseAspNetCore(this TestKitBuilder builder, IConfiguration configuration) { builder.ServiceCollection.Configure <TestKitOptions>(configuration); }
public static void UseAspNetCore(this TestKitBuilder builder, Action <TestKitOptions> configure) { builder.ServiceCollection.Configure(configure); }