public void DomainTagMustExistIfResultIsntNone() { XElement xElement = XElement.Parse(SpfAuthResultsDeserialiserTestsResource.NoDomainTag); var exception = Assert.Throws <ArgumentException>(() => _spfAuthResultsDeserialiser.Deserialise(new[] { xElement })); Assert.That(exception.Message, Is.EqualTo("Expected element 'domain' was not found")); }
[Test] public void CorrectlyFormedSpfAuthResultGeneratesSpfAuthResult() { XElement xElement = XElement.Parse(SpfAuthResultsDeserialiserTestsResource.SpfAuthResultStandard); SpfAuthResult[] spfAuthResults = _spfAuthResultsDeserialiser.Deserialise(new [] { xElement }); Assert.That(spfAuthResults.First().Domain, Is.EqualTo(TestConstants.ExpectedDomain)); Assert.That(spfAuthResults.First().Result, Is.EqualTo(TestConstants.ExpectedSpfResult)); }