-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
16 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,21 @@ public void TryParse_ValidDmarcString2_ReturnsTrueAndPopulatesDmarcRecord() | |
} | ||
|
||
[TestMethod] | ||
public void TryParse_CorruptDmarcString1_ReturnsTrueAndPopulatesDmarcRecord() | ||
public void TryParse_ValidDmarcString3_ReturnsTrueAndPopulatesDmarcRecord() | ||
{ | ||
var isSuccessful = DmarcRecordParser.TryParse("v=DMARC1; p=reject; rua=mailto:[email protected], mailto:[email protected]; pct=100; adkim=s; aspf=s", out var dmarcDataFragment, out var parseErrors); | ||
Assert.IsTrue(isSuccessful); | ||
Assert.IsNotNull(dmarcDataFragment); | ||
Assert.AreEqual("reject", dmarcDataFragment.DomainPolicy); | ||
Assert.AreEqual("mailto:[email protected], mailto:[email protected]", dmarcDataFragment.AggregateReportUri); | ||
Assert.AreEqual("100", dmarcDataFragment.PolicyPercentage); | ||
Assert.AreEqual("s", dmarcDataFragment.DkimAlignmentMode); | ||
Assert.AreEqual("s", dmarcDataFragment.SpfAlignmentMode); | ||
Assert.IsNull(parseErrors); | ||
} | ||
|
||
[TestMethod] | ||
public void TryParse_CorruptDmarcString1_ReturnsTrueAndParseErrors() | ||
{ | ||
var isSuccessful = DmarcRecordParser.TryParse("verification=123456789", out var dmarcDataFragment, out var parseErrors); | ||
Assert.IsTrue(isSuccessful); | ||
|
@@ -74,7 +88,7 @@ public void TryParse_CorruptDmarcString1_ReturnsTrueAndPopulatesDmarcRecord() | |
} | ||
|
||
[TestMethod] | ||
public void TryParse_CorruptDmarcString2_ReturnsTrueAndPopulatesDmarcRecord() | ||
public void TryParse_CorruptDmarcString2_ReturnsFalse() | ||
{ | ||
var isSuccessful = DmarcRecordParser.TryParse(" ", out var dmarcDataFragment, out var parseErrors); | ||
Assert.IsFalse(isSuccessful); | ||
|