예제 #1
0
        public void TestReadNonStandardBoundary()
        {
            Stream           boundaryStream = new MemoryStream(Encoding.ASCII.GetBytes(Strings.NonStandardBoundary));
            IMimeMailMessage message        = m_Reader.ReadMimeMessage(ref boundaryStream, m_EndOfMessageStrategy);

            Assert.That(message, Iz.Not.Null);
            Assert.That(message.Body["text/plain"], Iz.Not.Null);
            Assert.That(message.Body["text/html"], Iz.Not.Null);
            Assert.That(message.Attachments.Count, Iz.GreaterThan(0));
        }
예제 #2
0
        public void TestReadAttachment()
        {
            IMimeMailMessage message = m_Reader.ReadMimeMessage(ref m_AttachmentStream, m_EndOfMessageStrategy);

            Assert.IsFalse(message.IsNull());
            Assert.AreEqual(3, message.Attachments.Count);
            Assert.AreEqual("*****@*****.**", message.From[0].Address);
            Assert.AreEqual("*****@*****.**", message.To[0].Address);
            StringAssert.Contains("Software engineering", message.TextMessage);
            Assert.That(message.Attachments.Count(x => x.Type != null && x.Type.Equals("application")), Iz.EqualTo(1));
            Assert.That(message.Attachments.Count(x => x.Name != null && x.Name.Equals("TDCOperatorGroup1.pdf")), Iz.EqualTo(1));
            Assert.That(message.Attachments.First(x => x.Name != null && x.Name.Equals("TDCOperatorGroup1.pdf")).Data.Length, Iz.GreaterThan(0));
        }