From c237f8989a9b62121fe2bb1e6ac5ebad6c5088eb Mon Sep 17 00:00:00 2001 From: jacalvar Date: Tue, 15 Mar 2016 16:11:49 -0700 Subject: [PATCH] React to changes in DataProtection --- .../Internal/AntiforgeryOptionsSetupTest.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/AntiforgeryOptionsSetupTest.cs b/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/AntiforgeryOptionsSetupTest.cs index 79804b4117..181c62b3e5 100644 --- a/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/AntiforgeryOptionsSetupTest.cs +++ b/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/AntiforgeryOptionsSetupTest.cs @@ -1,6 +1,7 @@ // 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.AspNetCore.DataProtection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Xunit; @@ -19,7 +20,9 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal // Arrange var serviceCollection = new ServiceCollection(); serviceCollection.AddAntiforgery(); - serviceCollection.AddDataProtection(o => o.SetApplicationName(applicationId)); + serviceCollection + .AddDataProtection() + .SetApplicationName(applicationId); var services = serviceCollection.BuildServiceProvider(); var options = services.GetRequiredService>(); @@ -42,7 +45,9 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal o.CookieName = "antiforgery"; }); serviceCollection.AddAntiforgery(); - serviceCollection.AddDataProtection(o => o.SetApplicationName("HelloWorldApp")); + serviceCollection + .AddDataProtection() + .SetApplicationName("HelloWorldApp"); var services = serviceCollection.BuildServiceProvider(); var options = services.GetRequiredService>();