Пример #1
0
        public void Quoted_Printable()
        {
            Utilities.DecodeQuotedPrintable("=1");

            var test = "=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A";

            test = Utilities.DecodeQuotedPrintable(test);
            test.ShouldBe("\r\n\r\n\r\n\r\n\r\n");

            test = "H=C3=BAsv=C3=A9ti=20=C3=9Cnnepeket!";
            test = Utilities.DecodeQuotedPrintable(test, System.Text.Encoding.UTF8);
            test.ShouldBe("Húsvéti Ünnepeket!");

            test = Utilities.DecodeWords("coucou =?ISO-8859-1?Q?=E0_tous?=");
            test.ShouldBe("coucou à tous");
            test = Utilities.DecodeWords("=?iso-8859-1?Q?h=E9llo=5Fthere?=");
            test.ShouldBe("héllo_there");

            var invalid = @"=\c";

            test = Utilities.DecodeQuotedPrintable(invalid);
            test.ShouldBe(invalid);

            var msg = GetMessage(quotedPrintable);

            msg.Body.ShouldContain("E-mail Deployment Division");
        }
Пример #2
0
        public void TestQuotedPrintable()
        {
            var test = "=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A";

            test = Utilities.DecodeQuotedPrintable(test);
            test.Should().Equal("\r\n\r\n\r\n\r\n\r\n");

            test = Utilities.DecodeWords("coucou =?ISO-8859-1?Q?=E0_tous?=");
            test.Should().Equal("coucou à tous");
            test = Utilities.DecodeWords("=?iso-8859-1?Q?h=E9llo=5Fthere?=");
            test.Should().Equal("héllo_there");

            var msg = GetMessage(quotedPrintable);

            msg.Body.Should().Contain("E-mail Deployment Division");
        }