public static ServiceProvider BuildServiceProvider(this IServiceCollection serviceCollection, FlowHandlerTestBase flowHandlerTestBase, out IMediator mediator, out ILogger logger) { var serviceProvider = serviceCollection.BuildServiceProvider(); mediator = serviceProvider.GetService <IMediator>(); logger = serviceProvider.GetLogger(flowHandlerTestBase); return(serviceProvider); }
public static IServiceCollection AddDebugLogging(this IServiceCollection serviceCollection, FlowHandlerTestBase flowHandlerTestBase, StringBuilder loggingOutputBuilder = null) { serviceCollection .AddLogging(configure => { configure.SetMinimumLevel(LogLevel.Debug); configure.AddProvider(flowHandlerTestBase); if (loggingOutputBuilder != null) { configure.AddProvider(new TestLoggerProvider(loggingOutputBuilder)); } }); return(serviceCollection); }