Skip to content

Commit

Permalink
Merge branch 'feature/fluent_http_client' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Feb 10, 2017
2 parents df80667 + 74b858f commit 51de517
Show file tree
Hide file tree
Showing 81 changed files with 2,859 additions and 4,439 deletions.
34 changes: 21 additions & 13 deletions Source/StrongGrid.IntegrationTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ private static void Campaigns(IClient client, bool pauseAfterTests)
if (sender == null)
{
sender = client.SenderIdentities.CreateAsync("Integration Testing identity", new MailAddress(YOUR_EMAIL, "John Doe"), new MailAddress(YOUR_EMAIL, "John Doe"), "123 Main Street", null, "Small Town", "ZZ", "12345", "USA").Result;
throw new Exception($"A new sender identity was create and a verification email was sent to {sender.From.Email}. You must complete the verification process before proceeding.");
throw new Exception($"A new sender identity was created and a verification email was sent to {sender.From.Email}. You must complete the verification process before proceeding.");
}
else if (!sender.Verification.IsCompleted)
{
Expand Down Expand Up @@ -736,17 +736,21 @@ private static void Whitelabel(IClient client, bool pauseAfterTests)
{
Console.WriteLine("\n***** WHITELABEL DOMAINS *****");

var newDomain = client.Whitelabel.CreateDomainAsync("example.com", "email").Result;
Console.WriteLine($"Whitelabel domain created. Id: {newDomain.Id}");

var domains = client.Whitelabel.GetAllDomainsAsync().Result;
Console.WriteLine($"All whitelabel domains retrieved. There are {domains.Length} domains");

var domainValidation = client.Whitelabel.ValidateDomainAsync(newDomain.Id).Result;
var domain = domains.FirstOrDefault(d => d.Domain == "example.com");
if (domain == null)
{
domain = client.Whitelabel.CreateDomainAsync("example.com", "email").Result;
Console.WriteLine($"Whitelabel domain created. Id: {domain.Id}");
}

var domainValidation = client.Whitelabel.ValidateDomainAsync(domain.Id).Result;
Console.WriteLine($"Whitelabel domain validation: {domainValidation.IsValid}");

client.Whitelabel.DeleteDomainAsync(newDomain.Id).Wait();
Console.WriteLine($"Whitelabel domain {newDomain.Id} deleted.");
client.Whitelabel.DeleteDomainAsync(domain.Id).Wait();
Console.WriteLine($"Whitelabel domain {domain.Id} deleted.");


Console.WriteLine("\n***** WHITELABEL IPS *****");
Expand All @@ -757,17 +761,21 @@ private static void Whitelabel(IClient client, bool pauseAfterTests)

Console.WriteLine("\n***** WHITELABEL LINKS *****");

var newLink = client.Whitelabel.CreateLinkAsync("example.com", "email", true).Result;
Console.WriteLine($"Whitelabel link created. Id: {newLink.Id}");

var links = client.Whitelabel.GetAllLinksAsync().Result;
Console.WriteLine($"All whitelabel links retrieved. There are {links.Length} links");

var linkValidation = client.Whitelabel.ValidateLinkAsync(newLink.Id).Result;
var link = links.FirstOrDefault(d => d.Domain == "example.com");
if (link == null)
{
link = client.Whitelabel.CreateLinkAsync("example.com", "email", true).Result;
Console.WriteLine($"Whitelabel link created. Id: {link.Id}");
}

var linkValidation = client.Whitelabel.ValidateLinkAsync(link.Id).Result;
Console.WriteLine($"Whitelabel validation: {linkValidation.IsValid}");

client.Whitelabel.DeleteLinkAsync(newLink.Id).Wait();
Console.WriteLine($"Whitelabel link {newLink.Id} deleted.");
client.Whitelabel.DeleteLinkAsync(link.Id).Wait();
Console.WriteLine($"Whitelabel link {link.Id} deleted.");

ConcludeTests(pauseAfterTests);
}
Expand Down
6 changes: 3 additions & 3 deletions Source/StrongGrid.IntegrationTests/WebProxy.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Collections;
using System;
using System.Collections;
using System.Globalization;
using System.Net;
using System.Net.NetworkInformation;
using System.Text.RegularExpressions;
using System;
using System.Net;

namespace StrongGrid.IntegrationTests
{
Expand Down
Loading

0 comments on commit 51de517

Please sign in to comment.