diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlAttributeTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlAttributeTest.cs index 52124442e0..0cf8e4a63d 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlAttributeTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlAttributeTest.cs @@ -67,9 +67,16 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( new MarkupTagBlock( Factory.Markup("(Environment.NewLine + "href='", 2, 0, 2), suffix: new LocationTagged("'", 13, 1, 9)), + new MarkupBlock( + new AttributeBlockChunkGenerator( + name: "href", + prefix: new LocationTagged(Environment.NewLine + "href='", 2, 0, 2), + suffix: new LocationTagged("'", 11 + Environment.NewLine.Length, 1, 9)), Factory.Markup(Environment.NewLine + "href='").With(SpanChunkGenerator.Null), - Factory.Markup("Foo").With(new LiteralAttributeChunkGenerator(prefix: new LocationTagged(string.Empty, 10, 1, 6), value: new LocationTagged("Foo", 10, 1, 6))), + Factory.Markup("Foo").With( + new LiteralAttributeChunkGenerator( + prefix: new LocationTagged(string.Empty, 8 + Environment.NewLine.Length, 1, 6), + value: new LocationTagged("Foo", 8 + Environment.NewLine.Length, 1, 6))), Factory.Markup("'").With(SpanChunkGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); } @@ -81,13 +88,26 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( new MarkupTagBlock( Factory.Markup("(Environment.NewLine + "href='", 2, 0, 2), suffix: new LocationTagged("'", 13, 1, 9)), - Factory.Markup(Environment.NewLine + "href='").With(SpanChunkGenerator.Null), - Factory.Markup("Foo").With(new LiteralAttributeChunkGenerator(prefix: new LocationTagged(string.Empty, 10, 1, 6), value: new LocationTagged("Foo", 10, 1, 6))), - Factory.Markup("'").With(SpanChunkGenerator.Null)), - new MarkupBlock(new AttributeBlockChunkGenerator(name: "abcd", prefix: new LocationTagged(Environment.NewLine + "abcd='", 14, 1, 0), suffix: new LocationTagged("'", 25, 2, 9)), + new MarkupBlock(new AttributeBlockChunkGenerator( + name: "href", + prefix: new LocationTagged(Environment.NewLine + "href='", 2, 0, 2), + suffix: new LocationTagged("'", 11 + Environment.NewLine.Length, 1, 9)), + Factory.Markup(Environment.NewLine + "href='").With(SpanChunkGenerator.Null), + Factory.Markup("Foo").With( + new LiteralAttributeChunkGenerator( + prefix: new LocationTagged(string.Empty, 8 + Environment.NewLine.Length, 1, 6), + value: new LocationTagged("Foo", 8 + Environment.NewLine.Length, 1, 6))), + Factory.Markup("'").With(SpanChunkGenerator.Null)), + new MarkupBlock( + new AttributeBlockChunkGenerator( + name: "abcd", + prefix: new LocationTagged(Environment.NewLine + "abcd='", 12 + Environment.NewLine.Length, 1, 10), + suffix: new LocationTagged("'", 21 + Environment.NewLine.Length * 2, 2, 9)), Factory.Markup(Environment.NewLine + "abcd='").With(SpanChunkGenerator.Null), - Factory.Markup("Bar").With(new LiteralAttributeChunkGenerator(prefix: new LocationTagged(string.Empty, 22, 2, 6), value: new LocationTagged("Bar", 22, 2, 6))), + Factory.Markup("Bar").With( + new LiteralAttributeChunkGenerator( + prefix: new LocationTagged(string.Empty, 18 + Environment.NewLine.Length * 2, 2, 6), + value: new LocationTagged("Bar", 18 + Environment.NewLine.Length * 2, 2, 6))), Factory.Markup("'").With(SpanChunkGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); } @@ -99,9 +119,16 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( new MarkupTagBlock( Factory.Markup("(" " + Environment.NewLine + "href='", 2, 0, 2), suffix: new LocationTagged("'", 14, 1, 9)), + new MarkupBlock( + new AttributeBlockChunkGenerator( + name: "href", + prefix: new LocationTagged(" " + Environment.NewLine + "href='", 2, 0, 2), + suffix: new LocationTagged("'", 12 + Environment.NewLine.Length, 1, 9)), Factory.Markup(" " + Environment.NewLine + "href='").With(SpanChunkGenerator.Null), - Factory.Markup("Foo").With(new LiteralAttributeChunkGenerator(prefix: new LocationTagged(string.Empty, 11, 1, 6), value: new LocationTagged("Foo", 11, 1, 6))), + Factory.Markup("Foo").With( + new LiteralAttributeChunkGenerator( + prefix: new LocationTagged(string.Empty, 9 + Environment.NewLine.Length, 1, 6), + value: new LocationTagged("Foo", 9 + Environment.NewLine.Length, 1, 6))), Factory.Markup("'").With(SpanChunkGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); }