public void DefaultMessageProperties_CreatesExpectedMessage()
        {
            SendGridAttribute     attribute = new SendGridAttribute();
            SendGridConfiguration config    = new SendGridConfiguration
            {
                ApiKey      = "12345",
                FromAddress = new EmailAddress("*****@*****.**", "Test2"),
                ToAddress   = new EmailAddress("*****@*****.**", "Test")
            };

            SendGridMessage message = new SendGridMessage();

            message.Subject = "TestSubject";
            message.AddContent("text/plain", "TestText");

            SendGridHelpers.DefaultMessageProperties(message, config, attribute);

            Assert.Same(config.FromAddress, config.FromAddress);
            Assert.Equal("*****@*****.**", message.Personalizations.Single().Tos.Single().Email);
            Assert.Equal("TestSubject", message.Subject);
            Assert.Equal("TestText", message.Contents.Single().Value);
        }
        public void DefaultMessageProperties_CreatesExpectedMessage()
        {
            SendGridAttribute     attribute = new SendGridAttribute();
            SendGridConfiguration config    = new SendGridConfiguration
            {
                ApiKey      = "12345",
                FromAddress = new MailAddress("*****@*****.**", "Test2"),
                ToAddress   = new MailAddress("*****@*****.**", "Test")
            };
            SendGridMessage message = new SendGridMessage
            {
                Subject = "TestSubject",
                Text    = "TestText"
            };

            SendGridHelpers.DefaultMessageProperties(message, config, attribute);

            Assert.Same(config.FromAddress, config.FromAddress);
            Assert.Equal("*****@*****.**", message.To.Single().Address);
            Assert.Equal("TestSubject", message.Subject);
            Assert.Equal("TestText", message.Text);
        }