Move test infrastructure

This moves the test infrastructure to a common project and udpates the MVC
tests to use the good integration testing features.
This commit is contained in:
Ryan Nowak 2017-04-10 19:22:18 -07:00
parent 1262a6d4b2
commit 207f40f92d
87 changed files with 1827 additions and 401 deletions

View File

@ -36,7 +36,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
return codeDocument;
}
private static RazorSourceDocument GetDefaultImports()
// Internal for testing.
internal static RazorSourceDocument GetDefaultImports()
{
using (var stream = new MemoryStream())
using (var writer = new StreamWriter(stream, Encoding.UTF8))

View File

@ -1,304 +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.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.Extensions.DependencyModel;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
{
public class CodeGenerationTests
{
private static Assembly _assembly = typeof(CodeGenerationTests).GetTypeInfo().Assembly;
#region Runtime
[Fact]
public void RazorEngine_Basic_Runtime()
{
RunRuntimeTest("Basic");
}
[Fact]
public void RazorEngine_ViewImports_Runtime()
{
RunRuntimeTest("_ViewImports");
}
[Fact]
public void RazorEngine_Inject_Runtime()
{
RunRuntimeTest("Inject");
}
[Fact]
public void RazorEngine_InjectWithModel_Runtime()
{
RunRuntimeTest("InjectWithModel");
}
[Fact]
public void RazorEngine_InjectWithSemicolon_Runtime()
{
RunRuntimeTest("InjectWithSemicolon");
}
[Fact]
public void RazorEngine_Model_Runtime()
{
RunRuntimeTest("Model");
}
[Fact]
public void RazorEngine_ModelExpressionTagHelper_Runtime()
{
RunRuntimeTest("ModelExpressionTagHelper");
}
[Fact]
public void RazorEngine_RazorPages_Runtime()
{
RunRuntimeTest("RazorPages", BuildDivDescriptors());
}
[Fact]
public void RazorEngine_RazorPagesWithoutModel_Runtime()
{
RunRuntimeTest("RazorPagesWithoutModel", BuildDivDescriptors());
}
#endregion
#region DesignTime
[Fact]
public void RazorEngine_Basic_DesignTime()
{
RunDesignTimeTest("Basic");
}
[Fact]
public void RazorEngine_ViewImports_DesignTime()
{
RunDesignTimeTest("_ViewImports");
}
[Fact]
public void RazorEngine_Inject_DesignTime()
{
RunDesignTimeTest("Inject");
}
[Fact]
public void RazorEngine_InjectWithModel_DesignTime()
{
RunDesignTimeTest("InjectWithModel");
}
[Fact]
public void RazorEngine_InjectWithSemicolon_DesignTime()
{
RunDesignTimeTest("InjectWithSemicolon");
}
[Fact]
public void RazorEngine_Model_DesignTime()
{
RunDesignTimeTest("Model");
}
[Fact]
public void RazorEngine_MultipleModels_DesignTime()
{
RunDesignTimeTest("MultipleModels");
}
[Fact]
public void RazorEngine_ModelExpressionTagHelper_DesignTime()
{
RunDesignTimeTest("ModelExpressionTagHelper");
}
[Fact]
public void RazorEngine_RazorPages_DesignTime()
{
RunDesignTimeTest("RazorPages", BuildDivDescriptors());
}
[Fact]
public void RazorEngine_RazorPagesWithoutModel_DesignTime()
{
RunDesignTimeTest("RazorPagesWithoutModel", BuildDivDescriptors());
}
#endregion
private static void RunRuntimeTest(string testName, IEnumerable<TagHelperDescriptor> descriptors = null)
{
// Arrange
var inputFile = "TestFiles/Input/" + testName + ".cshtml";
var outputFile = "TestFiles/Output/Runtime/" + testName + ".cs";
var expectedCode = ResourceFile.ReadResource(_assembly, outputFile, sourceFile: false);
var engine = RazorEngine.Create(b =>
{
RazorExtensions.Register(b);
b.Features.Add(GetMetadataReferenceFeature());
if (descriptors != null)
{
b.AddTagHelpers(descriptors);
}
else
{
b.Features.Add(new DefaultTagHelperFeature());
}
});
var inputContent = ResourceFile.ReadResource(_assembly, inputFile, sourceFile: true);
var item = new TestRazorProjectItem("/" + inputFile) { Content = inputContent, };
var project = new TestRazorProject(new List<RazorProjectItem>()
{
item,
});
var razorTemplateEngine = new MvcRazorTemplateEngine(engine, project);
razorTemplateEngine.Options.ImportsFileName = "_ViewImports.cshtml";
var codeDocument = razorTemplateEngine.CreateCodeDocument(item);
codeDocument.Items["SuppressUniqueIds"] = "test";
codeDocument.Items["NewLineString"] = "\r\n";
// Act
var csharpDocument = razorTemplateEngine.GenerateCode(codeDocument);
// Assert
Assert.Empty(csharpDocument.Diagnostics);
#if GENERATE_BASELINES
ResourceFile.UpdateFile(_assembly, outputFile, expectedCode, csharpDocument.GeneratedCode);
#else
Assert.Equal(expectedCode, csharpDocument.GeneratedCode, ignoreLineEndingDifferences: true);
#endif
}
private static void RunDesignTimeTest(string testName, IEnumerable<TagHelperDescriptor> descriptors = null)
{
// Arrange
var inputFile = "TestFiles/Input/" + testName + ".cshtml";
var outputFile = "TestFiles/Output/DesignTime/" + testName + ".cs";
var expectedCode = ResourceFile.ReadResource(_assembly, outputFile, sourceFile: false);
var lineMappingOutputFile = "TestFiles/Output/DesignTime/" + testName + ".mappings.txt";
var expectedMappings = ResourceFile.ReadResource(_assembly, lineMappingOutputFile, sourceFile: false);
var engine = RazorEngine.CreateDesignTime(b =>
{
RazorExtensions.Register(b);
b.Features.Add(GetMetadataReferenceFeature());
if (descriptors != null)
{
b.AddTagHelpers(descriptors);
}
else
{
b.Features.Add(new DefaultTagHelperFeature());
}
});
var inputContent = ResourceFile.ReadResource(_assembly, inputFile, sourceFile: true);
var item = new TestRazorProjectItem("/" + inputFile) { Content = inputContent, };
var project = new TestRazorProject(new List<RazorProjectItem>()
{
item,
});
var razorTemplateEngine = new MvcRazorTemplateEngine(engine, project);
razorTemplateEngine.Options.ImportsFileName = "_ViewImports.cshtml";
var codeDocument = razorTemplateEngine.CreateCodeDocument(item);
codeDocument.Items["SuppressUniqueIds"] = "test";
codeDocument.Items["NewLineString"] = "\r\n";
// Act
var csharpDocument = razorTemplateEngine.GenerateCode(codeDocument);
// Assert
Assert.Empty(csharpDocument.Diagnostics);
var serializedMappings = LineMappingsSerializer.Serialize(csharpDocument, codeDocument.Source);
#if GENERATE_BASELINES
ResourceFile.UpdateFile(_assembly, outputFile, expectedCode, csharpDocument.GeneratedCode);
ResourceFile.UpdateFile(_assembly, lineMappingOutputFile, expectedMappings, serializedMappings);
#else
Assert.Equal(expectedCode, csharpDocument.GeneratedCode, ignoreLineEndingDifferences: true);
Assert.Equal(expectedMappings, serializedMappings, ignoreLineEndingDifferences: true);
#endif
}
private static IEnumerable<TagHelperDescriptor> BuildDivDescriptors()
{
return new List<TagHelperDescriptor> {
BuildDescriptor("div", "DivTagHelper", "TestAssembly"),
BuildDescriptor("a", "UrlResolutionTagHelper", "Microsoft.AspNetCore.Mvc.Razor")
};
}
private static TagHelperDescriptor BuildDescriptor(
string tagName,
string typeName,
string assemblyName)
{
return ITagHelperDescriptorBuilder.Create(typeName, assemblyName)
.TagMatchingRule(ruleBuilder => ruleBuilder.RequireTagName(tagName))
.Build();
}
private static IRazorEngineFeature GetMetadataReferenceFeature()
{
var currentAssembly = typeof(CodeGenerationTests).GetTypeInfo().Assembly;
var dependencyContext = DependencyContext.Load(currentAssembly);
var references = dependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths())
.Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath))
.ToList<MetadataReference>();
var syntaxTree = CreateTagHelperSyntaxTree();
var compilation = CSharpCompilation.Create("Microsoft.AspNetCore.Mvc.Razor", syntaxTree, references,
options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
var stream = new MemoryStream();
var compilationResult = compilation.Emit(stream, options: new EmitOptions());
stream.Position = 0;
Assert.True(compilationResult.Success);
references.Add(MetadataReference.CreateFromStream(stream));
var feature = new DefaultMetadataReferenceFeature()
{
References = references,
};
return feature;
}
private static IEnumerable<SyntaxTree> CreateTagHelperSyntaxTree()
{
var text = $@"
public class UrlResolutionTagHelper : {typeof(TagHelper).FullName}
{{
}}";
return new SyntaxTree[] { CSharpSyntaxTree.ParseText(text) };
}
}
}

