From d61a08edf4c6879bc3a495d01c270c2e7609b873 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 28 Mar 2016 10:34:41 -0700 Subject: [PATCH] React to HttpAbstractions namespace changes - aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592 - clean up `using`s --- .../IdentityServiceCollectionExtensions.cs | 3 +-- .../TestIdentityFactory.cs | 1 - .../DbUtil.cs | 2 -- test/Microsoft.AspNetCore.Identity.Test/SignInManagerTest.cs | 1 - test/Microsoft.AspNetCore.Identity.Test/UserManagerTest.cs | 1 - test/Shared/UserManagerTestBase.cs | 5 ++--- 6 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.AspNetCore.Identity/IdentityServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Identity/IdentityServiceCollectionExtensions.cs index fb5a23686..b8fc6126c 100644 --- a/src/Microsoft.AspNetCore.Identity/IdentityServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNetCore.Identity/IdentityServiceCollectionExtensions.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -39,7 +38,7 @@ public static IdentityBuilder AddIdentity( /// An action to configure the . /// An for creating and configuring the identity system. public static IdentityBuilder AddIdentity( - this IServiceCollection services, + this IServiceCollection services, Action setupAction) where TUser : class where TRole : class diff --git a/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test/TestIdentityFactory.cs b/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test/TestIdentityFactory.cs index 4c71470e8..c8ba6c922 100644 --- a/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test/TestIdentityFactory.cs +++ b/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test/TestIdentityFactory.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; diff --git a/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test/DbUtil.cs b/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test/DbUtil.cs index 1c4cc3ba8..4aab1f207 100644 --- a/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test/DbUtil.cs +++ b/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test/DbUtil.cs @@ -2,10 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using Xunit; namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test { diff --git a/test/Microsoft.AspNetCore.Identity.Test/SignInManagerTest.cs b/test/Microsoft.AspNetCore.Identity.Test/SignInManagerTest.cs index 02b44604e..dbf5f552b 100644 --- a/test/Microsoft.AspNetCore.Identity.Test/SignInManagerTest.cs +++ b/test/Microsoft.AspNetCore.Identity.Test/SignInManagerTest.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.Options; using Moq; using Xunit; diff --git a/test/Microsoft.AspNetCore.Identity.Test/UserManagerTest.cs b/test/Microsoft.AspNetCore.Identity.Test/UserManagerTest.cs index 076ad0853..28975a3c2 100644 --- a/test/Microsoft.AspNetCore.Identity.Test/UserManagerTest.cs +++ b/test/Microsoft.AspNetCore.Identity.Test/UserManagerTest.cs @@ -8,7 +8,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.DependencyInjection; using Moq; using Xunit; diff --git a/test/Shared/UserManagerTestBase.cs b/test/Shared/UserManagerTestBase.cs index 4ad4585e9..d2650e1a7 100644 --- a/test/Shared/UserManagerTestBase.cs +++ b/test/Shared/UserManagerTestBase.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.Testing; using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.DependencyInjection; @@ -1023,7 +1022,7 @@ public async Task SingleFailureLockout() Assert.True(await mgr.IsLockedOutAsync(user)); Assert.True(await mgr.GetLockoutEndDateAsync(user) > DateTimeOffset.UtcNow.AddMinutes(55)); IdentityResultAssert.VerifyLogMessage(mgr.Logger, $"User {await mgr.GetUserIdAsync(user)} is locked out."); - + Assert.Equal(0, await mgr.GetAccessFailedCountAsync(user)); } @@ -1769,7 +1768,7 @@ public async Task CanChangeEmailWithDifferentTokenProvider() { return; } - var manager = CreateManager(context: null, services: null, + var manager = CreateManager(context: null, services: null, configureServices: s => s.Configure( o => o.Tokens.ProviderMap["NewProvider2"] = new TokenProviderDescriptor(typeof(EmailTokenProvider)))); manager.Options.Tokens.ChangeEmailTokenProvider = "NewProvider2";