summaryrefslogtreecommitdiffstats
path: root/SendGrid/Tests/Transport/TestWebApi.cs
diff options
context:
space:
mode:
authorJosh Huber <josh.huber@pdp.com>2014-08-15 18:30:16 -0700
committerJosh Huber <josh.huber@pdp.com>2014-08-15 18:30:16 -0700
commit35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b (patch)
tree72e18dfd34e8cf50d89caa7a7122fe5098926dd6 /SendGrid/Tests/Transport/TestWebApi.cs
parent64e62585587bd9c2ef59c6c03f97af67c550b560 (diff)
downloadsendgrid-csharp-35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b.zip
sendgrid-csharp-35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b.tar.gz
sendgrid-csharp-35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b.tar.bz2
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));