summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/Messaging
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-02-02 06:55:56 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-02-02 06:55:56 -0800
commitda0c7f700cdf1dc00929f1597e263ca9b4977826 (patch)
tree0e161194d0a38e462a2a5ef3b68aedc35d074dfe /src/DotNetOpenAuth.Test/Messaging
parentdfa6d41368c85195fe2603eab4e3d6e7f2b7de9f (diff)
downloadDotNetOpenAuth-da0c7f700cdf1dc00929f1597e263ca9b4977826.zip
DotNetOpenAuth-da0c7f700cdf1dc00929f1597e263ca9b4977826.tar.gz
DotNetOpenAuth-da0c7f700cdf1dc00929f1597e263ca9b4977826.tar.bz2
Fixed parsing the Content-Type header in a couple places.
Fixed a few failing unit tests.
Diffstat (limited to 'src/DotNetOpenAuth.Test/Messaging')
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/OutgoingWebResponseTests.cs4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs b/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
index 21c589f..4fc89a7 100644
--- a/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
@@ -153,6 +153,7 @@ namespace DotNetOpenAuth.Test.Messaging
Match m = Regex.Match(req.ContentType, "multipart/form-data; boundary=(.+)");
Assert.IsTrue(m.Success, "Content-Type HTTP header not set correctly.");
string boundary = m.Groups[1].Value;
+ boundary = boundary.Substring(0, boundary.IndexOf(';')); // trim off charset
string expectedEntity = "--{0}\r\nContent-Disposition: form-data; name=\"a\"\r\n\r\nb\r\n--{0}--\r\n";
expectedEntity = string.Format(expectedEntity, boundary);
string actualEntity = httpHandler.RequestEntityAsString;
diff --git a/src/DotNetOpenAuth.Test/Messaging/OutgoingWebResponseTests.cs b/src/DotNetOpenAuth.Test/Messaging/OutgoingWebResponseTests.cs
index 35f9259..2923af4 100644
--- a/src/DotNetOpenAuth.Test/Messaging/OutgoingWebResponseTests.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/OutgoingWebResponseTests.cs
@@ -6,6 +6,7 @@
namespace DotNetOpenAuth.Test.Messaging {
using System.Net;
+ using System.Net.Mime;
using System.Text;
using DotNetOpenAuth.Messaging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -30,7 +31,8 @@ namespace DotNetOpenAuth.Test.Messaging {
CollectionAssert.AreEqual(expectedBuffer, actualBuffer);
// Verify that the header was set correctly.
- Assert.AreEqual(encoding.HeaderName, response.Headers[HttpResponseHeader.ContentEncoding]);
+ Assert.IsNull(response.Headers[HttpResponseHeader.ContentEncoding]);
+ Assert.AreEqual(encoding.HeaderName, new ContentType(response.Headers[HttpResponseHeader.ContentType]).CharSet);
}
}
}