summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-11-03 17:22:00 -0800
committerAndrew <andrewarnott@gmail.com>2008-11-04 08:12:52 -0800
commit462e19abd9034c11a12cad30e9899740f2bef8ff (patch)
treee08667f1d69249f8daa6c348a919bd0fd5434415 /src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
parent6a79be0eca3929d8fb4e797799dac8d6f7875475 (diff)
downloadDotNetOpenAuth-462e19abd9034c11a12cad30e9899740f2bef8ff.zip
DotNetOpenAuth-462e19abd9034c11a12cad30e9899740f2bef8ff.tar.gz
DotNetOpenAuth-462e19abd9034c11a12cad30e9899740f2bef8ff.tar.bz2
Changed namepace and project names in preparation for merge with DotNetOpenId.
Diffstat (limited to 'src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs')
-rw-r--r--src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs b/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
deleted file mode 100644
index ffd6044..0000000
--- a/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="MockReplayProtectionBindingElement.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOAuth.Test.Mocks {
- using DotNetOAuth.Messaging;
- using DotNetOAuth.Messaging.Bindings;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
-
- internal class MockReplayProtectionBindingElement : IChannelBindingElement {
- private bool messageReceived;
-
- #region IChannelBindingElement Members
-
- MessageProtections IChannelBindingElement.Protection {
- get { return MessageProtections.ReplayProtection; }
- }
-
- bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
- var replayMessage = message as IReplayProtectedProtocolMessage;
- if (replayMessage != null) {
- replayMessage.Nonce = "someNonce";
- return true;
- }
-
- return false;
- }
-
- 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");
- // this mock implementation passes the first time and fails subsequent times.
- if (this.messageReceived) {
- throw new ReplayedMessageException(message);
- }
- this.messageReceived = true;
- return true;
- }
-
- return false;
- }
-
- #endregion
- }
-}