-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3aaf27
commit 9928a67
Showing
2 changed files
with
30 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 |
---|---|---|
|
@@ -26,6 +26,30 @@ func TestV3NewMail(t *testing.T) { | |
} | ||
} | ||
|
||
func TestV3NewMailInit(t *testing.T) { | ||
from := NewEmail("Example User", "[email protected]") | ||
subject := "Hello World from the SendGrid Go Library" | ||
to := NewEmail("Example User", "[email protected]") | ||
content := NewContent("text/plain", "some text here") | ||
m := NewV3MailInit(from, subject, to, content) | ||
|
||
if m == nil { | ||
t.Errorf("NewV3MailInit() shouldn't return nil") | ||
} | ||
|
||
if m.From == nil { | ||
t.Errorf("From shouldn't be nil") | ||
} | ||
|
||
if m.Personalizations == nil { | ||
t.Errorf("Personalizations shouldn't be nil") | ||
} | ||
|
||
if m.Content == nil { | ||
t.Errorf("Content shouldn't be nil") | ||
} | ||
} | ||
|
||
func TestV3AddPersonalizations(t *testing.T) { | ||
numOfPersonalizations := rand.New(rand.NewSource(99)).Intn(10) | ||
personalizations := make([]*Personalization, 0) | ||
|