diff --git a/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs b/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs index adff3838b7..1889b06d1a 100644 --- a/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs +++ b/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs @@ -9,6 +9,7 @@ using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.AspNet.Security.DataProtection; using Xunit; +using Microsoft.Framework.Runtime.Infrastructure; namespace Microsoft.AspNet.Identity.EntityFramework.Test { @@ -43,7 +44,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test public async Task EnsureStartupUsageWorks() { var context = CreateContext(true); - var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); builder.UseServices(services => { diff --git a/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs b/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs index 0eda3c67f8..345e80ea62 100644 --- a/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs +++ b/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs @@ -11,6 +11,7 @@ using Microsoft.Data.Entity; using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.OptionsModel; +using Microsoft.Framework.Runtime.Infrastructure; using Xunit; namespace Microsoft.AspNet.Identity.EntityFramework.Test @@ -79,7 +80,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test public async Task EnsureStartupUsageWorks() { EnsureDatabase(); - var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); builder.UseServices(services => { @@ -104,7 +105,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test public async Task EnsureStartupOptionsChangeWorks() { EnsureDatabase(); - var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); builder.UseServices(services => { diff --git a/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs b/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs index 917ddb71c2..178fcfb9fd 100644 --- a/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs +++ b/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs @@ -14,6 +14,7 @@ using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.Logging; using Microsoft.AspNet.Security.DataProtection; using Xunit; +using Microsoft.Framework.Runtime.Infrastructure; namespace Microsoft.AspNet.Identity.EntityFramework.Test { @@ -48,7 +49,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test public async Task EnsureStartupUsageWorks() { EnsureDatabase(); - var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); builder.UseServices(services => { @@ -74,7 +75,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test public async Task EnsureStartupOptionsChangeWorks() { EnsureDatabase(); - var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); builder.UseServices(services => { diff --git a/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs b/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs index 3ba88219e8..a004c7c18c 100644 --- a/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs +++ b/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs @@ -12,6 +12,7 @@ using Moq; using System.Security.Claims; using System.Threading.Tasks; using Xunit; +using Microsoft.Framework.Runtime.Infrastructure; namespace Microsoft.AspNet.Identity.InMemory.Test { @@ -24,7 +25,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test [InlineData(false)] public async Task VerifyAccountControllerSignIn(bool isPersistent) { - var app = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var app = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); app.UseCookieAuthentication(); var context = new Mock(); diff --git a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs index 4d7983804a..fe4891f78b 100644 --- a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs +++ b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs @@ -9,6 +9,7 @@ using Microsoft.Framework.ConfigurationModel; using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.OptionsModel; +using Microsoft.Framework.Runtime.Infrastructure; using Xunit; namespace Microsoft.AspNet.Identity.Test @@ -113,7 +114,7 @@ namespace Microsoft.AspNet.Identity.Test [Fact] public void CanCustomizeIdentityOptions() { - var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); builder.UseServices(services => { services.AddIdentity(); @@ -135,7 +136,7 @@ namespace Microsoft.AspNet.Identity.Test [Fact] public void CanSetupIdentityOptions() { - var app = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); + var app = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider); app.UseServices(services => { services.AddIdentity().ConfigureIdentity(options => options.User.RequireUniqueEmail = true);