private IServiceProvider ConfigureServices(Action <IServiceCollection> addServices = null) { var services = new ServiceCollection(); services.AddSingleton(db); services.AddLogging(builder => builder.AddSerilog(logger)); application.ConfigureDi(services, logger); application.ConfigureAuthServices(services, FakeWebApiConfiguration); application.ConfigureMvc(services); addServices?.Invoke(services); return(services.BuildServiceProvider()); }