summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
index fb725d4..fd901c1 100644
--- a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
+++ b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
@@ -154,6 +154,22 @@ namespace DotNetOpenAuth.Test.ChannelElements {
this.ParameterizedRequestTest(HttpDeliveryMethods.PostRequest);
}
+ /// <summary>
+ /// Verifies that messages asking for special HTTP status codes get them.
+ /// </summary>
+ [TestMethod]
+ public void SendDirectMessageResponseHonorsHttpStatusCodes() {
+ IProtocolMessage message = MessagingTestBase.GetStandardTestMessage(MessagingTestBase.FieldFill.AllRequired);
+ UserAgentResponse directResponse = this.accessor.SendDirectMessageResponse(message);
+ Assert.AreEqual(HttpStatusCode.OK, directResponse.Status);
+
+ var httpMessage = new TestDirectResponseMessageWithHttpStatus();
+ MessagingTestBase.GetStandardTestMessage(MessagingTestBase.FieldFill.AllRequired, httpMessage);
+ httpMessage.HttpStatusCode = HttpStatusCode.NotAcceptable;
+ directResponse = this.accessor.SendDirectMessageResponse(httpMessage);
+ Assert.AreEqual(HttpStatusCode.NotAcceptable, directResponse.Status);
+ }
+
private static string CreateAuthorizationHeader(IDictionary<string, string> fields) {
if (fields == null) {
throw new ArgumentNullException("fields");
@@ -278,21 +294,5 @@ namespace DotNetOpenAuth.Test.ChannelElements {
Assert.AreEqual("Andrew", testMessage.Name);
Assert.AreEqual("http://hostb/pathB", testMessage.Location.AbsoluteUri);
}
-
- /// <summary>
- /// Verifies that messages asking for special HTTP status codes get them.
- /// </summary>
- [TestMethod]
- public void SendDirectMessageResponseHonorsHttpStatusCodes() {
- IProtocolMessage message = MessagingTestBase.GetStandardTestMessage(MessagingTestBase.FieldFill.AllRequired);
- UserAgentResponse directResponse = this.accessor.SendDirectMessageResponse(message);
- Assert.AreEqual(HttpStatusCode.OK, directResponse.Status);
-
- var httpMessage = new TestDirectResponseMessageWithHttpStatus();
- MessagingTestBase.GetStandardTestMessage(MessagingTestBase.FieldFill.AllRequired, httpMessage);
- httpMessage.HttpStatusCode = HttpStatusCode.NotAcceptable;
- directResponse = this.accessor.SendDirectMessageResponse(httpMessage);
- Assert.AreEqual(HttpStatusCode.NotAcceptable, directResponse.Status);
- }
}
}