public static void ValidateDoesNotReturnErrorWhenEncodingAttributeIsNotSpecified() { var directive = new OutputDirective( new DirectiveBlockStart(0), new DirectiveName(4, "output"), new[] { new Attribute(new AttributeName(14, "extension"), new Equals(18), new DoubleQuote(19), new AttributeValue(20, ".ext"), new DoubleQuote(22)) }, new BlockEnd(24)); Assert.False(directive.Validate().Any()); }
public static void ValidateReturnsErrorWhenExtensionAttributeIsNotSpecified() { var directive = new OutputDirective( new DirectiveBlockStart(0), new DirectiveName(4, "output"), new[] { new Attribute(new AttributeName(14, "encoding"), new Equals(18), new DoubleQuote(19), new AttributeValue(20, "utf-8"), new DoubleQuote(22)) }, new BlockEnd(24)); TemplateError error = directive.Validate().Single(); Assert.Contains("Extension", error.Message, StringComparison.OrdinalIgnoreCase); }