public void TestContentTypeCharsetWithLargeFirstChar() { const string messagePartContent = "Content-Type: TEXT/PLAIN; Charset=\"US-ASCII\"\r\n" + "\r\n" + // End of message headers "foo"; MessagePart messagePart = new OPMessage(Encoding.ASCII.GetBytes(messagePartContent)).MessagePart; Assert.AreEqual(Encoding.ASCII, messagePart.BodyEncoding); Assert.AreEqual("foo", messagePart.GetBodyAsText()); }
public void TestQuotedPrintableDoesNotDecodeUnderscoresInBody() { const string messagePartContent = "Content-Transfer-Encoding: quoted-printable\r\n" + "\r\n" + // End of message headers "a_a"; MessagePart messagePart = new OPMessage(Encoding.ASCII.GetBytes(messagePartContent)).MessagePart; // QuotedPrintable, when used as Content-Transfer-Encoding does not decode _ to spaces const string expectedBody = "a_a"; string actualBody = messagePart.GetBodyAsText(); Assert.AreEqual(expectedBody, actualBody); }