From 8e667ba730b0bd0c18d5517022f145812ca3fa79 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Thu, 19 Jul 2018 14:32:05 -0700 Subject: [PATCH] Rename parser tests to have shorter names --- .../Legacy/CSharpBlockTest.cs | 173 ++++---- .../Legacy/CSharpErrorTest.cs | 100 +++-- .../Legacy/CSharpExplicitExpressionTest.cs | 21 +- .../Legacy/CSharpImplicitExpressionTest.cs | 112 ++--- .../Legacy/CSharpSectionTest.cs | 58 +-- .../Legacy/CSharpSpecialBlockTest.cs | 6 +- .../Legacy/CSharpTemplateTest.cs | 29 +- .../Legacy/CSharpToMarkupSwitchTest.cs | 43 +- .../Legacy/CSharpVerbatimBlockTest.cs | 10 +- .../Legacy/CSharpWhitespaceHandlingTest.cs | 2 +- .../Legacy/HtmlBlockTest.cs | 79 ++-- .../Legacy/HtmlDocumentTest.cs | 76 ++-- .../Legacy/HtmlErrorTest.cs | 18 +- .../Legacy/HtmlToCodeSwitchTest.cs | 27 +- .../Legacy/TagHelperBlockRewriterTest.cs | 332 +++++++------- .../Legacy/TagHelperParseTreeRewriterTest.cs | 413 +++++++++--------- .../Legacy/WhiteSpaceRewriterTest.cs | 2 +- .../Language/Legacy/ParserTestBase.cs | 8 +- 18 files changed, 773 insertions(+), 736 deletions(-) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpBlockTest.cs index f530020333..6e7f36da26 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpBlockTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpBlockTest.cs @@ -9,20 +9,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpBlockTest : CsHtmlCodeParserTestBase { [Fact] - public void ParseBlock_NestedCodeBlockWithCSharpAt() + public void NestedCodeBlockWithCSharpAt() { ParseBlockTest("{ if (true) { var val = @x; if (val != 3) { } } }"); } [Fact] - public void ParseBlock_NestedCodeBlockWithMarkupSetsDotAsMarkup() + public void NestedCodeBlockWithMarkupSetsDotAsMarkup() { ParseBlockTest("if (true) { @if(false) {
@something.
} }"); } [Fact] - public void BalancingBracketsIgnoresStringLiteralCharactersAndBracketsInsideSingleLineComments() + public void BalancingBracketsIgnoresStringLiteralCharactersAndBrackets() { + // BalancingBracketsIgnoresStringLiteralCharactersAndBracketsInsideSingleLineComments SingleSpanBlockTest(@"if(foo) { // bar } "" baz ' zoop(); @@ -46,102 +47,107 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsForKeyword() + public void SkipsExprThenBalancesBracesIfFirstIdentifierIsForKeyword() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsForKeyword SingleSpanBlockTest( "for(int i = 0; i < 10; new Foo { Bar = \"baz\" }) { Debug.WriteLine(@\"foo } bar\"); }"); } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsForeachKeyword() + public void SkipsExprThenBalancesBracesIfFirstIdentifierIsForeachKeyword() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsForeachKeyword SingleSpanBlockTest( "foreach(int i = 0; i < 10; new Foo { Bar = \"baz\" }) { Debug.WriteLine(@\"foo } bar\"); }"); } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsWhileKeyword() + public void SkipsExprThenBalancesBracesIfFirstIdentifierIsWhileKeyword() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsWhileKeyword SingleSpanBlockTest( "while(int i = 0; i < 10; new Foo { Bar = \"baz\" }) { Debug.WriteLine(@\"foo } bar\"); }"); } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsUsingKeywordFollowedByParen() + public void SkipsExprThenBalancesIfFirstIdentifierIsUsingFollowedByParen() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsUsingKeywordFollowedByParen SingleSpanBlockTest( "using(int i = 0; i < 10; new Foo { Bar = \"baz\" }) { Debug.WriteLine(@\"foo } bar\"); }"); } [Fact] - public void ParseBlockSupportsUsingsNestedWithinOtherBlocks() + public void SupportsUsingsNestedWithinOtherBlocks() { SingleSpanBlockTest( "if(foo) { using(int i = 0; i < 10; new Foo { Bar = \"baz\" }) { Debug.WriteLine(@\"foo } bar\"); } }"); } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches() + public void SkipsExprThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsIfKeywordWithNoElseBranches SingleSpanBlockTest( "if(int i = 0; i < 10; new Foo { Bar = \"baz\" }) { Debug.WriteLine(@\"foo } bar\"); }"); } [Fact] - public void ParseBlockAllowsEmptyBlockStatement() + public void AllowsEmptyBlockStatement() { SingleSpanBlockTest("if(false) { }"); } [Fact] - public void ParseBlockTerminatesParenBalancingAtEOF() + public void TerminatesParenBalancingAtEOF() { ImplicitExpressionTest("Html.En(code()"); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenIfAndElseClause() + public void SupportsBlockCommentBetweenIfAndElseClause() { SingleSpanBlockTest( "if(foo) { bar(); } /* Foo */ /* Bar */ else { baz(); }"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenIfAndElseClause() + public void SupportsRazorCommentBetweenIfAndElseClause() { RunRazorCommentBetweenClausesTest( "if(foo) { bar(); } ", " else { baz(); }"); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenElseIfAndElseClause() + public void SupportsBlockCommentBetweenElseIfAndElseClause() { SingleSpanBlockTest( "if(foo) { bar(); } else if(bar) { baz(); } /* Foo */ /* Bar */ else { biz(); }"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenElseIfAndElseClause() + public void SupportsRazorCommentBetweenElseIfAndElseClause() { RunRazorCommentBetweenClausesTest( "if(foo) { bar(); } else if(bar) { baz(); } ", " else { baz(); }"); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenIfAndElseIfClause() + public void SupportsBlockCommentBetweenIfAndElseIfClause() { SingleSpanBlockTest( "if(foo) { bar(); } /* Foo */ /* Bar */ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenIfAndElseIfClause() + public void SupportsRazorCommentBetweenIfAndElseIfClause() { RunRazorCommentBetweenClausesTest("if(foo) { bar(); } ", " else if(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenIfAndElseClause() + public void SupportsLineCommentBetweenIfAndElseClause() { SingleSpanBlockTest(@"if(foo) { bar(); } // Foo @@ -150,7 +156,7 @@ else { baz(); }"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenElseIfAndElseClause() + public void SupportsLineCommentBetweenElseIfAndElseClause() { SingleSpanBlockTest(@"if(foo) { bar(); } else if(bar) { baz(); } // Foo @@ -159,7 +165,7 @@ else { biz(); }"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenIfAndElseIfClause() + public void SupportsLineCommentBetweenIfAndElseIfClause() { SingleSpanBlockTest(@"if(foo) { bar(); } // Foo @@ -168,7 +174,7 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockParsesElseIfBranchesOfIfStatement() + public void ParsesElseIfBranchesOfIfStatement() { const string ifStatement = @"if(int i = 0; i < 10; new Foo { Bar = ""baz"" }) { Debug.WriteLine(@""foo } bar""); @@ -182,7 +188,7 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockParsesMultipleElseIfBranchesOfIfStatement() + public void ParsesMultipleElseIfBranchesOfIfStatement() { const string ifStatement = @"if(int i = 0; i < 10; new Foo { Bar = ""baz"" }) { Debug.WriteLine(@""foo } bar""); @@ -195,7 +201,7 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch() + public void ParsesMultipleElseIfBranchesOfIfStatementFollowedByOneElseBranch() { const string ifStatement = @"if(int i = 0; i < 10; new Foo { Bar = ""baz"" }) { Debug.WriteLine(@""foo } bar""); @@ -210,7 +216,7 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockStopsParsingCodeAfterElseBranch() + public void StopsParsingCodeAfterElseBranch() { const string ifStatement = @"if(int i = 0; i < 10; new Foo { Bar = ""baz"" }) { Debug.WriteLine(@""foo } bar""); @@ -225,7 +231,7 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockStopsParsingIfIfStatementNotFollowedByElse() + public void StopsParsingIfIfStatementNotFollowedByElse() { const string document = @"if(int i = 0; i < 10; new Foo { Bar = ""baz"" }) { Debug.WriteLine(@""foo } bar""); @@ -235,7 +241,7 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockAcceptsElseIfWithNoCondition() + public void AcceptsElseIfWithNoCondition() { // We don't want to be a full C# parser - If the else if is missing it's condition, the C# compiler // can handle that, we have all the info we need to keep parsing @@ -249,46 +255,46 @@ else if(bar) { baz(); }"); } [Fact] - public void ParseBlockCorrectlyParsesDoWhileBlock() + public void CorrectlyParsesDoWhileBlock() { SingleSpanBlockTest( "do { var foo = bar; } while(foo != bar);"); } [Fact] - public void ParseBlockCorrectlyParsesDoWhileBlockMissingSemicolon() + public void CorrectlyParsesDoWhileBlockMissingSemicolon() { SingleSpanBlockTest("do { var foo = bar; } while(foo != bar)"); } [Fact] - public void ParseBlockCorrectlyParsesDoWhileBlockMissingWhileCondition() + public void CorrectlyParsesDoWhileBlockMissingWhileCondition() { SingleSpanBlockTest("do { var foo = bar; } while"); } [Fact] - public void ParseBlockCorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon() + public void CorrectlyParsesDoWhileBlockMissingWhileConditionWithSemicolon() { SingleSpanBlockTest( "do { var foo = bar; } while;"); } [Fact] - public void ParseBlockCorrectlyParsesDoWhileBlockMissingWhileClauseEntirely() + public void CorrectlyParsesDoWhileBlockMissingWhileClauseEntirely() { SingleSpanBlockTest("do { var foo = bar; } narf;"); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenDoAndWhileClause() + public void SupportsBlockCommentBetweenDoAndWhileClause() { SingleSpanBlockTest( "do { var foo = bar; } /* Foo */ /* Bar */ while(true);"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenDoAndWhileClause() + public void SupportsLineCommentBetweenDoAndWhileClause() { SingleSpanBlockTest(@"do { var foo = bar; } // Foo @@ -297,21 +303,22 @@ while(true);"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenDoAndWhileClause() + public void SupportsRazorCommentBetweenDoAndWhileClause() { RunRazorCommentBetweenClausesTest( "do { var foo = bar; } ", " while(true);"); } [Fact] - public void ParseBlockCorrectlyParsesMarkupInDoWhileBlock() + public void CorrectlyParsesMarkupInDoWhileBlock() { ParseBlockTest("@do { var foo = bar;

Foo

foo++; } while (foo);"); } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsSwitchKeyword() + public void SkipsExprThenBalancesBracesIfFirstIdentifierIsSwitchKeyword() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsSwitchKeyword SingleSpanBlockTest(@"switch(foo) { case 0: break; @@ -327,119 +334,120 @@ while(true);"); } [Fact] - public void ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsLockKeyword() + public void ThenBalancesBracesIfFirstIdentifierIsLockKeyword() { + // ParseBlockSkipsParenthesisedExpressionAndThenBalancesBracesIfFirstIdentifierIsLockKeyword SingleSpanBlockTest( "lock(foo) { Debug.WriteLine(@\"foo } bar\"); }"); } [Fact] - public void ParseBlockHasErrorsIfNamespaceImportMissingSemicolon() + public void HasErrorsIfNamespaceImportMissingSemicolon() { ParseBlockTest( "using Foo.Bar.Baz"); } [Fact] - public void ParseBlockHasErrorsIfNamespaceAliasMissingSemicolon() + public void HasErrorsIfNamespaceAliasMissingSemicolon() { ParseBlockTest( "using Foo.Bar.Baz = FooBarBaz"); } [Fact] - public void ParseBlockParsesNamespaceImportWithSemicolonForUsingKeywordIfIsInValidFormat() + public void ParsesNamespaceImportWithSemicolonForUsingKeywordIfIsInValidFormat() { ParseBlockTest( "using Foo.Bar.Baz;"); } [Fact] - public void ParseBlockDoesntCaptureWhitespaceAfterUsing() + public void DoesntCaptureWhitespaceAfterUsing() { ParseBlockTest("using Foo "); } [Fact] - public void ParseBlockCapturesNewlineAfterUsing() + public void CapturesNewlineAfterUsing() { ParseBlockTest($"using Foo{Environment.NewLine}"); } [Fact] - public void ParseBlockParsesNamespaceAliasWithSemicolonForUsingKeywordIfIsInValidFormat() + public void ParsesNamespaceAliasWithSemicolonForUsingKeywordIfIsInValidFormat() { ParseBlockTest( "using FooBarBaz = FooBarBaz;"); } [Fact] - public void ParseBlockTerminatesUsingKeywordAtEOFAndOutputsFileCodeBlock() + public void TerminatesUsingKeywordAtEOFAndOutputsFileCodeBlock() { SingleSpanBlockTest("using "); } [Fact] - public void ParseBlockTerminatesSingleLineCommentAtEndOfFile() + public void TerminatesSingleLineCommentAtEndOfFile() { const string document = "foreach(var f in Foo) { // foo bar baz"; SingleSpanBlockTest(document); } [Fact] - public void ParseBlockTerminatesBlockCommentAtEndOfFile() + public void TerminatesBlockCommentAtEndOfFile() { const string document = "foreach(var f in Foo) { /* foo bar baz"; SingleSpanBlockTest(document); } [Fact] - public void ParseBlockTerminatesSingleSlashAtEndOfFile() + public void TerminatesSingleSlashAtEndOfFile() { const string document = "foreach(var f in Foo) { / foo bar baz"; SingleSpanBlockTest(document); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenTryAndFinallyClause() + public void SupportsBlockCommentBetweenTryAndFinallyClause() { SingleSpanBlockTest("try { bar(); } /* Foo */ /* Bar */ finally { baz(); }"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenTryAndFinallyClause() + public void SupportsRazorCommentBetweenTryAndFinallyClause() { RunRazorCommentBetweenClausesTest("try { bar(); } ", " finally { biz(); }"); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenCatchAndFinallyClause() + public void SupportsBlockCommentBetweenCatchAndFinallyClause() { SingleSpanBlockTest( "try { bar(); } catch(bar) { baz(); } /* Foo */ /* Bar */ finally { biz(); }"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenCatchAndFinallyClause() + public void SupportsRazorCommentBetweenCatchAndFinallyClause() { RunRazorCommentBetweenClausesTest( "try { bar(); } catch(bar) { baz(); } ", " finally { biz(); }"); } [Fact] - public void ParseBlockSupportsBlockCommentBetweenTryAndCatchClause() + public void SupportsBlockCommentBetweenTryAndCatchClause() { SingleSpanBlockTest("try { bar(); } /* Foo */ /* Bar */ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsRazorCommentBetweenTryAndCatchClause() + public void SupportsRazorCommentBetweenTryAndCatchClause() { RunRazorCommentBetweenClausesTest("try { bar(); }", " catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenTryAndFinallyClause() + public void SupportsLineCommentBetweenTryAndFinallyClause() { SingleSpanBlockTest(@"try { bar(); } // Foo @@ -448,7 +456,7 @@ finally { baz(); }"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenCatchAndFinallyClause() + public void SupportsLineCommentBetweenCatchAndFinallyClause() { SingleSpanBlockTest(@"try { bar(); } catch(bar) { baz(); } // Foo @@ -457,7 +465,7 @@ finally { biz(); }"); } [Fact] - public void ParseBlockSupportsLineCommentBetweenTryAndCatchClause() + public void SupportsLineCommentBetweenTryAndCatchClause() { SingleSpanBlockTest(@"try { bar(); } // Foo @@ -466,13 +474,13 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsTryStatementWithNoAdditionalClauses() + public void SupportsTryStatementWithNoAdditionalClauses() { SingleSpanBlockTest("try { var foo = new { } }"); } [Fact] - public void ParseBlockSupportsMarkupWithinTryClause() + public void SupportsMarkupWithinTryClause() { RunSimpleWrappedMarkupTest( prefix: "try {", @@ -481,13 +489,13 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsTryStatementWithOneCatchClause() + public void SupportsTryStatementWithOneCatchClause() { SingleSpanBlockTest("try { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } }"); } [Fact] - public void ParseBlockSupportsMarkupWithinCatchClause() + public void SupportsMarkupWithinCatchClause() { RunSimpleWrappedMarkupTest( prefix: "try { var foo = new { } } catch(Foo Bar Baz) {", @@ -496,7 +504,7 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsTryStatementWithMultipleCatchClause() + public void SupportsTryStatementWithMultipleCatchClause() { SingleSpanBlockTest( "try { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } } catch(Foo Bar Baz) " + @@ -504,13 +512,13 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsExceptionLessCatchClauses() + public void SupportsExceptionLessCatchClauses() { SingleSpanBlockTest("try { var foo = new { } } catch { var foo = new { } }"); } [Fact] - public void ParseBlockSupportsMarkupWithinAdditionalCatchClauses() + public void SupportsMarkupWithinAdditionalCatchClauses() { RunSimpleWrappedMarkupTest( prefix: "try { var foo = new { } } catch(Foo Bar Baz) { var foo = new { } } catch(Foo Bar Baz) " + @@ -520,13 +528,13 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockSupportsTryStatementWithFinallyClause() + public void SupportsTryStatementWithFinallyClause() { SingleSpanBlockTest("try { var foo = new { } } finally { var foo = new { } }"); } [Fact] - public void ParseBlockSupportsMarkupWithinFinallyClause() + public void SupportsMarkupWithinFinallyClause() { RunSimpleWrappedMarkupTest( prefix: "try { var foo = new { } } finally {", @@ -535,57 +543,58 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlockStopsParsingCatchClausesAfterFinallyBlock() + public void StopsParsingCatchClausesAfterFinallyBlock() { var content = "try { var foo = new { } } finally { var foo = new { } }"; SingleSpanBlockTest(content + " catch(Foo Bar Baz) { }"); } [Fact] - public void ParseBlockDoesNotAllowMultipleFinallyBlocks() + public void DoesNotAllowMultipleFinallyBlocks() { var content = "try { var foo = new { } } finally { var foo = new { } }"; SingleSpanBlockTest(content + " finally { }"); } [Fact] - public void ParseBlockAcceptsTrailingDotIntoImplicitExpressionWhenEmbeddedInCode() + public void AcceptsTrailingDotIntoImplicitExpressionWhenEmbeddedInCode() { // Arrange ParseBlockTest(@"if(foo) { @foo. }"); } [Fact] - public void ParseBlockParsesExpressionOnSwitchCharacterFollowedByOpenParen() + public void ParsesExpressionOnSwitchCharacterFollowedByOpenParen() { // Arrange ParseBlockTest(@"if(foo) { @(foo + bar) }"); } [Fact] - public void ParseBlockParsesExpressionOnSwitchCharacterFollowedByIdentifierStart() + public void ParsesExpressionOnSwitchCharacterFollowedByIdentifierStart() { // Arrange ParseBlockTest(@"if(foo) { @foo[4].bar() }"); } [Fact] - public void ParseBlockTreatsDoubleAtSignAsEscapeSequenceIfAtStatementStart() + public void TreatsDoubleAtSignAsEscapeSequenceIfAtStatementStart() { // Arrange ParseBlockTest(@"if(foo) { @@class.Foo() }"); } [Fact] - public void ParseBlockTreatsAtSignsAfterFirstPairAsPartOfCSharpStatement() + public void TreatsAtSignsAfterFirstPairAsPartOfCSharpStatement() { // Arrange ParseBlockTest(@"if(foo) { @@@@class.Foo() }"); } [Fact] - public void ParseBlockDoesNotParseMarkupStatementOrExpressionOnSwitchCharacterNotFollowedByOpenAngleOrColon() + public void DoesNotParseOnSwitchCharacterNotFollowedByOpenAngleOrColon() { + // ParseBlockDoesNotParseMarkupStatementOrExpressionOnSwitchCharacterNotFollowedByOpenAngleOrColon // Arrange ParseBlockTest("if(foo) { @\"Foo\".ToString(); }"); } @@ -607,62 +616,62 @@ catch(bar) { baz(); }"); } [Fact] - public void ParseBlock_WithDoubleTransitionInAttributeValue_DoesNotThrow() + public void WithDoubleTransitionInAttributeValue_DoesNotThrow() { var input = "{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransitionAtEndOfAttributeValue_DoesNotThrow() + public void WithDoubleTransitionAtEndOfAttributeValue_DoesNotThrow() { var input = "{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransitionAtBeginningOfAttributeValue_DoesNotThrow() + public void WithDoubleTransitionAtBeginningOfAttributeValue_DoesNotThrow() { var input = "{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransitionBetweenAttributeValue_DoesNotThrow() + public void WithDoubleTransitionBetweenAttributeValue_DoesNotThrow() { var input = "{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransitionWithExpressionBlock_DoesNotThrow() + public void WithDoubleTransitionWithExpressionBlock_DoesNotThrow() { var input = "{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransitionInEmail_DoesNotThrow() + public void WithDoubleTransitionInEmail_DoesNotThrow() { var input = "{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransitionInRegex_DoesNotThrow() + public void WithDoubleTransitionInRegex_DoesNotThrow() { var input = @"{}"; ParseBlockTest(input); } [Fact] - public void ParseBlock_WithDoubleTransition_EndOfFile_Throws() + public void WithDoubleTransition_EndOfFile_Throws() { ParseBlockTest("{}"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpErrorTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpErrorTest.cs index d4a31728b4..a5cf944e98 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpErrorTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpErrorTest.cs @@ -10,79 +10,83 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpErrorTest : CsHtmlCodeParserTestBase { [Fact] - public void ParseBlockHandlesQuotesAfterTransition() + public void HandlesQuotesAfterTransition() { ParseBlockTest("@\""); } [Fact] - public void ParseBlockWithHelperDirectiveProducesError() + public void WithHelperDirectiveProducesError() { ParseBlockTest("@helper fooHelper { }"); } [Fact] - public void ParseBlockWithNestedCodeBlockProducesError() + public void WithNestedCodeBlockProducesError() { ParseBlockTest("@if { @{} }"); } [Fact] - public void ParseBlockCapturesWhitespaceToEndOfLineInInvalidUsingStatementAndTreatsAsFileCode() + public void CapturesWhitespaceToEOLInInvalidUsingStmtAndTreatsAsFileCode() { + // ParseBlockCapturesWhitespaceToEndOfLineInInvalidUsingStatementAndTreatsAsFileCode ParseBlockTest("using " + Environment.NewLine + Environment.NewLine); } [Fact] - public void ParseBlockMethodOutputsOpenCurlyAsCodeSpanIfEofFoundAfterOpenCurlyBrace() + public void MethodOutputsOpenCurlyAsCodeSpanIfEofFoundAfterOpenCurlyBrace() { ParseBlockTest("{"); } [Fact] - public void ParseBlockMethodOutputsZeroLengthCodeSpanIfStatementBlockEmpty() + public void MethodOutputsZeroLengthCodeSpanIfStatementBlockEmpty() { ParseBlockTest("{}"); } [Fact] - public void ParseBlockMethodProducesErrorIfNewlineFollowsTransition() + public void MethodProducesErrorIfNewlineFollowsTransition() { ParseBlockTest("@" + Environment.NewLine); } [Fact] - public void ParseBlockMethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpression() + public void MethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpr() { + // ParseBlockMethodProducesErrorIfWhitespaceBetweenTransitionAndBlockStartInEmbeddedExpression ParseBlockTest("{" + Environment.NewLine + " @ {}" + Environment.NewLine + "}"); } [Fact] - public void ParseBlockMethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression() + public void MethodProducesErrorIfEOFAfterTransitionInEmbeddedExpression() { ParseBlockTest("{" + Environment.NewLine + " @"); } [Fact] - public void ParseBlockMethodParsesNothingIfFirstCharacterIsNotIdentifierStartOrParenOrBrace() + public void MethodParsesNothingIfFirstCharacterIsNotIdentifierStartOrParenOrBrace() { ParseBlockTest("@!!!"); } [Fact] - public void ParseBlockShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExpressionUnclosed() + public void ShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExprUnclosed() { + // ParseBlockShouldReportErrorAndTerminateAtEOFIfIfParenInExplicitExpressionUnclosed ParseBlockTest("(foo bar" + Environment.NewLine + "baz"); } [Fact] - public void ParseBlockShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExpressionUnclosed() + public void ShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExprUnclosed() { + // ParseBlockShouldReportErrorAndTerminateAtMarkupIfIfParenInExplicitExpressionUnclosed ParseBlockTest("(foo bar" + Environment.NewLine + "" + Environment.NewLine + "baz" + Environment.NewLine @@ -90,7 +94,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockCorrectlyHandlesInCorrectTransitionsIfImplicitExpressionParensUnclosed() + public void CorrectlyHandlesInCorrectTransitionsIfImplicitExpressionParensUnclosed() { ParseBlockTest("Href(" + Environment.NewLine + "

@Html.Foo(Bar);

" + Environment.NewLine); @@ -98,8 +102,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] // Test for fix to Dev10 884975 - Incorrect Error Messaging - public void ParseBlockShouldReportErrorAndTerminateAtEOFIfParenInImplicitExpressionUnclosed() + public void ShouldReportErrorAndTerminateAtEOFIfParenInImplicitExprUnclosed() { + // ParseBlockShouldReportErrorAndTerminateAtEOFIfParenInImplicitExpressionUnclosed ParseBlockTest("Foo(Bar(Baz)" + Environment.NewLine + "Biz" + Environment.NewLine + "Boz"); @@ -107,8 +112,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] // Test for fix to Dev10 884975 - Incorrect Error Messaging - public void ParseBlockShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed() + public void ShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed() { + // ParseBlockShouldReportErrorAndTerminateAtMarkupIfParenInImplicitExpressionUnclosed ParseBlockTest("Foo(Bar(Baz)" + Environment.NewLine + "Biz" + Environment.NewLine + "" + Environment.NewLine @@ -118,8 +124,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] // Test for fix to Dev10 884975 - Incorrect Error Messaging - public void ParseBlockShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed() + public void ShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed() { + // ParseBlockShouldReportErrorAndTerminateAtEOFIfBracketInImplicitExpressionUnclosed ParseBlockTest("Foo[Bar[Baz]" + Environment.NewLine + "Biz" + Environment.NewLine + "Boz"); @@ -127,8 +134,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] // Test for fix to Dev10 884975 - Incorrect Error Messaging - public void ParseBlockShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExpressionUnclosed() + public void ShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExprUnclosed() { + // ParseBlockShouldReportErrorAndTerminateAtMarkupIfBracketInImplicitExpressionUnclosed ParseBlockTest("Foo[Bar[Baz]" + Environment.NewLine + "Biz" + Environment.NewLine + "" + Environment.NewLine @@ -138,13 +146,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Simple EOF handling errors: [Fact] - public void ParseBlockReportsErrorIfExplicitCodeBlockUnterminatedAtEOF() + public void ReportsErrorIfExplicitCodeBlockUnterminatedAtEOF() { ParseBlockTest("{ var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfClassBlockUnterminatedAtEOF() + public void ReportsErrorIfClassBlockUnterminatedAtEOF() { ParseBlockTest( "functions { var foo = bar; if(foo != null) { bar(); } ", @@ -152,138 +160,138 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockReportsErrorIfIfBlockUnterminatedAtEOF() + public void ReportsErrorIfIfBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("if"); } [Fact] - public void ParseBlockReportsErrorIfElseBlockUnterminatedAtEOF() + public void ReportsErrorIfElseBlockUnterminatedAtEOF() { ParseBlockTest("if(foo) { baz(); } else { var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfElseIfBlockUnterminatedAtEOF() + public void ReportsErrorIfElseIfBlockUnterminatedAtEOF() { ParseBlockTest("if(foo) { baz(); } else if { var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfDoBlockUnterminatedAtEOF() + public void ReportsErrorIfDoBlockUnterminatedAtEOF() { ParseBlockTest("do { var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfTryBlockUnterminatedAtEOF() + public void ReportsErrorIfTryBlockUnterminatedAtEOF() { ParseBlockTest("try { var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfCatchBlockUnterminatedAtEOF() + public void ReportsErrorIfCatchBlockUnterminatedAtEOF() { ParseBlockTest("try { baz(); } catch(Foo) { var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfFinallyBlockUnterminatedAtEOF() + public void ReportsErrorIfFinallyBlockUnterminatedAtEOF() { ParseBlockTest("try { baz(); } finally { var foo = bar; if(foo != null) { bar(); } "); } [Fact] - public void ParseBlockReportsErrorIfForBlockUnterminatedAtEOF() + public void ReportsErrorIfForBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("for"); } [Fact] - public void ParseBlockReportsErrorIfForeachBlockUnterminatedAtEOF() + public void ReportsErrorIfForeachBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("foreach"); } [Fact] - public void ParseBlockReportsErrorIfWhileBlockUnterminatedAtEOF() + public void ReportsErrorIfWhileBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("while"); } [Fact] - public void ParseBlockReportsErrorIfSwitchBlockUnterminatedAtEOF() + public void ReportsErrorIfSwitchBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("switch"); } [Fact] - public void ParseBlockReportsErrorIfLockBlockUnterminatedAtEOF() + public void ReportsErrorIfLockBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("lock"); } [Fact] - public void ParseBlockReportsErrorIfUsingBlockUnterminatedAtEOF() + public void ReportsErrorIfUsingBlockUnterminatedAtEOF() { RunUnterminatedSimpleKeywordBlock("using"); } [Fact] - public void ParseBlockRequiresControlFlowStatementsToHaveBraces() + public void RequiresControlFlowStatementsToHaveBraces() { ParseBlockTest("if(foo)

Bar

else if(bar)

Baz

else

Boz

"); } [Fact] - public void ParseBlockIncludesUnexpectedCharacterInSingleStatementControlFlowStatementError() + public void IncludesUnexpectedCharacterInSingleStatementControlFlowStatementError() { ParseBlockTest("if(foo)) { var bar = foo; }"); } [Fact] - public void ParseBlockOutputsErrorIfAtSignFollowedByLessThanSignAtStatementStart() + public void OutputsErrorIfAtSignFollowedByLessThanSignAtStatementStart() { ParseBlockTest("if(foo) { @

Bar

}"); } [Fact] - public void ParseBlockTerminatesIfBlockAtEOLWhenRecoveringFromMissingCloseParen() + public void TerminatesIfBlockAtEOLWhenRecoveringFromMissingCloseParen() { ParseBlockTest("if(foo bar" + Environment.NewLine + "baz"); } [Fact] - public void ParseBlockTerminatesForeachBlockAtEOLWhenRecoveringFromMissingCloseParen() + public void TerminatesForeachBlockAtEOLWhenRecoveringFromMissingCloseParen() { ParseBlockTest("foreach(foo bar" + Environment.NewLine + "baz"); } [Fact] - public void ParseBlockTerminatesWhileClauseInDoStatementAtEOLWhenRecoveringFromMissingCloseParen() + public void TerminatesWhileClauseInDoStmtAtEOLWhenRecoveringFromMissingCloseParen() { ParseBlockTest("do { } while(foo bar" + Environment.NewLine + "baz"); } [Fact] - public void ParseBlockTerminatesUsingBlockAtEOLWhenRecoveringFromMissingCloseParen() + public void TerminatesUsingBlockAtEOLWhenRecoveringFromMissingCloseParen() { ParseBlockTest("using(foo bar" + Environment.NewLine + "baz"); } [Fact] - public void ParseBlockResumesIfStatementAfterOpenParen() + public void ResumesIfStatementAfterOpenParen() { ParseBlockTest("if(" + Environment.NewLine + "else {

Foo

}"); } [Fact] - public void ParseBlockTerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing() + public void TerminatesNormalCSharpStringsAtEOLIfEndQuoteMissing() { SingleSpanBlockTest("if(foo) {" + Environment.NewLine + " var p = \"foo bar baz" + Environment.NewLine @@ -292,13 +300,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockTerminatesNormalStringAtEndOfFile() + public void TerminatesNormalStringAtEndOfFile() { SingleSpanBlockTest("if(foo) { var foo = \"blah blah blah blah blah"); } [Fact] - public void ParseBlockTerminatesVerbatimStringAtEndOfFile() + public void TerminatesVerbatimStringAtEndOfFile() { SingleSpanBlockTest("if(foo) { var foo = @\"blah " + Environment.NewLine + "blah; " + Environment.NewLine @@ -308,7 +316,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockCorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement() + public void CorrectlyParsesMarkupIncorrectyAssumedToBeWithinAStatement() { ParseBlockTest("if(foo) {" + Environment.NewLine + " var foo = \"foo bar baz" + Environment.NewLine @@ -317,13 +325,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockCorrectlyParsesAtSignInDelimitedBlock() + public void CorrectlyParsesAtSignInDelimitedBlock() { ParseBlockTest("(Request[\"description\"] ?? @photo.Description)"); } [Fact] - public void ParseBlockCorrectlyRecoversFromMissingCloseParenInExpressionWithinCode() + public void CorrectlyRecoversFromMissingCloseParenInExpressionWithinCode() { ParseBlockTest(@"{string.Format(}"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpExplicitExpressionTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpExplicitExpressionTest.cs index 8abae17490..9d15295d99 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpExplicitExpressionTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpExplicitExpressionTest.cs @@ -9,37 +9,38 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpExplicitExpressionTest : CsHtmlCodeParserTestBase { [Fact] - public void ParseBlockShouldOutputZeroLengthCodeSpanIfExplicitExpressionIsEmpty() + public void ShouldOutputZeroLengthCodeSpanIfExplicitExpressionIsEmpty() { ParseBlockTest("@()"); } [Fact] - public void ParseBlockShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpression() + public void ShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpr() { + // ParseBlockShouldOutputZeroLengthCodeSpanIfEOFOccursAfterStartOfExplicitExpression ParseBlockTest("@("); } [Fact] - public void ParseBlockShouldAcceptEscapedQuoteInNonVerbatimStrings() + public void ShouldAcceptEscapedQuoteInNonVerbatimStrings() { ParseBlockTest("@(\"\\\"\")"); } [Fact] - public void ParseBlockShouldAcceptEscapedQuoteInVerbatimStrings() + public void ShouldAcceptEscapedQuoteInVerbatimStrings() { ParseBlockTest("@(@\"\"\"\")"); } [Fact] - public void ParseBlockShouldAcceptMultipleRepeatedEscapedQuoteInVerbatimStrings() + public void ShouldAcceptMultipleRepeatedEscapedQuoteInVerbatimStrings() { ParseBlockTest("@(@\"\"\"\"\"\")"); } [Fact] - public void ParseBlockShouldAcceptMultiLineVerbatimStrings() + public void ShouldAcceptMultiLineVerbatimStrings() { ParseBlockTest(@"@(@""" + Environment.NewLine + @"Foo" + Environment.NewLine @@ -49,25 +50,25 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockShouldAcceptMultipleEscapedQuotesInNonVerbatimStrings() + public void ShouldAcceptMultipleEscapedQuotesInNonVerbatimStrings() { ParseBlockTest("@(\"\\\"hello, world\\\"\")"); } [Fact] - public void ParseBlockShouldAcceptMultipleEscapedQuotesInVerbatimStrings() + public void ShouldAcceptMultipleEscapedQuotesInVerbatimStrings() { ParseBlockTest("@(@\"\"\"hello, world\"\"\")"); } [Fact] - public void ParseBlockShouldAcceptConsecutiveEscapedQuotesInNonVerbatimStrings() + public void ShouldAcceptConsecutiveEscapedQuotesInNonVerbatimStrings() { ParseBlockTest("@(\"\\\"\\\"\")"); } [Fact] - public void ParseBlockShouldAcceptConsecutiveEscapedQuotesInVerbatimStrings() + public void ShouldAcceptConsecutiveEscapedQuotesInVerbatimStrings() { ParseBlockTest("@(@\"\"\"\"\"\")"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpImplicitExpressionTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpImplicitExpressionTest.cs index 5ab4300ef7..f46d227df9 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpImplicitExpressionTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpImplicitExpressionTest.cs @@ -8,210 +8,210 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpImplicitExpressionTest : CsHtmlCodeParserTestBase { [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket1() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket1() { // Act & Assert ImplicitExpressionTest("val??["); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket2() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket2() { // Act & Assert ImplicitExpressionTest("val??[0"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket3() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket3() { // Act & Assert ImplicitExpressionTest("val?["); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket4() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket4() { // Act & Assert ImplicitExpressionTest("val?("); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket5() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket5() { // Act & Assert ImplicitExpressionTest("val?[more"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket6() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket6() { // Act & Assert ImplicitExpressionTest("val?[0]"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket7() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket7() { // Act & Assert ImplicitExpressionTest("val?[

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket8() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket8() { // Act & Assert ImplicitExpressionTest("val?[more.

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket9() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket9() { // Act & Assert ImplicitExpressionTest("val??[more

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket10() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket10() { // Act & Assert ImplicitExpressionTest("val?[-1]?"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket11() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket11() { // Act & Assert ImplicitExpressionTest("val?[abc]?[def"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket12() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket12() { // Act & Assert ImplicitExpressionTest("val?[abc]?[2]"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket13() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket13() { // Act & Assert ImplicitExpressionTest("val?[abc]?.more?[def]"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket14() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket14() { // Act & Assert ImplicitExpressionTest("val?[abc]?.more?.abc"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket15() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket15() { // Act & Assert ImplicitExpressionTest("val?[null ?? true]"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket16() + public void ParsesNullConditionalOperatorImplicitExpression_Bracket16() { // Act & Assert ImplicitExpressionTest("val?[abc?.gef?[-1]]"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot1() + public void ParsesNullConditionalOperatorImplicitExpression_Dot1() { // Act & Assert ImplicitExpressionTest("val?"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot2() + public void ParsesNullConditionalOperatorImplicitExpression_Dot2() { // Act & Assert ImplicitExpressionTest("val??"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot3() + public void ParsesNullConditionalOperatorImplicitExpression_Dot3() { // Act & Assert ImplicitExpressionTest("val??more"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot4() + public void ParsesNullConditionalOperatorImplicitExpression_Dot4() { // Act & Assert ImplicitExpressionTest("val?!"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot5() + public void ParsesNullConditionalOperatorImplicitExpression_Dot5() { // Act & Assert ImplicitExpressionTest("val?."); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot6() + public void ParsesNullConditionalOperatorImplicitExpression_Dot6() { // Act & Assert ImplicitExpressionTest("val??."); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot7() + public void ParsesNullConditionalOperatorImplicitExpression_Dot7() { // Act & Assert ImplicitExpressionTest("val?.(abc)"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot8() + public void ParsesNullConditionalOperatorImplicitExpression_Dot8() { // Act & Assert ImplicitExpressionTest("val?.

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot9() + public void ParsesNullConditionalOperatorImplicitExpression_Dot9() { // Act & Assert ImplicitExpressionTest("val?.more"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot10() + public void ParsesNullConditionalOperatorImplicitExpression_Dot10() { // Act & Assert ImplicitExpressionTest("val?.more

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot11() + public void ParsesNullConditionalOperatorImplicitExpression_Dot11() { // Act & Assert ImplicitExpressionTest("val??.more

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot12() + public void ParsesNullConditionalOperatorImplicitExpression_Dot12() { // Act & Assert ImplicitExpressionTest("val?.more(false)?.

"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot13() + public void ParsesNullConditionalOperatorImplicitExpression_Dot13() { // Act & Assert ImplicitExpressionTest("val?.more(false)?.abc"); } [Fact] - public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Dot14() + public void ParsesNullConditionalOperatorImplicitExpression_Dot14() { // Act & Assert ImplicitExpressionTest("val?.more(null ?? true)?.abc"); @@ -224,145 +224,149 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockAcceptsNonEnglishCharactersThatAreValidIdentifiers() + public void AcceptsNonEnglishCharactersThatAreValidIdentifiers() { ImplicitExpressionTest("हळूँजद॔."); } [Fact] - public void ParseBlockOutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition() + public void OutputsZeroLengthCodeSpanIfInvalidCharacterFollowsTransition() { ParseBlockTest("@/"); } [Fact] - public void ParseBlockOutputsZeroLengthCodeSpanIfEOFOccursAfterTransition() + public void OutputsZeroLengthCodeSpanIfEOFOccursAfterTransition() { ParseBlockTest("@"); } [Fact] - public void ParseBlockSupportsSlashesWithinComplexImplicitExpressions() + public void SupportsSlashesWithinComplexImplicitExpressions() { ImplicitExpressionTest("DataGridColumn.Template(\"Years of Service\", e => (int)Math.Round((DateTime.Now - dt).TotalDays / 365))"); } [Fact] - public void ParseBlockMethodParsesSingleIdentifierAsImplicitExpression() + public void ParsesSingleIdentifierAsImplicitExpression() { ImplicitExpressionTest("foo"); } [Fact] - public void ParseBlockMethodDoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace() + public void DoesNotAcceptSemicolonIfExpressionTerminatedByWhitespace() { ImplicitExpressionTest("foo ;"); } [Fact] - public void ParseBlockMethodIgnoresSemicolonAtEndOfSimpleImplicitExpression() + public void IgnoresSemicolonAtEndOfSimpleImplicitExpression() { RunTrailingSemicolonTest("foo"); } [Fact] - public void ParseBlockMethodParsesDottedIdentifiersAsImplicitExpression() + public void ParsesDottedIdentifiersAsImplicitExpression() { ImplicitExpressionTest("foo.bar.baz"); } [Fact] - public void ParseBlockMethodIgnoresSemicolonAtEndOfDottedIdentifiers() + public void IgnoresSemicolonAtEndOfDottedIdentifiers() { RunTrailingSemicolonTest("foo.bar.baz"); } [Fact] - public void ParseBlockMethodDoesNotIncludeDotAtEOFInImplicitExpression() + public void DoesNotIncludeDotAtEOFInImplicitExpression() { ImplicitExpressionTest("foo.bar."); } [Fact] - public void ParseBlockMethodDoesNotIncludeDotFollowedByInvalidIdentifierCharacterInImplicitExpression1() + public void DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr1() { + // ParseBlockMethodDoesNotIncludeDotFollowedByInvalidIdentifierCharacterInImplicitExpression1 ImplicitExpressionTest("foo.bar.0"); } [Fact] - public void ParseBlockMethodDoesNotIncludeDotFollowedByInvalidIdentifierCharacterInImplicitExpression2() + public void DoesNotIncludeDotFollowedByInvalidIdentifierCharInImplicitExpr2() { + // ParseBlockMethodDoesNotIncludeDotFollowedByInvalidIdentifierCharacterInImplicitExpression2 ImplicitExpressionTest("foo.bar.

"); } [Fact] - public void ParseBlockMethodDoesNotIncludeSemicolonAfterDot() + public void DoesNotIncludeSemicolonAfterDot() { ImplicitExpressionTest("foo.bar.;"); } [Fact] - public void ParseBlockMethodTerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpression() + public void TerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpr() { + // ParseBlockMethodTerminatesAfterIdentifierUnlessFollowedByDotOrParenInImplicitExpression ImplicitExpressionTest("foo.bar

"); } [Fact] - public void ParseBlockProperlyParsesParenthesesAndBalancesThemInImplicitExpression() + public void ProperlyParsesParenthesesAndBalancesThemInImplicitExpression() { ImplicitExpressionTest(@"foo().bar(""bi\""z"", 4)(""chained method; call"").baz(@""bo""""z"", '\'', () => { return 4; }, (4+5+new { foo = bar[4] }))"); } [Fact] - public void ParseBlockProperlyParsesBracketsAndBalancesThemInImplicitExpression() + public void ProperlyParsesBracketsAndBalancesThemInImplicitExpression() { ImplicitExpressionTest(@"foo.bar[4 * (8 + 7)][""fo\""o""].baz"); } [Fact] - public void ParseBlockTerminatesImplicitExpressionAtHtmlEndTag() + public void TerminatesImplicitExpressionAtHtmlEndTag() { ImplicitExpressionTest("foo().bar.baz

zoop"); } [Fact] - public void ParseBlockTerminatesImplicitExpressionAtHtmlStartTag() + public void TerminatesImplicitExpressionAtHtmlStartTag() { ImplicitExpressionTest("foo().bar.baz

zoop"); } [Fact] - public void ParseBlockTerminatesImplicitExpressionBeforeDotIfDotNotFollowedByIdentifierStartCharacter() + public void TerminatesImplicitExprBeforeDotIfDotNotFollowedByIdentifierStartChar() { + // ParseBlockTerminatesImplicitExpressionBeforeDotIfDotNotFollowedByIdentifierStartCharacter ImplicitExpressionTest("foo().bar.baz.42"); } [Fact] - public void ParseBlockStopsBalancingParenthesesAtEOF() + public void StopsBalancingParenthesesAtEOF() { ImplicitExpressionTest("foo(()"); } [Fact] - public void ParseBlockTerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace() + public void TerminatesImplicitExpressionIfCloseParenFollowedByAnyWhiteSpace() { ImplicitExpressionTest("foo.bar() (baz)"); } [Fact] - public void ParseBlockTerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace() + public void TerminatesImplicitExpressionIfIdentifierFollowedByAnyWhiteSpace() { ImplicitExpressionTest("foo .bar() (baz)"); } [Fact] - public void ParseBlockTerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace() + public void TerminatesImplicitExpressionAtLastValidPointIfDotFollowedByWhitespace() { ImplicitExpressionTest("foo. bar() (baz)"); } [Fact] - public void ParseBlockOutputExpressionIfModuleTokenNotFollowedByBrace() + public void OutputExpressionIfModuleTokenNotFollowedByBrace() { ImplicitExpressionTest("module.foo()"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSectionTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSectionTest.cs index 2d05f57a29..52bca860e1 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSectionTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSectionTest.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpSectionTest : CsHtmlMarkupParserTestBase { [Fact] - public void ParseSectionBlockCapturesNewlineImmediatelyFollowing() + public void CapturesNewlineImmediatelyFollowing() { ParseDocumentTest( "@section" + Environment.NewLine, @@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockCapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace() + public void CapturesWhitespaceToEndOfLineInSectionStatementMissingOpenBrace() { ParseDocumentTest( "@section Foo " + Environment.NewLine + " ", @@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockCapturesWhitespaceToEndOfLineInSectionStatementMissingName() + public void CapturesWhitespaceToEndOfLineInSectionStatementMissingName() { ParseDocumentTest( "@section " + Environment.NewLine + " ", @@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockIgnoresSectionUnlessAllLowerCase() + public void IgnoresSectionUnlessAllLowerCase() { ParseDocumentTest( "@Section foo", @@ -42,16 +42,18 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartCharacter() + public void ReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartChar() { + // ParseSectionBlockReportsErrorAndTerminatesSectionBlockIfKeywordNotFollowedByIdentifierStartCharacter ParseDocumentTest( "@section 9 {

Foo

}", new[] { SectionDirective.Directive }); } [Fact] - public void ParseSectionBlockReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace() + public void ReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace() { + // ParseSectionBlockReportsErrorAndTerminatesSectionBlockIfNameNotFollowedByOpenBrace ParseDocumentTest( "@section foo-bar {

Foo

}", new[] { SectionDirective.Directive }); @@ -66,7 +68,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesEOFAfterOpenBrace() + public void HandlesEOFAfterOpenBrace() { ParseDocumentTest( "@section foo {", @@ -74,7 +76,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesEOFAfterOpenContent1() + public void HandlesEOFAfterOpenContent1() { ParseDocumentTest( @@ -83,7 +85,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesEOFAfterOpenContent2() + public void HandlesEOFAfterOpenContent2() { ParseDocumentTest( @@ -92,7 +94,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesEOFAfterOpenContent3() + public void HandlesEOFAfterOpenContent3() { ParseDocumentTest( @@ -101,7 +103,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesEOFAfterOpenContent4() + public void HandlesEOFAfterOpenContent4() { ParseDocumentTest( @@ -110,7 +112,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesUnterminatedSection() + public void HandlesUnterminatedSection() { ParseDocumentTest( "@section foo {

Foo{}

", @@ -118,7 +120,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockHandlesUnterminatedSectionWithNestedIf() + public void HandlesUnterminatedSectionWithNestedIf() { // Arrange var newLine = Environment.NewLine; @@ -134,8 +136,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockReportsErrorAndAcceptsWhitespaceToEndOfLineIfSectionNotFollowedByOpenBrace() + public void ReportsErrorAndAcceptsWhitespaceToEOLIfSectionNotFollowedByOpenBrace() { + // ParseSectionBlockReportsErrorAndAcceptsWhitespaceToEndOfLineIfSectionNotFollowedByOpenBrace // Arrange var chunkGenerator = new DirectiveChunkGenerator(SectionDirective.Directive); chunkGenerator.Diagnostics.Add( @@ -151,7 +154,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockAcceptsOpenBraceMultipleLinesBelowSectionName() + public void AcceptsOpenBraceMultipleLinesBelowSectionName() { ParseDocumentTest( "@section foo " @@ -168,7 +171,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockParsesNamedSectionCorrectly() + public void ParsesNamedSectionCorrectly() { ParseDocumentTest( "@section foo {

Foo

}", @@ -176,7 +179,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockDoesNotRequireSpaceBetweenSectionNameAndOpenBrace() + public void DoesNotRequireSpaceBetweenSectionNameAndOpenBrace() { ParseDocumentTest( "@section foo{

Foo

}", @@ -184,7 +187,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockBalancesBraces() + public void BalancesBraces() { ParseDocumentTest( "@section foo { }", @@ -192,7 +195,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockAllowsBracesInCSharpExpression() + public void AllowsBracesInCSharpExpression() { ParseDocumentTest( "@section foo { I really want to render a close brace, so here I go: @(\"}\") }", @@ -211,8 +214,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void SectionIsCorrectlyTerminatedWhenCloseBraceImmediatelyFollowsCodeBlockNoWhitespace() + public void SectionCorrectlyTerminatedWhenCloseBraceFollowsCodeBlockNoWhitespace() { + // SectionIsCorrectlyTerminatedWhenCloseBraceImmediatelyFollowsCodeBlockNoWhitespace ParseDocumentTest( "@section Foo {" + Environment.NewLine + "@if(true) {" + Environment.NewLine @@ -221,7 +225,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockCorrectlyTerminatesWhenCloseBraceImmediatelyFollowsMarkup() + public void CorrectlyTerminatesWhenCloseBraceImmediatelyFollowsMarkup() { ParseDocumentTest( "@section foo {something}", @@ -229,7 +233,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockParsesComment() + public void ParsesComment() { ParseDocumentTest( "@section s {}", @@ -239,7 +243,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // This was a user reported bug (codeplex #710), the section parser wasn't handling // comments. [Fact] - public void ParseSectionBlockParsesCommentWithDelimiters() + public void ParsesCommentWithDelimiters() { ParseDocumentTest( "@section s {}", @@ -247,7 +251,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockCommentRecoversFromUnclosedTag() + public void CommentRecoversFromUnclosedTag() { ParseDocumentTest( "@section s {" + Environment.NewLine + " \" '-->}", @@ -255,7 +259,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlockParsesXmlProcessingInstruction() + public void ParsesXmlProcessingInstruction() { ParseDocumentTest( "@section s { }", @@ -263,13 +267,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseSectionBlock_WithDoubleTransition1() + public void _WithDoubleTransition1() { ParseDocumentTest("@section s {}", new[] { SectionDirective.Directive }); } [Fact] - public void ParseSectionBlock_WithDoubleTransition2() + public void _WithDoubleTransition2() { ParseDocumentTest("@section s {}", new[] { SectionDirective.Directive }); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSpecialBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSpecialBlockTest.cs index 9506de7405..3015010516 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSpecialBlockTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpSpecialBlockTest.cs @@ -30,14 +30,16 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockBalancesBracesOutsideStringsIfFirstCharacterIsBraceAndReturnsSpanOfTypeCode() + public void BalancesBracesOutsideStringsIfFirstCharIsBraceAndReturnsSpanOfTypeCode() { + // ParseBlockBalancesBracesOutsideStringsIfFirstCharacterIsBraceAndReturnsSpanOfTypeCode ParseBlockTest("{foo\"b}ar\" if(condition) { string.Format(\"{0}\"); } }"); } [Fact] - public void ParseBlockBalancesParensOutsideStringsIfFirstCharacterIsParenAndReturnsSpanOfTypeExpression() + public void BalancesParensOutsideStringsIfFirstCharIsParenAndReturnsSpanOfTypeExpr() { + // ParseBlockBalancesParensOutsideStringsIfFirstCharacterIsParenAndReturnsSpanOfTypeExpression ParseBlockTest("(foo\"b)ar\" if(condition) { string.Format(\"{0}\"); } )"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTemplateTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTemplateTest.cs index 619292fd96..b672bcff91 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTemplateTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpTemplateTest.cs @@ -9,79 +9,82 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpTemplateTest : CsHtmlCodeParserTestBase { [Fact] - public void ParseBlockHandlesSingleLineTemplate() + public void HandlesSingleLineTemplate() { ParseBlockTest("{ var foo = @: bar" + Environment.NewLine + "; }"); } [Fact] - public void ParseBlockHandlesSingleLineImmediatelyFollowingStatementChar() + public void HandlesSingleLineImmediatelyFollowingStatementChar() { ParseBlockTest("{i@: bar" + Environment.NewLine + "}"); } [Fact] - public void ParseBlockHandlesSimpleTemplateInExplicitExpressionParens() + public void HandlesSimpleTemplateInExplicitExpressionParens() { ParseBlockTest("(Html.Repeat(10, @

Foo #@item

))"); } [Fact] - public void ParseBlockHandlesSimpleTemplateInImplicitExpressionParens() + public void HandlesSimpleTemplateInImplicitExpressionParens() { ParseBlockTest("Html.Repeat(10, @

Foo #@item

)"); } [Fact] - public void ParseBlockHandlesTwoTemplatesInImplicitExpressionParens() + public void HandlesTwoTemplatesInImplicitExpressionParens() { ParseBlockTest("Html.Repeat(10, @

Foo #@item

, @

Foo #@item

)"); } [Fact] - public void ParseBlockProducesErrorButCorrectlyParsesNestedTemplateInImplicitExpressionParens() + public void ProducesErrorButCorrectlyParsesNestedTemplateInImplicitExprParens() { + // ParseBlockProducesErrorButCorrectlyParsesNestedTemplateInImplicitExpressionParens ParseBlockTest("Html.Repeat(10, @

Foo #@Html.Repeat(10, @

@item

)

)"); } [Fact] - public void ParseBlockHandlesSimpleTemplateInStatementWithinCodeBlock() + public void HandlesSimpleTemplateInStatementWithinCodeBlock() { ParseBlockTest("foreach(foo in Bar) { Html.ExecuteTemplate(foo, @

Foo #@item

); }"); } [Fact] - public void ParseBlockHandlesTwoTemplatesInStatementWithinCodeBlock() + public void HandlesTwoTemplatesInStatementWithinCodeBlock() { ParseBlockTest("foreach(foo in Bar) { Html.ExecuteTemplate(foo, @

Foo #@item

, @

Foo #@item

); }"); } [Fact] - public void ParseBlockProducesErrorButCorrectlyParsesNestedTemplateInStatementWithinCodeBlock() + public void ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinCodeBlock() { + // ParseBlockProducesErrorButCorrectlyParsesNestedTemplateInStatementWithinCodeBlock ParseBlockTest("foreach(foo in Bar) { Html.ExecuteTemplate(foo, @

Foo #@Html.Repeat(10, @

@item

)

); }"); } [Fact] - public void ParseBlockHandlesSimpleTemplateInStatementWithinStatementBlock() + public void HandlesSimpleTemplateInStatementWithinStatementBlock() { ParseBlockTest("{ var foo = bar; Html.ExecuteTemplate(foo, @

Foo #@item

); }"); } [Fact] - public void ParseBlockHandlessTwoTemplatesInStatementWithinStatementBlock() + public void HandlessTwoTemplatesInStatementWithinStatementBlock() { ParseBlockTest("{ var foo = bar; Html.ExecuteTemplate(foo, @

Foo #@item

, @

Foo #@item

); }"); } [Fact] - public void ParseBlockProducesErrorButCorrectlyParsesNestedTemplateInStatementWithinStatementBlock() + public void ProducesErrorButCorrectlyParsesNestedTemplateInStmtWithinStmtBlock() { + // ParseBlockProducesErrorButCorrectlyParsesNestedTemplateInStatementWithinStatementBlock ParseBlockTest("{ var foo = bar; Html.ExecuteTemplate(foo, @

Foo #@Html.Repeat(10, @

@item

)

); }"); } [Fact] - public void ParseBlock_WithDoubleTransition_DoesNotThrow() + public void _WithDoubleTransition_DoesNotThrow() { ParseBlockTest("{ var foo = bar; Html.ExecuteTemplate(foo, @

Foo #@item

); }"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpToMarkupSwitchTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpToMarkupSwitchTest.cs index 128179ac25..510fb281f4 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpToMarkupSwitchTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpToMarkupSwitchTest.cs @@ -15,13 +15,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockGivesSpacesToCodeOnAtTagTemplateTransitionInDesignTimeMode() + public void GivesSpacesToCodeOnAtTagTemplateTransitionInDesignTimeMode() { ParseBlockTest("Foo( @

Foo

)", designTime: true); } [Fact] - public void ParseBlockGivesSpacesToCodeOnAtColonTemplateTransitionInDesignTimeMode() + public void GivesSpacesToCodeOnAtColonTemplateTransitionInDesignTimeMode() { ParseBlockTest("Foo( " + Environment.NewLine + "@:

Foo

" + Environment.NewLine @@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockGivesSpacesToCodeOnTagTransitionInDesignTimeMode() + public void GivesSpacesToCodeOnTagTransitionInDesignTimeMode() { ParseBlockTest("{" + Environment.NewLine + "

Foo

" + Environment.NewLine @@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockGivesSpacesToCodeOnInvalidAtTagTransitionInDesignTimeMode() + public void GivesSpacesToCodeOnInvalidAtTagTransitionInDesignTimeMode() { ParseBlockTest("{" + Environment.NewLine + " @

Foo

" + Environment.NewLine @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockGivesSpacesToCodeOnAtColonTransitionInDesignTimeMode() + public void GivesSpacesToCodeOnAtColonTransitionInDesignTimeMode() { ParseBlockTest("{" + Environment.NewLine + " @:

Foo

" + Environment.NewLine @@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockShouldSupportSingleLineMarkupContainingStatementBlock() + public void ShouldSupportSingleLineMarkupContainingStatementBlock() { ParseBlockTest("Repeat(10," + Environment.NewLine + " @: @{}" + Environment.NewLine @@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockShouldSupportMarkupWithoutPreceedingWhitespace() + public void ShouldSupportMarkupWithoutPreceedingWhitespace() { ParseBlockTest("foreach(var file in files){" + Environment.NewLine + Environment.NewLine @@ -74,8 +74,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockGivesAllWhitespaceOnSameLineExcludingPreceedingNewlineButIncludingTrailingNewLineToMarkup() + public void GivesAllWhitespaceOnSameLineWithTrailingNewLineToMarkupExclPreceedingNewline() { + // ParseBlockGivesAllWhitespaceOnSameLineExcludingPreceedingNewlineButIncludingTrailingNewLineToMarkup ParseBlockTest("if(foo) {" + Environment.NewLine + " var foo = \"After this statement there are 10 spaces\"; " + Environment.NewLine + "

" + Environment.NewLine @@ -88,19 +89,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockAllowsMarkupInIfBodyWithBraces() + public void AllowsMarkupInIfBodyWithBraces() { ParseBlockTest("if(foo) {

Bar

} else if(bar) {

Baz

} else {

Boz

}"); } [Fact] - public void ParseBlockAllowsMarkupInIfBodyWithBracesWithinCodeBlock() + public void AllowsMarkupInIfBodyWithBracesWithinCodeBlock() { ParseBlockTest("{ if(foo) {

Bar

} else if(bar) {

Baz

} else {

Boz

} }"); } [Fact] - public void ParseBlockSupportsMarkupInCaseAndDefaultBranchesOfSwitch() + public void SupportsMarkupInCaseAndDefaultBranchesOfSwitch() { // Arrange ParseBlockTest("switch(foo) {" + Environment.NewLine @@ -121,7 +122,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockSupportsMarkupInCaseAndDefaultBranchesOfSwitchInCodeBlock() + public void SupportsMarkupInCaseAndDefaultBranchesOfSwitchInCodeBlock() { // Arrange ParseBlockTest("{ switch(foo) {" + Environment.NewLine @@ -142,19 +143,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockParsesMarkupStatementOnOpenAngleBracket() + public void ParsesMarkupStatementOnOpenAngleBracket() { ParseBlockTest("for(int i = 0; i < 10; i++) {

Foo

}"); } [Fact] - public void ParseBlockParsesMarkupStatementOnOpenAngleBracketInCodeBlock() + public void ParsesMarkupStatementOnOpenAngleBracketInCodeBlock() { ParseBlockTest("{ for(int i = 0; i < 10; i++) {

Foo

} }"); } [Fact] - public void ParseBlockParsesMarkupStatementOnSwitchCharacterFollowedByColon() + public void ParsesMarkupStatementOnSwitchCharacterFollowedByColon() { // Arrange ParseBlockTest("if(foo) { @:Bar" + Environment.NewLine @@ -162,7 +163,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockParsesMarkupStatementOnSwitchCharacterFollowedByDoubleColon() + public void ParsesMarkupStatementOnSwitchCharacterFollowedByDoubleColon() { // Arrange ParseBlockTest("if(foo) { @::Sometext" + Environment.NewLine @@ -171,7 +172,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] - public void ParseBlockParsesMarkupStatementOnSwitchCharacterFollowedByTripleColon() + public void ParsesMarkupStatementOnSwitchCharacterFollowedByTripleColon() { // Arrange ParseBlockTest("if(foo) { @:::Sometext" + Environment.NewLine @@ -179,7 +180,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockParsesMarkupStatementOnSwitchCharacterFollowedByColonInCodeBlock() + public void ParsesMarkupStatementOnSwitchCharacterFollowedByColonInCodeBlock() { // Arrange ParseBlockTest("{ if(foo) { @:Bar" + Environment.NewLine @@ -187,19 +188,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockCorrectlyReturnsFromMarkupBlockWithPseudoTag() + public void CorrectlyReturnsFromMarkupBlockWithPseudoTag() { ParseBlockTest("if (i > 0) { ; }"); } [Fact] - public void ParseBlockCorrectlyReturnsFromMarkupBlockWithPseudoTagInCodeBlock() + public void CorrectlyReturnsFromMarkupBlockWithPseudoTagInCodeBlock() { ParseBlockTest("{ if (i > 0) { ; } }"); } [Fact] - public void ParseBlockSupportsAllKindsOfImplicitMarkupInCodeBlock() + public void SupportsAllKindsOfImplicitMarkupInCodeBlock() { ParseBlockTest("{" + Environment.NewLine + " if(true) {" + Environment.NewLine diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpVerbatimBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpVerbatimBlockTest.cs index 7b38b1cbe1..f6e5085d91 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpVerbatimBlockTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpVerbatimBlockTest.cs @@ -17,31 +17,31 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void InnerImplicitExpressionWithOnlySingleAtOutputsZeroLengthCodeSpan() + public void InnerImplicitExprWithOnlySingleAtOutputsZeroLengthCodeSpan() { ParseBlockTest("{@}"); } [Fact] - public void InnerImplicitExpressionDoesNotAcceptDotAfterAt() + public void InnerImplicitExprDoesNotAcceptDotAfterAt() { ParseBlockTest("{@.}"); } [Fact] - public void InnerImplicitExpressionWithOnlySingleAtAcceptsSingleSpaceOrNewlineAtDesignTime() + public void InnerImplicitExprWithOnlySingleAtAcceptsSingleSpaceOrNewlineAtDesignTime() { ParseBlockTest("{" + Environment.NewLine + " @" + Environment.NewLine + "}", designTime: true); } [Fact] - public void InnerImplicitExpressionDoesNotAcceptTrailingNewlineInRunTimeMode() + public void InnerImplicitExprDoesNotAcceptTrailingNewlineInRunTimeMode() { ParseBlockTest("{@foo." + Environment.NewLine + "}"); } [Fact] - public void InnerImplicitExpressionAcceptsTrailingNewlineInDesignTimeMode() + public void InnerImplicitExprAcceptsTrailingNewlineInDesignTimeMode() { ParseBlockTest("{@foo." + Environment.NewLine + "}", designTime: true); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpWhitespaceHandlingTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpWhitespaceHandlingTest.cs index e9c028da7e..44a642ce8b 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpWhitespaceHandlingTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpWhitespaceHandlingTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class CSharpWhitespaceHandlingTest : CsHtmlMarkupParserTestBase { [Fact] - public void StatementBlockDoesNotAcceptTrailingNewlineIfNewlinesAreSignificantToAncestor() + public void StmtBlockDoesNotAcceptTrailingNewlineIfTheyAreSignificantToAncestor() { ParseBlockTest("@: @if (true) { }" + Environment.NewLine + "}"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlBlockTest.cs index d069d68d59..b87eb28aa3 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlBlockTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlBlockTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class HtmlBlockTest : CsHtmlMarkupParserTestBase { [Fact] - public void ParseBlockHandlesUnbalancedTripleDashHTMLComments() + public void HandlesUnbalancedTripleDashHTMLComments() { ParseDocumentTest( @"@{ @@ -18,14 +18,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockHandlesOpenAngleAtEof() + public void HandlesOpenAngleAtEof() { ParseDocumentTest("@{" + Environment.NewLine + "<"); } [Fact] - public void ParseBlockHandlesOpenAngleWithProperTagFollowingIt() + public void HandlesOpenAngleWithProperTagFollowingIt() { ParseDocumentTest("@{" + Environment.NewLine + "<" + Environment.NewLine @@ -41,104 +41,104 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockAllowsStartAndEndTagsToDifferInCase() + public void AllowsStartAndEndTagsToDifferInCase() { ParseBlockTest("
  • Foo

  • "); } [Fact] - public void ParseBlockReadsToEndOfLineIfFirstCharacterAfterTransitionIsColon() + public void ReadsToEndOfLineIfFirstCharacterAfterTransitionIsColon() { ParseBlockTest("@:
  • Foo Bar Baz" + Environment.NewLine + "bork"); } [Fact] - public void ParseBlockStopsParsingSingleLineBlockAtEOFIfNoEOLReached() + public void StopsParsingSingleLineBlockAtEOFIfNoEOLReached() { ParseBlockTest("@:foo bar"); } [Fact] - public void ParseBlockStopsAtMatchingCloseTagToStartTag() + public void StopsAtMatchingCloseTagToStartTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockParsesUntilMatchingEndTagIfFirstNonWhitespaceCharacterIsStartTag() + public void ParsesUntilMatchingEndTagIfFirstNonWhitespaceCharacterIsStartTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockAllowsUnclosedTagsAsLongAsItCanRecoverToAnExpectedEndTag() + public void AllowsUnclosedTagsAsLongAsItCanRecoverToAnExpectedEndTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockWithSelfClosingTagJustEmitsTag() + public void WithSelfClosingTagJustEmitsTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockCanHandleSelfClosingTagsWithinBlock() + public void CanHandleSelfClosingTagsWithinBlock() { ParseBlockTest(""); } [Fact] - public void ParseBlockSupportsTagsWithAttributes() + public void SupportsTagsWithAttributes() { ParseBlockTest(""); } [Fact] - public void ParseBlockAllowsCloseAngleBracketInAttributeValueIfDoubleQuoted() + public void AllowsCloseAngleBracketInAttributeValueIfDoubleQuoted() { ParseBlockTest("\" />"); } [Fact] - public void ParseBlockAllowsCloseAngleBracketInAttributeValueIfSingleQuoted() + public void AllowsCloseAngleBracketInAttributeValueIfSingleQuoted() { ParseBlockTest("\' />"); } [Fact] - public void ParseBlockAllowsSlashInAttributeValueIfDoubleQuoted() + public void AllowsSlashInAttributeValueIfDoubleQuoted() { ParseBlockTest(""); } [Fact] - public void ParseBlockAllowsSlashInAttributeValueIfSingleQuoted() + public void AllowsSlashInAttributeValueIfSingleQuoted() { ParseBlockTest(""); } [Fact] - public void ParseBlockTerminatesAtEOF() + public void TerminatesAtEOF() { ParseBlockTest(""); } [Fact] - public void ParseBlockSupportsCommentAsBlock() + public void SupportsCommentAsBlock() { ParseBlockTest(""); } [Fact] - public void ParseBlockSupportsCommentWithExtraDashAsBlock() + public void SupportsCommentWithExtraDashAsBlock() { ParseBlockTest(""); } [Fact] - public void ParseBlockSupportsCommentWithinBlock() + public void SupportsCommentWithinBlock() { ParseBlockTest("barbaz"); } @@ -155,116 +155,117 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockProperlyBalancesCommentStartAndEndTags() + public void ProperlyBalancesCommentStartAndEndTags() { ParseBlockTest(""); } [Fact] - public void ParseBlockTerminatesAtEOFWhenParsingComment() + public void TerminatesAtEOFWhenParsingComment() { ParseBlockTest(""); } [Fact] - public void ParseBlockTerminatesCommentAtFirstOccurrenceOfEndSequence() + public void TerminatesCommentAtFirstOccurrenceOfEndSequence() { ParseBlockTest("-->"); } [Fact] - public void ParseBlockTreatsMalformedTagsAsContent() + public void TreatsMalformedTagsAsContent() { ParseBlockTest(""); } [Fact] - public void ParseBlockParsesSGMLDeclarationAsEmptyTag() + public void ParsesSGMLDeclarationAsEmptyTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockTerminatesSGMLDeclarationAtFirstCloseAngle() + public void TerminatesSGMLDeclarationAtFirstCloseAngle() { ParseBlockTest(" baz>"); } [Fact] - public void ParseBlockParsesXMLProcessingInstructionAsEmptyTag() + public void ParsesXMLProcessingInstructionAsEmptyTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockTerminatesXMLProcessingInstructionAtQuestionMarkCloseAnglePair() + public void TerminatesXMLProcessingInstructionAtQuestionMarkCloseAnglePair() { ParseBlockTest(" baz"); } [Fact] - public void ParseBlockDoesNotTerminateXMLProcessingInstructionAtCloseAngleUnlessPreceededByQuestionMark() + public void DoesNotTerminateXMLProcInstrAtCloseAngleUnlessPreceededByQuestionMark() { + // ParseBlockDoesNotTerminateXMLProcessingInstructionAtCloseAngleUnlessPreceededByQuestionMark ParseBlockTest(" baz?>"); } [Fact] - public void ParseBlockSupportsScriptTagsWithLessThanSignsInThem() + public void SupportsScriptTagsWithLessThanSignsInThem() { ParseBlockTest(@""); } [Fact] - public void ParseBlockSupportsScriptTagsWithSpacedLessThanSignsInThem() + public void SupportsScriptTagsWithSpacedLessThanSignsInThem() { ParseBlockTest(@""); } [Fact] - public void ParseBlockAcceptsEmptyTextTag() + public void AcceptsEmptyTextTag() { ParseBlockTest(""); } [Fact] - public void ParseBlockAcceptsTextTagAsOuterTagButDoesNotRender() + public void AcceptsTextTagAsOuterTagButDoesNotRender() { ParseBlockTest("Foo Bar Baz zoop"); } [Fact] - public void ParseBlockRendersLiteralTextTagIfDoubled() + public void RendersLiteralTextTagIfDoubled() { ParseBlockTest("Foo Bar Baz zoop"); } [Fact] - public void ParseBlockDoesNotConsiderPsuedoTagWithinMarkupBlock() + public void DoesNotConsiderPsuedoTagWithinMarkupBlock() { ParseBlockTest(""); } [Fact] - public void ParseBlockStopsParsingMidEmptyTagIfEOFReached() + public void StopsParsingMidEmptyTagIfEOFReached() { ParseBlockTest("
    Foo @if(true) {} Bar"); } [Fact] - public void ParseBlockIgnoresTagsInContentsOfScriptTag() + public void IgnoresTagsInContentsOfScriptTag() { ParseBlockTest(@""); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlDocumentTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlDocumentTest.cs index 0863f30168..f77ee48b60 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlDocumentTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/HtmlDocumentTest.cs @@ -13,43 +13,43 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private static readonly TestFile Nested1000 = TestFile.Create("TestFiles/nested-1000.html", typeof(HtmlDocumentTest)); [Fact] - public void ParseDocument_NestedCodeBlockWithMarkupSetsDotAsMarkup() + public void NestedCodeBlockWithMarkupSetsDotAsMarkup() { ParseDocumentTest("@if (true) { @if(false) {
    @something.
    } }"); } [Fact] - public void ParseDocumentOutputsEmptyBlockWithEmptyMarkupSpanIfContentIsEmptyString() + public void OutputsEmptyBlockWithEmptyMarkupSpanIfContentIsEmptyString() { ParseDocumentTest(string.Empty); } [Fact] - public void ParseDocumentOutputsWhitespaceOnlyContentAsSingleWhitespaceMarkupSpan() + public void OutputsWhitespaceOnlyContentAsSingleWhitespaceMarkupSpan() { ParseDocumentTest(" "); } [Fact] - public void ParseDocumentAcceptsSwapTokenAtEndOfFileAndOutputsZeroLengthCodeSpan() + public void AcceptsSwapTokenAtEndOfFileAndOutputsZeroLengthCodeSpan() { ParseDocumentTest("@"); } [Fact] - public void ParseDocumentCorrectlyHandlesOddlySpacedHTMLElements() + public void CorrectlyHandlesOddlySpacedHTMLElements() { ParseDocumentTest("

    Foo

    "); } [Fact] - public void ParseDocumentCorrectlyHandlesSingleLineOfMarkupWithEmbeddedStatement() + public void CorrectlyHandlesSingleLineOfMarkupWithEmbeddedStatement() { ParseDocumentTest("
    Foo @if(true) {} Bar
    "); } [Fact] - public void ParseDocumentWithinSectionDoesNotCreateDocumentLevelSpan() + public void WithinSectionDoesNotCreateDocumentLevelSpan() { ParseDocumentTest("@section Foo {" + Environment.NewLine + " " + Environment.NewLine @@ -58,25 +58,25 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseDocumentParsesWholeContentAsOneSpanIfNoSwapCharacterEncountered() + public void ParsesWholeContentAsOneSpanIfNoSwapCharacterEncountered() { ParseDocumentTest("foo baz"); } [Fact] - public void ParseDocumentHandsParsingOverToCodeParserWhenAtSignEncounteredAndEmitsOutput() + public void HandsParsingOverToCodeParserWhenAtSignEncounteredAndEmitsOutput() { ParseDocumentTest("foo @bar baz"); } [Fact] - public void ParseDocumentEmitsAtSignAsMarkupIfAtEndOfFile() + public void EmitsAtSignAsMarkupIfAtEndOfFile() { ParseDocumentTest("foo @"); } [Fact] - public void ParseDocumentEmitsCodeBlockIfFirstCharacterIsSwapCharacter() + public void EmitsCodeBlockIfFirstCharacterIsSwapCharacter() { ParseDocumentTest("@bar"); } @@ -84,107 +84,109 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy [Fact] public void ParseDocumentDoesNotSwitchToCodeOnEmailAddressInText() { - ParseDocument("example@microsoft.com"); + ParseDocumentTest("example@microsoft.com"); } [Fact] - public void ParseDocumentDoesNotSwitchToCodeOnEmailAddressInAttribute() + public void DoesNotSwitchToCodeOnEmailAddressInAttribute() { ParseDocumentTest("Email me"); } [Fact] - public void ParseDocumentDoesNotReturnErrorOnMismatchedTags() + public void DoesNotReturnErrorOnMismatchedTags() { ParseDocumentTest("Foo

    Baz"); } [Fact] - public void ParseDocumentReturnsOneMarkupSegmentIfNoCodeBlocksEncountered() + public void ReturnsOneMarkupSegmentIfNoCodeBlocksEncountered() { ParseDocumentTest("Foo BazBar"); } [Fact] - public void ParseBlockSupportsCodeWithinSGMLDeclaration() + public void SupportsCodeWithinSGMLDeclaration() { ParseBlockTest(""); } [Fact] - public void ParseBlockSupportsCodeWithinCDataDeclaration() + public void SupportsCodeWithinCDataDeclaration() { ParseBlockTest(""); } [Fact] - public void ParseBlockSupportsCodeWithinXMLProcessingInstruction() + public void SupportsCodeWithinXMLProcessingInstruction() { ParseBlockTest(""); } @@ -73,13 +72,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void ParseBlockDoesNotSwitchToCodeOnEmailAddressInAttribute() + public void DoesNotSwitchToCodeOnEmailAddressInAttribute() { ParseBlockTest("Email me"); } [Fact] - public void ParseBlockGivesWhitespacePreceedingAtToCodeIfThereIsNoMarkupOnThatLine() + public void GivesWhitespacePreceedingAtToCodeIfThereIsNoMarkupOnThatLine() { ParseBlockTest("
      " + Environment.NewLine + " @foreach(var p in Products) {" + Environment.NewLine @@ -125,13 +124,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy // Tests for "@@" escape sequence: [Fact] - public void ParseBlockTreatsTwoAtSignsAsEscapeSequence() + public void TreatsTwoAtSignsAsEscapeSequence() { ParseBlockTest("@@bar"); } [Fact] - public void ParseBlockTreatsPairsOfAtSignsAsEscapeSequence() + public void TreatsPairsOfAtSignsAsEscapeSequence() { ParseBlockTest("@@@@@bar"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TagHelperBlockRewriterTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TagHelperBlockRewriterTest.cs index 04e468c99e..09431eddde 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TagHelperBlockRewriterTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/TagHelperBlockRewriterTest.cs @@ -50,43 +50,43 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes1() + public void CanHandleSymbolBoundAttributes1() { EvaluateData(SymbolBoundAttributes_Descriptors, "
        "); } [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes2() + public void CanHandleSymbolBoundAttributes2() { EvaluateData(SymbolBoundAttributes_Descriptors, "
          "); } [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes3() + public void CanHandleSymbolBoundAttributes3() { EvaluateData(SymbolBoundAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes4() + public void CanHandleSymbolBoundAttributes4() { EvaluateData(SymbolBoundAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes5() + public void CanHandleSymbolBoundAttributes5() { EvaluateData(SymbolBoundAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes6() + public void CanHandleSymbolBoundAttributes6() { EvaluateData(SymbolBoundAttributes_Descriptors, "
          "); } [Fact] - public void Rewrite_CanHandleSymbolBoundAttributes7() + public void CanHandleSymbolBoundAttributes7() { EvaluateData(SymbolBoundAttributes_Descriptors, "
          "); } @@ -102,31 +102,31 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_CanHandleWithoutEndTagTagStructure1() + public void CanHandleWithoutEndTagTagStructure1() { EvaluateData(WithoutEndTag_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleWithoutEndTagTagStructure2() + public void CanHandleWithoutEndTagTagStructure2() { EvaluateData(WithoutEndTag_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleWithoutEndTagTagStructure3() + public void CanHandleWithoutEndTagTagStructure3() { EvaluateData(WithoutEndTag_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleWithoutEndTagTagStructure4() + public void CanHandleWithoutEndTagTagStructure4() { EvaluateData(WithoutEndTag_Descriptors, ""); } [Fact] - public void Rewrite_CanHandleWithoutEndTagTagStructure5() + public void CanHandleWithoutEndTagTagStructure5() { EvaluateData(WithoutEndTag_Descriptors, "
          "); } @@ -153,7 +153,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures1() + public void AllowsCompatibleTagStructures1() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.Unspecified, TagStructure.Unspecified); @@ -163,7 +163,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures2() + public void AllowsCompatibleTagStructures2() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.Unspecified, TagStructure.Unspecified); @@ -173,7 +173,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures3() + public void AllowsCompatibleTagStructures3() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.Unspecified, TagStructure.WithoutEndTag); @@ -183,7 +183,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures4() + public void AllowsCompatibleTagStructures4() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.WithoutEndTag, TagStructure.WithoutEndTag); @@ -193,7 +193,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures5() + public void AllowsCompatibleTagStructures5() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.Unspecified, TagStructure.NormalOrSelfClosing); @@ -203,7 +203,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures6() + public void AllowsCompatibleTagStructures6() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.Unspecified, TagStructure.WithoutEndTag); @@ -213,7 +213,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsCompatibleTagStructures7() + public void AllowsCompatibleTagStructures7() { // Arrange var descriptors = GetTagStructureCompatibilityDescriptors(TagStructure.NormalOrSelfClosing, TagStructure.Unspecified); @@ -223,163 +223,163 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes1() + public void CreatesErrorForMalformedTagHelpersWithAttributes1() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes4() + public void CreatesErrorForMalformedTagHelpersWithAttributes4() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes8() + public void CreatesErrorForMalformedTagHelpersWithAttributes8() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes9() + public void CreatesErrorForMalformedTagHelpersWithAttributes9() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes10() + public void CreatesErrorForMalformedTagHelpersWithAttributes10() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes11() + public void CreatesErrorForMalformedTagHelpersWithAttributes11() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes12() + public void CreatesErrorForMalformedTagHelpersWithAttributes12() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes13() + public void CreatesErrorForMalformedTagHelpersWithAttributes13() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes14() + public void CreatesErrorForMalformedTagHelpersWithAttributes14() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes15() + public void CreatesErrorForMalformedTagHelpersWithAttributes15() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes16() + public void CreatesErrorForMalformedTagHelpersWithAttributes16() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes18() + public void CreatesErrorForMalformedTagHelpersWithAttributes18() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelpersWithAttributes19() + public void CreatesErrorForMalformedTagHelpersWithAttributes19() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelper1() + public void CreatesErrorForMalformedTagHelper1() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelper5() + public void CreatesErrorForMalformedTagHelper5() { RunParseTreeRewriterTest(" <

          ", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelper7() + public void CreatesErrorForMalformedTagHelper7() { RunParseTreeRewriterTest("<<> <<>>", "strong", "p"); } [Fact] - public void Rewrite_CreatesErrorForMalformedTagHelper8() + public void CreatesErrorForMalformedTagHelper8() { RunParseTreeRewriterTest("

          ", "strong", "p"); } @@ -407,67 +407,67 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes1() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes1() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes2() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes2() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes3() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes3() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes4() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes4() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes5() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes5() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes6() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes6() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes7() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes7() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes8() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes8() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes9() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes9() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes10() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes10() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } [Fact] - public void Rewrite_CreatesMarkupCodeSpansForNonStringTagHelperAttributes11() + public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes11() { EvaluateData(CodeTagHelperAttributes_Descriptors, ""); } @@ -755,31 +755,31 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsEmptyAttributeTagHelpers1() + public void UnderstandsEmptyAttributeTagHelpers1() { RunParseTreeRewriterTest("

          ", "p"); } [Fact] - public void Rewrite_UnderstandsEmptyAttributeTagHelpers2() + public void UnderstandsEmptyAttributeTagHelpers2() { RunParseTreeRewriterTest("

          ", "p"); } [Fact] - public void Rewrite_UnderstandsEmptyAttributeTagHelpers3() + public void UnderstandsEmptyAttributeTagHelpers3() { RunParseTreeRewriterTest("

          ", "p"); } [Fact] - public void Rewrite_UnderstandsEmptyAttributeTagHelpers4() + public void UnderstandsEmptyAttributeTagHelpers4() { RunParseTreeRewriterTest("

          ", "p"); } [Fact] - public void Rewrite_UnderstandsEmptyAttributeTagHelpers5() + public void UnderstandsEmptyAttributeTagHelpers5() { RunParseTreeRewriterTest("

          ", "p"); } @@ -802,85 +802,85 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes1() + public void CreatesErrorForEmptyTagHelperBoundAttributes1() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes2() + public void CreatesErrorForEmptyTagHelperBoundAttributes2() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes3() + public void CreatesErrorForEmptyTagHelperBoundAttributes3() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes4() + public void CreatesErrorForEmptyTagHelperBoundAttributes4() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes5() + public void CreatesErrorForEmptyTagHelperBoundAttributes5() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes6() + public void CreatesErrorForEmptyTagHelperBoundAttributes6() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes7() + public void CreatesErrorForEmptyTagHelperBoundAttributes7() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes8() + public void CreatesErrorForEmptyTagHelperBoundAttributes8() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes9() + public void CreatesErrorForEmptyTagHelperBoundAttributes9() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes10() + public void CreatesErrorForEmptyTagHelperBoundAttributes10() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes11() + public void CreatesErrorForEmptyTagHelperBoundAttributes11() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes12() + public void CreatesErrorForEmptyTagHelperBoundAttributes12() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes13() + public void CreatesErrorForEmptyTagHelperBoundAttributes13() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } [Fact] - public void Rewrite_CreatesErrorForEmptyTagHelperBoundAttributes14() + public void CreatesErrorForEmptyTagHelperBoundAttributes14() { EvaluateData(EmptyTagHelperBoundAttribute_Descriptors, ""); } @@ -1026,7 +1026,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document1() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document1() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1037,7 +1037,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document2() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document2() { // Arrange var document = ""; @@ -1047,7 +1047,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document3() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document3() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1058,7 +1058,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document4() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document4() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1069,7 +1069,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document5() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document5() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1080,7 +1080,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document6() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document6() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1091,7 +1091,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Document7() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Document7() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1102,7 +1102,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block1() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block1() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1116,7 +1116,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block2() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block2() { // Arrange var document = ""; @@ -1129,7 +1129,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block3() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block3() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1143,7 +1143,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block4() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block4() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1157,7 +1157,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block5() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block5() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1171,7 +1171,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block6() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block6() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1185,7 +1185,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_GeneratesExpectedOutputForUnboundDataDashAttributes_Block7() + public void GeneratesExpectedOutputForUnboundDataDashAttributes_Block7() { // Arrange var dateTimeNowString = "@DateTime.Now"; @@ -1257,7 +1257,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document1() + public void UnderstandsMinimizedAttributes_Document1() { // Arrange var document = ""; @@ -1267,7 +1267,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document2() + public void UnderstandsMinimizedAttributes_Document2() { // Arrange var document = "

          "; @@ -1277,7 +1277,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document3() + public void UnderstandsMinimizedAttributes_Document3() { // Arrange var document = ""; @@ -1287,7 +1287,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document4() + public void UnderstandsMinimizedAttributes_Document4() { // Arrange var document = ""; @@ -1297,7 +1297,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document5() + public void UnderstandsMinimizedAttributes_Document5() { // Arrange var document = "

          "; @@ -1307,7 +1307,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document6() + public void UnderstandsMinimizedAttributes_Document6() { // Arrange var document = ""; @@ -1317,7 +1317,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document7() + public void UnderstandsMinimizedAttributes_Document7() { // Arrange var document = ""; @@ -1327,7 +1327,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document8() + public void UnderstandsMinimizedAttributes_Document8() { // Arrange var document = ""; @@ -1337,7 +1337,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document9() + public void UnderstandsMinimizedAttributes_Document9() { // Arrange var document = ""; @@ -1347,7 +1347,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document10() + public void UnderstandsMinimizedAttributes_Document10() { // Arrange var document = ""; @@ -1357,7 +1357,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document11() + public void UnderstandsMinimizedAttributes_Document11() { // Arrange var document = ""; @@ -1367,7 +1367,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document12() + public void UnderstandsMinimizedAttributes_Document12() { // Arrange var document = ""; @@ -1377,7 +1377,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document13() + public void UnderstandsMinimizedAttributes_Document13() { // Arrange var document = ""; @@ -1387,7 +1387,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document14() + public void UnderstandsMinimizedAttributes_Document14() { // Arrange var document = ""; @@ -1397,7 +1397,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document15() + public void UnderstandsMinimizedAttributes_Document15() { // Arrange var document = ""; @@ -1407,7 +1407,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document16() + public void UnderstandsMinimizedAttributes_Document16() { // Arrange var document = ""; @@ -1417,7 +1417,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document17() + public void UnderstandsMinimizedAttributes_Document17() { // Arrange var document = "

          "; @@ -1427,7 +1427,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document18() + public void UnderstandsMinimizedAttributes_Document18() { // Arrange var document = ""; @@ -1437,7 +1437,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document19() + public void UnderstandsMinimizedAttributes_Document19() { // Arrange var document = "

          "; @@ -1447,7 +1447,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document20() + public void UnderstandsMinimizedAttributes_Document20() { // Arrange var document = ""; @@ -1457,7 +1457,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document21() + public void UnderstandsMinimizedAttributes_Document21() { // Arrange var document = "

          "; @@ -1467,7 +1467,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document22() + public void UnderstandsMinimizedAttributes_Document22() { // Arrange var document = ""; @@ -1477,7 +1477,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document23() + public void UnderstandsMinimizedAttributes_Document23() { // Arrange var document = "

          "; @@ -1487,7 +1487,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document24() + public void UnderstandsMinimizedAttributes_Document24() { // Arrange var document = ""; @@ -1497,7 +1497,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document25() + public void UnderstandsMinimizedAttributes_Document25() { // Arrange var document = ""; @@ -1507,7 +1507,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document26() + public void UnderstandsMinimizedAttributes_Document26() { // Arrange var document = ""; @@ -1517,7 +1517,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document27() + public void UnderstandsMinimizedAttributes_Document27() { // Arrange var document = "

          "; @@ -1527,7 +1527,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document28() + public void UnderstandsMinimizedAttributes_Document28() { // Arrange var document = ""; @@ -1537,7 +1537,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document29() + public void UnderstandsMinimizedAttributes_Document29() { // Arrange var document = "

          "; @@ -1547,7 +1547,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document30() + public void UnderstandsMinimizedAttributes_Document30() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -1558,7 +1558,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document31() + public void UnderstandsMinimizedAttributes_Document31() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -1569,7 +1569,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document32() + public void UnderstandsMinimizedAttributes_Document32() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -1580,7 +1580,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Document33() + public void UnderstandsMinimizedAttributes_Document33() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -1591,7 +1591,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block1() + public void UnderstandsMinimizedAttributes_Block1() { // Arrange var document = ""; @@ -1604,7 +1604,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block2() + public void UnderstandsMinimizedAttributes_Block2() { // Arrange var document = "

          "; @@ -1617,7 +1617,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block3() + public void UnderstandsMinimizedAttributes_Block3() { // Arrange var document = ""; @@ -1630,7 +1630,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block4() + public void UnderstandsMinimizedAttributes_Block4() { // Arrange var document = ""; @@ -1643,7 +1643,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block5() + public void UnderstandsMinimizedAttributes_Block5() { // Arrange var document = "

          "; @@ -1656,7 +1656,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block6() + public void UnderstandsMinimizedAttributes_Block6() { // Arrange var document = ""; @@ -1669,7 +1669,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block7() + public void UnderstandsMinimizedAttributes_Block7() { // Arrange var document = ""; @@ -1682,7 +1682,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block8() + public void UnderstandsMinimizedAttributes_Block8() { // Arrange var document = ""; @@ -1695,7 +1695,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block9() + public void UnderstandsMinimizedAttributes_Block9() { // Arrange var document = ""; @@ -1708,7 +1708,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block10() + public void UnderstandsMinimizedAttributes_Block10() { // Arrange var document = ""; @@ -1721,7 +1721,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block11() + public void UnderstandsMinimizedAttributes_Block11() { // Arrange var document = ""; @@ -1734,7 +1734,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block12() + public void UnderstandsMinimizedAttributes_Block12() { // Arrange var document = ""; @@ -1747,7 +1747,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block13() + public void UnderstandsMinimizedAttributes_Block13() { // Arrange var document = ""; @@ -1760,7 +1760,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block14() + public void UnderstandsMinimizedAttributes_Block14() { // Arrange var document = ""; @@ -1773,7 +1773,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block15() + public void UnderstandsMinimizedAttributes_Block15() { // Arrange var document = ""; @@ -1786,7 +1786,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block16() + public void UnderstandsMinimizedAttributes_Block16() { // Arrange var document = ""; @@ -1799,7 +1799,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block17() + public void UnderstandsMinimizedAttributes_Block17() { // Arrange var document = "

          "; @@ -1812,7 +1812,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block18() + public void UnderstandsMinimizedAttributes_Block18() { // Arrange var document = ""; @@ -1825,7 +1825,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block19() + public void UnderstandsMinimizedAttributes_Block19() { // Arrange var document = "

          "; @@ -1838,7 +1838,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block20() + public void UnderstandsMinimizedAttributes_Block20() { // Arrange var document = ""; @@ -1851,7 +1851,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block21() + public void UnderstandsMinimizedAttributes_Block21() { // Arrange var document = "

          "; @@ -1864,7 +1864,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block22() + public void UnderstandsMinimizedAttributes_Block22() { // Arrange var document = ""; @@ -1877,7 +1877,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block23() + public void UnderstandsMinimizedAttributes_Block23() { // Arrange var document = "

          "; @@ -1890,7 +1890,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block24() + public void UnderstandsMinimizedAttributes_Block24() { // Arrange var document = ""; @@ -1903,7 +1903,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block25() + public void UnderstandsMinimizedAttributes_Block25() { // Arrange var document = ""; @@ -1916,7 +1916,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block26() + public void UnderstandsMinimizedAttributes_Block26() { // Arrange var document = ""; @@ -1929,7 +1929,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block27() + public void UnderstandsMinimizedAttributes_Block27() { // Arrange var document = "

          "; @@ -1942,7 +1942,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block28() + public void UnderstandsMinimizedAttributes_Block28() { // Arrange var document = ""; @@ -1955,7 +1955,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block29() + public void UnderstandsMinimizedAttributes_Block29() { // Arrange var document = "

          "; @@ -1968,7 +1968,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block30() + public void UnderstandsMinimizedAttributes_Block30() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -1982,7 +1982,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block31() + public void UnderstandsMinimizedAttributes_Block31() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -1996,7 +1996,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block32() + public void UnderstandsMinimizedAttributes_Block32() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -2010,7 +2010,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_Block33() + public void UnderstandsMinimizedAttributes_Block33() { // Arrange var expressionString = "@DateTime.Now + 1"; @@ -2024,55 +2024,55 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsMinimizedAttributes_PartialTags1() + public void UnderstandsMinimizedAttributes_PartialTags1() { EvaluateData(MinimizedAttribute_Descriptors, "{Environment.NewLine} {Environment.NewLine} Hello" + @@ -418,7 +419,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_RecoversWhenRequiredAttributeMismatchAndRestrictedChildren() + public void RecoversWhenRequiredAttributeMismatchAndRestrictedChildren() { // Arrange var documentContent = ""; @@ -438,7 +439,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_CanHandleMultipleTagHelpersWithAllowedChildren_OneNull() + public void CanHandleMultipleTagHelpersWithAllowedChildren_OneNull() { // Arrange var documentContent = "

          Hello World

          "; @@ -468,7 +469,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_CanHandleMultipleTagHelpersWithAllowedChildren() + public void CanHandleMultipleTagHelpersWithAllowedChildren() { // Arrange var documentContent = "

          Hello World

          "; @@ -498,7 +499,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren1() + public void UnderstandsAllowedChildren1() { // Arrange var documentContent = "


          "; @@ -509,7 +510,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren2() + public void UnderstandsAllowedChildren2() { // Arrange var documentContent = $"

          {Environment.NewLine}
          {Environment.NewLine}

          "; @@ -520,7 +521,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren3() + public void UnderstandsAllowedChildren3() { // Arrange var documentContent = "


          "; @@ -531,7 +532,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren4() + public void UnderstandsAllowedChildren4() { // Arrange var documentContent = "

          Hello

          "; @@ -542,7 +543,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren5() + public void UnderstandsAllowedChildren5() { // Arrange var documentContent = "


          "; @@ -553,7 +554,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren6() + public void UnderstandsAllowedChildren6() { // Arrange var documentContent = "


          Hello

          "; @@ -564,7 +565,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren7() + public void UnderstandsAllowedChildren7() { // Arrange var documentContent = "

          Title:
          Something

          "; @@ -575,7 +576,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren8() + public void UnderstandsAllowedChildren8() { // Arrange var documentContent = "

          Title:
          Something

          "; @@ -586,7 +587,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren9() + public void UnderstandsAllowedChildren9() { // Arrange var documentContent = "

          Title:
          Something

          "; @@ -597,7 +598,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren10() + public void UnderstandsAllowedChildren10() { // Arrange var documentContent = "

          Title:
          A Very Cool

          Something

          "; @@ -608,7 +609,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren11() + public void UnderstandsAllowedChildren11() { // Arrange var documentContent = "

          Title:
          A Very Cool

          Something

          "; @@ -619,7 +620,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren12() + public void UnderstandsAllowedChildren12() { // Arrange var documentContent = "

          "; @@ -630,7 +631,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren13() + public void UnderstandsAllowedChildren13() { // Arrange var documentContent = "

          <

          "; @@ -641,7 +642,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsAllowedChildren14() + public void UnderstandsAllowedChildren14() { // Arrange var documentContent = "


          :Hello:

          "; @@ -679,7 +680,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsSimpleHtmlCommentsAsChildren() + public void AllowsSimpleHtmlCommentsAsChildren() { // Arrange var allowedChildren = new List { "b" }; @@ -705,7 +706,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_DoesntAllowSimpleHtmlCommentsAsChildrenWhenFeatureFlagIsOff() + public void DoesntAllowSimpleHtmlCommentsAsChildrenWhenFeatureFlagIsOff() { // Arrange var allowedChildren = new List { "b" }; @@ -733,7 +734,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_FailsForContentWithCommentsAsChildren() + public void FailsForContentWithCommentsAsChildren() { // Arrange var allowedChildren = new List { "b" }; @@ -760,7 +761,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsRazorCommentsAsChildren() + public void AllowsRazorCommentsAsChildren() { // Arrange var allowedChildren = new List { "b" }; @@ -786,7 +787,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_AllowsRazorMarkupInHtmlComment() + public void AllowsRazorMarkupInHtmlComment() { // Arrange var allowedChildren = new List { "b" }; @@ -815,7 +816,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsNullTagNameWithAllowedChildrenForCatchAll() + public void UnderstandsNullTagNameWithAllowedChildrenForCatchAll() { // Arrange var documentContent = "

          "; @@ -835,7 +836,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_UnderstandsNullTagNameWithAllowedChildrenForCatchAllWithPrefix() + public void UnderstandsNullTagNameWithAllowedChildrenForCatchAllWithPrefix() { // Arrange var documentContent = ""; @@ -855,7 +856,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_CanHandleStartTagOnlyTagTagMode() + public void CanHandleStartTagOnlyTagTagMode() { // Arrange var documentContent = ""; @@ -874,7 +875,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_CreatesErrorForWithoutEndTagTagStructureForEndTags() + public void CreatesErrorForWithoutEndTagTagStructureForEndTags() { // Arrange var documentContent = ""; @@ -893,7 +894,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } [Fact] - public void Rewrite_CreatesErrorForInconsistentTagStructures() + public void CreatesErrorForInconsistentTagStructures() { // Arrange var documentContent = ""; @@ -941,181 +942,181 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly1() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly1() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly2() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly2() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly3() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly3() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly4() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly4() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly5() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly5() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly6() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly6() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly7() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly7() { EvaluateData(RequiredAttribute_Descriptors, "

          words and spaces

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly8() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly8() { EvaluateData(RequiredAttribute_Descriptors, "

          words and spaces

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly9() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly9() { EvaluateData(RequiredAttribute_Descriptors, "

          wordsandspaces

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly10() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly10() { EvaluateData(RequiredAttribute_Descriptors, ""); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly11() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly11() { EvaluateData(RequiredAttribute_Descriptors, ""); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly12() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly12() { EvaluateData(RequiredAttribute_Descriptors, "words and spaces"); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly13() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly13() { EvaluateData(RequiredAttribute_Descriptors, "words and spaces"); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly14() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly14() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly15() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly15() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly16() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly16() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly17() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly17() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly18() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly18() { EvaluateData(RequiredAttribute_Descriptors, "

          words and spaces

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly19() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly19() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly20() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly20() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly21() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly21() { EvaluateData(RequiredAttribute_Descriptors, "
          words and spaces
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly22() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly22() { EvaluateData(RequiredAttribute_Descriptors, "
          words and spaces
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly23() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly23() { EvaluateData(RequiredAttribute_Descriptors, "
          wordsandspaces
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly24() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly24() { EvaluateData(RequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly25() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly25() { EvaluateData(RequiredAttribute_Descriptors, "

          words and spaces

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly26() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly26() { EvaluateData(RequiredAttribute_Descriptors, "
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly27() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly27() { EvaluateData(RequiredAttribute_Descriptors, "
          words and spaces
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly28() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly28() { EvaluateData(RequiredAttribute_Descriptors, "
          words and spaces
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly29() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly29() { EvaluateData(RequiredAttribute_Descriptors, "
          words and spaces
          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly30() + public void RequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly30() { EvaluateData(RequiredAttribute_Descriptors, "
          wordsandspaces
          "); } @@ -1137,61 +1138,61 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly1() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly1() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly2() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly2() { EvaluateData(NestedRequiredAttribute_Descriptors, ""); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly3() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly3() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly4() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly4() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly5() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly5() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly6() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly6() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly7() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly7() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly8() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly8() { EvaluateData(NestedRequiredAttribute_Descriptors, ""); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly9() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly9() { EvaluateData(NestedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly10() + public void NestedRequiredAttributeDescriptorsCreateTagHelperBlocksCorrectly10() { EvaluateData(NestedRequiredAttribute_Descriptors, ""); } @@ -1207,61 +1208,61 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy }; [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateMalformedTagHelperBlocksCorrectly1() + public void RequiredAttributeDescriptorsCreateMalformedTagHelperBlocksCorrectly1() { EvaluateData(MalformedRequiredAttribute_Descriptors, ""); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateMalformedTagHelperBlocksCorrectly8() + public void RequiredAttributeDescriptorsCreateMalformedTagHelperBlocksCorrectly8() { EvaluateData(MalformedRequiredAttribute_Descriptors, "

          "); } [Fact] - public void Rewrite_RequiredAttributeDescriptorsCreateMalformedTagHelperBlocksCorrectly9() + public void RequiredAttributeDescriptorsCreateMalformedTagHelperBlocksCorrectly9() { EvaluateData(MalformedRequiredAttribute_Descriptors, "

          ", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers2() + public void AllowsPrefixedTagHelpers2() { EvaluateData(PrefixedTagHelperCatchAll_Descriptors, "words and spaces", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers3() + public void AllowsPrefixedTagHelpers3() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers4() + public void AllowsPrefixedTagHelpers4() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers5() + public void AllowsPrefixedTagHelpers5() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers6() + public void AllowsPrefixedTagHelpers6() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers7() + public void AllowsPrefixedTagHelpers7() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers8() + public void AllowsPrefixedTagHelpers8() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers9() + public void AllowsPrefixedTagHelpers9() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers10() + public void AllowsPrefixedTagHelpers10() { EvaluateData(PrefixedTagHelperColon_Descriptors, "words and spaces", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsPrefixedTagHelpers11() + public void AllowsPrefixedTagHelpers11() { EvaluateData(PrefixedTagHelperColon_Descriptors, "", tagHelperPrefix: "th:"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithAttributeTextTag1() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithAttrTextTag1() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithAttributeTextTag2() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithAttrTextTag2() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithAttributeTextTag3() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithAttrTextTag3() { RunParseTreeRewriterTest("@{words with spaces}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithAttributeTextTag4() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithAttrTextTag4() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithAttributeTextTag5() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithAttrTextTag5() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag1() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag1() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag2() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag2() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag3() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag3() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag4() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag4() { RunParseTreeRewriterTest("@{words and spaces}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag5() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag5() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag6() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag6() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag7() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag7() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag8() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag8() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag9() + public void AllowsTHElementOptForCompleteTextTagInCSharpBlock_WithBlockTextTag9() { RunParseTreeRewriterTest("@{}", "p", "text"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptForIncompleteTextTagInCSharpBlock1() + public void AllowsTagHelperElementOptForIncompleteTextTagInCSharpBlock1() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData2() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData2() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData3() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData3() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData4() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData4() { RunParseTreeRewriterTest("@{words and spaces}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData5() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData5() { RunParseTreeRewriterTest("@{

          }", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData6() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData6() { RunParseTreeRewriterTest("@{

          }", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData7() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData7() { RunParseTreeRewriterTest("@{

          }", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData8() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData8() { RunParseTreeRewriterTest("@{

          }", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData9() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData9() { RunParseTreeRewriterTest("@{

          }", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData10() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData10() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData11() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData11() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithBlockData12() + public void AllowsTagHelperElementOptOutCSharp_WithBlockData12() { RunParseTreeRewriterTest("@{

          }", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithAttributeData1() + public void AllowsTagHelperElementOptOutCSharp_WithAttributeData1() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithAttributeData2() + public void AllowsTagHelperElementOptOutCSharp_WithAttributeData2() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithAttributeData3() + public void AllowsTagHelperElementOptOutCSharp_WithAttributeData3() { RunParseTreeRewriterTest("@{words with spaces}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithAttributeData4() + public void AllowsTagHelperElementOptOutCSharp_WithAttributeData4() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutCSharp_WithAttributeData5() + public void AllowsTagHelperElementOptOutCSharp_WithAttributeData5() { RunParseTreeRewriterTest("@{}", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData1() + public void AllowsTagHelperElementOptOutHTML_WithBlockData1() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData2() + public void AllowsTagHelperElementOptOutHTML_WithBlockData2() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData3() + public void AllowsTagHelperElementOptOutHTML_WithBlockData3() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData4() + public void AllowsTagHelperElementOptOutHTML_WithBlockData4() { RunParseTreeRewriterTest("words and spaces", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData5() + public void AllowsTagHelperElementOptOutHTML_WithBlockData5() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData6() + public void AllowsTagHelperElementOptOutHTML_WithBlockData6() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData7() + public void AllowsTagHelperElementOptOutHTML_WithBlockData7() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData8() + public void AllowsTagHelperElementOptOutHTML_WithBlockData8() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData9() + public void AllowsTagHelperElementOptOutHTML_WithBlockData9() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData10() + public void AllowsTagHelperElementOptOutHTML_WithBlockData10() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData11() + public void AllowsTagHelperElementOptOutHTML_WithBlockData11() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithBlockData12() + public void AllowsTagHelperElementOptOutHTML_WithBlockData12() { RunParseTreeRewriterTest("

          ", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithAttributeData1() + public void AllowsTagHelperElementOptOutHTML_WithAttributeData1() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithAttributeData2() + public void AllowsTagHelperElementOptOutHTML_WithAttributeData2() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithAttributeData3() + public void AllowsTagHelperElementOptOutHTML_WithAttributeData3() { RunParseTreeRewriterTest("words and spaces", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithAttributeData4() + public void AllowsTagHelperElementOptOutHTML_WithAttributeData4() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void Rewrite_AllowsTagHelperElementOptOutHTML_WithAttributeData5() + public void AllowsTagHelperElementOptOutHTML_WithAttributeData5() { RunParseTreeRewriterTest("", "strong", "p"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteTextTagTransitionTagHelpers1() + public void DoesNotRewriteTextTagTransitionTagHelpers1() { RunParseTreeRewriterTest("Hello World", "p", "text"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteTextTagTransitionTagHelpers2() + public void DoesNotRewriteTextTagTransitionTagHelpers2() { RunParseTreeRewriterTest("@{Hello World}", "p", "text"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteTextTagTransitionTagHelpers3() + public void DoesNotRewriteTextTagTransitionTagHelpers3() { RunParseTreeRewriterTest("@{

          Hello World

          }", "p", "text"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteTextTagTransitionTagHelpers4() + public void DoesNotRewriteTextTagTransitionTagHelpers4() { RunParseTreeRewriterTest("@{

          Hello World

          }", "p", "text"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers1() + public void DoesNotRewriteSpecialTagTagHelpers1() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers2() + public void DoesNotRewriteSpecialTagTagHelpers2() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers3() + public void DoesNotRewriteSpecialTagTagHelpers3() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers4() + public void DoesNotRewriteSpecialTagTagHelpers4() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers5() + public void DoesNotRewriteSpecialTagTagHelpers5() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers6() + public void DoesNotRewriteSpecialTagTagHelpers6() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers7() + public void DoesNotRewriteSpecialTagTagHelpers7() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_DoesNotRewriteSpecialTagTagHelpers8() + public void DoesNotRewriteSpecialTagTagHelpers8() { RunParseTreeRewriterTest("", "!--", "?xml", "![CDATA[", "!DOCTYPE"); } [Fact] - public void TagHelperParseTreeRewriter_RewritesNestedTagHelperTagBlocks1() + public void RewritesNestedTagHelperTagBlocks1() { RunParseTreeRewriterTest("

          ", "p", "div"); } [Fact] - public void TagHelperParseTreeRewriter_RewritesNestedTagHelperTagBlocks2() + public void RewritesNestedTagHelperTagBlocks2() { RunParseTreeRewriterTest("

          Hello World

          ", "p", "div"); } [Fact] - public void TagHelperParseTreeRewriter_RewritesNestedTagHelperTagBlocks3() + public void RewritesNestedTagHelperTagBlocks3() { RunParseTreeRewriterTest("

          Hel

          lo

          World

          ", "p", "div"); } [Fact] - public void TagHelperParseTreeRewriter_RewritesNestedTagHelperTagBlocks4() + public void RewritesNestedTagHelperTagBlocks4() { RunParseTreeRewriterTest("

          Hello

          World

          ", "p", "div"); } [Fact] - public void Rewrite_HandlesMalformedNestedNonTagHelperTags_Correctly() + public void HandlesMalformedNestedNonTagHelperTags_Correctly() { RunParseTreeRewriterTest("
          @{
          }"); } diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/WhiteSpaceRewriterTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/WhiteSpaceRewriterTest.cs index 975912de80..856172a104 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/WhiteSpaceRewriterTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/WhiteSpaceRewriterTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public class WhiteSpaceRewriterTest : CsHtmlMarkupParserTestBase { [Fact] - public void Rewrite_Moves_Whitespace_Preceeding_ExpressionBlock_To_Parent_Block() + public void Moves_Whitespace_Preceeding_ExpressionBlock_To_Parent_Block() { // Arrange var parsed = ParseDocument( diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs index ef90477160..ff140b8489 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/ParserTestBase.cs @@ -110,10 +110,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy throw new InvalidOperationException(message); } - var baselineFileName = Path.ChangeExtension(FileName, ".syntaxtree.txt"); - var baselineDiagnosticsFileName = Path.ChangeExtension(FileName, ".diagnostics.txt"); - var baselineClassifiedSpansFileName = Path.ChangeExtension(FileName, ".classifiedspans.txt"); - var baselineTagHelperSpansFileName = Path.ChangeExtension(FileName, ".taghelperspans.txt"); + var baselineFileName = Path.ChangeExtension(FileName, ".stree.txt"); + var baselineDiagnosticsFileName = Path.ChangeExtension(FileName, ".diag.txt"); + var baselineClassifiedSpansFileName = Path.ChangeExtension(FileName, ".cspans.txt"); + var baselineTagHelperSpansFileName = Path.ChangeExtension(FileName, ".tspans.txt"); if (GenerateBaselines) {