From 216d3a0656df1aeee031d4afa4a4afb54957719a Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Fri, 6 Nov 2015 04:27:33 -0800 Subject: [PATCH] Fix some authentication unit tests failing on Linux and OS X. --- .../Google/GoogleMiddlewareTests.cs | 10 +++++----- .../Twitter/TwitterMiddlewareTests.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs index ab822206de..514ce126f3 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs @@ -245,7 +245,7 @@ namespace Microsoft.AspNet.Authentication.Google options.ClientSecret = "Test Secret"; }); var error = await Assert.ThrowsAnyAsync(() => server.SendAsync("https://example.com/signin-google?code=TestCode")); - Assert.Equal("The oauth state was missing or invalid.", error.Message); + Assert.Equal("The oauth state was missing or invalid.", error.GetBaseException().Message); } [Theory] @@ -279,7 +279,7 @@ namespace Microsoft.AspNet.Authentication.Google else { var error = await Assert.ThrowsAnyAsync(() => server.SendAsync("https://example.com/signin-google?error=OMG")); - Assert.Equal("OMG", error.Message); + Assert.Equal("OMG", error.GetBaseException().Message); } } @@ -417,7 +417,7 @@ namespace Microsoft.AspNet.Authentication.Google else { var error = await Assert.ThrowsAnyAsync(() => sendTask); - Assert.Equal("OAuth token endpoint failure: Status: BadRequest;Headers: ;Body: {\"Error\":\"Error\"};", error.Message); + Assert.Equal("OAuth token endpoint failure: Status: BadRequest;Headers: ;Body: {\"Error\":\"Error\"};", error.GetBaseException().Message); } } @@ -471,7 +471,7 @@ namespace Microsoft.AspNet.Authentication.Google else { var error = await Assert.ThrowsAnyAsync(() => sendTask); - Assert.Equal("Failed to retrieve access token.", error.Message); + Assert.Equal("Failed to retrieve access token.", error.GetBaseException().Message); } } @@ -723,7 +723,7 @@ namespace Microsoft.AspNet.Authentication.Google //Post a message to the Google middleware var error = await Assert.ThrowsAnyAsync(() => server.SendAsync("https://example.com/signin-google?code=TestCode")); - Assert.Equal("The oauth state was missing or invalid.", error.Message); + Assert.Equal("The oauth state was missing or invalid.", error.GetBaseException().Message); } [Fact] diff --git a/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs index e66090144c..36589a12d5 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs @@ -74,7 +74,7 @@ namespace Microsoft.AspNet.Authentication.Twitter // Send a bogus sign in var error = await Assert.ThrowsAnyAsync(() => server.SendAsync("https://example.com/signin-twitter")); - Assert.Equal("Invalid state cookie.", error.Message); + Assert.Equal("Invalid state cookie.", error.GetBaseException().Message); } [Fact]