-
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.
Merge pull request #508 from Niladri24dutta/SingleEmailToMultipleOver…
…load Single email to multiple recipients - Toggle display of recipients
- Loading branch information
Showing
2 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -448,6 +448,65 @@ public void TestCreateSingleEmailToMultipleRecipients() | |
Assert.True(msg5.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"Plain Text Content\"}]}"); | ||
} | ||
|
||
[Fact] | ||
public void TestCreateSingleEmailToMultipleRecipientsToggleRecipientDisplay() | ||
{ | ||
var emails = new List<EmailAddress> | ||
{ | ||
new EmailAddress("[email protected]"), | ||
new EmailAddress("[email protected]"), | ||
new EmailAddress("[email protected]") | ||
}; | ||
var msg = MailHelper.CreateSingleEmailToMultipleRecipients(new EmailAddress("[email protected]", "Example User"), | ||
emails, | ||
"Test Subject", | ||
"Plain Text Content", | ||
"HTML Content" | ||
); | ||
Assert.True(msg.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"Plain Text Content\"},{\"type\":\"text/html\",\"value\":\"HTML Content\"}]}"); | ||
|
||
var msg2 = MailHelper.CreateSingleEmailToMultipleRecipients(new EmailAddress("[email protected]", "Example User"), | ||
emails, | ||
"Test Subject", | ||
null, | ||
"HTML Content" | ||
); | ||
Assert.True(msg2.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/html\",\"value\":\"HTML Content\"}]}"); | ||
|
||
var msg3 = MailHelper.CreateSingleEmailToMultipleRecipients(new EmailAddress("[email protected]", "Example User"), | ||
emails, | ||
"Test Subject", | ||
"Plain Text Content", | ||
null | ||
); | ||
Assert.True(msg3.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"Plain Text Content\"}]}"); | ||
|
||
var msg4 = MailHelper.CreateSingleEmailToMultipleRecipients(new EmailAddress("[email protected]", "Example User"), | ||
emails, | ||
"Test Subject", | ||
"", | ||
"HTML Content" | ||
); | ||
Assert.True(msg4.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/html\",\"value\":\"HTML Content\"}]}"); | ||
|
||
var msg5 = MailHelper.CreateSingleEmailToMultipleRecipients(new EmailAddress("[email protected]", "Example User"), | ||
emails, | ||
"Test Subject", | ||
"Plain Text Content", | ||
"" | ||
); | ||
Assert.True(msg5.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]},{\"to\":[{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"Plain Text Content\"}]}"); | ||
|
||
var msg6 = MailHelper.CreateSingleEmailToMultipleRecipients(new EmailAddress("[email protected]", "Example User"), | ||
emails, | ||
"Test Subject", | ||
"Plain Text Content", | ||
"HTML Content", | ||
true | ||
); | ||
Assert.True(msg6.Serialize() == "{\"from\":{\"name\":\"Example User\",\"email\":\"[email protected]\"},\"subject\":\"Test Subject\",\"personalizations\":[{\"to\":[{\"email\":\"[email protected]\"},{\"email\":\"[email protected]\"},{\"email\":\"[email protected]\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"Plain Text Content\"},{\"type\":\"text/html\",\"value\":\"HTML Content\"}]}"); | ||
} | ||
|
||
[Fact] | ||
public void TestCreateMultipleEmailsToMultipleRecipients() | ||
{ | ||
|