From 9c4eee14b80c06419e8d4d18658ec1734bc3c960 Mon Sep 17 00:00:00 2001
From: "N. Taylor Mullen"
Date: Fri, 10 Jun 2016 12:00:28 -0700
Subject: [PATCH] Update tests to follow developer guidelines.
- Moved tests to match their corresponding test src files.
- Updated test namespaces to match their corresponding test src files.
#782
---
.../CSharpRazorCodeLanguageTest.cs | 2 +-
.../{Generators => }/ChunkTreeBuilderTest.cs | 4 +-
.../{Generators => }/ChunkVisitorTests.cs | 2 +-
.../AddImportChunkGeneratorTest.cs | 0
.../RazorCommentChunkGeneratorTest.cs | 0
.../CodeGenerators/CSharpCodeGeneratorTest.cs | 3 +-
.../CSharpPaddingBuilderTests.cs | 3 +-
...est.cs => CSharpRazorCodeGeneratorTest.cs} | 6 +-
.../CSharpTagHelperRenderingTest.cs | 18 +-
.../CSharpTagHelperRenderingUnitTest.cs | 4 +-
.../CodeGenTestCodeGenerator.cs | 2 +-
.../CodeGenerators/CodeGenTestHost.cs | 2 +-
.../CodeGenerators/LineMappingTest.cs | 2 +-
.../CodeGenerators/RazorChunkGeneratorTest.cs | 2 +-
.../CodeGenerators/TabTest.cs | 3 +-
...TagHelperAttributeValueCodeRendererTest.cs | 4 +-
.../CodeGenerators/TagHelperTestBase.cs | 6 +-
.../CodeGenerators/TestSpan.cs | 2 +-
.../TagHelperDescriptorProviderTest.cs | 0
.../TagHelpers/TagHelperDescriptorTest.cs | 3 +-
...agHelperRequiredAttributeDescriptorTest.cs | 0
.../Editor/AutoCompleteEditHandlerTest.cs | 4 +-
.../ImplicitExpressionEditHandlerTest.cs | 4 +-
.../Editor/RazorEditorParserTest.cs | 255 ------------------
.../Editor/SpanEditHandlerTest.cs | 4 +-
.../Framework/RawTextSymbol.cs | 2 +-
.../{CSharp => }/CSharpAutoCompleteTest.cs | 3 +-
.../Parser/{CSharp => }/CSharpBlockTest.cs | 3 +-
.../{CSharp => }/CSharpDirectivesTest.cs | 3 +-
.../Parser/{CSharp => }/CSharpErrorTest.cs | 3 +-
.../CSharpExplicitExpressionTest.cs | 2 +-
.../CSharpImplicitExpressionTest.cs | 3 +-
.../CSharpNestedStatementsTest.cs | 3 +-
.../{CSharp => }/CSharpRazorCommentsTest.cs | 3 +-
.../{CSharp => }/CSharpReservedWordsTest.cs | 3 +-
.../Parser/{CSharp => }/CSharpSectionTest.cs | 3 +-
.../{CSharp => }/CSharpSpecialBlockTest.cs | 3 +-
.../{CSharp => }/CSharpStatementTest.cs | 3 +-
.../Parser/{CSharp => }/CSharpTemplateTest.cs | 4 +-
.../{CSharp => }/CSharpToMarkupSwitchTest.cs | 7 +-
.../{CSharp => }/CSharpVerbatimBlockTest.cs | 2 +-
.../CSharpWhitespaceHandlingTest.cs | 4 +-
.../{Utils => Parser}/DisposableActionTest.cs | 3 +-
.../Parser/{Html => }/HtmlToCodeSwitchTest.cs | 5 +-
.../CallbackVisitorTest.cs} | 5 +-
.../{Html => Internal}/HtmlAttributeTest.cs | 4 +-
.../{Html => Internal}/HtmlBlockTest.cs | 4 +-
.../{Html => Internal}/HtmlDocumentTest.cs | 5 +-
.../{Html => Internal}/HtmlErrorTest.cs | 2 +-
.../{Html => Internal}/HtmlParserTestUtils.cs | 2 +-
.../Parser/{Html => Internal}/HtmlTagsTest.cs | 2 +-
.../Parser/ParserContextTest.cs | 4 +-
.../Parser/ParserVisitorExtensionsTest.cs | 5 +-
.../Parser/RazorParserTest.cs | 3 +-
.../Parser/{ => SyntaxTree}/BlockTest.cs | 3 +-
.../Internal}/TagHelperBlockRewriterTest.cs | 7 +-
.../TagHelperParseTreeRewriterTest.cs | 10 +-
.../Internal}/TagHelperRewritingTestBase.cs | 5 +-
.../{ => TagHelpers}/TagHelperBlockTest.cs | 0
.../TagHelperDirectiveSpanVisitorTest.cs | 5 +-
.../TextReaderExtensionsTest.cs | 4 +-
.../Parser/WhitespaceRewriterTest.cs | 3 +-
.../PartialParsingTestBase.cs | 2 +-
.../RazorCodeLanguageTest.cs | 2 +-
...arsingTest.cs => RazorEditorParserTest.cs} | 233 +++++++++++++++-
.../RazorEngineHostTest.cs | 2 +-
.../RazorTemplateEngineTest.cs | 2 +-
.../Output/EnumTagHelpers.DesignTime.cs | 6 +-
.../CodeGenerator/Output/EnumTagHelpers.cs | 6 +-
.../Text/LineTrackingStringBufferTest.cs | 3 +-
.../Text/LookaheadTextReaderTestBase.cs | 3 +-
.../Text/SourceLocationTrackerTest.cs | 3 +-
.../Text/TextChangeTest.cs | 4 +-
.../CSharpTokenizerCommentTest.cs | 3 +-
.../CSharpTokenizerIdentifierTest.cs | 3 +-
.../CSharpTokenizerLiteralTest.cs | 3 +-
.../CSharpTokenizerOperatorsTest.cs | 3 +-
.../{ => Internal}/CSharpTokenizerTest.cs | 3 +-
.../{ => Internal}/CSharpTokenizerTestBase.cs | 2 +-
.../{ => Internal}/HtmlTokenizerTest.cs | 4 +-
.../{ => Internal}/HtmlTokenizerTestBase.cs | 2 +-
.../{ => Internal}/TokenizerLookaheadTest.cs | 5 +-
.../Utils/ExceptionHelpers.cs | 2 +-
.../Utils/TestFile.cs | 2 +-
84 files changed, 352 insertions(+), 416 deletions(-)
rename test/Microsoft.AspNetCore.Razor.Test/Chunks/{Generators => }/ChunkTreeBuilderTest.cs (98%)
rename test/Microsoft.AspNetCore.Razor.Test/Chunks/{Generators => }/ChunkVisitorTests.cs (96%)
rename test/Microsoft.AspNetCore.Razor.Test/{CodeGenerators => Chunks/Generators}/AddImportChunkGeneratorTest.cs (100%)
rename test/Microsoft.AspNetCore.Razor.Test/{CodeGenerators => Chunks/Generators}/RazorCommentChunkGeneratorTest.cs (100%)
rename test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/{CSharpRazorChunkGeneratorTest.cs => CSharpRazorCodeGeneratorTest.cs} (99%)
rename test/Microsoft.AspNetCore.Razor.Test/{ => Compilation}/TagHelpers/TagHelperDescriptorProviderTest.cs (100%)
rename test/Microsoft.AspNetCore.Razor.Test/{ => Compilation}/TagHelpers/TagHelperDescriptorTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/{ => Compilation}/TagHelpers/TagHelperRequiredAttributeDescriptorTest.cs (100%)
delete mode 100644 test/Microsoft.AspNetCore.Razor.Test/Editor/RazorEditorParserTest.cs
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpAutoCompleteTest.cs (98%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpBlockTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpDirectivesTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpErrorTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpExplicitExpressionTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpImplicitExpressionTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpNestedStatementsTest.cs (97%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpRazorCommentsTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpReservedWordsTest.cs (94%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpSectionTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpSpecialBlockTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpStatementTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpTemplateTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpToMarkupSwitchTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpVerbatimBlockTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CSharp => }/CSharpWhitespaceHandlingTest.cs (92%)
rename test/Microsoft.AspNetCore.Razor.Test/{Utils => Parser}/DisposableActionTest.cs (87%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => }/HtmlToCodeSwitchTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{CallbackParserListenerTest.cs => Internal/CallbackVisitorTest.cs} (97%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => Internal}/HtmlAttributeTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => Internal}/HtmlBlockTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => Internal}/HtmlDocumentTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => Internal}/HtmlErrorTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => Internal}/HtmlParserTestUtils.cs (97%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{Html => Internal}/HtmlTagsTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{ => SyntaxTree}/BlockTest.cs (97%)
rename test/Microsoft.AspNetCore.Razor.Test/{TagHelpers => Parser/TagHelpers/Internal}/TagHelperBlockRewriterTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/{TagHelpers => Parser/TagHelpers/Internal}/TagHelperParseTreeRewriterTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/{TagHelpers => Parser/TagHelpers/Internal}/TagHelperRewritingTestBase.cs (97%)
rename test/Microsoft.AspNetCore.Razor.Test/Parser/{ => TagHelpers}/TagHelperBlockTest.cs (100%)
rename test/Microsoft.AspNetCore.Razor.Test/{ => Parser}/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs (99%)
rename test/Microsoft.AspNetCore.Razor.Test/{Text => Parser}/TextReaderExtensionsTest.cs (96%)
rename test/Microsoft.AspNetCore.Razor.Test/{Parser/PartialParsing => }/PartialParsingTestBase.cs (98%)
rename test/Microsoft.AspNetCore.Razor.Test/{Parser/PartialParsing/CSharpPartialParsingTest.cs => RazorEditorParserTest.cs} (77%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/CSharpTokenizerCommentTest.cs (97%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/CSharpTokenizerIdentifierTest.cs (98%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/CSharpTokenizerLiteralTest.cs (98%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/CSharpTokenizerOperatorsTest.cs (98%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/CSharpTokenizerTest.cs (96%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/CSharpTokenizerTestBase.cs (94%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/HtmlTokenizerTest.cs (97%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/HtmlTokenizerTestBase.cs (94%)
rename test/Microsoft.AspNetCore.Razor.Test/Tokenizer/{ => Internal}/TokenizerLookaheadTest.cs (97%)
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CSharpRazorCodeLanguageTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CSharpRazorCodeLanguageTest.cs
index 085e55595b..4b7cacf381 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CSharpRazorCodeLanguageTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CSharpRazorCodeLanguageTest.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.CodeGenerators;
using Microsoft.AspNetCore.Razor.Parser;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test
+namespace Microsoft.AspNetCore.Razor
{
public class CSharpRazorCodeLanguageTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/ChunkTreeBuilderTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Chunks/ChunkTreeBuilderTest.cs
similarity index 98%
rename from test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/ChunkTreeBuilderTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Chunks/ChunkTreeBuilderTest.cs
index cb93ea3601..170203304b 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/ChunkTreeBuilderTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Chunks/ChunkTreeBuilderTest.cs
@@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Chunks.Generators
+namespace Microsoft.AspNetCore.Razor.Chunks
{
public class ChunkTreeBuilderTest
{
@@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Razor.Chunks.Generators
var literalChunk = Assert.IsType(chunk);
Assert.Equal(2, literalChunk.Children.Count);
-
+
var span = Assert.IsType(literalChunk.Children[0].Association);
Assert.Same(span, previousSpan);
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/ChunkVisitorTests.cs b/test/Microsoft.AspNetCore.Razor.Test/Chunks/ChunkVisitorTests.cs
similarity index 96%
rename from test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/ChunkVisitorTests.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Chunks/ChunkVisitorTests.cs
index 6027984a40..12c629cf8a 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/ChunkVisitorTests.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Chunks/ChunkVisitorTests.cs
@@ -7,7 +7,7 @@ using Moq;
using Moq.Protected;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Chunks.Generators
+namespace Microsoft.AspNetCore.Razor.Chunks
{
public class ChunkVisitorTests
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/AddImportChunkGeneratorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/AddImportChunkGeneratorTest.cs
similarity index 100%
rename from test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/AddImportChunkGeneratorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/AddImportChunkGeneratorTest.cs
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/RazorCommentChunkGeneratorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/RazorCommentChunkGeneratorTest.cs
similarity index 100%
rename from test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/RazorCommentChunkGeneratorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Chunks/Generators/RazorCommentChunkGeneratorTest.cs
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpCodeGeneratorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpCodeGeneratorTest.cs
index 1103d4e4ae..baaada48d7 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpCodeGeneratorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpCodeGeneratorTest.cs
@@ -5,8 +5,7 @@
using System;
#endif
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
-using Microsoft.AspNetCore.Razor.Test;
-using Microsoft.AspNetCore.Razor.Test.Generator;
+using Microsoft.AspNetCore.Razor.Test.CodeGenerators;
using Microsoft.AspNetCore.Razor.Test.Utils;
using Moq;
using Xunit;
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpPaddingBuilderTests.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpPaddingBuilderTests.cs
index 33c18ca479..d2e39e757d 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpPaddingBuilderTests.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpPaddingBuilderTests.cs
@@ -5,13 +5,12 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.AspNetCore.Razor.CodeGenerators;
using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.CodeGenerators
{
public class CSharpPaddingBuilderTests
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpRazorChunkGeneratorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpRazorCodeGeneratorTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpRazorChunkGeneratorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpRazorCodeGeneratorTest.cs
index 68aa820afd..50aae30f47 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpRazorChunkGeneratorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpRazorCodeGeneratorTest.cs
@@ -4,13 +4,13 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.CodeGenerators;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
+using Microsoft.AspNetCore.Razor.Test.CodeGenerators;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.CodeGenerators
{
- public class RazorCodeGeneratorTest : RazorCodeGeneratorTest
+ public class CSharpRazorCodeGeneratorTest : RazorCodeGeneratorTest
{
protected override string FileExtension
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs
index 0647192014..0790e62896 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs
@@ -13,7 +13,7 @@ using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public class CSharpTagHelperRenderingTest : TagHelperTestBase
{
@@ -1832,31 +1832,31 @@ namespace Microsoft.AspNetCore.Razor.Test.Generator
documentAbsoluteIndex: 169,
documentLineIndex: 8,
documentCharacterOffsetIndex: 14,
- generatedAbsoluteIndex: 1929,
+ generatedAbsoluteIndex: 1934,
generatedLineIndex: 50,
- generatedCharacterOffsetIndex: 96,
+ generatedCharacterOffsetIndex: 101,
contentLength: 7),
BuildLineMapping(
documentAbsoluteIndex: 196,
documentLineIndex: 9,
documentCharacterOffsetIndex: 14,
- generatedAbsoluteIndex: 2312,
+ generatedAbsoluteIndex: 2322,
generatedLineIndex: 57,
- generatedCharacterOffsetIndex: 96,
+ generatedCharacterOffsetIndex: 101,
contentLength: 13),
BuildLineMapping(
documentAbsoluteIndex: 222,
documentLineIndex: 9,
documentCharacterOffsetIndex: 40,
- generatedAbsoluteIndex: 2495,
+ generatedAbsoluteIndex: 2510,
generatedLineIndex: 62,
- generatedCharacterOffsetIndex: 102,
+ generatedCharacterOffsetIndex: 107,
contentLength: 7),
BuildLineMapping(
documentAbsoluteIndex: 249,
documentLineIndex: 10,
documentCharacterOffsetIndex: 15,
- generatedAbsoluteIndex: 2821,
+ generatedAbsoluteIndex: 2836,
generatedLineIndex: 69,
generatedCharacterOffsetIndex: 39,
contentLength: 9),
@@ -1864,7 +1864,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Generator
documentAbsoluteIndex: 272,
documentLineIndex: 10,
documentCharacterOffsetIndex: 38,
- generatedAbsoluteIndex: 2943,
+ generatedAbsoluteIndex: 2958,
generatedLineIndex: 74,
generatedCharacterOffsetIndex: 45,
contentLength: 9),
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs
index e69b435682..3429212490 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs
@@ -4,13 +4,13 @@ using Microsoft.AspNetCore.Razor.Chunks;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.CodeGenerators;
using Microsoft.AspNetCore.Razor.CodeGenerators.Visitors;
+using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Parser.TagHelpers;
using Microsoft.AspNetCore.Razor.TagHelpers;
-using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public class CSharpTagHelperRenderingUnitTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestCodeGenerator.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestCodeGenerator.cs
index b4463c920a..20b47954ed 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestCodeGenerator.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestCodeGenerator.cs
@@ -3,7 +3,7 @@
using Microsoft.AspNetCore.Razor.CodeGenerators;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public class CodeGenTestCodeGenerator : CSharpCodeGenerator
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestHost.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestHost.cs
index fcb8933850..f8f3b6dc47 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestHost.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CodeGenTestHost.cs
@@ -3,7 +3,7 @@
using Microsoft.AspNetCore.Razor.CodeGenerators;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public class CodeGenTestHost : RazorEngineHost
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/LineMappingTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/LineMappingTest.cs
index 0eef4b4352..e40f350866 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/LineMappingTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/LineMappingTest.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Razor.CodeGenerators;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public class LineMappingTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/RazorChunkGeneratorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/RazorChunkGeneratorTest.cs
index 767415aaa1..87b18e5317 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/RazorChunkGeneratorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/RazorChunkGeneratorTest.cs
@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Razor.Test.Utils;
using Microsoft.AspNetCore.Testing;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public abstract class RazorCodeGeneratorTest
where TLanguage : RazorCodeLanguage, new()
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TabTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TabTest.cs
index cc8568e226..7970743d96 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TabTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TabTest.cs
@@ -2,7 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
[Flags]
public enum TabTest
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs
index 794bfab060..7da6268c91 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs
@@ -5,13 +5,13 @@ using System;
#if NETCOREAPP1_0
using System.Reflection;
#endif
-using Microsoft.AspNetCore.Razor.CodeGenerators;
using Microsoft.AspNetCore.Razor.CodeGenerators.Visitors;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Xunit;
+using Microsoft.AspNetCore.Razor.Test.CodeGenerators;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.CodeGenerators
{
public class TagHelperAttributeValueCodeRendererTest : TagHelperTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperTestBase.cs
index 9c878d5862..6e00c9b649 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperTestBase.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperTestBase.cs
@@ -6,12 +6,12 @@ using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Razor.CodeGenerators;
using Microsoft.AspNetCore.Razor.CodeGenerators.Visitors;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
+using Microsoft.AspNetCore.Razor.Parser;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
- public class TagHelperTestBase : RazorCodeGeneratorTest
+ public class TagHelperTestBase : CSharpRazorCodeGeneratorTest
{
protected void RunTagHelperTest(string testName,
string baseLineName = null,
diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TestSpan.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TestSpan.cs
index 2576878444..cdb4a62d71 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TestSpan.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TestSpan.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.Extensions.Internal;
-namespace Microsoft.AspNetCore.Razor.Test.Generator
+namespace Microsoft.AspNetCore.Razor.Test.CodeGenerators
{
public class TestSpan
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDescriptorProviderTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperDescriptorProviderTest.cs
similarity index 100%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDescriptorProviderTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperDescriptorProviderTest.cs
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperDescriptorTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperDescriptorTest.cs
index 12670dbf57..cc3747dcef 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperDescriptorTest.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-using System.Linq;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.AspNetCore.Razor.Test.Internal;
using Newtonsoft.Json;
@@ -66,7 +65,7 @@ namespace Microsoft.AspNetCore.Razor.Compilation.TagHelpers
$"\"{ nameof(TagHelperDescriptor.AllowedChildren) }\":[\"allowed child one\"]," +
$"\"{ nameof(TagHelperDescriptor.RequiredParent) }\":\"parent name\"," +
$"\"{ nameof(TagHelperDescriptor.TagStructure) }\":0," +
- $"\"{ nameof(TagHelperDescriptor.DesignTimeDescriptor) }\":{{"+
+ $"\"{ nameof(TagHelperDescriptor.DesignTimeDescriptor) }\":{{" +
$"\"{ nameof(TagHelperDesignTimeDescriptor.Summary) }\":\"usage summary\"," +
$"\"{ nameof(TagHelperDesignTimeDescriptor.Remarks) }\":\"usage remarks\"," +
$"\"{ nameof(TagHelperDesignTimeDescriptor.OutputElementHint) }\":\"some-tag\"}}}}";
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperRequiredAttributeDescriptorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperRequiredAttributeDescriptorTest.cs
similarity index 100%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperRequiredAttributeDescriptorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Compilation/TagHelpers/TagHelperRequiredAttributeDescriptorTest.cs
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs
index 2b7caabfd9..db1ef775d4 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs
@@ -2,11 +2,11 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Linq;
-using Microsoft.AspNetCore.Razor.Editor;
+using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Parser.SyntaxTree
+namespace Microsoft.AspNetCore.Razor.Editor
{
public class AutoCompleteEditHandlerTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs
index 31ebd8c87e..e8d21445ed 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs
@@ -4,11 +4,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.AspNetCore.Razor.Editor;
+using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Parser.SyntaxTree
+namespace Microsoft.AspNetCore.Razor.Editor
{
public class ImplicitExpressionEditHandlerTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/RazorEditorParserTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/RazorEditorParserTest.cs
deleted file mode 100644
index 4709db24b4..0000000000
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/RazorEditorParserTest.cs
+++ /dev/null
@@ -1,255 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Threading;
-using System.Web.WebPages.TestUtils;
-using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
-using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
-using Microsoft.AspNetCore.Razor.TagHelpers;
-using Microsoft.AspNetCore.Razor.Test.Framework;
-using Microsoft.AspNetCore.Razor.Test.Generator;
-using Microsoft.AspNetCore.Razor.Test.Utils;
-using Microsoft.AspNetCore.Razor.Text;
-using Microsoft.AspNetCore.Testing;
-using Xunit;
-
-namespace Microsoft.AspNetCore.Razor.Test.Editor
-{
- public class RazorEditorParserTest
- {
- private static readonly TestFile SimpleCSHTMLDocument = TestFile.Create("TestFiles/DesignTime/Simple.cshtml");
- private static readonly TestFile SimpleCSHTMLDocumentGenerated = TestFile.Create("TestFiles/DesignTime/Simple.txt");
- private const string TestLinePragmaFileName = "C:\\This\\Path\\Is\\Just\\For\\Line\\Pragmas.cshtml";
-
- [Fact]
- public void ConstructorRequiresNonNullPhysicalPath()
- {
- Assert.Throws("sourceFileName", () => new RazorEditorParser(CreateHost(), null));
- }
-
- [Fact]
- public void ConstructorRequiresNonEmptyPhysicalPath()
- {
- Assert.Throws("sourceFileName", () => new RazorEditorParser(CreateHost(), string.Empty));
- }
-
- [Theory]
- [InlineData(" ")]
- [InlineData("\r\n")]
- [InlineData("abcdefg")]
- [InlineData("\f\r\n abcd \t")]
- public void TreesAreDifferentReturnsFalseForAddedContent(string content)
- {
- // Arrange
- var factory = SpanFactory.CreateCsHtml();
- var blockFactory = new BlockFactory(factory);
- var original = new MarkupBlock(
- blockFactory.MarkupTagBlock(""),
- blockFactory.TagHelperBlock(
- tagName: "div",
- tagMode: TagMode.StartTagAndEndTag,
- start: new SourceLocation(3, 0, 3),
- startTag: blockFactory.MarkupTagBlock("
"),
- children: new SyntaxTreeNode[]
- {
- factory.Markup($"{Environment.NewLine}{Environment.NewLine}")
- },
- endTag: blockFactory.MarkupTagBlock("
")),
- blockFactory.MarkupTagBlock("
"));
-
- factory.Reset();
-
- var modified = new MarkupBlock(
- blockFactory.MarkupTagBlock(""),
- blockFactory.TagHelperBlock(
- tagName: "div",
- tagMode: TagMode.StartTagAndEndTag,
- start: new SourceLocation(3, 0, 3),
- startTag: blockFactory.MarkupTagBlock("
"),
- children: new SyntaxTreeNode[]
- {
- factory.Markup($"{Environment.NewLine}{content}{Environment.NewLine}")
- },
- endTag: blockFactory.MarkupTagBlock("
")),
- blockFactory.MarkupTagBlock(""));
- original.LinkNodes();
- modified.LinkNodes();
-
- var oldBuffer = new StringTextBuffer($"{Environment.NewLine}{Environment.NewLine}
");
- var newBuffer = new StringTextBuffer(
- $"{Environment.NewLine}{content}{Environment.NewLine}
");
-
- // Act
- var treesAreDifferent = BackgroundParser.TreesAreDifferent(
- original,
- modified,
- new[]
- {
- new TextChange(
- position: 8 + Environment.NewLine.Length,
- oldLength: 0,
- oldBuffer: oldBuffer,
- newLength: content.Length,
- newBuffer: newBuffer)
- });
-
- // Assert
- Assert.False(treesAreDifferent);
- }
-
- [Fact]
- public void TreesAreDifferentReturnsTrueIfTreeStructureIsDifferent()
- {
- var factory = SpanFactory.CreateCsHtml();
- var original = new MarkupBlock(
- factory.Markup(""),
- new ExpressionBlock(
- factory.CodeTransition()),
- factory.Markup("
"));
- var modified = new MarkupBlock(
- factory.Markup(""),
- new ExpressionBlock(
- factory.CodeTransition("@"),
- factory.Code("f")
- .AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false)),
- factory.Markup("
"));
- var oldBuffer = new StringTextBuffer("@
");
- var newBuffer = new StringTextBuffer("@f
");
- Assert.True(BackgroundParser.TreesAreDifferent(
- original,
- modified,
- new[]
- {
- new TextChange(position: 4, oldLength: 0, oldBuffer: oldBuffer, newLength: 1, newBuffer: newBuffer)
- }));
- }
-
- [Fact]
- public void TreesAreDifferentReturnsFalseIfTreeStructureIsSame()
- {
- var factory = SpanFactory.CreateCsHtml();
- var original = new MarkupBlock(
- factory.Markup(""),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("f")
- .AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false)),
- factory.Markup("
"));
- factory.Reset();
- var modified = new MarkupBlock(
- factory.Markup(""),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foo")
- .AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false)),
- factory.Markup("
"));
- original.LinkNodes();
- modified.LinkNodes();
- var oldBuffer = new StringTextBuffer("@f
");
- var newBuffer = new StringTextBuffer("@foo
");
- Assert.False(BackgroundParser.TreesAreDifferent(
- original,
- modified,
- new[]
- {
- new TextChange(position: 5, oldLength: 0, oldBuffer: oldBuffer, newLength: 2, newBuffer: newBuffer)
- }));
- }
-
- [Fact]
- public void CheckForStructureChangesRequiresNonNullBufferInChange()
- {
- var change = new TextChange();
- var parameterName = "change";
- var exception = Assert.Throws(
- parameterName,
- () =>
- {
- using (var parser = new RazorEditorParser(CreateHost(), "C:\\Foo.cshtml"))
- {
- parser.CheckForStructureChanges(change);
- }
- });
- ExceptionHelpers.ValidateArgumentException(parameterName, RazorResources.FormatStructure_Member_CannotBeNull(nameof(change.NewBuffer), nameof(TextChange)), exception);
- }
-
- private static RazorEngineHost CreateHost()
- {
- return new CodeGenTestHost(new CSharpRazorCodeLanguage()) { DesignTimeMode = true };
- }
-
- [Fact]
- [ReplaceCulture]
- public void CheckForStructureChangesStartsReparseAndFiresDocumentParseCompletedEventIfNoAdditionalChangesQueued()
- {
- // Arrange
- using (var parser = CreateClientParser())
- {
- var input = new StringTextBuffer(SimpleCSHTMLDocument.ReadAllText());
-
- DocumentParseCompleteEventArgs capturedArgs = null;
- var parseComplete = new ManualResetEventSlim(false);
-
- parser.DocumentParseComplete += (sender, args) =>
- {
- capturedArgs = args;
- parseComplete.Set();
- };
-
- // Act
- parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(string.Empty), input.Length, input));
-
- // Assert
- MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait);
-
- Assert.Equal(
- SimpleCSHTMLDocumentGenerated.ReadAllText(),
- capturedArgs.GeneratorResults.GeneratedCode);
- }
- }
-
- [Fact]
- public void CheckForStructureChangesStartsFullReparseIfChangeOverlapsMultipleSpans()
- {
- // Arrange
- using (var parser = new RazorEditorParser(CreateHost(), TestLinePragmaFileName))
- {
- var original = new StringTextBuffer("Foo @bar Baz");
- var changed = new StringTextBuffer("Foo @bap Daz");
- var change = new TextChange(7, 3, original, 3, changed);
-
- var parseComplete = new ManualResetEventSlim();
- var parseCount = 0;
- parser.DocumentParseComplete += (sender, args) =>
- {
- Interlocked.Increment(ref parseCount);
- parseComplete.Set();
- };
-
- Assert.Equal(PartialParseResult.Rejected, parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(string.Empty), 12, original)));
- MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait); // Wait for the parse to finish
- parseComplete.Reset();
-
- // Act
- var result = parser.CheckForStructureChanges(change);
-
- // Assert
- Assert.Equal(PartialParseResult.Rejected, result);
- MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait);
- Assert.Equal(2, parseCount);
- }
- }
-
- private TextChange CreateDummyChange()
- {
- return new TextChange(0, 0, new StringTextBuffer(string.Empty), 3, new StringTextBuffer("foo"));
- }
-
- private static RazorEditorParser CreateClientParser()
- {
- return new RazorEditorParser(CreateHost(), TestLinePragmaFileName);
- }
- }
-}
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs
index 0c91f59a9f..32ecc960b4 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs
@@ -3,11 +3,11 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.AspNetCore.Razor.Editor;
+using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Parser.SyntaxTree
+namespace Microsoft.AspNetCore.Razor.Editor
{
public class SpanEditHandlerTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Framework/RawTextSymbol.cs b/test/Microsoft.AspNetCore.Razor.Test/Framework/RawTextSymbol.cs
index 204c11b418..1392005df0 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Framework/RawTextSymbol.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Framework/RawTextSymbol.cs
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
namespace Microsoft.AspNetCore.Razor.Test.Framework
{
- internal class RawTextSymbol : ISymbol
+ public class RawTextSymbol : ISymbol
{
public SourceLocation Start { get; private set; }
public string Content { get; }
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpAutoCompleteTest.cs
similarity index 98%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpAutoCompleteTest.cs
index d7b50862d1..c4e5ef2a49 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpAutoCompleteTest.cs
@@ -4,13 +4,12 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpAutoCompleteTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpBlockTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpBlockTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpBlockTest.cs
index 68ea25e136..4d7b6f3344 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpBlockTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpBlockTest.cs
@@ -3,7 +3,6 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
@@ -11,7 +10,7 @@ using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpBlockTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpDirectivesTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpDirectivesTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpDirectivesTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpDirectivesTest.cs
index 58d7349c33..783d9f5c20 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpDirectivesTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpDirectivesTest.cs
@@ -2,12 +2,11 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpDirectivesTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpErrorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpErrorTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpErrorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpErrorTest.cs
index 4304cb2468..cbf910ad3f 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpErrorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpErrorTest.cs
@@ -3,12 +3,11 @@
using System;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpErrorTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpExplicitExpressionTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpExplicitExpressionTest.cs
index 8c22f472d3..6e83ef8f62 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpExplicitExpressionTest.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpExplicitExpressionTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpImplicitExpressionTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpImplicitExpressionTest.cs
index c2f0d5eab3..9de808cd63 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpImplicitExpressionTest.cs
@@ -2,12 +2,11 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpImplicitExpressionTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpNestedStatementsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpNestedStatementsTest.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpNestedStatementsTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpNestedStatementsTest.cs
index 5e06f7d282..74b7cb306f 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpNestedStatementsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpNestedStatementsTest.cs
@@ -1,12 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpNestedStatementsTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpRazorCommentsTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpRazorCommentsTest.cs
index b3762c6969..76e20cd585 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpRazorCommentsTest.cs
@@ -3,14 +3,13 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpRazorCommentsTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpReservedWordsTest.cs
similarity index 94%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpReservedWordsTest.cs
index 2f4653e3d9..3a979b8bc6 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpReservedWordsTest.cs
@@ -1,12 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class CSharpReservedWordsTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpSectionTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpSectionTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpSectionTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpSectionTest.cs
index d820ac3c1d..cf5eef4440 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpSectionTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpSectionTest.cs
@@ -3,14 +3,13 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class CSharpSectionTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpSpecialBlockTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpSpecialBlockTest.cs
index 0fdc1956ce..4e1eb88cff 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpSpecialBlockTest.cs
@@ -2,12 +2,11 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class CSharpSpecialBlockTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpStatementTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpStatementTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpStatementTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpStatementTest.cs
index 8ba179a850..ea59a08fd7 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpStatementTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpStatementTest.cs
@@ -3,12 +3,11 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
// Basic Tests for C# Statements:
// * Basic case for each statement
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpTemplateTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpTemplateTest.cs
index fd4f2f2743..149cff548c 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpTemplateTest.cs
@@ -4,15 +4,13 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
-using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class CSharpTemplateTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpToMarkupSwitchTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpToMarkupSwitchTest.cs
index 6aafc49b95..a1f68fe0ab 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpToMarkupSwitchTest.cs
@@ -2,16 +2,13 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
-using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpToMarkupSwitchTest : CsHtmlCodeParserTestBase
{
@@ -460,7 +457,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
Factory.Markup(Environment.NewLine).Accepts(AcceptedCharacters.None)
),
Factory.Code(
- $" return;{Environment.NewLine} case 2:{Environment.NewLine}"+
+ $" return;{Environment.NewLine} case 2:{Environment.NewLine}" +
" {" + Environment.NewLine).AsStatement(),
new MarkupBlock(
Factory.Markup(" "),
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpVerbatimBlockTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpVerbatimBlockTest.cs
index 3bae2da0e5..6e75ce3c4b 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpVerbatimBlockTest.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpVerbatimBlockTest : CsHtmlCodeParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpWhitespaceHandlingTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpWhitespaceHandlingTest.cs
similarity index 92%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpWhitespaceHandlingTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpWhitespaceHandlingTest.cs
index fe4777c5a6..f1ab422059 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharp/CSharpWhitespaceHandlingTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/CSharpWhitespaceHandlingTest.cs
@@ -3,14 +3,12 @@
using System;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
-using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.CSharp
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpWhitespaceHandlingTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Utils/DisposableActionTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/DisposableActionTest.cs
similarity index 87%
rename from test/Microsoft.AspNetCore.Razor.Test/Utils/DisposableActionTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/DisposableActionTest.cs
index 739bfe2f7b..b0693f9f1c 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Utils/DisposableActionTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/DisposableActionTest.cs
@@ -2,10 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Parser;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Utils
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class DisposableActionTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/HtmlToCodeSwitchTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/HtmlToCodeSwitchTest.cs
index 1c3e966643..72ab8560bc 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/HtmlToCodeSwitchTest.cs
@@ -4,15 +4,14 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
+using Microsoft.AspNetCore.Razor.Test.Parser.Internal;
using Microsoft.AspNetCore.Razor.Text;
-using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class HtmlToCodeSwitchTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/CallbackParserListenerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/CallbackVisitorTest.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/CallbackParserListenerTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/CallbackVisitorTest.cs
index b0bc578dfa..55c6ccc37c 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/CallbackParserListenerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/CallbackVisitorTest.cs
@@ -3,15 +3,14 @@
using System;
using System.Threading;
-using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Moq;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
- public class CallbackParserListenerTest
+ public class CallbackVisitorTest
{
[Fact]
public void ListenerConstructedWithSpanCallbackCallsCallbackOnEndSpan()
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlAttributeTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlAttributeTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlAttributeTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlAttributeTest.cs
index c692528971..dce5d1be23 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlAttributeTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlAttributeTest.cs
@@ -4,14 +4,12 @@
using System;
using System.Linq;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
-using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class HtmlAttributeTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlBlockTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlBlockTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlBlockTest.cs
index 70dc0d4e4f..9016339ad7 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlBlockTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlBlockTest.cs
@@ -4,8 +4,6 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
-using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
@@ -13,7 +11,7 @@ using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class HtmlBlockTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlDocumentTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlDocumentTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlDocumentTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlDocumentTest.cs
index ed4e7cdae0..08b677326a 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlDocumentTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlDocumentTest.cs
@@ -4,16 +4,15 @@
using System;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
using Microsoft.AspNetCore.Razor.Editor;
-using Microsoft.AspNetCore.Razor.Parser;
-using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
+using Microsoft.AspNetCore.Razor.Test.Utils;
using Microsoft.AspNetCore.Razor.Text;
using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class HtmlDocumentTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlErrorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlErrorTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlErrorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlErrorTest.cs
index f4c17490e5..977ac96782 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlErrorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlErrorTest.cs
@@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class HtmlErrorTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlParserTestUtils.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlParserTestUtils.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlParserTestUtils.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlParserTestUtils.cs
index 989fa9f9bc..5882914aa7 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlParserTestUtils.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlParserTestUtils.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Test.Parser.Internal
{
internal class HtmlParserTestUtils
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlTagsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlTagsTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlTagsTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlTagsTest.cs
index 3c02e82065..1b0774d105 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/Html/HtmlTagsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/Internal/HtmlTagsTest.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.Html
+namespace Microsoft.AspNetCore.Razor.Parser.Internal
{
public class HtmlTagsTest : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserContextTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserContextTest.cs
index 9e7b3803cb..6eb67feefe 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserContextTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserContextTest.cs
@@ -3,16 +3,16 @@
using System;
using System.IO;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
+using Microsoft.AspNetCore.Razor.Test.Utils;
using Microsoft.AspNetCore.Razor.Text;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Moq;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class ParserContextTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserVisitorExtensionsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserVisitorExtensionsTest.cs
index 964159d18d..3e57cb94a5 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserVisitorExtensionsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/ParserVisitorExtensionsTest.cs
@@ -3,13 +3,12 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.AspNetCore.Razor.Parser;
-using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
+using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Moq;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class ParserVisitorExtensionsTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/RazorParserTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/RazorParserTest.cs
index 220e710a5b..2615c55e5f 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/RazorParserTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/RazorParserTest.cs
@@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
@@ -14,7 +13,7 @@ using Moq;
using Moq.Protected;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class RazorParserTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/BlockTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/SyntaxTree/BlockTest.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/BlockTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/SyntaxTree/BlockTest.cs
index 7942637784..c89e213782 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/BlockTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/SyntaxTree/BlockTest.cs
@@ -4,12 +4,11 @@
using System.Linq;
using System.Web.WebPages.TestUtils;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser
+namespace Microsoft.AspNetCore.Razor.Parser.SyntaxTree
{
public class BlockTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperBlockRewriterTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperBlockRewriterTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperBlockRewriterTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperBlockRewriterTest.cs
index 9a159fe254..7cfc585aea 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperBlockRewriterTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperBlockRewriterTest.cs
@@ -6,16 +6,15 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
+using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
-using Microsoft.AspNetCore.Razor.Parser.TagHelpers;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.AspNetCore.Razor.Test.Framework;
-using Microsoft.AspNetCore.Razor.Test.TagHelpers;
+using Microsoft.AspNetCore.Razor.Test.Parser.TagHelpers.Internal;
using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Compilation.TagHelpers
+namespace Microsoft.AspNetCore.Razor.Parser.TagHelpers.Internal
{
public class TagHelperBlockRewriterTest : TagHelperRewritingTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperParseTreeRewriterTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperParseTreeRewriterTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperParseTreeRewriterTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperParseTreeRewriterTest.cs
index edc38baaf8..34e0135a1e 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperParseTreeRewriterTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperParseTreeRewriterTest.cs
@@ -6,18 +6,16 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.AspNetCore.Razor.Chunks.Generators;
-using Microsoft.AspNetCore.Razor.Parser;
+using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
+using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
using Microsoft.AspNetCore.Razor.TagHelpers;
-using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Razor.Test.Framework;
+using Microsoft.AspNetCore.Razor.Test.Parser.TagHelpers.Internal;
using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-using Microsoft.AspNetCore.Razor.Parser.TagHelpers.Internal;
-using Microsoft.AspNetCore.Razor.Parser.TagHelpers;
-using Microsoft.AspNetCore.Razor.Parser.Internal;
-namespace Microsoft.AspNetCore.Razor.Test.TagHelpers
+namespace Microsoft.AspNetCore.Razor.Parser.TagHelpers.Internal
{
public class TagHelperParseTreeRewriterTest : TagHelperRewritingTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperRewritingTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperRewritingTestBase.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperRewritingTestBase.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperRewritingTestBase.cs
index 4f71d0f535..4f3d2a3a75 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperRewritingTestBase.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/Internal/TagHelperRewritingTestBase.cs
@@ -3,15 +3,14 @@
using System.Collections.Generic;
using System.Linq;
+using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.TagHelpers.Internal;
-using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Text;
-using Microsoft.AspNetCore.Razor.Tokenizer;
using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
-namespace Microsoft.AspNetCore.Razor.Test.TagHelpers
+namespace Microsoft.AspNetCore.Razor.Test.Parser.TagHelpers.Internal
{
public class TagHelperRewritingTestBase : CsHtmlMarkupParserTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelperBlockTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/TagHelperBlockTest.cs
similarity index 100%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelperBlockTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/TagHelperBlockTest.cs
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs
similarity index 99%
rename from test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs
index fcb5282182..0975c4e0b0 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/TagHelpers/TagHelperDirectiveSpanVisitorTest.cs
@@ -4,16 +4,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.AspNetCore.Razor.Parser;
+using Microsoft.AspNetCore.Razor.Compilation.TagHelpers;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
-using Microsoft.AspNetCore.Razor.Parser.TagHelpers;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.Extensions.Internal;
using Moq;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Compilation.TagHelpers
+namespace Microsoft.AspNetCore.Razor.Parser.TagHelpers.Internal
{
public class TagHelperDirectiveSpanVisitorTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/TextReaderExtensionsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/TextReaderExtensionsTest.cs
similarity index 96%
rename from test/Microsoft.AspNetCore.Razor.Test/Text/TextReaderExtensionsTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Parser/TextReaderExtensionsTest.cs
index 3c42fb7369..53af2c9135 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Text/TextReaderExtensionsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/TextReaderExtensionsTest.cs
@@ -3,11 +3,9 @@
using System;
using System.IO;
-using Microsoft.AspNetCore.Razor.Parser;
-using Microsoft.AspNetCore.Razor.Parser.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Text
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class TextReaderExtensionsTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/WhitespaceRewriterTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Parser/WhitespaceRewriterTest.cs
index 29f8d42805..97c39bc981 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/WhitespaceRewriterTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Parser/WhitespaceRewriterTest.cs
@@ -1,12 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.Internal;
using Microsoft.AspNetCore.Razor.Test.Framework;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser
+namespace Microsoft.AspNetCore.Razor.Parser
{
public class WhitespaceRewriterTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test/PartialParsingTestBase.cs
similarity index 98%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs
rename to test/Microsoft.AspNetCore.Razor.Test/PartialParsingTestBase.cs
index a39b96e63b..79655dd3d6 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/PartialParsingTestBase.cs
@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Razor.Test.Utils;
using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.PartialParsing
+namespace Microsoft.AspNetCore.Razor
{
public abstract class PartialParsingTestBase
where TLanguage : RazorCodeLanguage, new()
diff --git a/test/Microsoft.AspNetCore.Razor.Test/RazorCodeLanguageTest.cs b/test/Microsoft.AspNetCore.Razor.Test/RazorCodeLanguageTest.cs
index eca16df9a6..0c92bbc20b 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/RazorCodeLanguageTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/RazorCodeLanguageTest.cs
@@ -3,7 +3,7 @@
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test
+namespace Microsoft.AspNetCore.Razor
{
public class RazorCodeLanguageTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Parser/PartialParsing/CSharpPartialParsingTest.cs b/test/Microsoft.AspNetCore.Razor.Test/RazorEditorParserTest.cs
similarity index 77%
rename from test/Microsoft.AspNetCore.Razor.Test/Parser/PartialParsing/CSharpPartialParsingTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/RazorEditorParserTest.cs
index 93b2419a7f..34e1e31a6e 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Parser/PartialParsing/CSharpPartialParsingTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/RazorEditorParserTest.cs
@@ -2,17 +2,241 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
+using System.Threading;
using System.Web.WebPages.TestUtils;
+using Microsoft.AspNetCore.Razor.Editor;
using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.SyntaxTree;
+using Microsoft.AspNetCore.Razor.TagHelpers;
+using Microsoft.AspNetCore.Razor.Test.CodeGenerators;
using Microsoft.AspNetCore.Razor.Test.Framework;
+using Microsoft.AspNetCore.Razor.Test.Utils;
using Microsoft.AspNetCore.Razor.Text;
+using Microsoft.AspNetCore.Testing;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Parser.PartialParsing
+namespace Microsoft.AspNetCore.Razor
{
- public class CSharpPartialParsingTest : PartialParsingTestBase
+ public class RazorEditorParserTest : PartialParsingTestBase
{
+ private static readonly TestFile SimpleCSHTMLDocument = TestFile.Create("TestFiles/DesignTime/Simple.cshtml");
+ private static readonly TestFile SimpleCSHTMLDocumentGenerated = TestFile.Create("TestFiles/DesignTime/Simple.txt");
+ private const string TestLinePragmaFileName = "C:\\This\\Path\\Is\\Just\\For\\Line\\Pragmas.cshtml";
+
+ [Fact]
+ public void ConstructorRequiresNonNullPhysicalPath()
+ {
+ Assert.Throws("sourceFileName", () => new RazorEditorParser(CreateCodeGenTestHost(), null));
+ }
+
+ [Fact]
+ public void ConstructorRequiresNonEmptyPhysicalPath()
+ {
+ Assert.Throws("sourceFileName", () => new RazorEditorParser(CreateCodeGenTestHost(), string.Empty));
+ }
+
+ [Theory]
+ [InlineData(" ")]
+ [InlineData("\r\n")]
+ [InlineData("abcdefg")]
+ [InlineData("\f\r\n abcd \t")]
+ public void TreesAreDifferentReturnsFalseForAddedContent(string content)
+ {
+ // Arrange
+ var factory = SpanFactory.CreateCsHtml();
+ var blockFactory = new BlockFactory(factory);
+ var original = new MarkupBlock(
+ blockFactory.MarkupTagBlock(""),
+ blockFactory.TagHelperBlock(
+ tagName: "div",
+ tagMode: TagMode.StartTagAndEndTag,
+ start: new SourceLocation(3, 0, 3),
+ startTag: blockFactory.MarkupTagBlock("
"),
+ children: new SyntaxTreeNode[]
+ {
+ factory.Markup($"{Environment.NewLine}{Environment.NewLine}")
+ },
+ endTag: blockFactory.MarkupTagBlock("
")),
+ blockFactory.MarkupTagBlock(""));
+
+ factory.Reset();
+
+ var modified = new MarkupBlock(
+ blockFactory.MarkupTagBlock(""),
+ blockFactory.TagHelperBlock(
+ tagName: "div",
+ tagMode: TagMode.StartTagAndEndTag,
+ start: new SourceLocation(3, 0, 3),
+ startTag: blockFactory.MarkupTagBlock("
"),
+ children: new SyntaxTreeNode[]
+ {
+ factory.Markup($"{Environment.NewLine}{content}{Environment.NewLine}")
+ },
+ endTag: blockFactory.MarkupTagBlock("
")),
+ blockFactory.MarkupTagBlock(""));
+ original.LinkNodes();
+ modified.LinkNodes();
+
+ var oldBuffer = new StringTextBuffer($"{Environment.NewLine}{Environment.NewLine}
");
+ var newBuffer = new StringTextBuffer(
+ $"{Environment.NewLine}{content}{Environment.NewLine}
");
+
+ // Act
+ var treesAreDifferent = BackgroundParser.TreesAreDifferent(
+ original,
+ modified,
+ new[]
+ {
+ new TextChange(
+ position: 8 + Environment.NewLine.Length,
+ oldLength: 0,
+ oldBuffer: oldBuffer,
+ newLength: content.Length,
+ newBuffer: newBuffer)
+ });
+
+ // Assert
+ Assert.False(treesAreDifferent);
+ }
+
+ [Fact]
+ public void TreesAreDifferentReturnsTrueIfTreeStructureIsDifferent()
+ {
+ var factory = SpanFactory.CreateCsHtml();
+ var original = new MarkupBlock(
+ factory.Markup(""),
+ new ExpressionBlock(
+ factory.CodeTransition()),
+ factory.Markup("
"));
+ var modified = new MarkupBlock(
+ factory.Markup(""),
+ new ExpressionBlock(
+ factory.CodeTransition("@"),
+ factory.Code("f")
+ .AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false)),
+ factory.Markup("
"));
+ var oldBuffer = new StringTextBuffer("@
");
+ var newBuffer = new StringTextBuffer("@f
");
+ Assert.True(BackgroundParser.TreesAreDifferent(
+ original,
+ modified,
+ new[]
+ {
+ new TextChange(position: 4, oldLength: 0, oldBuffer: oldBuffer, newLength: 1, newBuffer: newBuffer)
+ }));
+ }
+
+ [Fact]
+ public void TreesAreDifferentReturnsFalseIfTreeStructureIsSame()
+ {
+ var factory = SpanFactory.CreateCsHtml();
+ var original = new MarkupBlock(
+ factory.Markup(""),
+ new ExpressionBlock(
+ factory.CodeTransition(),
+ factory.Code("f")
+ .AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false)),
+ factory.Markup("
"));
+ factory.Reset();
+ var modified = new MarkupBlock(
+ factory.Markup(""),
+ new ExpressionBlock(
+ factory.CodeTransition(),
+ factory.Code("foo")
+ .AsImplicitExpression(CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false)),
+ factory.Markup("
"));
+ original.LinkNodes();
+ modified.LinkNodes();
+ var oldBuffer = new StringTextBuffer("@f
");
+ var newBuffer = new StringTextBuffer("@foo
");
+ Assert.False(BackgroundParser.TreesAreDifferent(
+ original,
+ modified,
+ new[]
+ {
+ new TextChange(position: 5, oldLength: 0, oldBuffer: oldBuffer, newLength: 2, newBuffer: newBuffer)
+ }));
+ }
+
+ [Fact]
+ public void CheckForStructureChangesRequiresNonNullBufferInChange()
+ {
+ var change = new TextChange();
+ var parameterName = "change";
+ var exception = Assert.Throws(
+ parameterName,
+ () =>
+ {
+ using (var parser = new RazorEditorParser(CreateCodeGenTestHost(), "C:\\Foo.cshtml"))
+ {
+ parser.CheckForStructureChanges(change);
+ }
+ });
+ ExceptionHelpers.ValidateArgumentException(parameterName, RazorResources.FormatStructure_Member_CannotBeNull(nameof(change.NewBuffer), nameof(TextChange)), exception);
+ }
+
+ [Fact]
+ [ReplaceCulture]
+ public void CheckForStructureChangesStartsReparseAndFiresDocumentParseCompletedEventIfNoAdditionalChangesQueued()
+ {
+ // Arrange
+ using (var parser = new RazorEditorParser(CreateCodeGenTestHost(), TestLinePragmaFileName))
+ {
+ var input = new StringTextBuffer(SimpleCSHTMLDocument.ReadAllText());
+
+ DocumentParseCompleteEventArgs capturedArgs = null;
+ var parseComplete = new ManualResetEventSlim(false);
+
+ parser.DocumentParseComplete += (sender, args) =>
+ {
+ capturedArgs = args;
+ parseComplete.Set();
+ };
+
+ // Act
+ parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(string.Empty), input.Length, input));
+
+ // Assert
+ MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait);
+
+ Assert.Equal(
+ SimpleCSHTMLDocumentGenerated.ReadAllText(),
+ capturedArgs.GeneratorResults.GeneratedCode);
+ }
+ }
+
+ [Fact]
+ public void CheckForStructureChangesStartsFullReparseIfChangeOverlapsMultipleSpans()
+ {
+ // Arrange
+ using (var parser = new RazorEditorParser(CreateHost(), TestLinePragmaFileName))
+ {
+ var original = new StringTextBuffer("Foo @bar Baz");
+ var changed = new StringTextBuffer("Foo @bap Daz");
+ var change = new TextChange(7, 3, original, 3, changed);
+
+ var parseComplete = new ManualResetEventSlim();
+ var parseCount = 0;
+ parser.DocumentParseComplete += (sender, args) =>
+ {
+ Interlocked.Increment(ref parseCount);
+ parseComplete.Set();
+ };
+
+ Assert.Equal(PartialParseResult.Rejected, parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(string.Empty), 12, original)));
+ MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait); // Wait for the parse to finish
+ parseComplete.Reset();
+
+ // Act
+ var result = parser.CheckForStructureChanges(change);
+
+ // Assert
+ Assert.Equal(PartialParseResult.Rejected, result);
+ MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait);
+ Assert.Equal(2, parseCount);
+ }
+ }
+
[Fact]
public void AwaitPeriodInsertionAcceptedProvisionally()
{
@@ -669,5 +893,10 @@ namespace Microsoft.AspNetCore.Razor.Test.Parser.PartialParsing
{
RunTypeKeywordTest("class");
}
+
+ private static RazorEngineHost CreateCodeGenTestHost()
+ {
+ return new CodeGenTestHost(new CSharpRazorCodeLanguage()) { DesignTimeMode = true };
+ }
}
}
diff --git a/test/Microsoft.AspNetCore.Razor.Test/RazorEngineHostTest.cs b/test/Microsoft.AspNetCore.Razor.Test/RazorEngineHostTest.cs
index 3c106917be..0ba3ae33e2 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/RazorEngineHostTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/RazorEngineHostTest.cs
@@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Razor.Parser;
using Microsoft.AspNetCore.Razor.Parser.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test
+namespace Microsoft.AspNetCore.Razor
{
public class RazorEngineHostTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/RazorTemplateEngineTest.cs b/test/Microsoft.AspNetCore.Razor.Test/RazorTemplateEngineTest.cs
index 9c4ac36159..122f84866e 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/RazorTemplateEngineTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/RazorTemplateEngineTest.cs
@@ -14,7 +14,7 @@ using Microsoft.AspNetCore.Razor.Text;
using Moq;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test
+namespace Microsoft.AspNetCore.Razor
{
public class RazorTemplateEngineTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.DesignTime.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.DesignTime.cs
index 6aa076dc2c..d751974b76 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.DesignTime.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.DesignTime.cs
@@ -48,19 +48,19 @@ __TestNamespace_InputTagHelper.Value = MyEnum.MyValue;
__TestNamespace_InputTagHelper = CreateTagHelper();
__TestNamespace_CatchAllTagHelper = CreateTagHelper();
#line 9 "EnumTagHelpers.cshtml"
-__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.Generator.MyEnum.MyValue;
+__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.CodeGenerators.MyEnum.MyValue;
#line default
#line hidden
__TestNamespace_InputTagHelper = CreateTagHelper();
__TestNamespace_CatchAllTagHelper = CreateTagHelper();
#line 10 "EnumTagHelpers.cshtml"
-__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.Generator.MyEnum.MySecondValue;
+__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.CodeGenerators.MyEnum.MySecondValue;
#line default
#line hidden
#line 10 "EnumTagHelpers.cshtml"
-__TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor.Test.Generator.MyEnum.MyValue;
+__TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor.Test.CodeGenerators.MyEnum.MyValue;
#line default
#line hidden
diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs
index c4432b399e..f2deaa0f28 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs
@@ -89,7 +89,7 @@ AddHtmlAttributeValue("", 128, MyEnum.MySecondValue, 128, 21, false);
__TestNamespace_CatchAllTagHelper = CreateTagHelper();
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
#line 9 "EnumTagHelpers.cshtml"
-__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.Generator.MyEnum.MyValue;
+__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.CodeGenerators.MyEnum.MyValue;
#line default
#line hidden
@@ -110,13 +110,13 @@ __TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.G
__TestNamespace_CatchAllTagHelper = CreateTagHelper();
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
#line 10 "EnumTagHelpers.cshtml"
-__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.Generator.MyEnum.MySecondValue;
+__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.CodeGenerators.MyEnum.MySecondValue;
#line default
#line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line 10 "EnumTagHelpers.cshtml"
-__TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor.Test.Generator.MyEnum.MyValue;
+__TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor.Test.CodeGenerators.MyEnum.MyValue;
#line default
#line hidden
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/LineTrackingStringBufferTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Text/LineTrackingStringBufferTest.cs
index 5a70a70870..9afaffeb25 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Text/LineTrackingStringBufferTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Text/LineTrackingStringBufferTest.cs
@@ -1,10 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Text
+namespace Microsoft.AspNetCore.Razor.Text
{
public class LineTrackingStringBufferTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/LookaheadTextReaderTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test/Text/LookaheadTextReaderTestBase.cs
index 08d94d1c7a..00348e916e 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Text/LookaheadTextReaderTestBase.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Text/LookaheadTextReaderTestBase.cs
@@ -3,10 +3,9 @@
using System;
using System.Text;
-using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Text
+namespace Microsoft.AspNetCore.Razor.Text
{
public abstract class LookaheadTextReaderTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/SourceLocationTrackerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Text/SourceLocationTrackerTest.cs
index 45bc7804a9..23a4ffc7b6 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Text/SourceLocationTrackerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Text/SourceLocationTrackerTest.cs
@@ -1,10 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Text;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Text
+namespace Microsoft.AspNetCore.Razor.Text
{
public class SourceLocationTrackerTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/TextChangeTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Text/TextChangeTest.cs
index c9abc11373..87db42f6c2 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Text/TextChangeTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Text/TextChangeTest.cs
@@ -3,11 +3,11 @@
using System;
using System.Web.WebPages.TestUtils;
-using Microsoft.AspNetCore.Razor.Text;
+using Microsoft.AspNetCore.Razor.Test.Utils;
using Moq;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Text
+namespace Microsoft.AspNetCore.Razor.Text
{
public class TextChangeTest
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerCommentTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerCommentTest.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerCommentTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerCommentTest.cs
index 0dff1fa68b..cdb179a51c 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerCommentTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerCommentTest.cs
@@ -1,10 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class CSharpTokenizerCommentTest : CSharpTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerIdentifierTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerIdentifierTest.cs
similarity index 98%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerIdentifierTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerIdentifierTest.cs
index 5d169c0f41..f742bc6e9d 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerIdentifierTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerIdentifierTest.cs
@@ -1,10 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class CSharpTokenizerIdentifierTest : CSharpTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerLiteralTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerLiteralTest.cs
similarity index 98%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerLiteralTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerLiteralTest.cs
index 407d90172f..8119a37603 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerLiteralTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerLiteralTest.cs
@@ -2,10 +2,11 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class CSharpTokenizerLiteralTest : CSharpTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerOperatorsTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerOperatorsTest.cs
similarity index 98%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerOperatorsTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerOperatorsTest.cs
index a98e7a62f8..a0eade3635 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerOperatorsTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerOperatorsTest.cs
@@ -1,10 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class CSharpTokenizerOperatorsTest : CSharpTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerTest.cs
similarity index 96%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerTest.cs
index cdf7be2c9e..67e035902c 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerTest.cs
@@ -1,10 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class CSharpTokenizerTest : CSharpTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerTestBase.cs
similarity index 94%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerTestBase.cs
index 915464bd3e..a91daa72e7 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/CSharpTokenizerTestBase.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.Tokenizer;
using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal
{
public abstract class CSharpTokenizerTestBase : TokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/HtmlTokenizerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/HtmlTokenizerTest.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/HtmlTokenizerTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/HtmlTokenizerTest.cs
index 547147264d..f36a82c9cb 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/HtmlTokenizerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/HtmlTokenizerTest.cs
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class HtmlTokenizerTest : HtmlTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/HtmlTokenizerTestBase.cs
similarity index 94%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/HtmlTokenizerTestBase.cs
index 704c6b8fc9..7795a3d55a 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/HtmlTokenizerTestBase.cs
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Razor.Tokenizer;
using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal
{
public abstract class HtmlTokenizerTestBase : TokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/TokenizerLookaheadTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/TokenizerLookaheadTest.cs
similarity index 97%
rename from test/Microsoft.AspNetCore.Razor.Test/Tokenizer/TokenizerLookaheadTest.cs
rename to test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/TokenizerLookaheadTest.cs
index 757e74793a..c0f006ab2a 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/TokenizerLookaheadTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Tokenizer/Internal/TokenizerLookaheadTest.cs
@@ -5,14 +5,13 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
+using Microsoft.AspNetCore.Razor.Test.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Text;
-using Microsoft.AspNetCore.Razor.Tokenizer;
-using Microsoft.AspNetCore.Razor.Tokenizer.Internal;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols.Internal;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test.Tokenizer
+namespace Microsoft.AspNetCore.Razor.Tokenizer.Internal
{
public class TokenizerLookaheadTest : HtmlTokenizerTestBase
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Utils/ExceptionHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/Utils/ExceptionHelpers.cs
index b15f886fcc..ed1f35a61f 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Utils/ExceptionHelpers.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Utils/ExceptionHelpers.cs
@@ -4,7 +4,7 @@
using System;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test
+namespace Microsoft.AspNetCore.Razor.Test.Utils
{
public static class ExceptionHelpers
{
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Utils/TestFile.cs b/test/Microsoft.AspNetCore.Razor.Test/Utils/TestFile.cs
index a24b675835..9a5dee760e 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Utils/TestFile.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Utils/TestFile.cs
@@ -6,7 +6,7 @@ using System.IO;
using System.Reflection;
using Xunit;
-namespace Microsoft.AspNetCore.Razor.Test
+namespace Microsoft.AspNetCore.Razor.Test.Utils
{
public class TestFile
{