Exemple #1
0
        public void ProviderShouldBeOverridenWhenSpfandDkimFailAndOnBlocklist(DmarcResult spfResult, DmarcResult dkimResult, int blocklistCount, string expectedProvider)
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched = CreateTestRecord(new List <string> {
                "domain1:pass"
            }, spfResult, dkimResult, blockListCount: blocklistCount);
            var result = aggregateReportRecordEnriched.ToDomDatProIpSpfRecord();

            Assert.AreEqual(expectedProvider, result[0].Provider);
        }
Exemple #2
0
        public void SpfFailShouldSConvertCorrectly()
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched =
                CreateTestRecord(new List <string>()
            {
                "domain11:fail"
            }, count: 12);

            List <DomDatProIpSpfRecord>
            result = aggregateReportRecordEnriched.ToDomDatProIpSpfRecord();

            Assert.AreEqual("domain11", result[0].SpfDomain);
            Assert.AreEqual(0, result[0].SpfPass);
            Assert.AreEqual(12, result[0].SpfFail);
        }
Exemple #3
0
        public void ConvertingToRecordsShouldCreateAllProvidersRecord()
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched = CreateTestRecord(new List <string>()
            {
                "domain1:pass"
            });

            List <DomDatProIpSpfRecord> result = aggregateReportRecordEnriched.ToDomDatProIpSpfRecord();

            Assert.AreEqual(2, result.Count);

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

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