diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-01-23 07:52:40 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2009-01-23 07:52:40 -0800 |
commit | 75fe6ffb45a46d42bbc6332987eb8dae5cac389d (patch) | |
tree | 92e09ab15f6fabcc70ec95bc1d2eb65eb8e20f54 /src/DotNetOpenAuth.Test | |
parent | cf1185c4891a509386bffd7e01fedce42d970cde (diff) | |
download | DotNetOpenAuth-75fe6ffb45a46d42bbc6332987eb8dae5cac389d.zip DotNetOpenAuth-75fe6ffb45a46d42bbc6332987eb8dae5cac389d.tar.gz DotNetOpenAuth-75fe6ffb45a46d42bbc6332987eb8dae5cac389d.tar.bz2 |
StyleCop fixes
Diffstat (limited to 'src/DotNetOpenAuth.Test')
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs index 4f2c574..e0fac9e 100644 --- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs @@ -93,7 +93,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements { public void ExtensionResponsesAreSigned() { Protocol protocol = Protocol.Default; var op = this.CreateProvider(); - IndirectSignedResponse response = CreateResponseWithExtensions(protocol); + IndirectSignedResponse response = this.CreateResponseWithExtensions(protocol); op.Channel.PrepareResponse(response); ITamperResistantOpenIdMessage signedResponse = (ITamperResistantOpenIdMessage)response; string extensionAliasKey = signedResponse.ExtraData.Single(kv => kv.Value == MockOpenIdExtension.MockTypeUri).Key; @@ -129,31 +129,10 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements { op.SecuritySettings.SignOutgoingExtensions = false; op.Channel.Send(CreateResponseWithExtensions(protocol)); op.GetRequest().Response.Send(); // check_auth - } - ); + }); coordinator.Run(); } - private static void RegisterMockExtension(Channel channel) { - ErrorUtilities.VerifyArgumentNotNull(channel, "channel"); - - ((OpenIdExtensionFactory)channel.BindingElements.OfType<ExtensionsBindingElement>().Single().ExtensionFactory).RegisterExtension(MockOpenIdExtension.Factory); - } - - /// <summary> - /// Creates a response message with one extensions. - /// </summary> - /// <param name="protocol">The protocol to construct the message with.</param> - /// <returns>The message ready to send from OP to RP.</returns> - private IndirectSignedResponse CreateResponseWithExtensions(Protocol protocol) { - ErrorUtilities.VerifyArgumentNotNull(protocol, "protocol"); - - IndirectSignedResponse response = new IndirectSignedResponse(protocol.Version, RPUri); - response.ProviderEndpoint = ProviderUri; - response.Extensions.Add(new MockOpenIdExtension("pv", "ev")); - return response; - } - /// <summary> /// Verifies that two extensions with the same TypeURI cannot be applied to the same message. /// </summary> @@ -183,5 +162,25 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements { where m.Success select m.Groups[1].Value; } + + private static void RegisterMockExtension(Channel channel) { + ErrorUtilities.VerifyArgumentNotNull(channel, "channel"); + + ((OpenIdExtensionFactory)channel.BindingElements.OfType<ExtensionsBindingElement>().Single().ExtensionFactory).RegisterExtension(MockOpenIdExtension.Factory); + } + + /// <summary> + /// Creates a response message with one extensions. + /// </summary> + /// <param name="protocol">The protocol to construct the message with.</param> + /// <returns>The message ready to send from OP to RP.</returns> + private IndirectSignedResponse CreateResponseWithExtensions(Protocol protocol) { + ErrorUtilities.VerifyArgumentNotNull(protocol, "protocol"); + + IndirectSignedResponse response = new IndirectSignedResponse(protocol.Version, RPUri); + response.ProviderEndpoint = ProviderUri; + response.Extensions.Add(new MockOpenIdExtension("pv", "ev")); + return response; + } } } |