Пример #1
0
        public void TestEndToEnd(string messageText)
        {
            CDO.Message message = this.LoadMessage(messageText);

            string originalSubject     = message.Subject;
            string originalContentType = message.GetContentType();

            //
            // Outgoing
            //
            Assert.DoesNotThrow(() => m_handler.ProcessCDOMessage(message));

            message = this.LoadMessage(message); // re-load the message
            base.VerifyOutgoingMessage(message);
            //
            // Incoming
            //
            Assert.DoesNotThrow(() => m_handler.ProcessCDOMessage(message));

            message = this.LoadMessage(message); // re-load the message
            base.VerifyIncomingMessage(message);

            Assert.True(message.Subject.Equals(originalSubject));
            Assert.True(MimeStandard.Equals(message.GetContentType(), originalContentType));

            Message mailMessage = MailParser.ParseMessage(message.GetMessageText());
            string  header      = mailMessage.Headers.GetValue(SmtpAgent.XHeaders.Receivers);

            Assert.DoesNotThrow(() => MailParser.ParseAddressCollection(header));
            MailAddressCollection addresses = MailParser.ParseAddressCollection(header);

            Assert.True(addresses.Count > 0);
        }
Пример #2
0
        internal void VerifyOutgoingMessage(CDO.Message message)
        {
            Assert.True(string.IsNullOrEmpty(message.Subject));

            ContentType contentType = new ContentType(message.GetContentType());

            Assert.True(SMIMEStandard.IsContentEncrypted(contentType));
        }
Пример #3
0
        internal void VerifyIncomingMessage(CDO.Message message)
        {
            ContentType contentType = new ContentType(message.GetContentType());

            Assert.False(SMIMEStandard.IsContentEncrypted(contentType));
        }