Ejemplo n.º 1
0
        public void DkimValueOptional()
        {
            XElement        xElement        = XElement.Parse(PolicyEvaluatedDeserialiserTestsResource.NoDkimValue);
            PolicyEvaluated policyEvaluated = _policyEvaluatedDeserialiser.Deserialise(xElement);

            Assert.That(policyEvaluated.Dkim, Is.Null);
        }
Ejemplo n.º 2
0
        public void DispositionTagOptional()
        {
            XElement        xElement        = XElement.Parse(PolicyEvaluatedDeserialiserTestsResource.NoDispositionTag);
            PolicyEvaluated policyEvaluated = _policyEvaluatedDeserialiser.Deserialise(xElement);

            Assert.That(policyEvaluated.Disposition, Is.Null);
        }
Ejemplo n.º 3
0
        public void InvalidDkimProducesNullValue()
        {
            XElement        xElement        = XElement.Parse(PolicyEvaluatedDeserialiserTestsResource.InvalidDkim);
            PolicyEvaluated policyEvaluated = _policyEvaluatedDeserialiser.Deserialise(xElement);

            Assert.That(policyEvaluated.Dkim, Is.Null);
        }
Ejemplo n.º 4
0
        public void CorrectlyFormedPolicyEvaluatedGeneratesPolicyEvaluated()
        {
            XElement        xElement        = XElement.Parse(PolicyEvaluatedDeserialiserTestsResource.StandardPolicyEvaluated);
            PolicyEvaluated policyEvaluated = _policyEvaluatedDeserialiser.Deserialise(xElement);

            Assert.That(policyEvaluated.Disposition, Is.EqualTo(TestConstants.ExpectedDisposition));
            Assert.That(policyEvaluated.Dkim, Is.EqualTo(TestConstants.ExpectedDkimDmarcResult));
            Assert.That(policyEvaluated.Spf, Is.EqualTo(TestConstants.ExpectedSpfDmarcResult));
        }
        public Row Deserialise(XElement row)
        {
            if (row.Name != "row")
            {
                throw new ArgumentException("Root element must be row");
            }

            string sourceIp = row.Single("source_ip").Value;

            int count = int.Parse(row.Single("count").Value);

            PolicyEvaluated policyEvaluated = _policyEvaluatedDeserialiser.Deserialise(row.Single("policy_evaluated"));

            return(new Row(sourceIp, count, policyEvaluated));
        }
Ejemplo n.º 6
0
 public Row(string sourceIp, int count, PolicyEvaluated policyEvaluated)
 {
     SourceIp        = sourceIp;
     Count           = count;
     PolicyEvaluated = policyEvaluated;
 }