From 5572955414c67d2830eb47f046485c57c1ac8dd6 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Sun, 18 Feb 2018 09:23:02 -0800 Subject: [PATCH] Cleanup Identity functional tests --- IdentityCore.sln | 2 + .../AuthorizationTests.cs | 11 +++++- .../Infrastructure/DefaultUIContext.cs | 15 ++------ .../Infrastructure/DefaultUIPage.cs | 6 +-- .../Infrastructure/HtmlPageContext.cs | 6 +-- .../Infrastructure/ServerFactory.cs | 37 ++++++++++++++++--- test/Identity.FunctionalTests/LoginTests.cs | 14 ++++--- .../ManagementTests.cs | 11 +++++- .../Pages/Account/ConfirmEmail.cs | 8 ++-- .../Pages/Account/ExternalLogin.cs | 7 ++-- .../Pages/Account/ForgotPassword.cs | 5 ++- .../Account/ForgotPasswordConfirmation.cs | 6 +-- .../Pages/Account/Login.cs | 1 - .../Pages/Account/LoginWithRecoveryCode.cs | 2 +- .../Pages/Account/ResetPassword.cs | 7 ++-- .../Account/ResetPasswordConfirmation.cs | 7 +++- .../Pages/Contoso/Login.cs | 7 ++-- .../RegistrationTests.cs | 9 ++++- test/Identity.FunctionalTests/UserStories.cs | 3 +- .../00000000000000_CreateIdentitySchema.cs | 3 -- .../20180217170630_UpdateIdentitySchema.cs | 5 ++- .../IdentityDbContextModelSnapshot.cs | 9 ++--- .../ContosoAuthenticationBuilderExtensions.cs | 8 ++-- .../Services/ContosoEmailSender.cs | 7 ++-- .../Services/IdentityEmail.cs | 8 ++-- .../appsettings.json | 1 - 26 files changed, 126 insertions(+), 79 deletions(-) diff --git a/IdentityCore.sln b/IdentityCore.sln index 1741223af9..3971ae00b5 100644 --- a/IdentityCore.sln +++ b/IdentityCore.sln @@ -234,6 +234,7 @@ Global {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Debug|x64.ActiveCfg = Debug|Any CPU {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Debug|x64.Build.0 = Debug|Any CPU {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Debug|x86.ActiveCfg = Debug|Any CPU + {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Debug|x86.Build.0 = Debug|Any CPU {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Release|Any CPU.ActiveCfg = Release|Any CPU {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Release|Any CPU.Build.0 = Release|Any CPU {D5FB2E24-4C71-430C-A289-59C8D59164B0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -281,6 +282,7 @@ Global {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Debug|x64.ActiveCfg = Debug|Any CPU {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Debug|x64.Build.0 = Debug|Any CPU {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Debug|x86.ActiveCfg = Debug|Any CPU + {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Debug|x86.Build.0 = Debug|Any CPU {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Release|Any CPU.ActiveCfg = Release|Any CPU {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Release|Any CPU.Build.0 = Release|Any CPU {EA424B4D-0BE1-49AC-A106-CC6CC808A104}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU diff --git a/test/Identity.FunctionalTests/AuthorizationTests.cs b/test/Identity.FunctionalTests/AuthorizationTests.cs index fe6e63ffc2..0d77d80f98 100644 --- a/test/Identity.FunctionalTests/AuthorizationTests.cs +++ b/test/Identity.FunctionalTests/AuthorizationTests.cs @@ -6,8 +6,15 @@ using Xunit; namespace Microsoft.AspNetCore.Identity.FunctionalTests { - public class AuthorizationTests + public class AuthorizationTests : IClassFixture { + public AuthorizationTests(ServerFactory serverFactory) + { + ServerFactory = serverFactory; + } + + public ServerFactory ServerFactory { get; } + public static TheoryData AuthorizedPages => new TheoryData { @@ -86,10 +93,10 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests // /Identity/Account/LoginWith2fa // /Identity/Account/ExternalLogin // /Identity/Account/ConfirmEmail + // /Identity/Account/ResetPassword, public static TheoryData UnauthorizedPages => new TheoryData { - "/Identity/Account/ResetPassword", "/Identity/Account/Login", "/Identity/Account/Lockout", "/Identity/Account/ForgotPasswordConfirmation", diff --git a/test/Identity.FunctionalTests/Infrastructure/DefaultUIContext.cs b/test/Identity.FunctionalTests/Infrastructure/DefaultUIContext.cs index 727b7932e5..30925f3806 100644 --- a/test/Identity.FunctionalTests/Infrastructure/DefaultUIContext.cs +++ b/test/Identity.FunctionalTests/Infrastructure/DefaultUIContext.cs @@ -1,20 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Text; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNetCore.Identity.FunctionalTests { public class DefaultUIContext : HtmlPageContext { - public DefaultUIContext() - { - } + public DefaultUIContext() { } - public DefaultUIContext(DefaultUIContext currentContext) - : base(currentContext) - { - - } + public DefaultUIContext(DefaultUIContext currentContext) : base(currentContext) { } public DefaultUIContext WithAuthenticatedUser() => new DefaultUIContext(this) { UserAuthenticated = true }; diff --git a/test/Identity.FunctionalTests/Infrastructure/DefaultUIPage.cs b/test/Identity.FunctionalTests/Infrastructure/DefaultUIPage.cs index 6c6c4d3288..fdda0ad266 100644 --- a/test/Identity.FunctionalTests/Infrastructure/DefaultUIPage.cs +++ b/test/Identity.FunctionalTests/Infrastructure/DefaultUIPage.cs @@ -1,7 +1,7 @@ -using System; -using System.Collections.Generic; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Net.Http; -using System.Text; using AngleSharp.Dom.Html; namespace Microsoft.AspNetCore.Identity.FunctionalTests diff --git a/test/Identity.FunctionalTests/Infrastructure/HtmlPageContext.cs b/test/Identity.FunctionalTests/Infrastructure/HtmlPageContext.cs index 7884616c76..546b73b526 100644 --- a/test/Identity.FunctionalTests/Infrastructure/HtmlPageContext.cs +++ b/test/Identity.FunctionalTests/Infrastructure/HtmlPageContext.cs @@ -9,13 +9,12 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests { private readonly IDictionary _properties; - protected HtmlPageContext() - : this(new Dictionary()) + protected HtmlPageContext() : this(new Dictionary()) { } protected HtmlPageContext(HtmlPageContext currentContext) - : this(new Dictionary(currentContext._properties)) + : this(new Dictionary(currentContext._properties)) { } @@ -26,6 +25,7 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests protected TValue GetValue(string key) => _properties.TryGetValue(key, out var rawValue) ? (TValue)rawValue : default; + protected void SetValue(string key, object value) => _properties[key] = value; } diff --git a/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs b/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs index 586bbd1e58..19f46df6fb 100644 --- a/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs +++ b/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Runtime.CompilerServices; @@ -12,9 +13,12 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Identity.FunctionalTests { - public class ServerFactory + public class ServerFactory : IDisposable { - public static TestServer CreateServer( + private bool disposedValue = false; + private IList _disposableServers = new List(); + + public TestServer CreateServer( Action configureBuilder, [CallerMemberName] string isolationKey = "") { @@ -30,13 +34,14 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests configureBuilder(builder); var server = new TestServer(builder); + _disposableServers.Add(server); return server; } - public static TestServer CreateDefaultServer([CallerMemberName] string isolationKey = "") => + public TestServer CreateDefaultServer([CallerMemberName] string isolationKey = "") => CreateServer(b => { }, isolationKey); - public static HttpClient CreateDefaultClient(TestServer server) + public HttpClient CreateDefaultClient(TestServer server) { var client = new HttpClient(new CookieContainerHandler(server.CreateHandler())) { @@ -46,7 +51,29 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests return client; } - public static HttpClient CreateDefaultClient() => + public HttpClient CreateDefaultClient() => CreateDefaultClient(CreateDefaultServer()); + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + foreach (var disposable in _disposableServers) + { + disposable?.Dispose(); + } + } + + _disposableServers = null; + disposedValue = true; + } + } + + public void Dispose() + { + Dispose(true); + } } } diff --git a/test/Identity.FunctionalTests/LoginTests.cs b/test/Identity.FunctionalTests/LoginTests.cs index 2a9f8209c9..6e1994e0c8 100644 --- a/test/Identity.FunctionalTests/LoginTests.cs +++ b/test/Identity.FunctionalTests/LoginTests.cs @@ -4,17 +4,21 @@ using System; using System.Linq; using System.Threading.Tasks; -using AngleSharp.Dom.Html; -using Identity.DefaultUI.WebSite.Services; -using Microsoft.AspNetCore.Identity.UI.Services; -using Microsoft.Extensions.DependencyInjection; +using Identity.DefaultUI.WebSite; using Xunit; using Xunit.Sdk; namespace Microsoft.AspNetCore.Identity.FunctionalTests { - public class LoginTests + public class LoginTests : IClassFixture { + public LoginTests(ServerFactory serverFactory) + { + ServerFactory = serverFactory; + } + + public ServerFactory ServerFactory { get; } + [Fact] public async Task CanLogInWithAPreviouslyRegisteredUser() { diff --git a/test/Identity.FunctionalTests/ManagementTests.cs b/test/Identity.FunctionalTests/ManagementTests.cs index aa117ea68c..cdc12683b2 100644 --- a/test/Identity.FunctionalTests/ManagementTests.cs +++ b/test/Identity.FunctionalTests/ManagementTests.cs @@ -3,13 +3,20 @@ using System; using System.Threading.Tasks; -using Identity.DefaultUI.WebSite.Services; +using Identity.DefaultUI.WebSite; using Xunit; namespace Microsoft.AspNetCore.Identity.FunctionalTests { - public class ManagementTests + public class ManagementTests : IClassFixture { + public ManagementTests(ServerFactory serverFactory) + { + ServerFactory = serverFactory; + } + + public ServerFactory ServerFactory { get; } + [Fact] public async Task CanEnableTwoFactorAuthentication() { diff --git a/test/Identity.FunctionalTests/Pages/Account/ConfirmEmail.cs b/test/Identity.FunctionalTests/Pages/Account/ConfirmEmail.cs index b3207cb961..3632dd849b 100644 --- a/test/Identity.FunctionalTests/Pages/Account/ConfirmEmail.cs +++ b/test/Identity.FunctionalTests/Pages/Account/ConfirmEmail.cs @@ -1,11 +1,11 @@ -using System; -using System.Collections.Generic; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Net.Http; -using System.Text; using System.Threading.Tasks; using AngleSharp.Dom.Html; -namespace Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account +namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account { public class ConfirmEmail : DefaultUIPage { diff --git a/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs b/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs index 7a10597aa0..d61120c9f8 100644 --- a/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs +++ b/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs @@ -1,11 +1,12 @@ -using System; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Collections.Generic; using System.Net.Http; -using System.Text; using System.Threading.Tasks; using AngleSharp.Dom.Html; -namespace Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account +namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account { public class ExternalLogin : DefaultUIPage { diff --git a/test/Identity.FunctionalTests/Pages/Account/ForgotPassword.cs b/test/Identity.FunctionalTests/Pages/Account/ForgotPassword.cs index 72d5334d11..71ba662d19 100644 --- a/test/Identity.FunctionalTests/Pages/Account/ForgotPassword.cs +++ b/test/Identity.FunctionalTests/Pages/Account/ForgotPassword.cs @@ -1,7 +1,8 @@ -using System; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Collections.Generic; using System.Net.Http; -using System.Text; using System.Threading.Tasks; using AngleSharp.Dom.Html; diff --git a/test/Identity.FunctionalTests/Pages/Account/ForgotPasswordConfirmation.cs b/test/Identity.FunctionalTests/Pages/Account/ForgotPasswordConfirmation.cs index 82f0d4acc0..ab6fa15fc2 100644 --- a/test/Identity.FunctionalTests/Pages/Account/ForgotPasswordConfirmation.cs +++ b/test/Identity.FunctionalTests/Pages/Account/ForgotPasswordConfirmation.cs @@ -1,7 +1,7 @@ -using System; -using System.Collections.Generic; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Net.Http; -using System.Text; using AngleSharp.Dom.Html; namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account diff --git a/test/Identity.FunctionalTests/Pages/Account/Login.cs b/test/Identity.FunctionalTests/Pages/Account/Login.cs index 365cbc1252..b7e9bdc752 100644 --- a/test/Identity.FunctionalTests/Pages/Account/Login.cs +++ b/test/Identity.FunctionalTests/Pages/Account/Login.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using AngleSharp.Dom.Html; -using Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account; using Xunit; namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account diff --git a/test/Identity.FunctionalTests/Pages/Account/LoginWithRecoveryCode.cs b/test/Identity.FunctionalTests/Pages/Account/LoginWithRecoveryCode.cs index f5ee768809..01fb130ab7 100644 --- a/test/Identity.FunctionalTests/Pages/Account/LoginWithRecoveryCode.cs +++ b/test/Identity.FunctionalTests/Pages/Account/LoginWithRecoveryCode.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account var indexPage = await Client.GetAsync(goToIndex); var index = await ResponseAssert.IsHtmlDocumentAsync(indexPage); - return new Index(Client, index, new DefaultUIContext(Context) { UserAuthenticated = true }); + return new Index(Client, index, Context.WithAuthenticatedUser()); } } } \ No newline at end of file diff --git a/test/Identity.FunctionalTests/Pages/Account/ResetPassword.cs b/test/Identity.FunctionalTests/Pages/Account/ResetPassword.cs index f5a1eea932..7596f4dd28 100644 --- a/test/Identity.FunctionalTests/Pages/Account/ResetPassword.cs +++ b/test/Identity.FunctionalTests/Pages/Account/ResetPassword.cs @@ -1,11 +1,12 @@ -using System; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Collections.Generic; using System.Net.Http; -using System.Text; using System.Threading.Tasks; using AngleSharp.Dom.Html; -namespace Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account +namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account { public class ResetPassword : DefaultUIPage { diff --git a/test/Identity.FunctionalTests/Pages/Account/ResetPasswordConfirmation.cs b/test/Identity.FunctionalTests/Pages/Account/ResetPasswordConfirmation.cs index 1bc03ac447..015d6972b1 100644 --- a/test/Identity.FunctionalTests/Pages/Account/ResetPasswordConfirmation.cs +++ b/test/Identity.FunctionalTests/Pages/Account/ResetPasswordConfirmation.cs @@ -1,7 +1,10 @@ -using System.Net.Http; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Net.Http; using AngleSharp.Dom.Html; -namespace Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account +namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account { public class ResetPasswordConfirmation : DefaultUIPage { diff --git a/test/Identity.FunctionalTests/Pages/Contoso/Login.cs b/test/Identity.FunctionalTests/Pages/Contoso/Login.cs index c9e22a85f4..b174a3af8c 100644 --- a/test/Identity.FunctionalTests/Pages/Contoso/Login.cs +++ b/test/Identity.FunctionalTests/Pages/Contoso/Login.cs @@ -1,10 +1,11 @@ -using System; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Collections.Generic; using System.Net.Http; -using System.Text; using System.Threading.Tasks; using AngleSharp.Dom.Html; -using Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account; +using Microsoft.AspNetCore.Identity.FunctionalTests.Account; namespace Microsoft.AspNetCore.Identity.FunctionalTests.Contoso { diff --git a/test/Identity.FunctionalTests/RegistrationTests.cs b/test/Identity.FunctionalTests/RegistrationTests.cs index f41f40ac98..36dfa2c2f0 100644 --- a/test/Identity.FunctionalTests/RegistrationTests.cs +++ b/test/Identity.FunctionalTests/RegistrationTests.cs @@ -7,8 +7,15 @@ using Xunit; namespace Microsoft.AspNetCore.Identity.FunctionalTests { - public class RegistrationTests + public class RegistrationTests : IClassFixture { + public RegistrationTests(ServerFactory serverFactory) + { + ServerFactory = serverFactory; + } + + public ServerFactory ServerFactory { get; } + [Fact] public async Task CanRegisterAUser() { diff --git a/test/Identity.FunctionalTests/UserStories.cs b/test/Identity.FunctionalTests/UserStories.cs index c772a6f428..824d4acefc 100644 --- a/test/Identity.FunctionalTests/UserStories.cs +++ b/test/Identity.FunctionalTests/UserStories.cs @@ -5,10 +5,9 @@ using System; using System.Net.Http; using System.Threading.Tasks; using AngleSharp.Dom.Html; -using Identity.DefaultUI.WebSite.Services; +using Identity.DefaultUI.WebSite; using Microsoft.AspNetCore.Identity.FunctionalTests.Account; using Microsoft.AspNetCore.Identity.FunctionalTests.Account.Manage; -using Microsoft.AspNetCore.Identity.FunctionalTests.Pages.Account; using Xunit; namespace Microsoft.AspNetCore.Identity.FunctionalTests diff --git a/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/00000000000000_CreateIdentitySchema.cs index 488642d3ee..3b0ba5c7d7 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/00000000000000_CreateIdentitySchema.cs +++ b/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/00000000000000_CreateIdentitySchema.cs @@ -2,9 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/20180217170630_UpdateIdentitySchema.cs b/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/20180217170630_UpdateIdentitySchema.cs index e99ded8a85..33fe9bf03d 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/20180217170630_UpdateIdentitySchema.cs +++ b/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/20180217170630_UpdateIdentitySchema.cs @@ -1,5 +1,6 @@ -using System; -using System.Collections.Generic; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using Microsoft.EntityFrameworkCore.Migrations; namespace Identity.DefaultUI.WebSite.Data.Migrations diff --git a/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/IdentityDbContextModelSnapshot.cs b/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/IdentityDbContextModelSnapshot.cs index 78593d82d0..16bf090c3d 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/IdentityDbContextModelSnapshot.cs +++ b/test/WebSites/Identity.DefaultUI.WebSite/Data/Migrations/IdentityDbContextModelSnapshot.cs @@ -1,13 +1,12 @@ -// +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +// using System; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; namespace Identity.DefaultUI.WebSite.Data.Migrations { diff --git a/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoAuthenticationBuilderExtensions.cs b/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoAuthenticationBuilderExtensions.cs index 0e64aaf5a8..1e52a5217b 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoAuthenticationBuilderExtensions.cs +++ b/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoAuthenticationBuilderExtensions.cs @@ -11,9 +11,9 @@ namespace Identity.DefaultUI.WebSite public static AuthenticationBuilder AddContosoAuthentication( this AuthenticationBuilder builder, Action configure) => - builder.AddScheme( - ContosoAuthenticationConstants.Scheme, - ContosoAuthenticationConstants.DisplayName, - configure); + builder.AddScheme( + ContosoAuthenticationConstants.Scheme, + ContosoAuthenticationConstants.DisplayName, + configure); } } diff --git a/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoEmailSender.cs b/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoEmailSender.cs index b1aebaded3..23cb0f3438 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoEmailSender.cs +++ b/test/WebSites/Identity.DefaultUI.WebSite/Services/ContosoEmailSender.cs @@ -1,10 +1,11 @@ -using System; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.UI.Services; -namespace Identity.DefaultUI.WebSite.Services +namespace Identity.DefaultUI.WebSite { public class ContosoEmailSender : IEmailSender { diff --git a/test/WebSites/Identity.DefaultUI.WebSite/Services/IdentityEmail.cs b/test/WebSites/Identity.DefaultUI.WebSite/Services/IdentityEmail.cs index dbf5c4d2f6..777e1a5301 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/Services/IdentityEmail.cs +++ b/test/WebSites/Identity.DefaultUI.WebSite/Services/IdentityEmail.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Identity.DefaultUI.WebSite.Services +namespace Identity.DefaultUI.WebSite { public class IdentityEmail { diff --git a/test/WebSites/Identity.DefaultUI.WebSite/appsettings.json b/test/WebSites/Identity.DefaultUI.WebSite/appsettings.json index acbebb34a4..1f00161129 100644 --- a/test/WebSites/Identity.DefaultUI.WebSite/appsettings.json +++ b/test/WebSites/Identity.DefaultUI.WebSite/appsettings.json @@ -1,7 +1,6 @@ { "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Identity.DefaultUI.WebSite-90455f3b-6c48-4aa0-a8d6-294d8e0b3d4d;Trusted_Connection=True;MultipleActiveResultSets=true" - //"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Identity.DefaultUI.WebSite-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Logging": { "LogLevel": {