Adding a ConfigureTestingServices (#335)
This commit is contained in:
committed by
Steve Smith
parent
f3f74a342e
commit
9695e9e3ba
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user