-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds a setter for data residency + dotnet formats
- Loading branch information
1 parent
e66576c
commit a84cf9e
Showing
10 changed files
with
121 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
namespace SendGrid.Tests | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
using SendGrid.Helpers.Mail; | ||
using Xunit; | ||
|
||
public class SendgridEmailClientTests | ||
{ | ||
[Fact] | ||
public void TestClientOptionsConstruction() | ||
{ | ||
var options = new SendGridClientOptions(); | ||
Assert.Equal("https://api.sendgrid.com", options.Host); | ||
} | ||
[Fact] | ||
public void TestClientOptionsSetDataResidency() | ||
{ | ||
var options = new SendGridClientOptions(); | ||
options.SetDataResidency("eu"); | ||
Assert.Equal("https://api.eu.sendgrid.com/", options.Host); | ||
} | ||
[Fact] | ||
public void TestClientOptionsSetDataResidencyEU() | ||
{ | ||
var options = new SendGridClientOptions(); | ||
options.SetDataResidency("eu"); | ||
Assert.Equal("https://api.eu.sendgrid.com/", options.Host); | ||
} | ||
|
||
[Fact] | ||
public void TestClientOptionsSetViaSendgridClient() | ||
{ | ||
var options = new SendGridClientOptions(); | ||
options.SetDataResidency("eu"); | ||
var sg = new SendGridClient(options); | ||
Assert.Equal("https://api.eu.sendgrid.com/", options.Host); | ||
} | ||
|
||
[Fact] | ||
public void TestErrorClientOptions() | ||
{ | ||
var options = new SendGridClientOptions(); | ||
Assert.Throws<ArgumentNullException>(() => options.SetDataResidency("")); | ||
Assert.Throws<ArgumentNullException>(() => options.SetDataResidency(null)); | ||
} | ||
} | ||
} |