diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-29 23:16:41 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-10-02 07:33:55 -0700 |
commit | 5cbd5d7edb994f874b265ed2e7c43f0bcd27b6ac (patch) | |
tree | a7b11de02bc213b279906aaa4aafc7d15ff09bac /src/DotNetOAuth.Test/Messaging | |
parent | 55c86fc27084af191bbb80fb91da34c24b945c3e (diff) | |
download | DotNetOpenAuth-5cbd5d7edb994f874b265ed2e7c43f0bcd27b6ac.zip DotNetOpenAuth-5cbd5d7edb994f874b265ed2e7c43f0bcd27b6ac.tar.gz DotNetOpenAuth-5cbd5d7edb994f874b265ed2e7c43f0bcd27b6ac.tar.bz2 |
Removed the queue/dequeue methodology of queued responses. Now the methods that generate them return them.
Besides simplifying the API somewhat, this change allows for Consumer, ServiceProvider and Channel classes to be entirely threadsafe and reusable.
Diffstat (limited to 'src/DotNetOAuth.Test/Messaging')
-rw-r--r-- | src/DotNetOAuth.Test/Messaging/ChannelTests.cs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs index e9dd6ea..9caa10d 100644 --- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs +++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs @@ -25,11 +25,6 @@ namespace DotNetOAuth.Test.Messaging { }
[TestMethod]
- public void DequeueIndirectOrResponseMessageReturnsNull() {
- Assert.IsNull(this.Channel.DequeueIndirectOrResponseMessage());
- }
-
- [TestMethod]
public void ReadFromRequestQueryString() {
this.ParameterizedReceiveTest("GET");
}
@@ -69,8 +64,7 @@ namespace DotNetOAuth.Test.Messaging { message.Recipient = new Uri("http://provider/path");
var expected = GetStandardTestFields(FieldFill.CompleteBeforeBindings);
- this.Channel.Send(message);
- Response response = this.Channel.DequeueIndirectOrResponseMessage();
+ Response response = this.Channel.Send(message);
Assert.AreEqual(HttpStatusCode.Redirect, response.Status);
StringAssert.StartsWith(response.Headers[HttpResponseHeader.Location], "http://provider/path");
foreach (var pair in expected) {
@@ -113,8 +107,7 @@ namespace DotNetOAuth.Test.Messaging { Location = new Uri("http://host/path"),
Recipient = new Uri("http://provider/path"),
};
- this.Channel.Send(message);
- Response response = this.Channel.DequeueIndirectOrResponseMessage();
+ Response response = this.Channel.Send(message);
Assert.AreEqual(HttpStatusCode.OK, response.Status, "A form redirect should be an HTTP successful response.");
Assert.IsNull(response.Headers[HttpResponseHeader.Location], "There should not be a redirection header in the response.");
string body = response.Body;
@@ -166,20 +159,6 @@ namespace DotNetOAuth.Test.Messaging { }
[TestMethod, ExpectedException(typeof(ArgumentNullException))]
- public void QueueIndirectOrResponseMessageNull() {
- TestBadChannel badChannel = new TestBadChannel(false);
- badChannel.QueueIndirectOrResponseMessage(null);
- }
-
- [TestMethod, ExpectedException(typeof(InvalidOperationException))]
- public void QueueIndirectOrResponseMessageTwice() {
- TestBadChannel badChannel = new TestBadChannel(false);
- Response response = new Response();
- badChannel.QueueIndirectOrResponseMessage(new Response());
- badChannel.QueueIndirectOrResponseMessage(new Response());
- }
-
- [TestMethod, ExpectedException(typeof(ArgumentNullException))]
public void SendIndirectMessageNull() {
TestBadChannel badChannel = new TestBadChannel(false);
badChannel.SendIndirectMessage(null);
|