View File

@ -0,0 +1,419 @@
// 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.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.IntegrationTests;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.Extensions.DependencyModel;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests
{
public class CodeGenerationIntegrationTest : IntegrationTestBase
{
private static readonly RazorSourceDocument DefaultImports = MvcRazorTemplateEngine.GetDefaultImports();
#region Runtime
[Fact]
public void Basic_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void _ViewImports_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void Inject_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void InjectWithModel_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void InjectWithSemicolon_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void Model_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void ModelExpressionTagHelper_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void RazorPages_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine(BuildDivDescriptors());
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void RazorPagesWithoutModel_Runtime()
{
// Arrange
var engine = CreateRuntimeEngine(BuildDivDescriptors());
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
#endregion
#region DesignTime
[Fact]
public void Basic_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void _ViewImports_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void Inject_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void InjectWithModel_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void InjectWithSemicolon_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void Model_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void MultipleModels_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void ModelExpressionTagHelper_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine();
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void RazorPages_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine(BuildDivDescriptors());
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
[Fact]
public void RazorPagesWithoutModel_DesignTime()
{
// Arrange
var engine = CreateDesignTimeEngine(BuildDivDescriptors());
var document = CreateCodeDocument();
// Act
engine.Process(document);
// Assert
AssertIRMatchesBaseline(document.GetIRDocument());
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
}
#endregion
protected RazorEngine CreateDesignTimeEngine(IEnumerable<TagHelperDescriptor> descriptors = null)
{
return RazorEngine.CreateDesignTime(b =>
{
RazorExtensions.Register(b);
b.Features.Add(GetMetadataReferenceFeature());
if (descriptors != null)
{
b.AddTagHelpers(descriptors);
}
else
{
b.Features.Add(new DefaultTagHelperFeature());
}
});
}
protected RazorEngine CreateRuntimeEngine(IEnumerable<TagHelperDescriptor> descriptors = null)
{
return RazorEngine.Create(b =>
{
RazorExtensions.Register(b);
b.Features.Add(GetMetadataReferenceFeature());
if (descriptors != null)
{
b.AddTagHelpers(descriptors);
}
else
{
b.Features.Add(new DefaultTagHelperFeature());
}
});
}
protected override void OnCreatingCodeDocument(ref RazorSourceDocument source, IList<RazorSourceDocument> imports)
{
imports.Add(DefaultImports);
}
private static IEnumerable<TagHelperDescriptor> BuildDivDescriptors()
{
return new List<TagHelperDescriptor>
{
BuildDescriptor("div", "DivTagHelper", "TestAssembly"),
BuildDescriptor("a", "UrlResolutionTagHelper", "Microsoft.AspNetCore.Mvc.Razor")
};
}
private static TagHelperDescriptor BuildDescriptor(
string tagName,
string typeName,
string assemblyName)
{
return ITagHelperDescriptorBuilder.Create(typeName, assemblyName)
.TagMatchingRule(ruleBuilder => ruleBuilder.RequireTagName(tagName))
.Build();
}
private static IRazorEngineFeature GetMetadataReferenceFeature()
{
var currentAssembly = typeof(CodeGenerationIntegrationTest).GetTypeInfo().Assembly;
var dependencyContext = DependencyContext.Load(currentAssembly);
var references = dependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths())
.Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath))
.ToList<MetadataReference>();
var syntaxTree = CreateTagHelperSyntaxTree();
var compilation = CSharpCompilation.Create(
"Microsoft.AspNetCore.Mvc.Razor",
syntaxTree,
references,
options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
var stream = new MemoryStream();
var compilationResult = compilation.Emit(stream, options: new EmitOptions());
stream.Position = 0;
Assert.True(compilationResult.Success);
references.Add(MetadataReference.CreateFromStream(stream));
var feature = new DefaultMetadataReferenceFeature()
{
References = references,
};
return feature;
}
private static IEnumerable<SyntaxTree> CreateTagHelperSyntaxTree()
{
var text = $@"
public class UrlResolutionTagHelper : {typeof(TagHelper).FullName}
{{
}}";
return new SyntaxTree[] { CSharpSyntaxTree.ParseText(text) };
}
}
}

View File

@ -6,8 +6,6 @@
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp2.0</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<DefineConstants Condition="'$(GenerateBaselines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants>
<DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

View File

