summaryrefslogtreecommitdiffstats
path: root/SendGrid/UnitTest/UnitTest.cs
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-07-18 13:50:44 -0700
committerMaxim Dubrovkin <maximdubrovkin@Maxims-MBP.Dlink>2016-09-20 20:09:03 +0500
commitf08c79852785523a37e8e2e923cea1612a932042 (patch)
tree16bed5f1efb29a2789b0b647d55bc3e0d3e9817a /SendGrid/UnitTest/UnitTest.cs
parente00b2e769d839bec061877e3899e6d060de1600b (diff)
downloadsendgrid-csharp-f08c79852785523a37e8e2e923cea1612a932042.zip
sendgrid-csharp-f08c79852785523a37e8e2e923cea1612a932042.tar.gz
sendgrid-csharp-f08c79852785523a37e8e2e923cea1612a932042.tar.bz2
Updating CSharp Dependency to fix issue #256
Diffstat (limited to 'SendGrid/UnitTest/UnitTest.cs')
-rw-r--r--SendGrid/UnitTest/UnitTest.cs834
1 files changed, 498 insertions, 336 deletions
diff --git a/SendGrid/UnitTest/UnitTest.cs b/SendGrid/UnitTest/UnitTest.cs
index d312e4a..b63a51b 100644
--- a/SendGrid/UnitTest/UnitTest.cs
+++ b/SendGrid/UnitTest/UnitTest.cs
@@ -32,7 +32,9 @@ namespace UnitTest
process.StartInfo = startInfo;
process.Start();
System.Threading.Thread.Sleep(15000);
- } else {
+ }
+ else
+ {
System.Threading.Thread.Sleep(15000);
}
}
@@ -283,15 +285,17 @@ namespace UnitTest
'ips': [
{
'ip': '192.168.1.1'
- },
+ },
{
'ip': '192.*.*.*'
- },
+ },
{
'ip': '192.168.1.3/32'
}
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -314,11 +318,13 @@ namespace UnitTest
{
string data = @"{
'ids': [
- 1,
- 2,
+ 1,
+ 2,
3
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -352,10 +358,12 @@ namespace UnitTest
public void test_alerts_post()
{
string data = @"{
- 'email_to': 'example@example.com',
- 'frequency': 'daily',
+ 'email_to': 'example@example.com',
+ 'frequency': 'daily',
'type': 'stats_notification'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -379,6 +387,8 @@ namespace UnitTest
string data = @"{
'email_to': 'example@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var alert_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -413,14 +423,16 @@ namespace UnitTest
public void test_api_keys_post()
{
string data = @"{
- 'name': 'My API Key',
- 'sample': 'data',
+ 'name': 'My API Key',
+ 'sample': 'data',
'scopes': [
- 'mail.send',
- 'alerts.create',
+ 'mail.send',
+ 'alerts.create',
'alerts.read'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -445,12 +457,14 @@ namespace UnitTest
public void test_api_keys__api_key_id__put()
{
string data = @"{
- 'name': 'A New Hope',
+ 'name': 'A New Hope',
'scopes': [
- 'user.profile.read',
+ 'user.profile.read',
'user.profile.update'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var api_key_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -465,6 +479,8 @@ namespace UnitTest
string data = @"{
'name': 'A New Hope'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var api_key_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -499,10 +515,12 @@ namespace UnitTest
public void test_asm_groups_post()
{
string data = @"{
- 'description': 'Suggestions for products our users might like.',
- 'is_default': true,
+ 'description': 'Suggestions for products our users might like.',
+ 'is_default': true,
'name': 'Product Suggestions'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -527,10 +545,12 @@ namespace UnitTest
public void test_asm_groups__group_id__patch()
{
string data = @"{
- 'description': 'Suggestions for items our users might like.',
- 'id': 103,
+ 'description': 'Suggestions for items our users might like.',
+ 'id': 103,
'name': 'Item Suggestions'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var group_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -566,10 +586,12 @@ namespace UnitTest
{
string data = @"{
'recipient_emails': [
- 'test1@example.com',
+ 'test1@example.com',
'test2@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var group_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -594,11 +616,13 @@ namespace UnitTest
{
string data = @"{
'recipient_emails': [
- 'exists1@example.com',
- 'exists2@example.com',
+ 'exists1@example.com',
+ 'exists2@example.com',
'doesnotexists@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var group_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -634,10 +658,12 @@ namespace UnitTest
{
string data = @"{
'recipient_emails': [
- 'test1@example.com',
+ 'test1@example.com',
'test2@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -682,11 +708,11 @@ namespace UnitTest
public void test_browsers_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'browsers': 'test_string',
- 'end_date': '2016-04-01',
- 'limit': 'test_string',
- 'offset': 'test_string',
+ 'aggregated_by': 'day',
+ 'browsers': 'test_string',
+ 'end_date': '2016-04-01',
+ 'limit': 'test_string',
+ 'offset': 'test_string',
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -702,23 +728,25 @@ namespace UnitTest
string data = @"{
'categories': [
'spring line'
- ],
- 'custom_unsubscribe_url': '',
- 'html_content': '<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>',
- 'ip_pool': 'marketing',
+ ],
+ 'custom_unsubscribe_url': '',
+ 'html_content': '<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>',
+ 'ip_pool': 'marketing',
'list_ids': [
- 110,
+ 110,
124
- ],
- 'plain_content': 'Check out our spring line!',
+ ],
+ 'plain_content': 'Check out our spring line!',
'segment_ids': [
110
- ],
- 'sender_id': 124451,
- 'subject': 'New Products for Spring!',
- 'suppression_group_id': 42,
+ ],
+ 'sender_id': 124451,
+ 'subject': 'New Products for Spring!',
+ 'suppression_group_id': 42,
'title': 'March Newsletter'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -730,7 +758,7 @@ namespace UnitTest
public void test_campaigns_get()
{
string queryParams = @"{
- 'limit': 1,
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -746,12 +774,14 @@ namespace UnitTest
string data = @"{
'categories': [
'summer line'
- ],
- 'html_content': '<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>',
- 'plain_content': 'Check out our summer line!',
- 'subject': 'New Products for Summer!',
+ ],
+ 'html_content': '<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>',
+ 'plain_content': 'Check out our summer line!',
+ 'subject': 'New Products for Summer!',
'title': 'May Newsletter'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var campaign_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -788,6 +818,8 @@ namespace UnitTest
string data = @"{
'send_at': 1489451436
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var campaign_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -802,6 +834,8 @@ namespace UnitTest
string data = @"{
'send_at': 1489771528
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var campaign_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -849,6 +883,8 @@ namespace UnitTest
string data = @"{
'to': 'your.email@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var campaign_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -861,8 +897,8 @@ namespace UnitTest
public void test_categories_get()
{
string queryParams = @"{
- 'category': 'test_string',
- 'limit': 1,
+ 'category': 'test_string',
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -876,11 +912,11 @@ namespace UnitTest
public void test_categories_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'categories': 'test_string',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
+ 'aggregated_by': 'day',
+ 'categories': 'test_string',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -894,12 +930,12 @@ namespace UnitTest
public void test_categories_stats_sums_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
- 'sort_by_direction': 'asc',
- 'sort_by_metric': 'test_string',
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
+ 'sort_by_direction': 'asc',
+ 'sort_by_metric': 'test_string',
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -913,8 +949,8 @@ namespace UnitTest
public void test_clients_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -928,8 +964,8 @@ namespace UnitTest
public void test_clients__client_type__stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
'start_date': '2016-01-01'
}";
var client_type = "test_url_param";
@@ -944,9 +980,11 @@ namespace UnitTest
public void test_contactdb_custom_fields_post()
{
string data = @"{
- 'name': 'pet',
+ 'name': 'pet',
'type': 'text'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -992,6 +1030,8 @@ namespace UnitTest
string data = @"{
'name': 'your list name'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -1013,11 +1053,13 @@ namespace UnitTest
public void test_contactdb_lists_delete()
{
string data = @"[
- 1,
- 2,
- 3,
+ 1,
+ 2,
+ 3,
4
]";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -1031,6 +1073,8 @@ namespace UnitTest
string data = @"{
'name': 'newlistname'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
string queryParams = @"{
'list_id': 1
}";
@@ -1074,9 +1118,11 @@ namespace UnitTest
public void test_contactdb_lists__list_id__recipients_post()
{
string data = @"[
- 'recipient_id1',
+ 'recipient_id1',
'recipient_id2'
]";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var list_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -1089,8 +1135,8 @@ namespace UnitTest
public void test_contactdb_lists__list_id__recipients_get()
{
string queryParams = @"{
- 'list_id': 1,
- 'page': 1,
+ 'list_id': 1,
+ 'page': 1,
'page_size': 1
}";
var list_id = "test_url_param";
@@ -1117,7 +1163,7 @@ namespace UnitTest
public void test_contactdb_lists__list_id__recipients__recipient_id__delete()
{
string queryParams = @"{
- 'list_id': 1,
+ 'list_id': 1,
'recipient_id': 1
}";
var list_id = "test_url_param";
@@ -1134,11 +1180,13 @@ namespace UnitTest
{
string data = @"[
{
- 'email': 'jones@example.com',
- 'first_name': 'Guy',
+ 'email': 'jones@example.com',
+ 'first_name': 'Guy',
'last_name': 'Jones'
}
]";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -1151,18 +1199,20 @@ namespace UnitTest
{
string data = @"[
{
- 'age': 25,
- 'email': 'example@example.com',
- 'first_name': '',
+ 'age': 25,
+ 'email': 'example@example.com',
+ 'first_name': '',
'last_name': 'User'
- },
+ },
{
- 'age': 25,
- 'email': 'example2@example.com',
- 'first_name': 'Example',
+ 'age': 25,
+ 'email': 'example2@example.com',
+ 'first_name': 'Example',
'last_name': 'User'
}
]";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -1174,7 +1224,7 @@ namespace UnitTest
public void test_contactdb_recipients_get()
{
string queryParams = @"{
- 'page': 1,
+ 'page': 1,
'page_size': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -1188,9 +1238,11 @@ namespace UnitTest
public void test_contactdb_recipients_delete()
{
string data = @"[
- 'recipient_id1',
+ 'recipient_id1',
'recipient_id2'
]";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1280,27 +1332,29 @@ namespace UnitTest
string data = @"{
'conditions': [
{
- 'and_or': '',
- 'field': 'last_name',
- 'operator': 'eq',
+ 'and_or': '',
+ 'field': 'last_name',
+ 'operator': 'eq',
'value': 'Miller'
- },
+ },
{
- 'and_or': 'and',
- 'field': 'last_clicked',
- 'operator': 'gt',
+ 'and_or': 'and',
+ 'field': 'last_clicked',
+ 'operator': 'gt',
'value': '01/02/2015'
- },
+ },
{
- 'and_or': 'or',
- 'field': 'clicks.campaign_identifier',
- 'operator': 'eq',
+ 'and_or': 'or',
+ 'field': 'clicks.campaign_identifier',
+ 'operator': 'eq',
'value': '513'
}
- ],
- 'list_id': 4,
+ ],
+ 'list_id': 4,
'name': 'Last Name Miller'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1324,15 +1378,17 @@ namespace UnitTest
string data = @"{
'conditions': [
{
- 'and_or': '',
- 'field': 'last_name',
- 'operator': 'eq',
+ 'and_or': '',
+ 'field': 'last_name',
+ 'operator': 'eq',
'value': 'Miller'
}
- ],
- 'list_id': 5,
+ ],
+ 'list_id': 5,
'name': 'The Millers'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
string queryParams = @"{
'segment_id': 'test_string'
}";
@@ -1376,7 +1432,7 @@ namespace UnitTest
public void test_contactdb_segments__segment_id__recipients_get()
{
string queryParams = @"{
- 'page': 1,
+ 'page': 1,
'page_size': 1
}";
var segment_id = "test_url_param";
@@ -1391,10 +1447,10 @@ namespace UnitTest
public void test_devices_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -1408,11 +1464,11 @@ namespace UnitTest
public void test_geo_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'country': 'US',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
+ 'aggregated_by': 'day',
+ 'country': 'US',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -1426,10 +1482,10 @@ namespace UnitTest
public void test_ips_get()
{
string queryParams = @"{
- 'exclude_whitelabels': 'true',
- 'ip': 'test_string',
- 'limit': 1,
- 'offset': 1,
+ 'exclude_whitelabels': 'true',
+ 'ip': 'test_string',
+ 'limit': 1,
+ 'offset': 1,
'subuser': 'test_string'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -1455,6 +1511,8 @@ namespace UnitTest
string data = @"{
'name': 'marketing'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1478,6 +1536,8 @@ namespace UnitTest
string data = @"{
'name': 'new_pool_name'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var pool_name = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -1514,6 +1574,8 @@ namespace UnitTest
string data = @"{
'ip': '0.0.0.0'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var pool_name = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -1540,6 +1602,8 @@ namespace UnitTest
string data = @"{
'ip': '0.0.0.0'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1616,142 +1680,144 @@ namespace UnitTest
{
string data = @"{
'asm': {
- 'group_id': 1,
+ 'group_id': 1,
'groups_to_display': [
- 1,
- 2,
+ 1,
+ 2,
3
]
- },
+ },
'attachments': [
{
- 'content': '[BASE64 encoded content block here]',
- 'content_id': 'ii_139db99fdb5c3704',
- 'disposition': 'inline',
- 'filename': 'file1.jpg',
- 'name': 'file1',
+ 'content': '[BASE64 encoded content block here]',
+ 'content_id': 'ii_139db99fdb5c3704',
+ 'disposition': 'inline',
+ 'filename': 'file1.jpg',
+ 'name': 'file1',
'type': 'jpg'
}
- ],
- 'batch_id': '[YOUR BATCH ID GOES HERE]',
+ ],
+ 'batch_id': '[YOUR BATCH ID GOES HERE]',
'categories': [
- 'category1',
+ 'category1',
'category2'
- ],
+ ],
'content': [
{
- 'type': 'text/html',
+ 'type': 'text/html',
'value': '<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>'
}
- ],
+ ],
'custom_args': {
- 'New Argument 1': 'New Value 1',
- 'activationAttempt': '1',
+ 'New Argument 1': 'New Value 1',
+ 'activationAttempt': '1',
'customerAccountNumber': '[CUSTOMER ACCOUNT NUMBER GOES HERE]'
- },
+ },
'from': {
- 'email': 'sam.smith@example.com',
+ 'email': 'sam.smith@example.com',
'name': 'Sam Smith'
- },
- 'headers': {},
- 'ip_pool_name': '[YOUR POOL NAME GOES HERE]',
+ },
+ 'headers': {},
+ 'ip_pool_name': '[YOUR POOL NAME GOES HERE]',
'mail_settings': {
'bcc': {
- 'email': 'ben.doe@example.com',
+ 'email': 'ben.doe@example.com',
'enable': true
- },
+ },
'bypass_list_management': {
'enable': true
- },
+ },
'footer': {
- 'enable': true,
- 'html': '<p>Thanks</br>The SendGrid Team</p>',
+ 'enable': true,
+ 'html': '<p>Thanks</br>The SendGrid Team</p>',
'text': 'Thanks,/n The SendGrid Team'
- },
+ },
'sandbox_mode': {
'enable': false
- },
+ },
'spam_check': {
- 'enable': true,
- 'post_to_url': 'http://example.com/compliance',
+ 'enable': true,
+ 'post_to_url': 'http://example.com/compliance',
'threshold': 3
}
- },
+ },
'personalizations': [
{
'bcc': [
{
- 'email': 'sam.doe@example.com',
+ 'email': 'sam.doe@example.com',
'name': 'Sam Doe'
}
- ],
+ ],
'cc': [
{
- 'email': 'jane.doe@example.com',
+ 'email': 'jane.doe@example.com',
'name': 'Jane Doe'
}
- ],
+ ],
'custom_args': {
- 'New Argument 1': 'New Value 1',
- 'activationAttempt': '1',
+ 'New Argument 1': 'New Value 1',
+ 'activationAttempt': '1',
'customerAccountNumber': '[CUSTOMER ACCOUNT NUMBER GOES HERE]'
- },
+ },
'headers': {
- 'X-Accept-Language': 'en',
+ 'X-Accept-Language': 'en',
'X-Mailer': 'MyApp'
- },
- 'send_at': 1409348513,
- 'subject': 'Hello, World!',
+ },
+ 'send_at': 1409348513,
+ 'subject': 'Hello, World!',
'substitutions': {
- 'id': 'substitutions',
+ 'id': 'substitutions',
'type': 'object'
- },
+ },
'to': [
{
- 'email': 'john.doe@example.com',
+ 'email': 'john.doe@example.com',
'name': 'John Doe'
}
]
}
- ],
+ ],
'reply_to': {
- 'email': 'sam.smith@example.com',
+ 'email': 'sam.smith@example.com',
'name': 'Sam Smith'
- },
+ },
'sections': {
'section': {
- ':sectionName1': 'section 1 text',
+ ':sectionName1': 'section 1 text',
':sectionName2': 'section 2 text'
}
- },
- 'send_at': 1409348513,
- 'subject': 'Hello, World!',
- 'template_id': '[YOUR TEMPLATE ID GOES HERE]',
+ },
+ 'send_at': 1409348513,
+ 'subject': 'Hello, World!',
+ 'template_id': '[YOUR TEMPLATE ID GOES HERE]',
'tracking_settings': {
'click_tracking': {
- 'enable': true,
+ 'enable': true,
'enable_text': true
- },
+ },
'ganalytics': {
- 'enable': true,
- 'utm_campaign': '[NAME OF YOUR REFERRER SOURCE]',
- 'utm_content': '[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]',
- 'utm_medium': '[NAME OF YOUR MARKETING MEDIUM e.g. email]',
- 'utm_name': '[NAME OF YOUR CAMPAIGN]',
+ 'enable': true,
+ 'utm_campaign': '[NAME OF YOUR REFERRER SOURCE]',
+ 'utm_content': '[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]',
+ 'utm_medium': '[NAME OF YOUR MARKETING MEDIUM e.g. email]',
+ 'utm_name': '[NAME OF YOUR CAMPAIGN]',
'utm_term': '[IDENTIFY PAID KEYWORDS HERE]'
- },
+ },
'open_tracking': {
- 'enable': true,
+ 'enable': true,
'substitution_tag': '%opentrack'
- },
+ },
'subscription_tracking': {
- 'enable': true,
- 'html': 'If you would like to unsubscribe and stop receiving these emails <% clickhere %>.',
- 'substitution_tag': '<%click here%>',
+ 'enable': true,
+ 'html': 'If you would like to unsubscribe and stop receiving these emails <% clickhere %>.',
+ 'substitution_tag': '<%click here%>',
'text': 'If you would like to unsubscribe and stop receiveing these emails <% click here %>.'
}
}
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "202");
@@ -1763,7 +1829,7 @@ namespace UnitTest
public void test_mail_settings_get()
{
string queryParams = @"{
- 'limit': 1,
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -1777,12 +1843,14 @@ namespace UnitTest
public void test_mail_settings_address_whitelist_patch()
{
string data = @"{
- 'enabled': true,
+ 'enabled': true,
'list': [
- 'email1@example.com',
+ 'email1@example.com',
'example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1804,9 +1872,11 @@ namespace UnitTest
public void test_mail_settings_bcc_patch()
{
string data = @"{
- 'email': 'email@example.com',
+ 'email': 'email@example.com',
'enabled': false
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1828,10 +1898,12 @@ namespace UnitTest
public void test_mail_settings_bounce_purge_patch()
{
string data = @"{
- 'enabled': true,
- 'hard_bounces': 5,
+ 'enabled': true,
+ 'hard_bounces': 5,
'soft_bounces': 5
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1853,10 +1925,12 @@ namespace UnitTest
public void test_mail_settings_footer_patch()
{
string data = @"{
- 'enabled': true,
- 'html_content': '...',
+ 'enabled': true,
+ 'html_content': '...',
'plain_content': '...'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1878,9 +1952,11 @@ namespace UnitTest
public void test_mail_settings_forward_bounce_patch()
{
string data = @"{
- 'email': 'example@example.com',
+ 'email': 'example@example.com',
'enabled': true
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1902,9 +1978,11 @@ namespace UnitTest
public void test_mail_settings_forward_spam_patch()
{
string data = @"{
- 'email': '',
+ 'email': '',
'enabled': false
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1928,6 +2006,8 @@ namespace UnitTest
string data = @"{
'enabled': false
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1949,10 +2029,12 @@ namespace UnitTest
public void test_mail_settings_spam_check_patch()
{
string data = @"{
- 'enabled': true,
- 'max_score': 5,
+ 'enabled': true,
+ 'max_score': 5,
'url': 'url'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1974,9 +2056,11 @@ namespace UnitTest
public void test_mail_settings_template_patch()
{
string data = @"{
- 'enabled': true,
+ 'enabled': true,
'html_content': '<% body %>'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -1998,11 +2082,11 @@ namespace UnitTest
public void test_mailbox_providers_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'mailbox_providers': 'test_string',
- 'offset': 1,
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'mailbox_providers': 'test_string',
+ 'offset': 1,
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2016,7 +2100,7 @@ namespace UnitTest
public void test_partner_settings_get()
{
string queryParams = @"{
- 'limit': 1,
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2030,10 +2114,12 @@ namespace UnitTest
public void test_partner_settings_new_relic_patch()
{
string data = @"{
- 'enable_subuser_statistics': true,
- 'enabled': true,
+ 'enable_subuser_statistics': true,
+ 'enabled': true,
'license_key': ''
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2065,22 +2151,24 @@ namespace UnitTest
public void test_senders_post()
{
string data = @"{
- 'address': '123 Elm St.',
- 'address_2': 'Apt. 456',
- 'city': 'Denver',
- 'country': 'United States',
+ 'address': '123 Elm St.',
+ 'address_2': 'Apt. 456',
+ 'city': 'Denver',
+ 'country': 'United States',
'from': {
- 'email': 'from@example.com',
+ 'email': 'from@example.com',
'name': 'Example INC'
- },
- 'nickname': 'My Sender ID',
+ },
+ 'nickname': 'My Sender ID',
'reply_to': {
- 'email': 'replyto@example.com',
+ 'email': 'replyto@example.com',
'name': 'Example INC'
- },
- 'state': 'Colorado',
+ },
+ 'state': 'Colorado',
'zip': '80202'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -2102,22 +2190,24 @@ namespace UnitTest
public void test_senders__sender_id__patch()
{
string data = @"{
- 'address': '123 Elm St.',
- 'address_2': 'Apt. 456',
- 'city': 'Denver',
- 'country': 'United States',
+ 'address': '123 Elm St.',
+ 'address_2': 'Apt. 456',
+ 'city': 'Denver',
+ 'country': 'United States',
'from': {
- 'email': 'from@example.com',
+ 'email': 'from@example.com',
'name': 'Example INC'
- },
- 'nickname': 'My Sender ID',
+ },
+ 'nickname': 'My Sender ID',
'reply_to': {
- 'email': 'replyto@example.com',
+ 'email': 'replyto@example.com',
'name': 'Example INC'
- },
- 'state': 'Colorado',
+ },
+ 'state': 'Colorado',
'zip': '80202'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var sender_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2163,10 +2253,10 @@ namespace UnitTest
public void test_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2180,14 +2270,16 @@ namespace UnitTest
public void test_subusers_post()
{
string data = @"{
- 'email': 'John@example.com',
+ 'email': 'John@example.com',
'ips': [
- '1.1.1.1',
+ '1.1.1.1',
'2.2.2.2'
- ],
- 'password': 'johns_password',
+ ],
+ 'password': 'johns_password',
'username': 'John@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2199,8 +2291,8 @@ namespace UnitTest
public void test_subusers_get()
{
string queryParams = @"{
- 'limit': 1,
- 'offset': 1,
+ 'limit': 1,
+ 'offset': 1,
'username': 'test_string'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2227,11 +2319,11 @@ namespace UnitTest
public void test_subusers_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
- 'start_date': '2016-01-01',
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
+ 'start_date': '2016-01-01',
'subusers': 'test_string'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2245,11 +2337,11 @@ namespace UnitTest
public void test_subusers_stats_monthly_get()
{
string queryParams = @"{
- 'date': 'test_string',
- 'limit': 1,
- 'offset': 1,
- 'sort_by_direction': 'asc',
- 'sort_by_metric': 'test_string',
+ 'date': 'test_string',
+ 'limit': 1,
+ 'offset': 1,
+ 'sort_by_direction': 'asc',
+ 'sort_by_metric': 'test_string',
'subuser': 'test_string'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2263,12 +2355,12 @@ namespace UnitTest
public void test_subusers_stats_sums_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 1,
- 'offset': 1,
- 'sort_by_direction': 'asc',
- 'sort_by_metric': 'test_string',
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
+ 'sort_by_direction': 'asc',
+ 'sort_by_metric': 'test_string',
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2284,6 +2376,8 @@ namespace UnitTest
string data = @"{
'disabled': false
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var subuser_name = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2309,6 +2403,8 @@ namespace UnitTest
string data = @"[
'127.0.0.1'
]";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var subuser_name = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2321,9 +2417,11 @@ namespace UnitTest
public void test_subusers__subuser_name__monitor_put()
{
string data = @"{
- 'email': 'example@example.com',
+ 'email': 'example@example.com',
'frequency': 500
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var subuser_name = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2336,9 +2434,11 @@ namespace UnitTest
public void test_subusers__subuser_name__monitor_post()
{
string data = @"{
- 'email': 'example@example.com',
+ 'email': 'example@example.com',
'frequency': 50000
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var subuser_name = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2373,10 +2473,10 @@ namespace UnitTest
public void test_subusers__subuser_name__stats_monthly_get()
{
string queryParams = @"{
- 'date': 'test_string',
- 'limit': 1,
- 'offset': 1,
- 'sort_by_direction': 'asc',
+ 'date': 'test_string',
+ 'limit': 1,
+ 'offset': 1,
+ 'sort_by_direction': 'asc',
'sort_by_metric': 'test_string'
}";
var subuser_name = "test_url_param";
@@ -2391,9 +2491,9 @@ namespace UnitTest
public void test_suppression_blocks_get()
{
string queryParams = @"{
- 'end_time': 1,
- 'limit': 1,
- 'offset': 1,
+ 'end_time': 1,
+ 'limit': 1,
+ 'offset': 1,
'start_time': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2407,12 +2507,14 @@ namespace UnitTest
public void test_suppression_blocks_delete()
{
string data = @"{
- 'delete_all': false,
+ 'delete_all': false,
'emails': [
- 'example1@example.com',
+ 'example1@example.com',
'example2@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -2446,7 +2548,7 @@ namespace UnitTest
public void test_suppression_bounces_get()
{
string queryParams = @"{
- 'end_time': 1,
+ 'end_time': 1,
'start_time': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2460,12 +2562,14 @@ namespace UnitTest
public void test_suppression_bounces_delete()
{
string data = @"{
- 'delete_all': true,
+ 'delete_all': true,
'emails': [
- 'example@example.com',
+ 'example@example.com',
'example2@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -2502,9 +2606,9 @@ namespace UnitTest
public void test_suppression_invalid_emails_get()
{
string queryParams = @"{
- 'end_time': 1,
- 'limit': 1,
- 'offset': 1,
+ 'end_time': 1,
+ 'limit': 1,
+ 'offset': 1,
'start_time': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2518,12 +2622,14 @@ namespace UnitTest
public void test_suppression_invalid_emails_delete()
{
string data = @"{
- 'delete_all': false,
+ 'delete_all': false,
'emails': [
- 'example1@example.com',
+ 'example1@example.com',
'example2@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -2579,9 +2685,9 @@ namespace UnitTest
public void test_suppression_spam_reports_get()
{
string queryParams = @"{
- 'end_time': 1,
- 'limit': 1,
- 'offset': 1,
+ 'end_time': 1,
+ 'limit': 1,
+ 'offset': 1,
'start_time': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2595,12 +2701,14 @@ namespace UnitTest
public void test_suppression_spam_reports_delete()
{
string data = @"{
- 'delete_all': false,
+ 'delete_all': false,
'emails': [
- 'example1@example.com',
+ 'example1@example.com',
'example2@example.com'
]
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -2612,9 +2720,9 @@ namespace UnitTest
public void test_suppression_unsubscribes_get()
{
string queryParams = @"{
- 'end_time': 1,
- 'limit': 1,
- 'offset': 1,
+ 'end_time': 1,
+ 'limit': 1,
+ 'offset': 1,
'start_time': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2630,6 +2738,8 @@ namespace UnitTest
string data = @"{
'name': 'example_name'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -2653,6 +2763,8 @@ namespace UnitTest
string data = @"{
'name': 'new_example_name'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var template_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2687,13 +2799,15 @@ namespace UnitTest
public void test_templates__template_id__versions_post()
{
string data = @"{
- 'active': 1,
- 'html_content': '<%body%>',
- 'name': 'example_version_name',
- 'plain_content': '<%body%>',
- 'subject': '<%subject%>',
+ 'active': 1,
+ 'html_content': '<%body%>',
+ 'name': 'example_version_name',
+ 'plain_content': '<%body%>',
+ 'subject': '<%subject%>',
'template_id': 'ddb96bbc-9b92-425e-8979-99464621b543'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var template_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -2706,12 +2820,14 @@ namespace UnitTest
public void test_templates__template_id__versions__version_id__patch()
{
string data = @"{
- 'active': 1,
- 'html_content': '<%body%>',
- 'name': 'updated_example_name',
- 'plain_content': '<%body%>',
+ 'active': 1,
+ 'html_content': '<%body%>',
+ 'name': 'updated_example_name',
+ 'plain_content': '<%body%>',
'subject': '<%subject%>'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var template_id = "test_url_param";
var version_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2761,7 +2877,7 @@ namespace UnitTest
public void test_tracking_settings_get()
{
string queryParams = @"{
- 'limit': 1,
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -2777,6 +2893,8 @@ namespace UnitTest
string data = @"{
'enabled': true
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2798,13 +2916,15 @@ namespace UnitTest
public void test_tracking_settings_google_analytics_patch()
{
string data = @"{
- 'enabled': true,
- 'utm_campaign': 'website',
- 'utm_content': '',
- 'utm_medium': 'email',
- 'utm_source': 'sendgrid.com',
+ 'enabled': true,
+ 'utm_campaign': 'website',
+ 'utm_content': '',
+ 'utm_medium': 'email',
+ 'utm_source': 'sendgrid.com',
'utm_term': ''
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2828,6 +2948,8 @@ namespace UnitTest
string data = @"{
'enabled': true
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2849,13 +2971,15 @@ namespace UnitTest
public void test_tracking_settings_subscription_patch()
{
string data = @"{
- 'enabled': true,
- 'html_content': 'html content',
- 'landing': 'landing page html',
- 'plain_content': 'text content',
- 'replace': 'replacement tag',
+ 'enabled': true,
+ 'html_content': 'html content',
+ 'landing': 'landing page html',
+ 'plain_content': 'text content',
+ 'replace': 'replacement tag',
'url': 'url'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2899,6 +3023,8 @@ namespace UnitTest
string data = @"{
'email': 'example@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2920,9 +3046,11 @@ namespace UnitTest
public void test_user_password_put()
{
string data = @"{
- 'new_password': 'new_password',
+ 'new_password': 'new_password',
'old_password': 'old_password'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2934,10 +3062,12 @@ namespace UnitTest
public void test_user_profile_patch()
{
string data = @"{
- 'city': 'Orange',
- 'first_name': 'Example',
+ 'city': 'Orange',
+ 'first_name': 'Example',
'last_name': 'User'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -2959,9 +3089,11 @@ namespace UnitTest
public void test_user_scheduled_sends_post()
{
string data = @"{
- 'batch_id': 'YOUR_BATCH_ID',
+ 'batch_id': 'YOUR_BATCH_ID',
'status': 'pause'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -2985,6 +3117,8 @@ namespace UnitTest
string data = @"{
'status': 'pause'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var batch_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -3019,9 +3153,11 @@ namespace UnitTest
public void test_user_settings_enforced_tls_patch()
{
string data = @"{
- 'require_tls': true,
+ 'require_tls': true,
'require_valid_cert': false
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -3045,6 +3181,8 @@ namespace UnitTest
string data = @"{
'username': 'test_username'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -3066,20 +3204,22 @@ namespace UnitTest
public void test_user_webhooks_event_settings_patch()
{
string data = @"{
- 'bounce': true,
- 'click': true,
- 'deferred': true,
- 'delivered': true,
- 'dropped': true,
- 'enabled': true,
- 'group_resubscribe': true,
- 'group_unsubscribe': true,
- 'open': true,
- 'processed': true,
- 'spam_report': true,
- 'unsubscribe': true,
+ 'bounce': true,
+ 'click': true,
+ 'deferred': true,
+ 'delivered': true,
+ 'dropped': true,
+ 'enabled': true,
+ 'group_resubscribe': true,
+ 'group_unsubscribe': true,
+ 'open': true,
+ 'processed': true,
+ 'spam_report': true,
+ 'unsubscribe': true,
'url': 'url'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "200");
@@ -3103,6 +3243,8 @@ namespace UnitTest
string data = @"{
'url': 'url'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "204");
@@ -3114,11 +3256,13 @@ namespace UnitTest
public void test_user_webhooks_parse_settings_post()
{
string data = @"{
- 'hostname': 'myhostname.com',
- 'send_raw': false,
- 'spam_check': true,
+ 'hostname': 'myhostname.com',
+ 'send_raw': false,
+ 'spam_check': true,
'url': 'http://email.myhosthame.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -3140,10 +3284,12 @@ namespace UnitTest
public void test_user_webhooks_parse_settings__hostname__patch()
{
string data = @"{
- 'send_raw': true,
- 'spam_check': false,
+ 'send_raw': true,
+ 'spam_check': false,
'url': 'http://newdomain.com/parse'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var hostname = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -3178,10 +3324,10 @@ namespace UnitTest
public void test_user_webhooks_parse_stats_get()
{
string queryParams = @"{
- 'aggregated_by': 'day',
- 'end_date': '2016-04-01',
- 'limit': 'test_string',
- 'offset': 'test_string',
+ 'aggregated_by': 'day',
+ 'end_date': '2016-04-01',
+ 'limit': 'test_string',
+ 'offset': 'test_string',
'start_date': '2016-01-01'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -3195,17 +3341,19 @@ namespace UnitTest
public void test_whitelabel_domains_post()
{
string data = @"{
- 'automatic_security': false,
- 'custom_spf': true,
- 'default': true,
- 'domain': 'example.com',
+ 'automatic_security': false,
+ 'custom_spf': true,
+ 'default': true,
+ 'domain': 'example.com',
'ips': [
- '192.168.1.1',
+ '192.168.1.1',
'192.168.1.2'
- ],
- 'subdomain': 'news',
+ ],
+ 'subdomain': 'news',
'username': 'john@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -3217,10 +3365,10 @@ namespace UnitTest
public void test_whitelabel_domains_get()
{
string queryParams = @"{
- 'domain': 'test_string',
- 'exclude_subusers': 'true',
- 'limit': 1,
- 'offset': 1,
+ 'domain': 'test_string',
+ 'exclude_subusers': 'true',
+ 'limit': 1,
+ 'offset': 1,
'username': 'test_string'
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -3264,9 +3412,11 @@ namespace UnitTest
public void test_whitelabel_domains__domain_id__patch()
{
string data = @"{
- 'custom_spf': true,
+ 'custom_spf': true,
'default': false
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var domain_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -3303,6 +3453,8 @@ namespace UnitTest
string data = @"{
'username': 'jane@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var domain_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -3317,6 +3469,8 @@ namespace UnitTest
string data = @"{
'ip': '192.168.0.1'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -3352,10 +3506,12 @@ namespace UnitTest
public void test_whitelabel_ips_post()
{
string data = @"{
- 'domain': 'example.com',
- 'ip': '192.168.1.1',
+ 'domain': 'example.com',
+ 'ip': '192.168.1.1',
'subdomain': 'email'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
headers.Add("X-Mock", "201");
@@ -3367,8 +3523,8 @@ namespace UnitTest
public void test_whitelabel_ips_get()
{
string queryParams = @"{
- 'ip': 'test_string',
- 'limit': 1,
+ 'ip': 'test_string',
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -3415,12 +3571,14 @@ namespace UnitTest
public void test_whitelabel_links_post()
{
string data = @"{
- 'default': true,
- 'domain': 'example.com',
+ 'default': true,
+ 'domain': 'example.com',
'subdomain': 'mail'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
string queryParams = @"{
- 'limit': 1,
+ 'limit': 1,
'offset': 1
}";
Dictionary<String, String> headers = new Dictionary<String, String>();
@@ -3488,6 +3646,8 @@ namespace UnitTest
string data = @"{
'default': true
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();
@@ -3535,6 +3695,8 @@ namespace UnitTest
string data = @"{
'username': 'jane@example.com'
}";
+ Object json = JsonConvert.DeserializeObject<Object>(data);
+ data = json.ToString();
var link_id = "test_url_param";
Dictionary<String, String> headers = new Dictionary<String, String>();
headers.Clear();