Esempio n. 1
0
        public void ReadCnmTest()
        {
            string        path    = TestDataSample.GetCNMPath("Y0B6E8H2.CNM");
            ParserContext context = new ParserContext(path);
            IEmailParser  parser  = ParserFactory.CreateEmail(context) as IEmailParser;
            ToxyEmail     email   = parser.Parse();

            Assert.AreEqual(1, email.From.Count);
            Assert.AreEqual(1, email.To.Count);
            Assert.AreEqual("Тюльпаны <*****@*****.**>", email.From[0]);
            Assert.AreEqual("<*****@*****.**>", email.To[0]);

            Assert.AreEqual("Тюльпаны", email.Subject);
            Assert.IsTrue(email.Body.StartsWith("Тел: 960-51-57;Продажа тюльпанов"));
            Assert.IsTrue(email.HtmlBody.StartsWith("<!DOCTYPE HTML"));
        }