summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Messaging/ChannelTests.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/Messaging/ChannelTests.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/Messaging/ChannelTests.cs')
-rw-r--r--src/DotNetOAuth.Test/Messaging/ChannelTests.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
index e4381a6..ac7e8d5 100644
--- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
+++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
@@ -285,5 +285,18 @@ namespace DotNetOAuth.Test.Messaging {
Assert.AreSame(expire, channel.BindingElements[3]);
Assert.AreSame(sign, channel.BindingElements[4]);
}
+
+ [TestMethod, ExpectedException(typeof(UnprotectedMessageException))]
+ public void InsufficientlyProtectedMessageSent() {
+ var message = new TestSignedDirectedMessage(MessageTransport.Direct);
+ message.Recipient = new Uri("http://localtest");
+ this.Channel.Send(message);
+ }
+
+ [TestMethod, ExpectedException(typeof(UnprotectedMessageException))]
+ public void InsufficientlyProtectedMessageReceived() {
+ this.Channel = CreateChannel(MessageProtection.None, MessageProtection.TamperProtection);
+ this.ParameterizedReceiveProtectedTest(DateTime.Now, false);
+ }
}
}