From 61a47d79a82e8217d2bf4397eb1112a81a2de3ec Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 4 Sep 2015 11:47:19 -0700 Subject: [PATCH] Work around System.Uri relative path bug on mono. --- .../Facebook/FacebookMiddlewareTests.cs | 2 +- .../Google/GoogleMiddlewareTests.cs | 6 +++--- .../MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs index f32aa37547..22f9cfd8ce 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs @@ -236,7 +236,7 @@ namespace Microsoft.AspNet.Authentication.Facebook "https://example.com/signin-facebook?code=TestCode&state=" + UrlEncoder.Default.UrlEncode(state), correlationKey + "=" + correlationValue); transaction.Response.StatusCode.ShouldBe(HttpStatusCode.Redirect); - transaction.Response.Headers.Location.ToString().ShouldBe("/me"); + transaction.Response.Headers.GetValues("Location").First().ShouldBe("/me"); finalUserInfoEndpoint.Count(c => c == '?').ShouldBe(1); finalUserInfoEndpoint.ShouldContain("fields=email,timezone,picture"); finalUserInfoEndpoint.ShouldContain("&access_token="); diff --git a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs index afefb49077..4a35c55c77 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs @@ -286,7 +286,7 @@ namespace Microsoft.AspNet.Authentication.Google "https://example.com/signin-google?code=TestCode&state=" + UrlEncoder.Default.UrlEncode(state), correlationKey + "=" + correlationValue); transaction.Response.StatusCode.ShouldBe(HttpStatusCode.Redirect); - transaction.Response.Headers.Location.ToString().ShouldBe("/me"); + transaction.Response.Headers.GetValues("Location").First().ShouldBe("/me"); transaction.SetCookie.Count.ShouldBe(2); transaction.SetCookie[0].ShouldContain(correlationKey); transaction.SetCookie[1].ShouldContain(".AspNet." + TestExtensions.CookieAuthenticationScheme); @@ -434,7 +434,7 @@ namespace Microsoft.AspNet.Authentication.Google "https://example.com/signin-google?code=TestCode&state=" + UrlEncoder.Default.UrlEncode(state), correlationKey + "=" + correlationValue); transaction.Response.StatusCode.ShouldBe(HttpStatusCode.Redirect); - transaction.Response.Headers.Location.ToString().ShouldBe("/me"); + transaction.Response.Headers.GetValues("Location").First().ShouldBe("/me"); transaction.SetCookie.Count.ShouldBe(2); transaction.SetCookie[0].ShouldContain(correlationKey); transaction.SetCookie[1].ShouldContain(".AspNet." + TestExtensions.CookieAuthenticationScheme); @@ -526,7 +526,7 @@ namespace Microsoft.AspNet.Authentication.Google correlationKey + "=" + correlationValue); transaction.Response.StatusCode.ShouldBe(HttpStatusCode.Redirect); - transaction.Response.Headers.Location.ToString().ShouldBe("/foo"); + transaction.Response.Headers.GetValues("Location").First().ShouldBe("/foo"); } diff --git a/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs index b469100eee..42c6a8cd3c 100644 --- a/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using System; +using System.Linq; using System.Net; using System.Net.Http; using System.Security.Claims; @@ -163,7 +164,7 @@ namespace Microsoft.AspNet.Authentication.Tests.MicrosoftAccount "https://example.com/signin-microsoft?code=TestCode&state=" + UrlEncoder.Default.UrlEncode(state), correlationKey + "=" + correlationValue); transaction.Response.StatusCode.ShouldBe(HttpStatusCode.Redirect); - transaction.Response.Headers.Location.ToString().ShouldBe("/me"); + transaction.Response.Headers.GetValues("Location").First().ShouldBe("/me"); transaction.SetCookie.Count.ShouldBe(2); transaction.SetCookie[0].ShouldContain(correlationKey); transaction.SetCookie[1].ShouldContain(".AspNet." + TestExtensions.CookieAuthenticationScheme);