コード例 #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 CDO.Message LoadMessage(CDO.Message source)
 {
     return(this.LoadMessage(source.GetMessageText()));
 }