summaryrefslogtreecommitdiffstats
path: root/SendGrid/Tests/Transport/TestWebApi.cs
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2014-10-07 14:54:52 -0600
committerBrandon West <brawest@gmail.com>2014-10-07 14:54:52 -0600
commitca91fad22dfec2cd1219267fe979c1d9a33a522e (patch)
tree9c15fbba66ff518d71fa9235bfd6b665c644399d /SendGrid/Tests/Transport/TestWebApi.cs
parentc8bbb307de6ab5d571797d2f210a0ec0f5531d3a (diff)
parent35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b (diff)
downloadsendgrid-csharp-ca91fad22dfec2cd1219267fe979c1d9a33a522e.zip
sendgrid-csharp-ca91fad22dfec2cd1219267fe979c1d9a33a522e.tar.gz
sendgrid-csharp-ca91fad22dfec2cd1219267fe979c1d9a33a522e.tar.bz2
Merge pull request #80 from pianomanjh/feature/cc-bcc
add CC, Bcc support
Diffstat (limited to 'SendGrid/Tests/Transport/TestWebApi.cs')
-rw-r--r--SendGrid/Tests/Transport/TestWebApi.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/SendGrid/Tests/Transport/TestWebApi.cs b/SendGrid/Tests/Transport/TestWebApi.cs
index 39aa992..6a4fa0c 100644
--- a/SendGrid/Tests/Transport/TestWebApi.cs
+++ b/SendGrid/Tests/Transport/TestWebApi.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
-using System.Net.Mail;
+using System.Net.Mail;
using Moq;
using NUnit.Framework;
using SendGrid;
@@ -36,7 +36,11 @@ namespace Tests.Transport
public void TestFetchFormParams()
{
// Test Variables
- const string toAddress = "foobar@outlook.com";
+ const string toAddress = "foobar@outlook.com";
+ const string ccAddress = "cc@outlook.com";
+ const string bcc1Address = "bcc1@outlook.com";
+ const string bcc2Address = "bcc2@outlook.com";
+ MailAddress[] bccAddresses = {new MailAddress(bcc1Address), new MailAddress(bcc2Address)};
const string fromAddress = "test@outlook.com";
const string subject = "Test Subject";
const string textBody = "Test Text Body";
@@ -47,6 +51,8 @@ namespace Tests.Transport
var message = new SendGridMessage();
message.AddTo(toAddress);
+ message.AddCc(ccAddress);
+ message.Bcc = bccAddresses;
message.From = new MailAddress(fromAddress);
message.Subject = subject;
message.Text = textBody;
@@ -59,6 +65,9 @@ namespace Tests.Transport
Assert.True(result.Any(r => r.Key == "api_user" && r.Value == TestUsername));
Assert.True(result.Any(r => r.Key == "api_key" && r.Value == TestPassword));
Assert.True(result.Any(r => r.Key == "to[]" && r.Value == toAddress));
+ Assert.True(result.Any(r => r.Key == "cc[]" && r.Value == ccAddress));
+ Assert.True(result.Any(r => r.Key == "bcc[]" && r.Value == bcc1Address));
+ Assert.True(result.Any(r => r.Key == "bcc[]" && r.Value == bcc2Address));
Assert.True(result.Any(r => r.Key == "from" && r.Value == fromAddress));
Assert.True(result.Any(r => r.Key == "subject" && r.Value == subject));
Assert.True(result.Any(r => r.Key == "text" && r.Value == textBody));