summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-03 18:38:48 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-03 18:38:48 -0700
commit871dc36214618e53ab682ab71413f925a78b27f5 (patch)
tree82576c7d8c8958abea86cc2724692a717a5ca6fc /src/DotNetOAuth.Test/Messaging/ChannelTests.cs
parentefb71eb0514b352ed3fdbad75a8e8d885a94ce05 (diff)
downloadDotNetOpenAuth-871dc36214618e53ab682ab71413f925a78b27f5.zip
DotNetOpenAuth-871dc36214618e53ab682ab71413f925a78b27f5.tar.gz
DotNetOpenAuth-871dc36214618e53ab682ab71413f925a78b27f5.tar.bz2
More channel work and testing.
Diffstat (limited to 'src/DotNetOAuth.Test/Messaging/ChannelTests.cs')
-rw-r--r--src/DotNetOAuth.Test/Messaging/ChannelTests.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
index 3282788..a2909c4 100644
--- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
+++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
@@ -38,12 +38,29 @@ namespace DotNetOAuth.Test.Messaging {
[TestMethod]
public void ReadFromRequestQueryString() {
- ParameterizedReceiveTest("GET");
+ this.ParameterizedReceiveTest("GET");
}
[TestMethod]
public void ReadFromRequestForm() {
- ParameterizedReceiveTest("POST");
+ this.ParameterizedReceiveTest("POST");
+ }
+
+ [TestMethod]
+ public void SendIndirectMessage() {
+ IProtocolMessage message = new TestDirectedMessage {
+ Age = 15,
+ Name = "Andrew",
+ Location = new Uri("http://host/path"),
+ Recipient = new Uri("http://provider/path"),
+ };
+ this.channel.Send(message);
+ Response response = this.channel.DequeueIndirectOrResponseMessage();
+ Assert.AreEqual(HttpStatusCode.Redirect, response.Status);
+ StringAssert.StartsWith(response.Headers[HttpResponseHeader.Location], "http://provider/path");
+ StringAssert.Contains(response.Headers[HttpResponseHeader.Location], "age=15");
+ StringAssert.Contains(response.Headers[HttpResponseHeader.Location], "Name=Andrew");
+ StringAssert.Contains(response.Headers[HttpResponseHeader.Location], "Location=http%3a%2f%2fhost%2fpath");
}
private static HttpRequestInfo CreateHttpRequest(string method, IDictionary<string, string> fields) {