Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public void TestThatXmlFilesGetsParsed()
 {
     Assert.That(m_Stream, Iz.Not.Null);
     MIMER.IEndCriteriaStrategy endofmessage = new BasicEndOfMessageStrategy();
     var message = new MailReader().ReadMimeMessage(ref m_Stream, endofmessage);
     Assert.That(message.Attachments.Count(a => a.Type.Equals("text") && a.SubType.Equals("xml")), Iz.EqualTo(1));
 }
Ejemplo n.º 3
0
 public void TestThatCorrectNumberOfImagesGetsParsed()
 {
     Assert.That(m_Stream, Iz.Not.Null);
     MIMER.IEndCriteriaStrategy endofmessage = new BasicEndOfMessageStrategy();
     var message = new MailReader().ReadMimeMessage(ref m_Stream, endofmessage);
     Assert.That(message.Attachments.Count(a => a.Type.Equals("image")), Iz.EqualTo(105));
 }