summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
diff options
context:
space:
mode:
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) {