From 3a7917c56658d3629c037018e0ecfff076a010c6 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 14 Jan 2016 14:07:31 -0800 Subject: [PATCH] Move away from using OptionsSetup in test --- .../IdentityOptionsTest.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs index e657710ded..d1c3bfccaa 100644 --- a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs +++ b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs @@ -107,23 +107,16 @@ namespace Microsoft.AspNet.Identity.Test Assert.Equal(1001, options.Lockout.MaxFailedAccessAttempts); } - public class PasswordsNegativeLengthSetup : ConfigureOptions - { - public PasswordsNegativeLengthSetup() - : base(options => options.Password.RequiredLength = -1) - { } - } - [Fact] public void CanCustomizeIdentityOptions() { var services = new ServiceCollection() - .ConfigureOptions(); + .Configure(options => options.Password.RequiredLength = -1); services.AddIdentity(); var serviceProvider = services.BuildServiceProvider(); var setup = serviceProvider.GetRequiredService>(); - Assert.IsType(typeof(PasswordsNegativeLengthSetup), setup); + Assert.NotNull(setup); var optionsGetter = serviceProvider.GetRequiredService>(); Assert.NotNull(optionsGetter); var myOptions = optionsGetter.Value;