diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs b/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs index 7903e89..f97e795 100644 --- a/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs +++ b/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs @@ -73,37 +73,6 @@ namespace DotNetOpenAuth.Test { return result; } - internal Channel CreateChannel(MessageProtections capabilityAndRecognition) { - return this.CreateChannel(capabilityAndRecognition, capabilityAndRecognition); - } - - internal Channel CreateChannel(MessageProtections capability, MessageProtections recognition) { - var bindingElements = new List<IChannelBindingElement>(); - if (capability >= MessageProtections.TamperProtection) { - bindingElements.Add(new MockSigningBindingElement()); - } - if (capability >= MessageProtections.Expiration) { - bindingElements.Add(new StandardExpirationBindingElement()); - } - if (capability >= MessageProtections.ReplayProtection) { - bindingElements.Add(new MockReplayProtectionBindingElement()); - } - - bool signing = false, expiration = false, replay = false; - if (recognition >= MessageProtections.TamperProtection) { - signing = true; - } - if (recognition >= MessageProtections.Expiration) { - expiration = true; - } - if (recognition >= MessageProtections.ReplayProtection) { - replay = true; - } - - var typeProvider = new TestMessageFactory(signing, expiration, replay); - return new TestChannel(typeProvider, bindingElements.ToArray(), this.HostFactories); - } - internal static IDictionary<string, string> GetStandardTestFields(FieldFill fill) { TestMessage expectedMessage = GetStandardTestMessage(fill); @@ -145,6 +114,37 @@ namespace DotNetOpenAuth.Test { } } + internal Channel CreateChannel(MessageProtections capabilityAndRecognition) { + return this.CreateChannel(capabilityAndRecognition, capabilityAndRecognition); + } + + internal Channel CreateChannel(MessageProtections capability, MessageProtections recognition) { + var bindingElements = new List<IChannelBindingElement>(); + if (capability >= MessageProtections.TamperProtection) { + bindingElements.Add(new MockSigningBindingElement()); + } + if (capability >= MessageProtections.Expiration) { + bindingElements.Add(new StandardExpirationBindingElement()); + } + if (capability >= MessageProtections.ReplayProtection) { + bindingElements.Add(new MockReplayProtectionBindingElement()); + } + + bool signing = false, expiration = false, replay = false; + if (recognition >= MessageProtections.TamperProtection) { + signing = true; + } + if (recognition >= MessageProtections.Expiration) { + expiration = true; + } + if (recognition >= MessageProtections.ReplayProtection) { + replay = true; + } + + var typeProvider = new TestMessageFactory(signing, expiration, replay); + return new TestChannel(typeProvider, bindingElements.ToArray(), this.HostFactories); + } + internal async Task ParameterizedReceiveTestAsync(HttpMethod method) { var fields = GetStandardTestFields(FieldFill.CompleteBeforeBindings); TestMessage expectedMessage = GetStandardTestMessage(FieldFill.CompleteBeforeBindings); |