Ejemplo n.º 1
0
        public static void ValidateReturnsErrorWhenProcessorAttributeIsNotSpecified()
        {
            var           directive = new CustomDirective(new DirectiveBlockStart(0), new DirectiveName(4, "custom"), new Attribute[0], new BlockEnd(24));
            TemplateError error     = directive.Validate().Single();

            Assert.Contains("Processor", error.Message, StringComparison.OrdinalIgnoreCase);
        }
Ejemplo n.º 2
0
        public static void ValidateReturnsNoErrorsWhenDirectiveContainsUnrecognizedAttributes()
        {
            var a1        = new Attribute(new AttributeName(13, "processor"), new Equals(21), new DoubleQuote(22), new AttributeValue(23, "CustomProcessor"), new DoubleQuote(22));
            var a2        = new Attribute(new AttributeName(24, "custom"), new Equals(30), new DoubleQuote(31), new AttributeValue(32, "CustomValue"), new DoubleQuote(43));
            var directive = new CustomDirective(
                new DirectiveBlockStart(0),
                new DirectiveName(4, "custom"),
                new[] { a1, a2 },
                new BlockEnd(45));

            Assert.False(directive.Validate().Any());
        }