-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better code for parsing email addresses; for #62
- Loading branch information
1 parent
9ee20e5
commit 9f1fa19
Showing
2 changed files
with
50 additions
and
23 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 |
---|---|---|
|
@@ -280,6 +280,7 @@ BUSINESS DEMANDS AND HOPE YOU WILL NOT BETRAY THE TRUST AND CONFIDENCE WHICH | |
[TestMethod] | ||
public void TestBasicMimeMessage() { | ||
var msg = GetMessage(@"From: John Doe <[email protected]> | ||
To: <[email protected]>; [email protected]; John Doe <[email protected]> | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; | ||
boundary=""XXXXboundary text"" | ||
|
@@ -301,7 +302,17 @@ this is the attachment text | |
--XXXXboundary text--"); | ||
|
||
msg.From.Should().Not.Be.Null(); | ||
msg.Attachments.Count.Should().Equal(2); | ||
msg.From.DisplayName.Should().Equal("John Doe"); | ||
msg.From.Address.Should().Equal("[email protected]"); | ||
|
||
var to = msg.To.ToArray(); | ||
to.Length.Should().Equal(3); | ||
to[0].Address.Should().Equal("[email protected]"); | ||
to[1].Address.Should().Equal("[email protected]"); | ||
to[2].Address.Should().Equal("[email protected]"); | ||
|
||
msg.Attachments.Count.Should().Equal(1); | ||
msg.AlternateViews.Count.Should().Equal(1); | ||
msg.Attachments.All(a => a.GetData().Any().Should().Be.True()); | ||
} | ||
|
||
|