Removed warning in ViewImports integration test

This commit is contained in:
Ajay Bhargav Baaskaran 2017-07-28 16:59:35 -07:00
parent 244c6ddccd
commit ee64ee7e1a
6 changed files with 12 additions and 18 deletions

View File

@ -109,11 +109,8 @@ public class MyModel
[Fact]
public void _ViewImports_Runtime()
{
var error = "'TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml.Model' " +
"hides inherited member 'RazorPage<dynamic>.Model'. Use the new keyword if hiding was intended.";
var references = CreateCompilationReferences(CurrentMvcShim);
RunRuntimeTest(references, new[] { error, });
RunRuntimeTest(references);
}
[Fact]
@ -347,11 +344,8 @@ public abstract class MyPageModel<T> : Page
[Fact]
public void _ViewImports_DesignTime()
{
var error = "'TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml.Model' " +
"hides inherited member 'RazorPage<dynamic>.Model'. Use the new keyword if hiding was intended.";
var references = CreateCompilationReferences(CurrentMvcShim);
RunDesignTimeTest(references, new[] { error, });
RunDesignTimeTest(references);
}
[Fact]

View File

@ -1 +1 @@
@inject IHtmlHelper<TModel> Model
@inject IHtmlHelper<TModel> Helper

View File

@ -20,7 +20,7 @@ IHtmlHelper<TModel> __typeHelper = default(IHtmlHelper<TModel>);
}
))();
((System.Action)(() => {
global::System.Object Model = null;
global::System.Object Helper = null;
}
))();
}
@ -34,7 +34,7 @@ global::System.Object Model = null;
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public IHtmlHelper<dynamic> Model { get; private set; }
public IHtmlHelper<dynamic> Helper { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

View File

@ -24,7 +24,7 @@ Document -
DirectiveToken - (729:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (832:14,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
DirectiveToken - (28:0,28 [6] _ViewImports.cshtml) - Helper
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -

View File

@ -3,8 +3,8 @@ Source Location: (8:0,8 [19] TestFiles/IntegrationTests/CodeGenerationIntegratio
Generated Location: (679:18,0 [19] )
|IHtmlHelper<TModel>|
Source Location: (28:0,28 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml)
|Model|
Generated Location: (827:22,22 [5] )
|Model|
Source Location: (28:0,28 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml)
|Helper|
Generated Location: (827:22,22 [6] )
|Helper|

View File

@ -1,4 +1,4 @@
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "778b41f9406fcda776cc3f1bf093f3b21956e582"
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e57bbc3e746e8b13b4c33d8df0e022bd397d8caa"
// <auto-generated/>
#pragma warning disable 1591
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml))]
@ -20,7 +20,7 @@ namespace AspNetCore
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public IHtmlHelper<dynamic> Model { get; private set; }
public IHtmlHelper<dynamic> Helper { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]