diff --git a/CleanAspCore.Api.Tests/TestSetup/TestWebApi.cs b/CleanAspCore.Api.Tests/TestSetup/TestWebApi.cs index 3eb07de..9ab2534 100644 --- a/CleanAspCore.Api.Tests/TestSetup/TestWebApi.cs +++ b/CleanAspCore.Api.Tests/TestSetup/TestWebApi.cs @@ -1,7 +1,9 @@ using CleanAspCore.Data; using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Refit; @@ -31,6 +33,14 @@ protected override IHost CreateHost(IHostBuilder builder) }); }); + builder.ConfigureServices(services => + { + services.RemoveAll(typeof(DbContextOptions)); + services.AddDbContext(c => c + .EnableSensitiveDataLogging() + .EnableDetailedErrors()); + }); + builder.ConfigureLogging(loggingBuilder => { loggingBuilder.ClearProviders();