Example #1
0
        public void DkimPassAndFailShouldConvertCorrectly()
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched =
                CreateTestRecord(new List <string>()
            {
                "domain1:selector1:fail", "domain1:selector2:pass", "domain2:selector1:pass"
            }, count: 13);

            List <DomDatProIpDkimRecord>
            result = aggregateReportRecordEnriched.ToDomDatProIpDkimRecord();

            Assert.AreEqual("domain1", result[0].DkimDomain);
            Assert.AreEqual("selector1", result[0].DkimSelector);
            Assert.AreEqual(0, result[0].DkimPass);
            Assert.AreEqual(13, result[0].DkimFail);

            Assert.AreEqual("domain1", result[1].DkimDomain);
            Assert.AreEqual("selector2", result[1].DkimSelector);
            Assert.AreEqual(13, result[1].DkimPass);
            Assert.AreEqual(0, result[1].DkimFail);

            Assert.AreEqual("domain2", result[2].DkimDomain);
            Assert.AreEqual("selector1", result[2].DkimSelector);
            Assert.AreEqual(13, result[2].DkimPass);
            Assert.AreEqual(0, result[2].DkimFail);
        }
Example #2
0
        public void ProviderShouldBeOverridenWhenSpfandDkimFailAndOnBlocklist(DmarcResult spfResult, DmarcResult dkimResult, int blocklistCount, string expectedProvider)
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched = CreateTestRecord(new List <string> {
                "domain1:selector1:pass"
            }, spfResult, dkimResult, blockListCount: blocklistCount);
            var result = aggregateReportRecordEnriched.ToDomDatProIpDkimRecord();

            Assert.AreEqual(expectedProvider, result[0].Provider);
        }
Example #3
0
        public void ConvertingToRecordsShouldCreateAllProvidersRecord()
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched = CreateTestRecord(new List <string>()
            {
                "domain1:selector1:pass"
            });

            List <DomDatProIpDkimRecord> result = aggregateReportRecordEnriched.ToDomDatProIpDkimRecord();

            Assert.AreEqual(2, result.Count);

            Assert.AreEqual("mail.host.provider", result[0].Provider);
            Assert.AreEqual("domain1", result[0].DkimDomain);

            Assert.AreEqual("All Providers", result[1].Provider);
            Assert.AreEqual("domain1", result[1].DkimDomain);
        }