public void SerializeHeaders_WithSingleRecipient()
        {
            var expected = new StringBuilder();

            expected.AppendLine("From: [email protected]");
            expected.AppendLine("To: [email protected]");
            expected.AppendLine("Subject: Test");

            var headers = MailMessageSerializer.SerializeHeaders(new MailMessage("*****@*****.**", "*****@*****.**")
            {
                Subject = "Test"
            });

            Assert.AreEqual(expected.ToString(), headers);
        }
        public void SerializeHeaders_WithMultipleRecipients()
        {
            var expected = new StringBuilder();

            expected.AppendLine("From: [email protected]");
            expected.AppendLine("To: [email protected],[email protected]");
            expected.AppendLine("Subject: Test");

            var mailMessage = new MailMessage {
                From = new MailAddress("*****@*****.**"), Subject = "Test"
            };

            mailMessage.To.Add("[email protected], [email protected]");

            var headers = MailMessageSerializer.SerializeHeaders(mailMessage);

            Assert.AreEqual(expected.ToString(), headers);
        }