diff --git a/Razor.sln b/Razor.sln index d11d25a949..af9dbe9e74 100644 --- a/Razor.sln +++ b/Razor.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26228.9 +VisualStudioVersion = 15.0.26428.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3C0D6505-79B3-49D0-B4C3-176F0F1836ED}" EndProject @@ -18,7 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution NuGet.config = NuGet.config EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPageGenerator", "src\RazorPageGenerator\RazorPageGenerator.csproj", "{7BE58880-36AD-4CD5-9E16-2A5AFEA790EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorPageGenerator", "src\RazorPageGenerator\RazorPageGenerator.csproj", "{7BE58880-36AD-4CD5-9E16-2A5AFEA790EF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Language", "src\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj", "{932F3C9C-A6C0-40D3-BA50-9309886242FC}" EndProject @@ -42,7 +42,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.Lang EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorPageGenerator.Test", "test\RazorPageGenerator.Test\RazorPageGenerator.Test.csproj", "{96EB1BD4-B8E0-4F52-A068-BBCACA7E3F63}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.LanguageServices.Razor.Test", "test\Microsoft.VisualStudio.LanguageServices.Razor.Test\Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj", "{37E61BDB-658E-4F44-A499-D64CC6D35485}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.LanguageServices.Razor.Test", "test\Microsoft.VisualStudio.LanguageServices.Razor.Test\Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj", "{37E61BDB-658E-4F44-A499-D64CC6D35485}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.Extensions", "src\Microsoft.AspNetCore.Mvc.Razor.Extensions\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj", "{995F2FEB-65FA-4399-B1C0-16E0B3FBDB15}" EndProject @@ -52,6 +52,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Performance", "test\Microsoft.AspNetCore.Razor.Performance\Microsoft.AspNetCore.Razor.Performance.csproj", "{82C23CF8-95FF-40F7-BF50-3AD9EE21ED58}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test.MvcShim", "test\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj", "{8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -202,6 +204,14 @@ Global {82C23CF8-95FF-40F7-BF50-3AD9EE21ED58}.Release|Any CPU.Build.0 = Release|Any CPU {82C23CF8-95FF-40F7-BF50-3AD9EE21ED58}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU {82C23CF8-95FF-40F7-BF50-3AD9EE21ED58}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.Release|Any CPU.Build.0 = Release|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -225,5 +235,6 @@ Global {7CFD5646-A757-4498-9E01-9C8528ED60AE} = {92463391-81BE-462B-AC3C-78C6C760741F} {078AEF36-F319-4CE2-BAA2-5B58A6536B46} = {92463391-81BE-462B-AC3C-78C6C760741F} {82C23CF8-95FF-40F7-BF50-3AD9EE21ED58} = {92463391-81BE-462B-AC3C-78C6C760741F} + {8F165A3F-A18C-4649-AA08-C0E1BA5F5C90} = {92463391-81BE-462B-AC3C-78C6C760741F} EndGlobalSection EndGlobal diff --git a/build/repo.props b/build/repo.props index f8da117175..ebb303b291 100644 --- a/build/repo.props +++ b/build/repo.props @@ -3,5 +3,6 @@ + diff --git a/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DesignTimeDirectiveTargetExtension.cs b/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DesignTimeDirectiveTargetExtension.cs index 802a487f4c..96b49c9ec9 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DesignTimeDirectiveTargetExtension.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/CodeGeneration/DesignTimeDirectiveTargetExtension.cs @@ -56,14 +56,16 @@ namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration { case DirectiveTokenKind.Type: - // {node.Content} __typeHelper = null; + // {node.Content} __typeHelper = default({node.Content}); context.AddLineMappingFor(node); context.Writer .Write(node.Content) .Write(" ") .WriteStartAssignment(TypeHelper) - .WriteLine("null;"); + .Write("default(") + .Write(node.Content) + .WriteLine(");"); break; case DirectiveTokenKind.Member: diff --git a/src/Microsoft.AspNetCore.Razor.Language/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Razor.Language/Properties/AssemblyInfo.cs index eabcaa6a0f..a94f741179 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Properties/AssemblyInfo.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Razor.Extensions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Language.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/DictionaryPrefixTestTagHelper.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/DictionaryPrefixTestTagHelper.cs deleted file mode 100644 index 7f0a41e197..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/DictionaryPrefixTestTagHelper.cs +++ /dev/null @@ -1,20 +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 Microsoft.AspNetCore.Mvc.ViewFeatures; -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions -{ - [HtmlTargetElement(Attributes = "prefix-*")] - public class DictionaryPrefixTestTagHelper : TagHelper - { - [HtmlAttributeName(DictionaryAttributePrefix = "prefix-")] - public IDictionary PrefixValues { get; set; } = new Dictionary(); - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/InputTestTagHelper.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/InputTestTagHelper.cs deleted file mode 100644 index d71a2b235f..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/InputTestTagHelper.cs +++ /dev/null @@ -1,13 +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 Microsoft.AspNetCore.Mvc.ViewFeatures; -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions -{ - public class InputTestTagHelper : TagHelper - { - public ModelExpression For { get; set; } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs index de2293f16b..cc9f82d681 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs @@ -15,237 +15,222 @@ using Microsoft.CodeAnalysis.Emit; using Microsoft.CodeAnalysis.Razor; using Microsoft.Extensions.DependencyModel; using Xunit; +#if !NET46 +using System.Runtime.Loader; +#endif namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests { public class CodeGenerationIntegrationTest : IntegrationTestBase { + private const string CurrentMvcShim = "Microsoft.AspNetCore.Razor.Test.MvcShim.dll"; private static readonly RazorSourceDocument DefaultImports = MvcRazorTemplateEngine.GetDefaultImports(); #region Runtime [Fact] public void IncompleteDirectives_Runtime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyService +{ + public string Html { get; set; } +}"; + var compilationReferences = CreateCompilationReferences(CurrentMvcShim, appCode); - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + RunRuntimeTest(compilationReferences, expectedErrors: new[] + { + "Identifier expected" + }); } [Fact] public void InheritsViewModel_Runtime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Razor; - // Act - engine.Process(document); +public class MyBasePageForViews : RazorPage +{ + public override Task ExecuteAsync() + { + throw new System.NotImplementedException(); + } +} +public class MyModel +{ - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + + RunRuntimeTest(references); } [Fact] public void InheritsWithViewImports_Runtime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.RazorPages; - // Act - engine.Process(document); +public abstract class MyPageModel : Page +{ + public override Task ExecuteAsync() + { + throw new System.NotImplementedException(); + } +} - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class MyModel +{ + +}"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + + RunRuntimeTest(references); } [Fact] public void MalformedPageDirective_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunRuntimeTest(references); } [Fact] public void Basic_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunRuntimeTest(references); } [Fact] public void _ViewImports_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunRuntimeTest(references); } [Fact] public void Inject_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyApp +{ + public string MyProperty { get; set; } +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + RunRuntimeTest(references); } [Fact] public void InjectWithModel_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyModel +{ - // Act - engine.Process(document); +} - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class MyService +{ + public string Html { get; set; } +} + +public class MyApp +{ + public string MyProperty { get; set; } +}"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + + RunRuntimeTest(references); } [Fact] public void InjectWithSemicolon_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyModel +{ - // Act - engine.Process(document); +} - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class MyApp +{ + public string MyProperty { get; set; } +} + +public class MyService +{ + public string Html { get; set; } +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + + RunRuntimeTest(references); } [Fact] public void Model_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim); - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + RunRuntimeTest(references); } - [Fact] + [Fact(Skip = "https://github.com/aspnet/Razor/issues/1348")] public void ModelExpressionTagHelper_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +using Microsoft.AspNetCore.Mvc.ViewFeatures; - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class InputTestTagHelper : {typeof(TagHelper).FullName} +{{ + public ModelExpression For {{ get; set; }} +}} +"); + RunRuntimeTest(references); } [Fact] public void RazorPages_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(BuildDivDescriptors()); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +public class DivTagHelper : {typeof(TagHelper).FullName} +{{ - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +}} +"); + RunRuntimeTest(references); } [Fact] public void RazorPagesWithoutModel_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(BuildDivDescriptors()); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +public class DivTagHelper : {typeof(TagHelper).FullName} +{{ - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +}} +"); + RunRuntimeTest(references); } [Fact] public void PageWithNamespace_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunRuntimeTest(references); } [Fact] public void ViewWithNamespace_Runtime() { - // Arrange - var engine = CreateRuntimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunRuntimeTest(references); } #endregion @@ -253,233 +238,230 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests [Fact] public void IncompleteDirectives_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyService +{ + public string Html { get; set; } +} +"; - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest( + references, + expectedErrors: new[] + { + "Identifier expected" + }); } [Fact] public void InheritsViewModel_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Razor; - // Act - engine.Process(document); +public class MyBasePageForViews : RazorPage +{ + public override Task ExecuteAsync() + { + throw new System.NotImplementedException(); + } +} - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class MyModel +{ + +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest(references); } [Fact] public void InheritsWithViewImports_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.RazorPages; - // Act - engine.Process(document); +public class MyModel +{ - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +} + +public abstract class MyPageModel : Page +{ + public override Task ExecuteAsync() + { + throw new System.NotImplementedException(); + } +} +"; + + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest(references); } [Fact] public void MalformedPageDirective_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunDesignTimeTest(references); } [Fact] public void Basic_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunDesignTimeTest(references); } [Fact] public void _ViewImports_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunDesignTimeTest(references); } [Fact] public void Inject_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var appCode = @" +public class MyApp +{ + public string MyProperty { get; set; } +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest(references); } [Fact] public void InjectWithModel_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyModel +{ - // Act - engine.Process(document); +} - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class MyService +{ + public string Html { get; set; } +} + +public class MyApp +{ + public string MyProperty { get; set; } +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest(references); } [Fact] public void InjectWithSemicolon_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class MyModel +{ - // Act - engine.Process(document); +} - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class MyService +{ + public string Html { get; set; } +} + +public class MyApp +{ + public string MyProperty { get; set; } +} +"; + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest(references); } [Fact] public void Model_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunDesignTimeTest(references); } [Fact] public void MultipleModels_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var appCode = @" +public class ThisShouldBeGenerated +{ - // Act - engine.Process(document); +}"; - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim, appCode); + RunDesignTimeTest(references); } - [Fact] + [Fact(Skip = "https://github.com/aspnet/Razor/issues/1348")] public void ModelExpressionTagHelper_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +using Microsoft.AspNetCore.Mvc.ViewFeatures; - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +public class InputTestTagHelper : {typeof(TagHelper).FullName} +{{ + public ModelExpression For {{ get; set; }} +}} +"); + RunDesignTimeTest(references); } [Fact] public void RazorPages_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(BuildDivDescriptors()); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +public class DivTagHelper : {typeof(TagHelper).FullName} +{{ - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +}} +"); + RunDesignTimeTest(references); } [Fact] public void RazorPagesWithoutModel_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(BuildDivDescriptors()); - var document = CreateCodeDocument(); + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +public class DivTagHelper : {typeof(TagHelper).FullName} +{{ - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); +}} +"); + RunDesignTimeTest(references); } [Fact] public void PageWithNamespace_DesignTime() { - // Arrange - var engine = CreateDesignTimeEngine(); - var document = CreateCodeDocument(); - - // Act - engine.Process(document); - - // Assert - AssertIRMatchesBaseline(document.GetIRDocument()); - AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + var references = CreateCompilationReferences(CurrentMvcShim); + RunDesignTimeTest(references); } [Fact] public void ViewWithNamespace_DesignTime() + { + var references = CreateCompilationReferences(CurrentMvcShim); + RunDesignTimeTest(references); + } + #endregion + + private void RunRuntimeTest( + IEnumerable compilationReferences, + IEnumerable expectedErrors = null) { // Arrange - var engine = CreateDesignTimeEngine(); + var engine = CreateRuntimeEngine(compilationReferences); var document = CreateCodeDocument(); // Act @@ -488,48 +470,88 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests // Assert AssertIRMatchesBaseline(document.GetIRDocument()); AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + AssertDocumentCompiles(document, compilationReferences, expectedErrors); } - #endregion - protected RazorEngine CreateDesignTimeEngine(IEnumerable descriptors = null) + private void RunDesignTimeTest( + IEnumerable compilationReferences, + IEnumerable expectedErrors = null) + { + // Arrange + var engine = CreateDesignTimeEngine(compilationReferences); + var document = CreateCodeDocument(); + + // Act + engine.Process(document); + + // Assert + AssertIRMatchesBaseline(document.GetIRDocument()); + AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); + AssertLineMappingsMatchBaseline(document); + AssertDocumentCompiles(document, compilationReferences, expectedErrors); + } + + private static IEnumerable CreateCompilationReferences(string mvcShimName, string appCode = null) + { + var shimReferences = CreateMvcShimReferences(mvcShimName); + return CreateAppCodeReferences(appCode, shimReferences); + } + + private void AssertDocumentCompiles( + RazorCodeDocument document, + IEnumerable compilationReferences, + IEnumerable expectedErrors = null) + { + var syntaxTree = CSharpSyntaxTree.ParseText(document.GetCSharpDocument().GeneratedCode); + var options = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary); + + var compilation = CSharpCompilation.Create("CodeGenerationTestAssembly", new[] { syntaxTree }, compilationReferences, options); + + var diagnostics = compilation.GetDiagnostics(); + + var errors = diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error); + + if (expectedErrors == null) + { + Assert.Equal(0, errors.Count()); + } + else + { + Assert.Equal(expectedErrors.Count(), errors.Count()); + + var expectedArray = expectedErrors.ToArray(); + var actualArray = errors.ToArray(); + + for (var i = 0; i < expectedErrors.Count(); i++) + { + Assert.Equal(expectedArray[i], actualArray[i].GetMessage()); + } + } + } + + protected RazorEngine CreateDesignTimeEngine(IEnumerable references) { return RazorEngine.CreateDesignTime(b => { RazorExtensions.Register(b); - b.Features.Add(GetMetadataReferenceFeature()); - - if (descriptors != null) - { - b.AddTagHelpers(descriptors); - } - else - { - b.Features.Add(new CompilationTagHelperFeature()); - b.Features.Add(new DefaultTagHelperDescriptorProvider() { DesignTime = true }); - b.Features.Add(new ViewComponentTagHelperDescriptorProvider()); - } + b.Features.Add(GetMetadataReferenceFeature(references)); + b.Features.Add(new CompilationTagHelperFeature()); + b.Features.Add(new DefaultTagHelperDescriptorProvider() { DesignTime = true }); + b.Features.Add(new ViewComponentTagHelperDescriptorProvider()); }); } - protected RazorEngine CreateRuntimeEngine(IEnumerable descriptors = null) + protected RazorEngine CreateRuntimeEngine(IEnumerable references) { return RazorEngine.Create(b => { RazorExtensions.Register(b); - b.Features.Add(GetMetadataReferenceFeature()); - - if (descriptors != null) - { - b.AddTagHelpers(descriptors); - } - else - { - b.Features.Add(new CompilationTagHelperFeature()); - b.Features.Add(new DefaultTagHelperDescriptorProvider()); - b.Features.Add(new ViewComponentTagHelperDescriptorProvider()); - } + b.Features.Add(GetMetadataReferenceFeature(references)); + b.Features.Add(new CompilationTagHelperFeature()); + b.Features.Add(new DefaultTagHelperDescriptorProvider() { DesignTime = true }); + b.Features.Add(new ViewComponentTagHelperDescriptorProvider()); }); } @@ -547,37 +569,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests imports.Add(RazorSourceDocument.Create(text, DefaultImports.FileName, DefaultImports.Encoding)); } - private static IEnumerable BuildDivDescriptors() - { - return new List - { - BuildDescriptor("div", "DivTagHelper", "TestAssembly"), - BuildDescriptor("a", "UrlResolutionTagHelper", "Microsoft.AspNetCore.Mvc.Razor") - }; - } - - private static TagHelperDescriptor BuildDescriptor( - string tagName, - string typeName, + private static MetadataReference BuildDynamicAssembly( + string text, + IEnumerable references, string assemblyName) { - return TagHelperDescriptorBuilder.Create(typeName, assemblyName) - .TagMatchingRule(ruleBuilder => ruleBuilder.RequireTagName(tagName)) - .Build(); - } + var syntaxTree = new SyntaxTree[] { CSharpSyntaxTree.ParseText(text) }; - private static IMetadataReferenceFeature 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(); - - var syntaxTree = CreateTagHelperSyntaxTree(); var compilation = CSharpCompilation.Create( - "Microsoft.AspNetCore.Mvc.Razor", + assemblyName, syntaxTree, references, options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); @@ -588,25 +588,63 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests Assert.True(compilationResult.Success); - references.Add(MetadataReference.CreateFromStream(stream)); - - var feature = new DefaultMetadataReferenceFeature() - { - References = references, - }; - - return feature; + return MetadataReference.CreateFromStream(stream); } - private static IEnumerable CreateTagHelperSyntaxTree() + private static IRazorEngineFeature GetMetadataReferenceFeature(IEnumerable references) { - var text = $@" - public class UrlResolutionTagHelper : {typeof(TagHelper).FullName} - {{ + return new DefaultMetadataReferenceFeature() + { + References = references.ToList() + }; + } - }}"; + private static IEnumerable CreateAppCodeReferences(string appCode, IEnumerable shimReferences) + { + var references = new List(shimReferences); - return new SyntaxTree[] { CSharpSyntaxTree.ParseText(text) }; + if (appCode != null) + { + var appCodeSyntaxTrees = new List { CSharpSyntaxTree.ParseText(appCode) }; + + var compilation = CSharpCompilation.Create( + "AppCode", + appCodeSyntaxTrees, + shimReferences, + options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + var stream = new MemoryStream(); + var compilationResult = compilation.Emit(stream, options: new EmitOptions()); + stream.Position = 0; + + var diagString = string.Join(";", compilationResult.Diagnostics.Where(s => s.Severity == DiagnosticSeverity.Error).Select(s => s.ToString())); + Assert.True(compilationResult.Success, string.Format("Application code needed for tests didn't compile!: {0}", diagString)); + + references.Add(MetadataReference.CreateFromStream(stream)); + } + + return references; + } + + private static IEnumerable CreateMvcShimReferences(string mvcShimName) + { + var dllPath = Path.Combine(Directory.GetCurrentDirectory(), mvcShimName); + Assembly assembly; +#if NET46 + assembly = Assembly.LoadFile(dllPath); +#else + assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(dllPath); +#endif + var assemblyDependencyContext = DependencyContext.Load(assembly); + + var assemblyReferencePaths = assemblyDependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths()); + + var references = assemblyReferencePaths + .Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath)) + .ToList(); + + Assert.NotEmpty(references); + + return references; } } } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj index 3767a8c652..41190c40d9 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj @@ -28,6 +28,30 @@ + + + + + + false + Content + PreserveNewest + Build + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ModelExpressionPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ModelExpressionPassTest.cs index 5f3c483f9b..1aaa9066d4 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ModelExpressionPassTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ModelExpressionPassTest.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Intermediate; using Microsoft.AspNetCore.Razor.Language.Legacy; @@ -69,7 +68,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions .BindAttribute(attribute => attribute .Name("Foo") - .TypeName(typeof(ModelExpression).FullName)) + .TypeName("Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression")) .TagMatchingRule(rule => rule.RequireTagName("p")) .Build() @@ -114,7 +113,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions .BindAttribute(attribute => attribute .Name("Foo") - .TypeName(typeof(ModelExpression).FullName)) + .TypeName("Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression")) .TagMatchingRule(rule => rule.RequireTagName("p")) .Build() diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml index 90b91c5da6..6e13d2e6f0 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml @@ -1,4 +1,4 @@ - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs index dc4f8622fb..712569bdf7 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs @@ -20,12 +20,12 @@ namespace AspNetCore public async override global::System.Threading.Tasks.Task ExecuteAsync() { #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" - __o = logo; + __o = this.ToString(); #line default #line hidden #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" -__o = Html.Input("SomeKey"); +__o = string.Format("{0}", "Hello"); #line default #line hidden diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt index 8807cbe2f9..ab1bfc4031 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt @@ -29,18 +29,19 @@ Document - MethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [4] Basic.cshtml) RazorIRToken - (0:0,0 [4] 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 -
+ HtmlAttribute - (4:0,4 [25] Basic.cshtml) - class=" - " + CSharpAttributeValue - (12:0,12 [16] Basic.cshtml) - + CSharpExpression - (13:0,13 [15] Basic.cshtml) + RazorIRToken - (13:0,13 [15] Basic.cshtml) - CSharp - this.ToString() + HtmlContent - (29:0,29 [24] Basic.cshtml) + RazorIRToken - (29:0,29 [1] Basic.cshtml) - Html - > + RazorIRToken - (30:0,30 [23] Basic.cshtml) - Html - \n Hello world\n + CSharpExpression - (54:2,5 [29] Basic.cshtml) + RazorIRToken - (54:2,5 [29] Basic.cshtml) - CSharp - string.Format("{0}", "Hello") + HtmlContent - (83:2,34 [10] Basic.cshtml) + RazorIRToken - (83:2,34 [2] Basic.cshtml) - Html - \n + RazorIRToken - (85:3,0 [6] Basic.cshtml) - Html - + RazorIRToken - (91:3,6 [2] Basic.cshtml) - Html - \n InjectDirective - InjectDirective - InjectDirective - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt index a1413c119e..31a1c5d011 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt @@ -1,10 +1,10 @@ -Source Location: (13:0,13 [4] /TestFiles/Input/Basic.cshtml) -|logo| -Generated Location: (829:22,13 [4] ) -|logo| +Source Location: (13:0,13 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) +|this.ToString()| +Generated Location: (909:22,13 [15] ) +|this.ToString()| -Source Location: (43:2,5 [21] /TestFiles/Input/Basic.cshtml) -|Html.Input("SomeKey")| -Generated Location: (914:27,6 [21] ) -|Html.Input("SomeKey")| +Source Location: (54:2,5 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) +|string.Format("{0}", "Hello")| +Generated Location: (1045:27,6 [29] ) +|string.Format("{0}", "Hello")| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs index 60f0d45217..87f0ae5339 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs @@ -1,4 +1,4 @@ -#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "54a70ff4c6d27ac6cdc6725cb6bab12012015729" +#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fd421120502bfd80d21169d04fd6ba54b5cc7f12" namespace AspNetCore { #line hidden @@ -17,25 +17,25 @@ namespace AspNetCore BeginContext(0, 4, true); WriteLiteral("