From bebd3dc9a0122cc35a1ecc4e4305b767588c61b9 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 5 Nov 2015 14:27:42 -0800 Subject: [PATCH] Update test files to showcase block level Razor statements in attributes. - Block level Razor statements in attributes used to not work. Added a few use cases to ensure that they're properly tested. aspnet/Razor#594 --- .../RazorWebSite.UrlResolution.Index.Encoded.html | 1 + .../resources/RazorWebSite.UrlResolution.Index.html | 1 + ...WebSite.Home.UnboundDynamicAttributes.Encoded.html | 5 ++++- ...gHelpersWebSite.Home.UnboundDynamicAttributes.html | 5 ++++- .../RazorWebSite/Views/UrlResolution/Index.cshtml | 8 ++++++++ .../Views/Home/UnboundDynamicAttributes.cshtml | 11 ++++++++++- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.Encoded.html b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.Encoded.html index 8a89e575b2..b759d1e5e7 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.Encoded.html +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.Encoded.html @@ -27,6 +27,7 @@ + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.html b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.html index 326890c06f..73f9fcdb67 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.html +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/RazorWebSite.UrlResolution.Index.html @@ -27,6 +27,7 @@ + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.Encoded.html b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.Encoded.html index 1cf31bbfcc..944255327a 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.Encoded.html +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.Encoded.html @@ -1,4 +1,6 @@ + + @@ -12,4 +14,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.html b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.html index 07f535a299..d1a78630dc 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.html +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/compiler/resources/TagHelpersWebSite.Home.UnboundDynamicAttributes.html @@ -1,4 +1,6 @@ + + @@ -12,4 +14,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/test/WebSites/RazorWebSite/Views/UrlResolution/Index.cshtml b/test/WebSites/RazorWebSite/Views/UrlResolution/Index.cshtml index 1e00f4329d..2e9b6d9773 100644 --- a/test/WebSites/RazorWebSite/Views/UrlResolution/Index.cshtml +++ b/test/WebSites/RazorWebSite/Views/UrlResolution/Index.cshtml @@ -4,6 +4,13 @@ var dynamicUrl = "~/SomeUrl"; } +@functions { + public Task DoSomething() + { + return Task.FromResult(true); + } +} + @@ -33,6 +40,7 @@ + \ No newline at end of file diff --git a/test/WebSites/TagHelpersWebSite/Views/Home/UnboundDynamicAttributes.cshtml b/test/WebSites/TagHelpersWebSite/Views/Home/UnboundDynamicAttributes.cshtml index 0dec871399..109681004f 100644 --- a/test/WebSites/TagHelpersWebSite/Views/Home/UnboundDynamicAttributes.cshtml +++ b/test/WebSites/TagHelpersWebSite/Views/Home/UnboundDynamicAttributes.cshtml @@ -7,6 +7,14 @@ var stringVar = "value"; string nullVar = null; } + +@functions { + public Task DoSomething() + { + return Task.FromResult(true); + } +} + @@ -20,4 +28,5 @@ - \ No newline at end of file + + \ No newline at end of file