Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit 5f06906

Browse files
committed
React to fallback changes
1 parent 977a08d commit 5f06906

File tree

6 files changed

+14
-30
lines changed

6 files changed

+14
-30
lines changed

test/Microsoft.AspNet.Security.Test/Cookies/CookieMiddlewareTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.AspNet.Builder;
1616
using Microsoft.AspNet.Http;
1717
using Microsoft.AspNet.Http.Security;
18+
using Microsoft.AspNet.Security.DataProtection;
1819
using Microsoft.AspNet.TestHost;
1920
using Shouldly;
2021
using Xunit;
@@ -365,8 +366,9 @@ private static async Task<XElement> GetAuthData(TestServer server, string url, s
365366

366367
private static TestServer CreateServer(Action<CookieAuthenticationOptions> configureOptions, Func<HttpContext, Task> testpath = null)
367368
{
368-
return TestServer.Create(TestServices.CreateTestServices(), app =>
369+
return TestServer.Create(app =>
369370
{
371+
app.UseServices(services => services.Add(DataProtectionServices.GetDefaultServices()));
370372
app.UseCookieAuthentication(configureOptions);
371373
app.Use(async (context, next) =>
372374
{

test/Microsoft.AspNet.Security.Test/Facebook/FacebookMiddlewareTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
using System.Threading.Tasks;
1010
using Microsoft.AspNet.Builder;
1111
using Microsoft.AspNet.Http;
12-
using Microsoft.AspNet.Http.Security;
13-
using Microsoft.AspNet.Security.Cookies;
12+
using Microsoft.AspNet.Security.DataProtection;
1413
using Microsoft.AspNet.TestHost;
1514
using Microsoft.Framework.DependencyInjection;
16-
using Microsoft.Framework.OptionsModel;
1715
using Shouldly;
1816
using Xunit;
1917

@@ -29,6 +27,7 @@ public async Task ChallengeWillTriggerApplyRedirectEvent()
2927
{
3028
app.UseServices(services =>
3129
{
30+
services.Add(DataProtectionServices.GetDefaultServices());
3231
services.ConfigureFacebookAuthentication(options =>
3332
{
3433
options.AppId = "Test App Id";
@@ -72,6 +71,7 @@ public async Task ChallengeWillTriggerRedirection()
7271
{
7372
app.UseServices(services =>
7473
{
74+
services.Add(DataProtectionServices.GetDefaultServices());
7575
services.ConfigureFacebookAuthentication(options =>
7676
{
7777
options.AppId = "Test App Id";
@@ -107,7 +107,7 @@ public async Task ChallengeWillTriggerRedirection()
107107

108108
private static TestServer CreateServer(Action<IApplicationBuilder> configure, Func<HttpContext, bool> handler)
109109
{
110-
return TestServer.Create(TestServices.CreateTestServices(), app =>
110+
return TestServer.Create(app =>
111111
{
112112
if (configure != null)
113113
{

test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,11 @@ private static async Task<Transaction> SendAsync(TestServer server, string uri,
463463

464464
private static TestServer CreateServer(Action<GoogleAuthenticationOptions> configureOptions, Func<HttpContext, Task> testpath = null)
465465
{
466-
return TestServer.Create(TestServices.CreateTestServices(), app =>
466+
return TestServer.Create(app =>
467467
{
468468
app.UseServices(services =>
469469
{
470+
services.Add(DataProtectionServices.GetDefaultServices());
470471
services.Configure<ExternalAuthenticationOptions>(options =>
471472
{
472473
options.SignInAsAuthenticationType = CookieAuthenticationType;

test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@ public async Task AuthenticatedEventCanGetRefreshToken()
161161

162162
private static TestServer CreateServer(Action<MicrosoftAccountAuthenticationOptions> configureOptions, Func<HttpContext, bool> handler)
163163
{
164-
return TestServer.Create(TestServices.CreateTestServices(), app =>
164+
return TestServer.Create(app =>
165165
{
166166
app.UseServices(services =>
167167
{
168+
services.Add(DataProtectionServices.GetDefaultServices());
168169
services.Configure<ExternalAuthenticationOptions>(options =>
169170
{
170171
options.SignInAsAuthenticationType = "External";

test/Microsoft.AspNet.Security.Test/TestServices.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Xunit;
1818
using Microsoft.Framework.OptionsModel;
1919
using Microsoft.Framework.DependencyInjection;
20+
using Microsoft.AspNet.Security.DataProtection;
2021

2122
namespace Microsoft.AspNet.Security.Twitter
2223
{
@@ -107,10 +108,11 @@ public async Task ChallengeWillTriggerRedirection()
107108

108109
private static TestServer CreateServer(Action<IApplicationBuilder> configure, Func<HttpContext, bool> handler)
109110
{
110-
return TestServer.Create(TestServices.CreateTestServices(), app =>
111+
return TestServer.Create(app =>
111112
{
112113
app.UseServices(services =>
113114
{
115+
services.Add(DataProtectionServices.GetDefaultServices());
114116
services.Configure<ExternalAuthenticationOptions>(options =>
115117
{
116118
options.SignInAsAuthenticationType = "External";

0 commit comments

Comments
 (0)