diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-13 18:07:20 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-09-13 18:07:20 -0700 |
commit | 76cf7ef65fb66bfd44f9672f50e1901daa91126f (patch) | |
tree | 852fffd2dd1bbf36b9e7cef9e2d971449e179cb1 | |
parent | e4e249ea522d4d79622f94a01e41c4d92d3612f4 (diff) | |
download | DotNetOpenAuth-76cf7ef65fb66bfd44f9672f50e1901daa91126f.zip DotNetOpenAuth-76cf7ef65fb66bfd44f9672f50e1901daa91126f.tar.gz DotNetOpenAuth-76cf7ef65fb66bfd44f9672f50e1901daa91126f.tar.bz2 |
Simplified tests slightly.
-rw-r--r-- | src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs | 6 | ||||
-rw-r--r-- | src/DotNetOAuth.Test/Messaging/ChannelTests.cs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs b/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs index 6ba1cfc..bbef6f2 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, MessageProtection.Expiration);
+ Channel channel = CreateChannel(MessageProtection.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, MessageProtection.Expiration);
+ this.Channel = CreateChannel(MessageProtection.Expiration);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
[TestMethod, ExpectedException(typeof(ExpiredMessageException))]
public void VerifyBadTimestampIsRejected() {
- this.Channel = CreateChannel(MessageProtection.Expiration, MessageProtection.Expiration);
+ this.Channel = CreateChannel(MessageProtection.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 ac7e8d5..5ffd1d6 100644 --- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs +++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs @@ -223,26 +223,26 @@ namespace DotNetOAuth.Test.Messaging { TestReplayProtectedMessage message = new TestReplayProtectedMessage(MessageTransport.Indirect);
message.Recipient = new Uri("http://localtest");
- this.Channel = CreateChannel(MessageProtection.ReplayProtection, MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtection.ReplayProtection);
this.Channel.Send(message);
Assert.IsNotNull(((IReplayProtectedProtocolMessage)message).Nonce);
}
[TestMethod, ExpectedException(typeof(InvalidSignatureException))]
public void ReceivedInvalidSignature() {
- this.Channel = CreateChannel(MessageProtection.TamperProtection, MessageProtection.TamperProtection);
+ this.Channel = CreateChannel(MessageProtection.TamperProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, true);
}
[TestMethod]
public void ReceivedReplayProtectedMessageJustOnce() {
- this.Channel = CreateChannel(MessageProtection.ReplayProtection, MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtection.ReplayProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
[TestMethod, ExpectedException(typeof(ReplayedMessageException))]
public void ReceivedReplayProtectedMessageTwice() {
- this.Channel = CreateChannel(MessageProtection.ReplayProtection, MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtection.ReplayProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
|