summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-13 18:05:35 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-13 18:05:35 -0700
commite4e249ea522d4d79622f94a01e41c4d92d3612f4 (patch)
tree4e5305999229d495a8c2cbedacb9e8a4c4f306b0 /src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
parent09722c436047dccfb6b6294906013786f78d5d53 (diff)
downloadDotNetOpenAuth-e4e249ea522d4d79622f94a01e41c4d92d3612f4.zip
DotNetOpenAuth-e4e249ea522d4d79622f94a01e41c4d92d3612f4.tar.gz
DotNetOpenAuth-e4e249ea522d4d79622f94a01e41c4d92d3612f4.tar.bz2
Added check so Channel can guarantee that messages receive all the protections they require.
Diffstat (limited to 'src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs')
-rw-r--r--src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs b/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
index 1b80b5b..805ace5 100644
--- a/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
+++ b/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
@@ -18,14 +18,17 @@ namespace DotNetOAuth.Test.Mocks {
get { return MessageProtection.ReplayProtection; }
}
- void IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
+ bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
var replayMessage = message as IReplayProtectedProtocolMessage;
if (replayMessage != null) {
replayMessage.Nonce = "someNonce";
+ return true;
}
+
+ return false;
}
- void IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) {
+ bool IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) {
var replayMessage = message as IReplayProtectedProtocolMessage;
if (replayMessage != null) {
Assert.AreEqual("someNonce", replayMessage.Nonce, "The nonce didn't serialize correctly, or something");
@@ -34,7 +37,10 @@ namespace DotNetOAuth.Test.Mocks {
throw new ReplayedMessageException(message);
}
this.messageReceived = true;
+ return true;
}
+
+ return false;
}
#endregion