diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/InjectChunkVisitorTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/InjectChunkVisitorTest.cs index 85705b0fff..afd458d64f 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/InjectChunkVisitorTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/InjectChunkVisitorTest.cs @@ -146,82 +146,6 @@ MyType1 Assert.Equal(expected, code); } - [Fact] - public void InjectVisitor_GeneratesCorrectLineMappings() - { - // Arrange - var host = new MvcRazorHost(new TestFileSystem()) - { - DesignTimeMode = true - }; - host.NamespaceImports.Clear(); - var engine = new RazorTemplateEngine(host); - var source = ReadResource("TestFiles/Input/Inject.cshtml"); - var expectedCode = ReadResource("TestFiles/Output/Inject.cs"); - var expectedLineMappings = new List - { - BuildLineMapping(1, 0, 1, 30, 3, 0, 17), - BuildLineMapping(28, 1, 8, 598, 26, 8, 20) - }; - - // Act - GeneratorResults results; - using (var buffer = new StringTextBuffer(source)) - { - results = engine.GenerateCode(buffer); - } - - // Assert - Assert.True(results.Success); - Assert.Equal(expectedCode, results.GeneratedCode); - Assert.Empty(results.ParserErrors); - Assert.Equal(expectedLineMappings, results.DesignTimeLineMappings); - } - - [Fact] - public void InjectVisitorWithModel_GeneratesCorrectLineMappings() - { - // Arrange - var host = new MvcRazorHost(new TestFileSystem()) - { - DesignTimeMode = true - }; - host.NamespaceImports.Clear(); - var engine = new RazorTemplateEngine(host); - var source = ReadResource("TestFiles/Input/InjectWithModel.cshtml"); - var expectedCode = ReadResource("TestFiles/Output/InjectWithModel.cs"); - var expectedLineMappings = new List - { - BuildLineMapping(7, 0, 7, 151, 6, 7, 7), - BuildLineMapping(24, 1, 8, 587, 26, 8, 20), - BuildLineMapping(54, 2, 8, 757, 34, 8, 23) - }; - - // Act - GeneratorResults results; - using (var buffer = new StringTextBuffer(source)) - { - results = engine.GenerateCode(buffer); - } - - // Assert - Assert.True(results.Success); - Assert.Equal(expectedCode, results.GeneratedCode); - Assert.Empty(results.ParserErrors); - Assert.Equal(expectedLineMappings, results.DesignTimeLineMappings); - } - - private string ReadResource(string resourceName) - { - var assembly = typeof(InjectChunkVisitorTest).Assembly; - - using (var stream = assembly.GetManifestResourceStream(resourceName)) - using (var streamReader = new StreamReader(stream)) - { - return streamReader.ReadToEnd(); - } - } - private static CodeGeneratorContext CreateContext() { return CodeGeneratorContext.Create(new MvcRazorHost(new TestFileSystem()), @@ -230,25 +154,5 @@ MyType1 string.Empty, shouldGenerateLinePragmas: true); } - - private static LineMapping BuildLineMapping(int documentAbsoluteIndex, - int documentLineIndex, - int documentCharacterIndex, - int generatedAbsoluteIndex, - int generatedLineIndex, - int generatedCharacterIndex, - int contentLength) - { - var documentLocation = new SourceLocation(documentAbsoluteIndex, - documentLineIndex, - documentCharacterIndex); - var generatedLocation = new SourceLocation(generatedAbsoluteIndex, - generatedLineIndex, - generatedCharacterIndex); - - return new LineMapping( - documentLocation: new MappingLocation(documentLocation, contentLength), - generatedLocation: new MappingLocation(generatedLocation, contentLength)); - } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs index 5d20588236..f52f9e7727 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs @@ -2,14 +2,10 @@ // 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 Microsoft.AspNet.Razor; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator.Compiler; using Microsoft.AspNet.Razor.Generator.Compiler.CSharp; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Text; using Xunit; namespace Microsoft.AspNet.Mvc.Razor @@ -102,48 +98,6 @@ Environment.NewLine + Assert.Equal(expected, code); } - [Fact] - public void ModelVisitor_GeneratesCorrectLineMappings() - { - // Arrange - var host = new MvcRazorHost(new TestFileSystem()) - { - DesignTimeMode = true - }; - host.NamespaceImports.Clear(); - var engine = new RazorTemplateEngine(host); - var source = ReadResource("TestFiles/Input/Model.cshtml"); - var expectedCode = ReadResource("TestFiles/Output/Model.cs"); - var expectedLineMappings = new List - { - BuildLineMapping(7, 0, 7, 151, 6, 7, 30), - }; - - // Act - GeneratorResults results; - using (var buffer = new StringTextBuffer(source)) - { - results = engine.GenerateCode(buffer); - } - - // Assert - Assert.True(results.Success); - Assert.Equal(expectedCode, results.GeneratedCode); - Assert.Empty(results.ParserErrors); - Assert.Equal(expectedLineMappings, results.DesignTimeLineMappings); - } - - private string ReadResource(string resourceName) - { - var assembly = typeof(ModelChunkVisitorTest).Assembly; - - using (var stream = assembly.GetManifestResourceStream(resourceName)) - using (var streamReader = new StreamReader(stream)) - { - return streamReader.ReadToEnd(); - } - } - private static CodeGeneratorContext CreateContext() { return CodeGeneratorContext.Create(new MvcRazorHost(new TestFileSystem()), @@ -152,25 +106,5 @@ Environment.NewLine + string.Empty, shouldGenerateLinePragmas: true); } - - private static LineMapping BuildLineMapping(int documentAbsoluteIndex, - int documentLineIndex, - int documentCharacterIndex, - int generatedAbsoluteIndex, - int generatedLineIndex, - int generatedCharacterIndex, - int contentLength) - { - var documentLocation = new SourceLocation(documentAbsoluteIndex, - documentLineIndex, - documentCharacterIndex); - var generatedLocation = new SourceLocation(generatedAbsoluteIndex, - generatedLineIndex, - generatedCharacterIndex); - - return new LineMapping( - documentLocation: new MappingLocation(documentLocation, contentLength), - generatedLocation: new MappingLocation(generatedLocation, contentLength)); - } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs new file mode 100644 index 0000000000..ca6647ccbb --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Open Technologies, Inc. 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 Microsoft.AspNet.Razor; +using Microsoft.AspNet.Razor.Generator.Compiler; +using Microsoft.AspNet.Razor.Text; +using Xunit; + +namespace Microsoft.AspNet.Mvc.Razor +{ + public class MvcRazorHostTest + { + [Theory] + [InlineData("Basic")] + [InlineData("Inject")] + [InlineData("InjectWithModel")] + [InlineData("Model")] + public void MvcRazorHost_ParsesAndGeneratesCodeForBasicScenarios(string scenarioName) + { + // Arrange + var host = new MvcRazorHost(new TestFileSystem()); + + // Act and Assert + RunRuntimeTest(host, scenarioName); + } + + [Fact] + public void InjectVisitor_GeneratesCorrectLineMappings() + { + // Arrange + var host = new MvcRazorHost(new TestFileSystem()) + { + DesignTimeMode = true + }; + host.NamespaceImports.Clear(); + var expectedLineMappings = new List + { + BuildLineMapping(1, 0, 1, 59, 3, 0, 17), + BuildLineMapping(28, 1, 8, 688, 26, 8, 20) + }; + + // Act and Assert + RunDesignTimeTest(host, "Inject", expectedLineMappings); + } + + [Fact] + public void InjectVisitorWithModel_GeneratesCorrectLineMappings() + { + // Arrange + var host = new MvcRazorHost(new TestFileSystem()) + { + DesignTimeMode = true + }; + host.NamespaceImports.Clear(); + var expectedLineMappings = new[] + { + BuildLineMapping(7, 0, 7, 214, 6, 7, 7), + BuildLineMapping(24, 1, 8, 713, 26, 8, 20), + BuildLineMapping(54, 2, 8, 921, 34, 8, 23) + }; + + // Act and Assert + RunDesignTimeTest(host, "InjectWithModel", expectedLineMappings); + } + + [Fact] + public void ModelVisitor_GeneratesCorrectLineMappings() + { + // Arrange + var host = new MvcRazorHost(new TestFileSystem()) + { + DesignTimeMode = true + }; + host.NamespaceImports.Clear(); + var expectedLineMappings = new[] + { + BuildLineMapping(7, 0, 7, 194, 6, 7, 30), + }; + + // Act and Assert + RunDesignTimeTest(host, "Model", expectedLineMappings); + } + + private static void RunRuntimeTest(MvcRazorHost host, + string testName) + { + var inputFile = "TestFiles/Input/" + testName + ".cshtml"; + var expectedCode = ReadResource("TestFiles/Output/Runtime/" + testName + ".cs"); + + // Act + GeneratorResults results; + using (var stream = GetResourceStream(inputFile)) + { + results = host.GenerateCode(inputFile, stream); + } + + // Assert + Assert.True(results.Success); + Assert.Equal(expectedCode, results.GeneratedCode); + Assert.Empty(results.ParserErrors); + } + + private static void RunDesignTimeTest(MvcRazorHost host, + string testName, + IEnumerable expectedLineMappings) + { + var inputFile = "TestFiles/Input/" + testName + ".cshtml"; + var expectedCode = ReadResource("TestFiles/Output/DesignTime/" + testName + ".cs"); + + // Act + GeneratorResults results; + using (var stream = GetResourceStream(inputFile)) + { + results = host.GenerateCode(inputFile, stream); + } + + // Assert + Assert.True(results.Success); + Assert.Equal(expectedCode, results.GeneratedCode); + Assert.Empty(results.ParserErrors); + Assert.Equal(expectedLineMappings, results.DesignTimeLineMappings); + } + + private static string ReadResource(string resourceName) + { + using (var stream = GetResourceStream(resourceName)) + { + using (var streamReader = new StreamReader(stream)) + { + return streamReader.ReadToEnd(); + } + } + } + + private static Stream GetResourceStream(string resourceName) + { + var assembly = typeof(MvcRazorHostTest).Assembly; + return assembly.GetManifestResourceStream(resourceName); + } + + private static LineMapping BuildLineMapping(int documentAbsoluteIndex, + int documentLineIndex, + int documentCharacterIndex, + int generatedAbsoluteIndex, + int generatedLineIndex, + int generatedCharacterIndex, + int contentLength) + { + var documentLocation = new SourceLocation(documentAbsoluteIndex, + documentLineIndex, + documentCharacterIndex); + var generatedLocation = new SourceLocation(generatedAbsoluteIndex, + generatedLineIndex, + generatedCharacterIndex); + + return new LineMapping( + documentLocation: new MappingLocation(documentLocation, contentLength), + generatedLocation: new MappingLocation(generatedLocation, contentLength)); + } + } +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml new file mode 100644 index 0000000000..90b91c5da6 --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs new file mode 100644 index 0000000000..74593b407b --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs @@ -0,0 +1,59 @@ +namespace Asp +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Microsoft.AspNet.Mvc; + using Microsoft.AspNet.Mvc.Rendering; + using System.Threading.Tasks; + + public class ASPV_TestFiles_Input_Basic_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + { + #line hidden + public ASPV_TestFiles_Input_Basic_cshtml() + { + } + #line hidden + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.Rendering.IHtmlHelper Html { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IViewComponentHelper Component { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IUrlHelper Url { get; private set; } + + #line hidden + + #pragma warning disable 1998 + public override async Task ExecuteAsync() + { + PageExecutionContext.BeginContext(0, 4, true); + WriteLiteral("( +#line 1 "TestFiles/Input/Basic.cshtml" + logo + +#line default +#line hidden + , 12), false)); + PageExecutionContext.BeginContext(18, 24, true); + WriteLiteral(">\r\n Hello world\r\n "); + PageExecutionContext.EndContext(); + PageExecutionContext.BeginContext(43, 21, false); + Write( +#line 3 "TestFiles/Input/Basic.cshtml" + Html.Input("SomeKey") + +#line default +#line hidden + ); + + PageExecutionContext.EndContext(); + PageExecutionContext.BeginContext(64, 8, true); + WriteLiteral("\r\n"); + PageExecutionContext.EndContext(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Inject.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs similarity index 82% rename from test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Inject.cs rename to test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs index f8a947a10c..4fa67c591d 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Inject.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs @@ -1,6 +1,6 @@ namespace Asp { -#line 1 "" +#line 1 "TestFiles/Input/Inject.cshtml" using MyNamespace #line default @@ -8,7 +8,7 @@ using MyNamespace ; using System.Threading.Tasks; - public class __CompiledTemplate : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_TestFiles_Input_Inject_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() @@ -17,13 +17,13 @@ using MyNamespace #pragma warning restore 219 } #line hidden - public __CompiledTemplate() + public ASPV_TestFiles_Input_Inject_cshtml() { } #line hidden [Microsoft.AspNet.Mvc.ActivateAttribute] public -#line 2 "" +#line 2 "TestFiles/Input/Inject.cshtml" MyApp MyPropertyName #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/InjectWithModel.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs similarity index 78% rename from test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/InjectWithModel.cs rename to test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs index cb3fd992d6..cf7d144d48 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/InjectWithModel.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs @@ -2,8 +2,8 @@ { using System.Threading.Tasks; - public class __CompiledTemplate : Microsoft.AspNet.Mvc.Razor.RazorPage< -#line 1 "" + public class ASPV_TestFiles_Input_InjectWithModel_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage< +#line 1 "TestFiles/Input/InjectWithModel.cshtml" MyModel #line default @@ -17,13 +17,13 @@ #pragma warning restore 219 } #line hidden - public __CompiledTemplate() + public ASPV_TestFiles_Input_InjectWithModel_cshtml() { } #line hidden [Microsoft.AspNet.Mvc.ActivateAttribute] public -#line 2 "" +#line 2 "TestFiles/Input/InjectWithModel.cshtml" MyApp MyPropertyName #line default @@ -31,7 +31,7 @@ { get; private set; } [Microsoft.AspNet.Mvc.ActivateAttribute] public -#line 3 "" +#line 3 "TestFiles/Input/InjectWithModel.cshtml" MyService Html #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Model.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs similarity index 84% rename from test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Model.cs rename to test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs index 2cc67b2a6b..9bba58b51b 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Model.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs @@ -2,8 +2,8 @@ { using System.Threading.Tasks; - public class __CompiledTemplate : Microsoft.AspNet.Mvc.Razor.RazorPage< -#line 1 "" + public class ASPV_TestFiles_Input_Model_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage< +#line 1 "TestFiles/Input/Model.cshtml" System.Collections.IEnumerable #line default @@ -17,7 +17,7 @@ #pragma warning restore 219 } #line hidden - public __CompiledTemplate() + public ASPV_TestFiles_Input_Model_cshtml() { } #line hidden diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs new file mode 100644 index 0000000000..edabf5796d --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs @@ -0,0 +1,42 @@ +namespace Asp +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Microsoft.AspNet.Mvc; + using Microsoft.AspNet.Mvc.Rendering; + using System.Threading.Tasks; + + public class ASPV_TestFiles_Input_Basic_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + { + #line hidden + public ASPV_TestFiles_Input_Basic_cshtml() + { + } + #line hidden + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.Rendering.IHtmlHelper Html { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IViewComponentHelper Component { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IUrlHelper Url { get; private set; } + + #line hidden + + #pragma warning disable 1998 + public override async Task ExecuteAsync() + { + WriteLiteral("(logo, 12), false)); + WriteLiteral(">\r\n Hello world\r\n "); +#line 3 "TestFiles/Input/Basic.cshtml" +Write(Html.Input("SomeKey")); + +#line default +#line hidden + WriteLiteral("\r\n"); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs new file mode 100644 index 0000000000..8ee25d6779 --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs @@ -0,0 +1,40 @@ +namespace Asp +{ +#line 1 "TestFiles/Input/Inject.cshtml" +using MyNamespace + +#line default +#line hidden + ; + using System; + using System.Linq; + using System.Collections.Generic; + using Microsoft.AspNet.Mvc; + using Microsoft.AspNet.Mvc.Rendering; + using System.Threading.Tasks; + + public class ASPV_TestFiles_Input_Inject_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + { + #line hidden + public ASPV_TestFiles_Input_Inject_cshtml() + { + } + #line hidden + [Microsoft.AspNet.Mvc.ActivateAttribute] + public MyApp MyPropertyName { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.Rendering.IHtmlHelper Html { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IViewComponentHelper Component { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IUrlHelper Url { get; private set; } + + #line hidden + + #pragma warning disable 1998 + public override async Task ExecuteAsync() + { + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs new file mode 100644 index 0000000000..b818f61025 --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs @@ -0,0 +1,40 @@ +namespace Asp +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Microsoft.AspNet.Mvc; + using Microsoft.AspNet.Mvc.Rendering; + using System.Threading.Tasks; + + public class ASPV_TestFiles_Input_InjectWithModel_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage< +#line 1 "TestFiles/Input/InjectWithModel.cshtml" + MyModel + +#line default +#line hidden + > + { + #line hidden + public ASPV_TestFiles_Input_InjectWithModel_cshtml() + { + } + #line hidden + [Microsoft.AspNet.Mvc.ActivateAttribute] + public MyApp MyPropertyName { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public MyService Html { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IViewComponentHelper Component { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IUrlHelper Url { get; private set; } + + #line hidden + + #pragma warning disable 1998 + public override async Task ExecuteAsync() + { + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs new file mode 100644 index 0000000000..3562ebb821 --- /dev/null +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs @@ -0,0 +1,38 @@ +namespace Asp +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Microsoft.AspNet.Mvc; + using Microsoft.AspNet.Mvc.Rendering; + using System.Threading.Tasks; + + public class ASPV_TestFiles_Input_Model_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage< +#line 1 "TestFiles/Input/Model.cshtml" + System.Collections.IEnumerable + +#line default +#line hidden + > + { + #line hidden + public ASPV_TestFiles_Input_Model_cshtml() + { + } + #line hidden + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.Rendering.IHtmlHelper Html { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IViewComponentHelper Component { get; private set; } + [Microsoft.AspNet.Mvc.ActivateAttribute] + public Microsoft.AspNet.Mvc.IUrlHelper Url { get; private set; } + + #line hidden + + #pragma warning disable 1998 + public override async Task ExecuteAsync() + { + } + #pragma warning restore 1998 + } +}