Beispiel #1
0
        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."));
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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."));
        }