@ -0,0 +1,56 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = global::System.Object
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (0:0,0 [4] Basic.cshtml)
RazorIRToken - (0:0,0 [4] Basic.cshtml) - Html - <div
HtmlAttribute - (4:0,4 [14] Basic.cshtml) - class=" - "
CSharpAttributeValue - (12:0,12 [5] Basic.cshtml) -
CSharpExpression - (13:0,13 [4] Basic.cshtml)
RazorIRToken - (13:0,13 [4] Basic.cshtml) - CSharp - logo
HtmlContent - (18:0,18 [24] Basic.cshtml)
RazorIRToken - (18:0,18 [1] Basic.cshtml) - Html - >
RazorIRToken - (19:0,19 [23] Basic.cshtml) - Html - \n Hello world\n
CSharpExpression - (43:2,5 [21] Basic.cshtml)
RazorIRToken - (43:2,5 [21] Basic.cshtml) - CSharp - Html.Input("SomeKey")
HtmlContent - (64:2,26 [8] Basic.cshtml)
RazorIRToken - (64:2,26 [2] Basic.cshtml) - Html - \n
RazorIRToken - (66:3,0 [6] Basic.cshtml) - Html - </div>
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,48 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(0, 4, true);
HtmlContent - (0:0,0 [4] Basic.cshtml)
RazorIRToken - (0:0,0 [4] Basic.cshtml) - Html - <div
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
HtmlAttribute - (4:0,4 [14] Basic.cshtml) - class=" - "
CSharpAttributeValue - (12:0,12 [5] Basic.cshtml) -
CSharpExpression - (13:0,13 [4] Basic.cshtml)
RazorIRToken - (13:0,13 [4] Basic.cshtml) - CSharp - logo
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(18, 24, true);
HtmlContent - (18:0,18 [24] Basic.cshtml)
RazorIRToken - (18:0,18 [1] Basic.cshtml) - Html - >
RazorIRToken - (19:0,19 [19] Basic.cshtml) - Html - \n Hello world\n
RazorIRToken - (38:2,0 [4] Basic.cshtml) - Html -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(43, 21, false);
CSharpExpression - (43:2,5 [21] Basic.cshtml)
RazorIRToken - (43:2,5 [21] Basic.cshtml) - CSharp - Html.Input("SomeKey")
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(64, 8, true);
HtmlContent - (64:2,26 [8] Basic.cshtml)
RazorIRToken - (64:2,26 [2] Basic.cshtml) - Html - \n
RazorIRToken - (66:3,0 [6] Basic.cshtml) - Html - </div>
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,48 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = MyModel
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (7:0,7 [7] InjectWithModel.cshtml) - MyModel
DirectiveToken - (24:1,8 [5] InjectWithModel.cshtml) - MyApp
DirectiveToken - (30:1,14 [14] InjectWithModel.cshtml) - MyPropertyName
DirectiveToken - (54:2,8 [17] InjectWithModel.cshtml) - MyService<TModel>
DirectiveToken - (72:2,26 [4] InjectWithModel.cshtml) - Html
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,18 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel> -
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,54 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = MyModel
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (7:0,7 [7] InjectWithSemicolon.cshtml) - MyModel
DirectiveToken - (24:1,8 [5] InjectWithSemicolon.cshtml) - MyApp
DirectiveToken - (30:1,14 [14] InjectWithSemicolon.cshtml) - MyPropertyName
DirectiveToken - (58:2,8 [17] InjectWithSemicolon.cshtml) - MyService<TModel>
DirectiveToken - (76:2,26 [4] InjectWithSemicolon.cshtml) - Html
DirectiveToken - (93:3,8 [5] InjectWithSemicolon.cshtml) - MyApp
DirectiveToken - (99:3,14 [15] InjectWithSemicolon.cshtml) - MyPropertyName2
DirectiveToken - (129:4,8 [17] InjectWithSemicolon.cshtml) - MyService<TModel>
DirectiveToken - (147:4,26 [5] InjectWithSemicolon.cshtml) - Html2
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,20 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel> -
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,48 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = global::System.Object
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
UsingStatement - (1:0,1 [17] Inject.cshtml) - MyNamespace
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (28:1,8 [5] Inject.cshtml) - MyApp
DirectiveToken - (34:1,14 [14] Inject.cshtml) - MyPropertyName
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (18:0,18 [2] Inject.cshtml)
RazorIRToken - (18:0,18 [2] Inject.cshtml) - Html - \n
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,19 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
UsingStatement - (1:0,1 [19] Inject.cshtml) - MyNamespace
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,72 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = DateTime
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (7:0,7 [8] ModelExpressionTagHelper.cshtml) - DateTime
DirectiveToken - (33:2,14 [108] ModelExpressionTagHelper.cshtml) - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Extensions.Test
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
DeclareTagHelperFields - - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (17:1,0 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (17:1,0 [2] ModelExpressionTagHelper.cshtml) - Html - \n
HtmlContent - (141:2,122 [4] ModelExpressionTagHelper.cshtml)
RazorIRToken - (141:2,122 [4] ModelExpressionTagHelper.cshtml) - Html - \n\n
TagHelper - (145:4,0 [24] ModelExpressionTagHelper.cshtml)
InitializeTagHelperStructure - - input-test - TagMode.SelfClosing
CreateTagHelper - - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper
SetTagHelperProperty - (162:4,17 [3] ModelExpressionTagHelper.cshtml) - for - For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
RazorIRToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
RazorIRToken - - CSharp - __model.
RazorIRToken - (162:4,17 [3] ModelExpressionTagHelper.cshtml) - CSharp - Now
RazorIRToken - - CSharp - )
ExecuteTagHelpers -
HtmlContent - (169:4,24 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (169:4,24 [2] ModelExpressionTagHelper.cshtml) - Html - \n
TagHelper - (171:5,0 [27] ModelExpressionTagHelper.cshtml)
InitializeTagHelperStructure - - input-test - TagMode.SelfClosing
CreateTagHelper - - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper
SetTagHelperProperty - (188:5,17 [6] ModelExpressionTagHelper.cshtml) - for - For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
RazorIRToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
RazorIRToken - (189:5,18 [5] ModelExpressionTagHelper.cshtml) - CSharp - Model
RazorIRToken - - CSharp - )
ExecuteTagHelpers -
HtmlContent - (198:5,27 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (198:5,27 [2] ModelExpressionTagHelper.cshtml) - Html - \n
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,69 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime> -
DeclareTagHelperFields - - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(17, 2, true);
HtmlContent - (17:1,0 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (17:1,0 [2] ModelExpressionTagHelper.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(143, 2, true);
HtmlContent - (143:3,0 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (143:3,0 [2] ModelExpressionTagHelper.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (145:4,0 [24] ModelExpressionTagHelper.cshtml)
InitializeTagHelperStructure - - input-test - TagMode.SelfClosing
CreateTagHelper - - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper
SetTagHelperProperty - (162:4,17 [3] ModelExpressionTagHelper.cshtml) - for - For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
RazorIRToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
RazorIRToken - - CSharp - __model.
RazorIRToken - (162:4,17 [3] ModelExpressionTagHelper.cshtml) - CSharp - Now
RazorIRToken - - CSharp - )
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(145, 24, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(169, 2, true);
HtmlContent - (169:4,24 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (169:4,24 [2] ModelExpressionTagHelper.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (171:5,0 [27] ModelExpressionTagHelper.cshtml)
InitializeTagHelperStructure - - input-test - TagMode.SelfClosing
CreateTagHelper - - Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper
SetTagHelperProperty - (188:5,17 [6] ModelExpressionTagHelper.cshtml) - for - For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
RazorIRToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
RazorIRToken - (189:5,18 [5] ModelExpressionTagHelper.cshtml) - CSharp - Model
RazorIRToken - - CSharp - )
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(171, 27, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(198, 2, true);
HtmlContent - (198:5,27 [2] ModelExpressionTagHelper.cshtml)
RazorIRToken - (198:5,27 [2] ModelExpressionTagHelper.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,43 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = System.Collections.IEnumerable
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (7:0,7 [30] Model.cshtml) - System.Collections.IEnumerable
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,17 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable> -
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,44 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = System.Collections.IEnumerable
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (7:0,7 [21] MultipleModels.cshtml) - ThisShouldBeGenerated
DirectiveToken - (37:1,7 [30] MultipleModels.cshtml) - System.Collections.IEnumerable
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,147 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
UsingStatement - (43:3,1 [41] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml - global::Microsoft.AspNetCore.Mvc.RazorPages.Page -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (23:2,14 [17] RazorPagesWithoutModel.cshtml) - "*, TestAssembly"
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
DeclareTagHelperFields - - DivTagHelper
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (7:1,0 [2] RazorPagesWithoutModel.cshtml)
RazorIRToken - (7:1,0 [2] RazorPagesWithoutModel.cshtml) - Html - \n
HtmlContent - (40:2,31 [2] RazorPagesWithoutModel.cshtml)
RazorIRToken - (40:2,31 [2] RazorPagesWithoutModel.cshtml) - Html - \n
HtmlContent - (84:3,42 [4] RazorPagesWithoutModel.cshtml)
RazorIRToken - (84:3,42 [4] RazorPagesWithoutModel.cshtml) - Html - \n\n
HtmlContent - (384:18,1 [77] RazorPagesWithoutModel.cshtml)
RazorIRToken - (384:18,1 [4] RazorPagesWithoutModel.cshtml) - Html - \n\n
RazorIRToken - (388:20,0 [4] RazorPagesWithoutModel.cshtml) - Html - <h1>
RazorIRToken - (392:20,4 [12] RazorPagesWithoutModel.cshtml) - Html - New Customer
RazorIRToken - (404:20,16 [5] RazorPagesWithoutModel.cshtml) - Html - </h1>
RazorIRToken - (409:20,21 [2] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (411:21,0 [5] RazorPagesWithoutModel.cshtml) - Html - <form
RazorIRToken - (416:21,5 [14] RazorPagesWithoutModel.cshtml) - Html - method="post"
RazorIRToken - (430:21,19 [24] RazorPagesWithoutModel.cshtml) - Html - class="form-horizontal"
RazorIRToken - (454:21,43 [1] RazorPagesWithoutModel.cshtml) - Html - >
RazorIRToken - (455:21,44 [6] RazorPagesWithoutModel.cshtml) - Html - \n
TagHelper - (461:22,4 [31] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (473:22,16 [11] RazorPagesWithoutModel.cshtml)
RazorIRToken - (473:22,16 [11] RazorPagesWithoutModel.cshtml) - Html - text-danger
ExecuteTagHelpers -
HtmlContent - (492:22,35 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (492:22,35 [6] RazorPagesWithoutModel.cshtml) - Html - \n
TagHelper - (498:23,4 [237] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (522:23,28 [48] RazorPagesWithoutModel.cshtml)
RazorIRToken - (522:23,28 [10] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (532:24,8 [6] RazorPagesWithoutModel.cshtml) - Html - <label
RazorIRToken - (538:24,14 [31] RazorPagesWithoutModel.cshtml) - Html - class="col-md-2 control-label"
RazorIRToken - (569:24,45 [1] RazorPagesWithoutModel.cshtml) - Html - >
CSharpExpression - (571:24,47 [4] RazorPagesWithoutModel.cshtml)
RazorIRToken - (571:24,47 [4] RazorPagesWithoutModel.cshtml) - CSharp - Name
HtmlContent - (575:24,51 [18] RazorPagesWithoutModel.cshtml)
RazorIRToken - (575:24,51 [8] RazorPagesWithoutModel.cshtml) - Html - </label>
RazorIRToken - (583:24,59 [10] RazorPagesWithoutModel.cshtml) - Html - \n
TagHelper - (593:25,8 [130] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (616:25,31 [101] RazorPagesWithoutModel.cshtml)
RazorIRToken - (616:25,31 [14] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (630:26,12 [6] RazorPagesWithoutModel.cshtml) - Html - <input
RazorIRToken - (636:26,18 [21] RazorPagesWithoutModel.cshtml) - Html - class="form-control"
RazorIRToken - (657:26,39 [3] RazorPagesWithoutModel.cshtml) - Html - />
RazorIRToken - (660:26,42 [14] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (674:27,12 [5] RazorPagesWithoutModel.cshtml) - Html - <span
RazorIRToken - (679:27,17 [20] RazorPagesWithoutModel.cshtml) - Html - class="text-danger"
RazorIRToken - (699:27,37 [1] RazorPagesWithoutModel.cshtml) - Html - >
RazorIRToken - (700:27,38 [7] RazorPagesWithoutModel.cshtml) - Html - </span>
RazorIRToken - (707:27,45 [10] RazorPagesWithoutModel.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (605:25,20 [9] RazorPagesWithoutModel.cshtml)
RazorIRToken - (605:25,20 [9] RazorPagesWithoutModel.cshtml) - Html - col-md-10
ExecuteTagHelpers -
HtmlContent - (723:28,14 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (723:28,14 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (510:23,16 [10] RazorPagesWithoutModel.cshtml)
RazorIRToken - (510:23,16 [10] RazorPagesWithoutModel.cshtml) - Html - form-group
ExecuteTagHelpers -
HtmlContent - (735:29,10 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (735:29,10 [6] RazorPagesWithoutModel.cshtml) - Html - \n
TagHelper - (741:30,4 [174] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (765:30,28 [10] RazorPagesWithoutModel.cshtml)
RazorIRToken - (765:30,28 [10] RazorPagesWithoutModel.cshtml) - Html - \n
TagHelper - (775:31,8 [128] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (814:31,47 [83] RazorPagesWithoutModel.cshtml)
RazorIRToken - (814:31,47 [14] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (828:32,12 [7] RazorPagesWithoutModel.cshtml) - Html - <button
RazorIRToken - (835:32,19 [14] RazorPagesWithoutModel.cshtml) - Html - type="submit"
RazorIRToken - (849:32,33 [24] RazorPagesWithoutModel.cshtml) - Html - class="btn btn-primary"
RazorIRToken - (873:32,57 [1] RazorPagesWithoutModel.cshtml) - Html - >
RazorIRToken - (874:32,58 [4] RazorPagesWithoutModel.cshtml) - Html - Save
RazorIRToken - (878:32,62 [9] RazorPagesWithoutModel.cshtml) - Html - </button>
RazorIRToken - (887:32,71 [10] RazorPagesWithoutModel.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (787:31,20 [25] RazorPagesWithoutModel.cshtml)
RazorIRToken - (787:31,20 [25] RazorPagesWithoutModel.cshtml) - Html - col-md-offset-2 col-md-10
ExecuteTagHelpers -
HtmlContent - (903:33,14 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (903:33,14 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (753:30,16 [10] RazorPagesWithoutModel.cshtml)
RazorIRToken - (753:30,16 [10] RazorPagesWithoutModel.cshtml) - Html - form-group
ExecuteTagHelpers -
HtmlContent - (915:34,10 [11] RazorPagesWithoutModel.cshtml)
RazorIRToken - (915:34,10 [2] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (917:35,0 [7] RazorPagesWithoutModel.cshtml) - Html - </form>
RazorIRToken - (924:35,7 [2] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement - (100:5,12 [283] RazorPagesWithoutModel.cshtml)
RazorIRToken - (100:5,12 [283] RazorPagesWithoutModel.cshtml) - CSharp - \n public IActionResult OnPost(Customer customer)\n {\n Name = customer.Name;\n return Redirect("~/customers/inlinepagemodels/");\n }\n\n public string Name { get; set; }\n\n public class Customer\n {\n public string Name { get; set; }\n }\n
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
CSharpStatement -
RazorIRToken - - CSharp - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml>)PageContext?.ViewData;
CSharpStatement -
RazorIRToken - - CSharp - public TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml Model => ViewData.Model;

View File

@ -0,0 +1,189 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
UsingStatement - (43:3,1 [43] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml - global::Microsoft.AspNetCore.Mvc.RazorPages.Page -
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 - class - text-danger - HtmlAttributeValueStyle.DoubleQuotes
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 - class - col-md-10 - HtmlAttributeValueStyle.DoubleQuotes
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - class - form-group - HtmlAttributeValueStyle.DoubleQuotes
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_3 - class - col-md-offset-2 col-md-10 - HtmlAttributeValueStyle.DoubleQuotes
DeclareTagHelperFields - - DivTagHelper
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(7, 2, true);
HtmlContent - (7:1,0 [2] RazorPagesWithoutModel.cshtml)
RazorIRToken - (7:1,0 [2] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(86, 2, true);
HtmlContent - (86:4,0 [2] RazorPagesWithoutModel.cshtml)
RazorIRToken - (86:4,0 [2] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(386, 75, true);
HtmlContent - (386:19,0 [75] RazorPagesWithoutModel.cshtml)
RazorIRToken - (386:19,0 [2] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (388:20,0 [4] RazorPagesWithoutModel.cshtml) - Html - <h1>
RazorIRToken - (392:20,4 [12] RazorPagesWithoutModel.cshtml) - Html - New Customer
RazorIRToken - (404:20,16 [5] RazorPagesWithoutModel.cshtml) - Html - </h1>
RazorIRToken - (409:20,21 [2] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (411:21,0 [5] RazorPagesWithoutModel.cshtml) - Html - <form
RazorIRToken - (416:21,5 [14] RazorPagesWithoutModel.cshtml) - Html - method="post"
RazorIRToken - (430:21,19 [24] RazorPagesWithoutModel.cshtml) - Html - class="form-horizontal"
RazorIRToken - (454:21,43 [1] RazorPagesWithoutModel.cshtml) - Html - >
RazorIRToken - (455:21,44 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (461:22,4 [31] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(461, 31, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(492, 6, true);
HtmlContent - (492:22,35 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (492:22,35 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (498:23,4 [237] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(522, 48, true);
HtmlContent - (522:23,28 [48] RazorPagesWithoutModel.cshtml)
RazorIRToken - (522:23,28 [10] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (532:24,8 [6] RazorPagesWithoutModel.cshtml) - Html - <label
RazorIRToken - (538:24,14 [31] RazorPagesWithoutModel.cshtml) - Html - class="col-md-2 control-label"
RazorIRToken - (569:24,45 [1] RazorPagesWithoutModel.cshtml) - Html - >
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(571, 4, false);
CSharpExpression - (571:24,47 [4] RazorPagesWithoutModel.cshtml)
RazorIRToken - (571:24,47 [4] RazorPagesWithoutModel.cshtml) - CSharp - Name
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(575, 18, true);
HtmlContent - (575:24,51 [18] RazorPagesWithoutModel.cshtml)
RazorIRToken - (575:24,51 [8] RazorPagesWithoutModel.cshtml) - Html - </label>
RazorIRToken - (583:24,59 [10] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (593:25,8 [130] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(616, 101, true);
HtmlContent - (616:25,31 [101] RazorPagesWithoutModel.cshtml)
RazorIRToken - (616:25,31 [14] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (630:26,12 [6] RazorPagesWithoutModel.cshtml) - Html - <input
RazorIRToken - (636:26,18 [21] RazorPagesWithoutModel.cshtml) - Html - class="form-control"
RazorIRToken - (657:26,39 [3] RazorPagesWithoutModel.cshtml) - Html - />
RazorIRToken - (660:26,42 [14] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (674:27,12 [5] RazorPagesWithoutModel.cshtml) - Html - <span
RazorIRToken - (679:27,17 [20] RazorPagesWithoutModel.cshtml) - Html - class="text-danger"
RazorIRToken - (699:27,37 [1] RazorPagesWithoutModel.cshtml) - Html - >
RazorIRToken - (700:27,38 [7] RazorPagesWithoutModel.cshtml) - Html - </span>
RazorIRToken - (707:27,45 [10] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(593, 130, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(723, 6, true);
HtmlContent - (723:28,14 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (723:28,14 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(498, 237, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(735, 6, true);
HtmlContent - (735:29,10 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (735:29,10 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (741:30,4 [174] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(765, 10, true);
HtmlContent - (765:30,28 [10] RazorPagesWithoutModel.cshtml)
RazorIRToken - (765:30,28 [10] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (775:31,8 [128] RazorPagesWithoutModel.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(814, 83, true);
HtmlContent - (814:31,47 [83] RazorPagesWithoutModel.cshtml)
RazorIRToken - (814:31,47 [14] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (828:32,12 [7] RazorPagesWithoutModel.cshtml) - Html - <button
RazorIRToken - (835:32,19 [14] RazorPagesWithoutModel.cshtml) - Html - type="submit"
RazorIRToken - (849:32,33 [24] RazorPagesWithoutModel.cshtml) - Html - class="btn btn-primary"
RazorIRToken - (873:32,57 [1] RazorPagesWithoutModel.cshtml) - Html - >
RazorIRToken - (874:32,58 [4] RazorPagesWithoutModel.cshtml) - Html - Save
RazorIRToken - (878:32,62 [9] RazorPagesWithoutModel.cshtml) - Html - </button>
RazorIRToken - (887:32,71 [10] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_3
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(775, 128, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(903, 6, true);
HtmlContent - (903:33,14 [6] RazorPagesWithoutModel.cshtml)
RazorIRToken - (903:33,14 [6] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(741, 174, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(915, 11, true);
HtmlContent - (915:34,10 [11] RazorPagesWithoutModel.cshtml)
RazorIRToken - (915:34,10 [2] RazorPagesWithoutModel.cshtml) - Html - \n
RazorIRToken - (917:35,0 [7] RazorPagesWithoutModel.cshtml) - Html - </form>
RazorIRToken - (924:35,7 [2] RazorPagesWithoutModel.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement - (100:5,12 [283] RazorPagesWithoutModel.cshtml)
RazorIRToken - (100:5,12 [283] RazorPagesWithoutModel.cshtml) - CSharp - \n public IActionResult OnPost(Customer customer)\n {\n Name = customer.Name;\n return Redirect("~/customers/inlinepagemodels/");\n }\n\n public string Name { get; set; }\n\n public class Customer\n {\n public string Name { get; set; }\n }\n
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
CSharpStatement -
RazorIRToken - - CSharp - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml>)PageContext?.ViewData;
CSharpStatement -
RazorIRToken - - CSharp - public TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml Model => ViewData.Model;

View File

@ -0,0 +1,148 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = NewModel
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
UsingStatement - (60:4,1 [41] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages_cshtml - global::Microsoft.AspNetCore.Mvc.RazorPages.Page -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (16:2,7 [8] RazorPages.cshtml) - NewModel
DirectiveToken - (40:3,14 [17] RazorPages.cshtml) - "*, TestAssembly"
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
DeclareTagHelperFields - - DivTagHelper
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (7:1,0 [2] RazorPages.cshtml)
RazorIRToken - (7:1,0 [2] RazorPages.cshtml) - Html - \n
HtmlContent - (57:3,31 [2] RazorPages.cshtml)
RazorIRToken - (57:3,31 [2] RazorPages.cshtml) - Html - \n
HtmlContent - (101:4,42 [4] RazorPages.cshtml)
RazorIRToken - (101:4,42 [4] RazorPages.cshtml) - Html - \n\n
HtmlContent - (478:22,1 [78] RazorPages.cshtml)
RazorIRToken - (478:22,1 [4] RazorPages.cshtml) - Html - \n\n
RazorIRToken - (482:24,0 [4] RazorPages.cshtml) - Html - <h1>
RazorIRToken - (486:24,4 [12] RazorPages.cshtml) - Html - New Customer
RazorIRToken - (498:24,16 [5] RazorPages.cshtml) - Html - </h1>
RazorIRToken - (503:24,21 [2] RazorPages.cshtml) - Html - \n
RazorIRToken - (505:25,0 [5] RazorPages.cshtml) - Html - <form
RazorIRToken - (510:25,5 [14] RazorPages.cshtml) - Html - method="post"
RazorIRToken - (524:25,19 [24] RazorPages.cshtml) - Html - class="form-horizontal"
RazorIRToken - (548:25,43 [2] RazorPages.cshtml) - Html - >
RazorIRToken - (550:25,45 [6] RazorPages.cshtml) - Html - \n
TagHelper - (556:26,4 [31] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (568:26,16 [11] RazorPages.cshtml)
RazorIRToken - (568:26,16 [11] RazorPages.cshtml) - Html - text-danger
ExecuteTagHelpers -
HtmlContent - (587:26,35 [6] RazorPages.cshtml)
RazorIRToken - (587:26,35 [6] RazorPages.cshtml) - Html - \n
TagHelper - (593:27,4 [237] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (617:27,28 [48] RazorPages.cshtml)
RazorIRToken - (617:27,28 [10] RazorPages.cshtml) - Html - \n
RazorIRToken - (627:28,8 [6] RazorPages.cshtml) - Html - <label
RazorIRToken - (633:28,14 [31] RazorPages.cshtml) - Html - class="col-md-2 control-label"
RazorIRToken - (664:28,45 [1] RazorPages.cshtml) - Html - >
CSharpExpression - (666:28,47 [4] RazorPages.cshtml)
RazorIRToken - (666:28,47 [4] RazorPages.cshtml) - CSharp - Name
HtmlContent - (670:28,51 [18] RazorPages.cshtml)
RazorIRToken - (670:28,51 [8] RazorPages.cshtml) - Html - </label>
RazorIRToken - (678:28,59 [10] RazorPages.cshtml) - Html - \n
TagHelper - (688:29,8 [130] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (711:29,31 [101] RazorPages.cshtml)
RazorIRToken - (711:29,31 [14] RazorPages.cshtml) - Html - \n
RazorIRToken - (725:30,12 [6] RazorPages.cshtml) - Html - <input
RazorIRToken - (731:30,18 [21] RazorPages.cshtml) - Html - class="form-control"
RazorIRToken - (752:30,39 [3] RazorPages.cshtml) - Html - />
RazorIRToken - (755:30,42 [14] RazorPages.cshtml) - Html - \n
RazorIRToken - (769:31,12 [5] RazorPages.cshtml) - Html - <span
RazorIRToken - (774:31,17 [20] RazorPages.cshtml) - Html - class="text-danger"
RazorIRToken - (794:31,37 [1] RazorPages.cshtml) - Html - >
RazorIRToken - (795:31,38 [7] RazorPages.cshtml) - Html - </span>
RazorIRToken - (802:31,45 [10] RazorPages.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (700:29,20 [9] RazorPages.cshtml)
RazorIRToken - (700:29,20 [9] RazorPages.cshtml) - Html - col-md-10
ExecuteTagHelpers -
HtmlContent - (818:32,14 [6] RazorPages.cshtml)
RazorIRToken - (818:32,14 [6] RazorPages.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (605:27,16 [10] RazorPages.cshtml)
RazorIRToken - (605:27,16 [10] RazorPages.cshtml) - Html - form-group
ExecuteTagHelpers -
HtmlContent - (830:33,10 [6] RazorPages.cshtml)
RazorIRToken - (830:33,10 [6] RazorPages.cshtml) - Html - \n
TagHelper - (836:34,4 [174] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (860:34,28 [10] RazorPages.cshtml)
RazorIRToken - (860:34,28 [10] RazorPages.cshtml) - Html - \n
TagHelper - (870:35,8 [128] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
HtmlContent - (909:35,47 [83] RazorPages.cshtml)
RazorIRToken - (909:35,47 [14] RazorPages.cshtml) - Html - \n
RazorIRToken - (923:36,12 [7] RazorPages.cshtml) - Html - <button
RazorIRToken - (930:36,19 [14] RazorPages.cshtml) - Html - type="submit"
RazorIRToken - (944:36,33 [24] RazorPages.cshtml) - Html - class="btn btn-primary"
RazorIRToken - (968:36,57 [1] RazorPages.cshtml) - Html - >
RazorIRToken - (969:36,58 [4] RazorPages.cshtml) - Html - Save
RazorIRToken - (973:36,62 [9] RazorPages.cshtml) - Html - </button>
RazorIRToken - (982:36,71 [10] RazorPages.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (882:35,20 [25] RazorPages.cshtml)
RazorIRToken - (882:35,20 [25] RazorPages.cshtml) - Html - col-md-offset-2 col-md-10
ExecuteTagHelpers -
HtmlContent - (998:37,14 [6] RazorPages.cshtml)
RazorIRToken - (998:37,14 [6] RazorPages.cshtml) - Html - \n
CreateTagHelper - - DivTagHelper
AddTagHelperHtmlAttribute - - class - HtmlAttributeValueStyle.DoubleQuotes
HtmlContent - (848:34,16 [10] RazorPages.cshtml)
RazorIRToken - (848:34,16 [10] RazorPages.cshtml) - Html - form-group
ExecuteTagHelpers -
HtmlContent - (1010:38,10 [11] RazorPages.cshtml)
RazorIRToken - (1010:38,10 [2] RazorPages.cshtml) - Html - \n
RazorIRToken - (1012:39,0 [7] RazorPages.cshtml) - Html - </form>
RazorIRToken - (1019:39,7 [2] RazorPages.cshtml) - Html - \n
CSharpStatement - (117:6,12 [360] RazorPages.cshtml)
RazorIRToken - (117:6,12 [360] RazorPages.cshtml) - CSharp - \n public class NewModel : PageModel\n {\n public IActionResult OnPost(Customer customer)\n {\n Name = customer.Name;\n return Redirect("~/customers/inlinepagemodels/");\n }\n\n public string Name { get; set; }\n }\n\n public class Customer\n {\n public string Name { get; set; }\n }\n
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
CSharpStatement -
RazorIRToken - - CSharp - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<NewModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<NewModel>)PageContext?.ViewData;
CSharpStatement -
RazorIRToken - - CSharp - public NewModel Model => ViewData.Model;

View File

@ -0,0 +1,189 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
UsingStatement - (60:4,1 [43] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages_cshtml - global::Microsoft.AspNetCore.Mvc.RazorPages.Page -
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 - class - text-danger - HtmlAttributeValueStyle.DoubleQuotes
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 - class - col-md-10 - HtmlAttributeValueStyle.DoubleQuotes
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - class - form-group - HtmlAttributeValueStyle.DoubleQuotes
DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_3 - class - col-md-offset-2 col-md-10 - HtmlAttributeValueStyle.DoubleQuotes
DeclareTagHelperFields - - DivTagHelper
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(7, 2, true);
HtmlContent - (7:1,0 [2] RazorPages.cshtml)
RazorIRToken - (7:1,0 [2] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(103, 2, true);
HtmlContent - (103:5,0 [2] RazorPages.cshtml)
RazorIRToken - (103:5,0 [2] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(480, 76, true);
HtmlContent - (480:23,0 [76] RazorPages.cshtml)
RazorIRToken - (480:23,0 [2] RazorPages.cshtml) - Html - \n
RazorIRToken - (482:24,0 [4] RazorPages.cshtml) - Html - <h1>
RazorIRToken - (486:24,4 [12] RazorPages.cshtml) - Html - New Customer
RazorIRToken - (498:24,16 [5] RazorPages.cshtml) - Html - </h1>
RazorIRToken - (503:24,21 [2] RazorPages.cshtml) - Html - \n
RazorIRToken - (505:25,0 [5] RazorPages.cshtml) - Html - <form
RazorIRToken - (510:25,5 [14] RazorPages.cshtml) - Html - method="post"
RazorIRToken - (524:25,19 [24] RazorPages.cshtml) - Html - class="form-horizontal"
RazorIRToken - (548:25,43 [2] RazorPages.cshtml) - Html - >
RazorIRToken - (550:25,45 [6] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (556:26,4 [31] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(556, 31, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(587, 6, true);
HtmlContent - (587:26,35 [6] RazorPages.cshtml)
RazorIRToken - (587:26,35 [6] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (593:27,4 [237] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(617, 48, true);
HtmlContent - (617:27,28 [48] RazorPages.cshtml)
RazorIRToken - (617:27,28 [10] RazorPages.cshtml) - Html - \n
RazorIRToken - (627:28,8 [6] RazorPages.cshtml) - Html - <label
RazorIRToken - (633:28,14 [31] RazorPages.cshtml) - Html - class="col-md-2 control-label"
RazorIRToken - (664:28,45 [1] RazorPages.cshtml) - Html - >
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(666, 4, false);
CSharpExpression - (666:28,47 [4] RazorPages.cshtml)
RazorIRToken - (666:28,47 [4] RazorPages.cshtml) - CSharp - Name
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(670, 18, true);
HtmlContent - (670:28,51 [18] RazorPages.cshtml)
RazorIRToken - (670:28,51 [8] RazorPages.cshtml) - Html - </label>
RazorIRToken - (678:28,59 [10] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (688:29,8 [130] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(711, 101, true);
HtmlContent - (711:29,31 [101] RazorPages.cshtml)
RazorIRToken - (711:29,31 [14] RazorPages.cshtml) - Html - \n
RazorIRToken - (725:30,12 [6] RazorPages.cshtml) - Html - <input
RazorIRToken - (731:30,18 [21] RazorPages.cshtml) - Html - class="form-control"
RazorIRToken - (752:30,39 [3] RazorPages.cshtml) - Html - />
RazorIRToken - (755:30,42 [14] RazorPages.cshtml) - Html - \n
RazorIRToken - (769:31,12 [5] RazorPages.cshtml) - Html - <span
RazorIRToken - (774:31,17 [20] RazorPages.cshtml) - Html - class="text-danger"
RazorIRToken - (794:31,37 [1] RazorPages.cshtml) - Html - >
RazorIRToken - (795:31,38 [7] RazorPages.cshtml) - Html - </span>
RazorIRToken - (802:31,45 [10] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(688, 130, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(818, 6, true);
HtmlContent - (818:32,14 [6] RazorPages.cshtml)
RazorIRToken - (818:32,14 [6] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(593, 237, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(830, 6, true);
HtmlContent - (830:33,10 [6] RazorPages.cshtml)
RazorIRToken - (830:33,10 [6] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (836:34,4 [174] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(860, 10, true);
HtmlContent - (860:34,28 [10] RazorPages.cshtml)
RazorIRToken - (860:34,28 [10] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
TagHelper - (870:35,8 [128] RazorPages.cshtml)
InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(909, 83, true);
HtmlContent - (909:35,47 [83] RazorPages.cshtml)
RazorIRToken - (909:35,47 [14] RazorPages.cshtml) - Html - \n
RazorIRToken - (923:36,12 [7] RazorPages.cshtml) - Html - <button
RazorIRToken - (930:36,19 [14] RazorPages.cshtml) - Html - type="submit"
RazorIRToken - (944:36,33 [24] RazorPages.cshtml) - Html - class="btn btn-primary"
RazorIRToken - (968:36,57 [1] RazorPages.cshtml) - Html - >
RazorIRToken - (969:36,58 [4] RazorPages.cshtml) - Html - Save
RazorIRToken - (973:36,62 [9] RazorPages.cshtml) - Html - </button>
RazorIRToken - (982:36,71 [10] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_3
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(870, 128, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(998, 6, true);
HtmlContent - (998:37,14 [6] RazorPages.cshtml)
RazorIRToken - (998:37,14 [6] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CreateTagHelper - - DivTagHelper
AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(836, 174, false);
ExecuteTagHelpers -
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement -
RazorIRToken - - CSharp - BeginContext(1010, 11, true);
HtmlContent - (1010:38,10 [11] RazorPages.cshtml)
RazorIRToken - (1010:38,10 [2] RazorPages.cshtml) - Html - \n
RazorIRToken - (1012:39,0 [7] RazorPages.cshtml) - Html - </form>
RazorIRToken - (1019:39,7 [2] RazorPages.cshtml) - Html - \n
CSharpStatement -
RazorIRToken - - CSharp - EndContext();
CSharpStatement - (117:6,12 [360] RazorPages.cshtml)
RazorIRToken - (117:6,12 [360] RazorPages.cshtml) - CSharp - \n public class NewModel : PageModel\n {\n public IActionResult OnPost(Customer customer)\n {\n Name = customer.Name;\n return Redirect("~/customers/inlinepagemodels/");\n }\n\n public string Name { get; set; }\n }\n\n public class Customer\n {\n public string Name { get; set; }\n }\n
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
CSharpStatement -
RazorIRToken - - CSharp - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<NewModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<NewModel>)PageContext?.ViewData;
CSharpStatement -
RazorIRToken - - CSharp - public NewModel Model => ViewData.Model;

View File

@ -0,0 +1,45 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - - TModel = global::System.Object
UsingStatement - (1:0,1 [12] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [17] ) - System.Linq
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
DirectiveTokenHelper -
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning disable 219
CSharpStatement -
RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() {
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (263:6,71 [4] ) - Html
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
DirectiveToken - (332:7,63 [4] ) - Json
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
DirectiveToken - (400:8,62 [9] ) - Component
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
DirectiveToken - (463:9,52 [3] ) - Url
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (8:0,8 [19] _ViewImports.cshtml) - IHtmlHelper<TModel>
DirectiveToken - (28:0,28 [5] _ViewImports.cshtml) - Model
CSharpStatement -
RazorIRToken - - CSharp - }
CSharpStatement -
RazorIRToken - - CSharp - #pragma warning restore 219
CSharpStatement -
RazorIRToken - - CSharp - private static System.Object __o = null;
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -0,0 +1,18 @@
Document -
Checksum -
NamespaceDeclaration - - AspNetCore
UsingStatement - (1:0,1 [14] ) - System
UsingStatement - - System.Threading.Tasks
UsingStatement - (16:1,1 [19] ) - System.Linq
UsingStatement - (36:2,1 [34] ) - System.Collections.Generic
UsingStatement - (71:3,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingStatement - (104:4,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingStatement - (147:5,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -
InjectDirective -

View File

@ -8,8 +8,10 @@ namespace Microsoft.AspNetCore.Razor.Language
{
public class FileSystemRazorProjectItemTest
{
private static string TestFolder { get; } =
Path.Combine(TestProject.GetProjectDirectory(), "TestFiles", "FileSystemRazorProject");
private static string TestFolder { get; } = Path.Combine(
TestProject.GetProjectDirectory(typeof(FileSystemRazorProjectItemTest)),
"TestFiles",
"FileSystemRazorProject");
[Fact]
public void FileSystemRazorProjectItem_SetsProperties()

View File

@ -10,8 +10,10 @@ namespace Microsoft.AspNetCore.Razor.Language
{
public class FileSystemRazorProjectTest
{
private static string TestFolder { get; } =
Path.Combine(TestProject.GetProjectDirectory(), "TestFiles", "FileSystemRazorProject");
private static string TestFolder { get; } = Path.Combine(
TestProject.GetProjectDirectory(typeof(FileSystemRazorProjectTest)),
"TestFiles",
"FileSystemRazorProject");
[Theory]
[InlineData(null)]

View File

@ -1,11 +1,8 @@
// 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.Collections.Generic;
using System.IO;
using Xunit;
using Xunit.Sdk;
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
{

View File

@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
public class HtmlDocumentTest : CsHtmlMarkupParserTestBase
{
private static readonly TestFile Nested1000 = TestFile.Create("TestFiles/nested-1000.html");
private static readonly TestFile Nested1000 = TestFile.Create("TestFiles/nested-1000.html", typeof(HtmlDocumentTest));
[Fact]
public void ParseDocument_NestedCodeBlockWithMarkupSetsDotAsMarkup()

View File

@ -11,8 +11,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
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 static readonly TestFile SimpleCSHTMLDocument = TestFile.Create("TestFiles/DesignTime/Simple.cshtml", typeof(RazorEditorParserTest));
private static readonly TestFile SimpleCSHTMLDocumentGenerated = TestFile.Create("TestFiles/DesignTime/Simple.txt", typeof(RazorEditorParserTest));
private const string TestLinePragmaFileName = "C:\\This\\Path\\Is\\Just\\For\\Line\\Pragmas.cshtml";
public static TheoryData TagHelperPartialParseRejectData

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
public void CanParseStuff()
{
var parser = new RazorParser();
var sourceDocument = TestRazorSourceDocument.CreateResource("TestFiles/Source/BasicMarkup.cshtml");
var sourceDocument = TestRazorSourceDocument.CreateResource("TestFiles/Source/BasicMarkup.cshtml", GetType());
var output = parser.Parse(sourceDocument);
Assert.NotNull(output);

View File

@ -1,29 +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.Collections.Generic;
namespace Microsoft.AspNetCore.Razor.Language
{
internal class TestRazorCodeDocument : DefaultRazorCodeDocument
{
public static TestRazorCodeDocument CreateEmpty()
{
var source = TestRazorSourceDocument.Create(content: string.Empty);
return new TestRazorCodeDocument(source, imports: null);
}
public static TestRazorCodeDocument Create(string content)
{
var source = TestRazorSourceDocument.Create(content);
return new TestRazorCodeDocument(source, imports: null);
}
private TestRazorCodeDocument(
RazorSourceDocument source,
IEnumerable<RazorSourceDocument> imports)
: base(source, imports)
{
}
}
}

View File

@ -21,17 +21,22 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
[IntializeTestFile]
public abstract class IntegrationTestBase
{
#if GENERATE_BASELINES
private static readonly bool GenerateBaselines = true;
#else
private static readonly bool GenerateBaselines = false;
#endif
#if !NET452
private static readonly AsyncLocal<string> _filename = new AsyncLocal<string>();
#endif
protected static string TestProjectRoot { get; } = TestProject.GetProjectDirectory();
protected IntegrationTestBase()
{
TestProjectRoot = TestProject.GetProjectDirectory(GetType());
}
#if GENERATE_BASELINES
protected bool GenerateBaselines { get; set; } = true;
#else
protected bool GenerateBaselines { get; set; } = false;
#endif
protected string TestProjectRoot { get; }
// Used by the test framework to set the 'base' name for test files.
public static string Filename
@ -63,27 +68,29 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
var suffixIndex = Filename.LastIndexOf("_");
var normalizedFileName = suffixIndex == -1 ? Filename : Filename.Substring(0, suffixIndex);
var sourceFilename = Path.ChangeExtension(normalizedFileName, ".cshtml");
var testFile = TestFile.Create(sourceFilename);
var testFile = TestFile.Create(sourceFilename, GetType().GetTypeInfo().Assembly);
if (!testFile.Exists())
{
throw new XunitException($"The resource {sourceFilename} was not found.");
}
var source = TestRazorSourceDocument.CreateResource(sourceFilename, GetType(), normalizeNewLines: true);
var imports = new List<RazorSourceDocument>();
while (true)
{
var importsFilename = Path.ChangeExtension(normalizedFileName + "_Imports" + imports.Count.ToString(), ".cshtml");
if (!TestFile.Create(importsFilename).Exists())
if (!TestFile.Create(importsFilename, GetType().GetTypeInfo().Assembly).Exists())
{
break;
}
imports.Add(
TestRazorSourceDocument.CreateResource(importsFilename, encoding: null, normalizeNewLines: true));
imports.Add(TestRazorSourceDocument.CreateResource(importsFilename, GetType(), normalizeNewLines: true));
}
var codeDocument = RazorCodeDocument.Create(
TestRazorSourceDocument.CreateResource(sourceFilename, encoding: null, normalizeNewLines: true), imports);
OnCreatingCodeDocument(ref source, imports);
var codeDocument = RazorCodeDocument.Create(source, imports);
// This will ensure that we're not putting any randomly generated data in a baseline.
codeDocument.Items[DefaultRazorCSharpLoweringPhase.SuppressUniqueIds] = "test";
@ -91,9 +98,19 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
// This is to make tests work cross platform.
codeDocument.Items[DefaultRazorCSharpLoweringPhase.NewLineString] = "\r\n";
OnCreatedCodeDocument(ref codeDocument);
return codeDocument;
}
protected virtual void OnCreatingCodeDocument(ref RazorSourceDocument source, IList<RazorSourceDocument> imports)
{
}
protected virtual void OnCreatedCodeDocument(ref RazorCodeDocument codeDocument)
{
}
protected void AssertIRMatchesBaseline(DocumentIRNode document)
{
if (Filename == null)
@ -111,7 +128,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
return;
}
var testFile = TestFile.Create(baselineFilename);
var testFile = TestFile.Create(baselineFilename, GetType().GetTypeInfo().Assembly);
if (!testFile.Exists())
{
throw new XunitException($"The resource {baselineFilename} was not found.");
@ -138,7 +155,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
return;
}
var testFile = TestFile.Create(baselineFilename);
var testFile = TestFile.Create(baselineFilename, GetType().GetTypeInfo().Assembly);
if (!testFile.Exists())
{
throw new XunitException($"The resource {baselineFilename} was not found.");
@ -180,7 +197,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
return;
}
var testFile = TestFile.Create(baselineFilename);
var testFile = TestFile.Create(baselineFilename, GetType().GetTypeInfo().Assembly);
if (!testFile.Exists())
{
throw new XunitException($"The resource {baselineFilename} was not found.");
@ -214,7 +231,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
public override void VisitNamespace(NamespaceDeclarationIRNode node)
{
node.Content = typeof(CodeGenerationIntegrationTest).Namespace + ".TestFiles";
node.Content = "Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles";
VisitDefault(node);
}

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
{
public override void Before(MethodInfo methodUnderTest)
{
if (typeof(IntegrationTestBase).IsAssignableFrom(methodUnderTest.DeclaringType))
if (typeof(IntegrationTestBase).GetTypeInfo().IsAssignableFrom(methodUnderTest.DeclaringType.GetTypeInfo()))
{
var typeName = methodUnderTest.DeclaringType.Name;
IntegrationTestBase.Filename = $"TestFiles/IntegrationTests/{typeName}/{methodUnderTest.Name}";
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
public override void After(MethodInfo methodUnderTest)
{
if (typeof(IntegrationTestBase).IsAssignableFrom(methodUnderTest.DeclaringType))
if (typeof(IntegrationTestBase).GetTypeInfo().IsAssignableFrom(methodUnderTest.DeclaringType.GetTypeInfo()))
{
IntegrationTestBase.Filename = null;
}

View File

@ -192,8 +192,12 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
_writer.Write(sourceRange.Length);
_writer.Write("] ");
var fileName = sourceRange.FilePath.Substring(sourceRange.FilePath.LastIndexOf('/') + 1);
_writer.Write(fileName);
if (sourceRange.FilePath != null)
{
var fileName = sourceRange.FilePath.Substring(sourceRange.FilePath.LastIndexOf('/') + 1);
_writer.Write(fileName);
}
_writer.Write(")");
}
}

View File

@ -4,13 +4,12 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.AspNetCore.Razor.Language;
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
{
public class TestTagHelperDescriptors
{
internal static IEnumerable<TagHelperDescriptor> SimpleTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> SimpleTagHelperDescriptors
{
get
{
@ -43,7 +42,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> CssSelectorTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> CssSelectorTagHelperDescriptors
{
get
{
@ -143,7 +142,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> EnumTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> EnumTagHelperDescriptors
{
get
{
@ -177,7 +176,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> SymbolBoundTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> SymbolBoundTagHelperDescriptors
{
get
{
@ -222,7 +221,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> MinimizedTagHelpers_Descriptors
public static IEnumerable<TagHelperDescriptor> MinimizedTagHelpers_Descriptors
{
get
{
@ -268,7 +267,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> DynamicAttributeTagHelpers_Descriptors
public static IEnumerable<TagHelperDescriptor> DynamicAttributeTagHelpers_Descriptors
{
get
{
@ -289,7 +288,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> AttributeTargetingTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> AttributeTargetingTagHelperDescriptors
{
get
{
@ -344,7 +343,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> PrefixedAttributeTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> PrefixedAttributeTagHelperDescriptors
{
get
{
@ -396,7 +395,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> TagHelpersInSectionDescriptors
public static IEnumerable<TagHelperDescriptor> TagHelpersInSectionDescriptors
{
get
{
@ -419,7 +418,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
}
}
internal static IEnumerable<TagHelperDescriptor> DefaultPAndInputTagHelperDescriptors
public static IEnumerable<TagHelperDescriptor> DefaultPAndInputTagHelperDescriptors
{
get
{

View File

@ -20,9 +20,14 @@ namespace Microsoft.AspNetCore.Razor.Language
public string ResourceName { get; }
public static TestFile Create(string resourceName)
public static TestFile Create(string resourceName, Type type)
{
return new TestFile(resourceName, typeof(TestFile).GetTypeInfo().Assembly);
return new TestFile(resourceName, type.GetTypeInfo().Assembly);
}
public static TestFile Create(string resourceName, Assembly assembly)
{
return new TestFile(resourceName, assembly);
}
public Stream OpenRead()

View File

@ -9,9 +9,7 @@ namespace Microsoft.AspNetCore.Razor.Language
{
public static class TestProject
{
private static readonly string ThisProjectName = typeof(TestProject).GetTypeInfo().Assembly.GetName().Name;
public static string GetProjectDirectory()
public static string GetProjectDirectory(Type type)
{
#if NET452
@ -19,9 +17,10 @@ namespace Microsoft.AspNetCore.Razor.Language
#else
var currentDirectory = new DirectoryInfo(AppContext.BaseDirectory);
#endif
var name = type.GetTypeInfo().Assembly.GetName().Name;
while (currentDirectory != null &&
!string.Equals(currentDirectory.Name, ThisProjectName, StringComparison.Ordinal))
!string.Equals(currentDirectory.Name, name, StringComparison.Ordinal))
{
currentDirectory = currentDirectory.Parent;
}

View File

@ -0,0 +1,27 @@
// 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.Collections.Generic;
namespace Microsoft.AspNetCore.Razor.Language
{
public static class TestRazorCodeDocument
{
public static RazorCodeDocument CreateEmpty()
{
var source = TestRazorSourceDocument.Create(content: string.Empty);
return new DefaultRazorCodeDocument(source, imports: null);
}
public static RazorCodeDocument Create(string content)
{
var source = TestRazorSourceDocument.Create(content);
return new DefaultRazorCodeDocument(source, imports: null);
}
public static RazorCodeDocument Create(RazorSourceDocument source, IEnumerable<RazorSourceDocument> imports)
{
return new DefaultRazorCodeDocument(source, imports);
}
}
}

View File

@ -1,24 +1,24 @@
// 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.IO;
using System.Text;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System;
using System.IO;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
namespace Microsoft.AspNetCore.Razor.Language
{
internal class TestRazorSourceDocument : DefaultRazorSourceDocument
public static class TestRazorSourceDocument
{
private TestRazorSourceDocument(string content, Encoding encoding, string filename)
: base(content, encoding, filename)
public static RazorSourceDocument CreateResource(string path, Type type, Encoding encoding = null, bool normalizeNewLines = false)
{
return CreateResource(path, type.GetTypeInfo().Assembly, encoding, normalizeNewLines);
}
public static RazorSourceDocument CreateResource(string path, Encoding encoding = null, bool normalizeNewLines = false)
public static RazorSourceDocument CreateResource(string path, Assembly assembly, Encoding encoding = null, bool normalizeNewLines = false)
{
var file = TestFile.Create(path);
var file = TestFile.Create(path, assembly);
using (var input = file.OpenRead())
using (var reader = new StreamReader(input))
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Razor.Language
content = NormalizeNewLines(content);
}
return new TestRazorSourceDocument(content, encoding ?? Encoding.UTF8, path);
return new DefaultRazorSourceDocument(content, encoding ?? Encoding.UTF8, path);
}
}
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Razor.Language
content = NormalizeNewLines(content);
}
return new TestRazorSourceDocument(content, encoding ?? Encoding.UTF8, fileName);
return new DefaultRazorSourceDocument(content, encoding ?? Encoding.UTF8, fileName);
}
private static string NormalizeNewLines(string content)

View File

@ -8,12 +8,9 @@
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Microsoft.AspNetCore.Razor.Language.Test\TestProject.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\RazorPageGenerator\RazorPageGenerator.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />

View File

@ -34,7 +34,7 @@ namespace RazorPageGenerator.Test
public void Generator_GeneratesCodeForFilesIntheViewsDirectory()
{
// Arrange
var projectDirectory = TestProject.GetProjectDirectory();
var projectDirectory = TestProject.GetProjectDirectory(GetType());
// Act