React to fallback changes

This commit is contained in:
Hao Kung 2014-11-20 17:42:14 -08:00
parent 0e9fa31da5
commit 9f351a09a2
5 changed files with 13 additions and 8 deletions

View File

@ -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 =>
{

View File

@ -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 =>
{

View File

@ -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 =>
{

View File

@ -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<HttpContext>();

View File

@ -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<IdentityUser>();
@ -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<IdentityUser>().ConfigureIdentity(options => options.User.RequireUniqueEmail = true);