diff options
Diffstat (limited to 'src/DotNetOAuth.Test/Messaging')
3 files changed, 16 insertions, 16 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs b/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs index bbef6f2..6c05434 100644 --- a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs +++ b/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs @@ -19,20 +19,20 @@ namespace DotNetOAuth.Test.Messaging.Bindings { message.Recipient = new Uri("http://localtest");
((IExpiringProtocolMessage)message).UtcCreationDate = DateTime.Parse("1/1/1990");
- Channel channel = CreateChannel(MessageProtection.Expiration);
+ Channel channel = CreateChannel(MessageProtections.Expiration);
channel.Send(message);
Assert.IsTrue(DateTime.UtcNow - ((IExpiringProtocolMessage)message).UtcCreationDate < TimeSpan.FromSeconds(3), "The timestamp on the message was not set on send.");
}
[TestMethod]
public void VerifyGoodTimestampIsAccepted() {
- this.Channel = CreateChannel(MessageProtection.Expiration);
+ this.Channel = CreateChannel(MessageProtections.Expiration);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
[TestMethod, ExpectedException(typeof(ExpiredMessageException))]
public void VerifyBadTimestampIsRejected() {
- this.Channel = CreateChannel(MessageProtection.Expiration);
+ this.Channel = CreateChannel(MessageProtections.Expiration);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow - StandardExpirationBindingElement.DefaultMaximumMessageAge - TimeSpan.FromSeconds(1), false);
}
}
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs index 9caa10d..e142c82 100644 --- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs +++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs @@ -205,26 +205,26 @@ namespace DotNetOAuth.Test.Messaging { TestReplayProtectedMessage message = new TestReplayProtectedMessage(MessageTransport.Indirect);
message.Recipient = new Uri("http://localtest");
- this.Channel = CreateChannel(MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtections.ReplayProtection);
this.Channel.Send(message);
Assert.IsNotNull(((IReplayProtectedProtocolMessage)message).Nonce);
}
[TestMethod, ExpectedException(typeof(InvalidSignatureException))]
public void ReceivedInvalidSignature() {
- this.Channel = CreateChannel(MessageProtection.TamperProtection);
+ this.Channel = CreateChannel(MessageProtections.TamperProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, true);
}
[TestMethod]
public void ReceivedReplayProtectedMessageJustOnce() {
- this.Channel = CreateChannel(MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtections.ReplayProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
[TestMethod, ExpectedException(typeof(ReplayedMessageException))]
public void ReceivedReplayProtectedMessageTwice() {
- this.Channel = CreateChannel(MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtections.ReplayProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
@@ -277,7 +277,7 @@ namespace DotNetOAuth.Test.Messaging { [TestMethod, ExpectedException(typeof(UnprotectedMessageException))]
public void InsufficientlyProtectedMessageReceived() {
- this.Channel = CreateChannel(MessageProtection.None, MessageProtection.TamperProtection);
+ this.Channel = CreateChannel(MessageProtections.None, MessageProtections.TamperProtection);
this.ParameterizedReceiveProtectedTest(DateTime.Now, false);
}
diff --git a/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs b/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs index aa4f350..403cd25 100644 --- a/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs +++ b/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs @@ -78,30 +78,30 @@ namespace DotNetOAuth.Test { return request;
}
- internal static Channel CreateChannel(MessageProtection capabilityAndRecognition) {
+ internal static Channel CreateChannel(MessageProtections capabilityAndRecognition) {
return CreateChannel(capabilityAndRecognition, capabilityAndRecognition);
}
- internal static Channel CreateChannel(MessageProtection capability, MessageProtection recognition) {
+ internal static Channel CreateChannel(MessageProtections capability, MessageProtections recognition) {
var bindingElements = new List<IChannelBindingElement>();
- if (capability >= MessageProtection.TamperProtection) {
+ if (capability >= MessageProtections.TamperProtection) {
bindingElements.Add(new MockSigningBindingElement());
}
- if (capability >= MessageProtection.Expiration) {
+ if (capability >= MessageProtections.Expiration) {
bindingElements.Add(new StandardExpirationBindingElement());
}
- if (capability >= MessageProtection.ReplayProtection) {
+ if (capability >= MessageProtections.ReplayProtection) {
bindingElements.Add(new MockReplayProtectionBindingElement());
}
bool signing = false, expiration = false, replay = false;
- if (recognition >= MessageProtection.TamperProtection) {
+ if (recognition >= MessageProtections.TamperProtection) {
signing = true;
}
- if (recognition >= MessageProtection.Expiration) {
+ if (recognition >= MessageProtections.Expiration) {
expiration = true;
}
- if (recognition >= MessageProtection.ReplayProtection) {
+ if (recognition >= MessageProtections.ReplayProtection) {
replay = true;
}
|