public void ShouldFailWhenUrlIsBogus() { var signature = GetGraphForFile("../../inputs/pubinfohasbogusurl.ex_"); var rule = new PublisherInformationPresentRule(); var logger = new MemorySignatureLogger(); var result = rule.Validate(signature, logger, Configuration); Assert.Equal(RuleResult.Fail, result); Assert.Collection(logger.Messages, s => s.EndsWith("Signature's accompanying URL is not a valid URI.")); }
public void ShouldPassWhenUrlAndDescriptionPresent() { var signature = GetGraphForFile("../../inputs/pubinfovalid.ex_"); var rule = new PublisherInformationPresentRule(); var logger = new MemorySignatureLogger(); var result = rule.Validate(signature, logger, Configuration); Assert.Equal(RuleResult.Pass, result); Assert.Empty(logger.Messages); }
public void ShouldFailWhenNoPublisherDescription() { var signature = GetGraphForFile("../../inputs/pubinfohasurl.ex_"); var rule = new PublisherInformationPresentRule(); var logger = new MemorySignatureLogger(); var result = rule.Validate(signature, logger, Configuration); Assert.Equal(RuleResult.Fail, result); Assert.Collection(logger.Messages, s => s.EndsWith("Signature does not have an accompanying description.")); }