diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-10 16:38:53 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-10 16:38:53 -0700 |
commit | 6beb76839944cf8c35732c5d2a35052c512e3be5 (patch) | |
tree | cb8dd5863a0824f17ecc9d26b9cad343b978cd91 /src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs | |
parent | 4489eb5418033dc6321c72a58f351df2457b8b8c (diff) | |
download | DotNetOpenAuth-6beb76839944cf8c35732c5d2a35052c512e3be5.zip DotNetOpenAuth-6beb76839944cf8c35732c5d2a35052c512e3be5.tar.gz DotNetOpenAuth-6beb76839944cf8c35732c5d2a35052c512e3be5.tar.bz2 |
More unit test fixes.
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs index 91318f5..5642bc5 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs @@ -7,6 +7,8 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { using System; using System.Collections.Generic; + using System.Threading.Tasks; + using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; @@ -124,20 +126,22 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Verifies that certain problematic claimed identifiers pass through to the RP response correctly. /// </summary> [Test] - public void ProblematicClaimedId() { + public async Task ProblematicClaimedId() { var providerEndpoint = new ProviderEndpointDescription(OpenIdTestBase.OPUri, Protocol.Default.Version); string claimed_id = BaseMockUri + "a./b."; var se = IdentifierDiscoveryResult.CreateForClaimedIdentifier(claimed_id, claimed_id, providerEndpoint, null, null); - UriIdentifier identityUri = (UriIdentifier)se.ClaimedIdentifier; - var mockId = new MockIdentifier(identityUri, this.MockResponder, new IdentifierDiscoveryResult[] { se }); - - var positiveAssertion = this.GetPositiveAssertion(); - positiveAssertion.ClaimedIdentifier = mockId; - positiveAssertion.LocalIdentifier = mockId; - var rp = CreateRelyingParty(); - var authResponse = new PositiveAuthenticationResponse(positiveAssertion, rp); - Assert.AreEqual(AuthenticationStatus.Authenticated, authResponse.Status); - Assert.AreEqual(claimed_id, authResponse.ClaimedIdentifier.ToString()); + var identityUri = (UriIdentifier)se.ClaimedIdentifier; + var coordinator = new CoordinatorBase( + CoordinatorBase.RelyingPartyDriver(async (rp, ct) => { + var positiveAssertion = this.GetPositiveAssertion(); + positiveAssertion.ClaimedIdentifier = claimed_id; + positiveAssertion.LocalIdentifier = claimed_id; + var authResponse = new PositiveAuthenticationResponse(positiveAssertion, rp); + Assert.AreEqual(AuthenticationStatus.Authenticated, authResponse.Status); + Assert.AreEqual(claimed_id, authResponse.ClaimedIdentifier.ToString()); + }), + MockHttpRequest.RegisterMockXrdsResponse(se)); + await coordinator.RunAsync(); } private PositiveAssertionResponse GetPositiveAssertion() { |