示例#1
1
        public void TestParse()
        {
            Assert.IsNotNull(m_Stream);
            MIMER.RFC2045.MailReader m = new MailReader();
            MIMER.IEndCriteriaStrategy endofmessage = new BasicEndOfMessageStrategy();

            MIMER.RFC2045.IMimeMailMessage message = m.ReadMimeMessage(ref m_Stream, endofmessage);
            Assert.AreEqual("*****@*****.**", message.To[0].Address);
            Assert.AreEqual("*****@*****.**", message.CarbonCopy[0].Address);
            Assert.AreEqual("Testing the .eml format", message.Subject);
            Assert.AreEqual(3, message.Attachments.Count);
            Assert.That(message.Attachments.Count(x=>x.Name != null && x.Name.Equals("cp_bg_black800.gif")), Iz.EqualTo(1));
            System.Net.Mail.MailMessage mailmessage = message.ToMailMessage();
            Assert.IsNull(mailmessage.From);
            Assert.AreEqual("*****@*****.**", mailmessage.CC[0].Address);
            Assert.AreEqual(message.TextMessage, mailmessage.Body);
            Assert.AreEqual(message.Attachments.Count, mailmessage.Attachments.Count);
        }
示例#2
0
 public void TestThatCssFileGetsParsed()
 {
     Assert.IsNotNull(m_Stream);
     var reader = new MailReader();
     MIMER.IEndCriteriaStrategy endofmessage = new BasicEndOfMessageStrategy();
     var message = reader.ReadMimeMessage(ref m_Stream, endofmessage);
     Assert.That(message.Attachments.Count(a=>a.Type.Equals("text") && a.SubType.Equals("css")), Iz.EqualTo(1));
 }