diff --git a/src/Web/Startup.cs b/src/Web/Startup.cs index cfcf603..813fc02 100644 --- a/src/Web/Startup.cs +++ b/src/Web/Startup.cs @@ -74,6 +74,10 @@ namespace Microsoft.eShopWeb.Web ConfigureServices(services); } + public void ConfigureTestingServices(IServiceCollection services) + { + ConfigureInMemoryDatabases(services); + } // This method gets called by the runtime. Use this method to add services to the container. diff --git a/tests/FunctionalTests/Web/CustomWebApplicationFactory.cs b/tests/FunctionalTests/Web/CustomWebApplicationFactory.cs index 6f17765..1db16a3 100644 --- a/tests/FunctionalTests/Web/CustomWebApplicationFactory.cs +++ b/tests/FunctionalTests/Web/CustomWebApplicationFactory.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Identity.UI; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.EntityFrameworkCore; using Microsoft.eShopWeb.Infrastructure.Data; @@ -17,6 +16,8 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers { protected override void ConfigureWebHost(IWebHostBuilder builder) { + builder.UseEnvironment("Testing"); + builder.ConfigureServices(services => { services.AddEntityFrameworkInMemoryDatabase();