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
This commit is contained in:
N. Taylor Mullen 2015-11-05 14:27:42 -08:00
parent 5364468001
commit bebd3dc9a0
6 changed files with 28 additions and 3 deletions

View File

@ -27,6 +27,7 @@
<menuitem icon="HtmlEncode[[/]]Person" />
</menu>
<object data="HtmlEncode[[/]]Person" archive="HtmlEncode[[/]]Person/HtmlEncode[[John Doe]]" data="HtmlEncode[[/]]Person" archive="HtmlEncode[[/]]Person/HtmlEncode[[John Doe]]" />
<object archive="HtmlEncode[[/]]Person/HtmlEncode[[John Doe]]" />
<applet archive="HtmlEncode[[/]]A+Really(Crazy),Url.Is:This/HtmlEncode[[John Doe]]/Detail" />
</body>
</html>

View File

@ -27,6 +27,7 @@
<menuitem icon="/Person" />
</menu>
<object data="/Person" archive="/Person/John Doe" data="/Person" archive="/Person/John Doe" />
<object archive="/Person/John Doe" />
<applet archive="/A+Really(Crazy),Url.Is:This/John Doe/Detail" />
</body>
</html>

View File

@ -1,4 +1,6 @@
<input checked="HtmlEncode[[checked]]" processed />
<input checked="HtmlEncode[[checked]]" processed />
<input processed />
@ -12,4 +14,5 @@
<input processed />
<input checked="" processed />
<input checked=" " processed />
<input checked=" HtmlEncode[[value]] HtmlEncode[[True]]" processed />
<input checked=" HtmlEncode[[value]] HtmlEncode[[True]]" processed />
<input checked=" True " processed />

View File

@ -1,4 +1,6 @@
<input checked="checked" processed />
<input checked="checked" processed />
<input processed />
@ -12,4 +14,5 @@
<input processed />
<input checked="" processed />
<input checked=" " processed />
<input checked=" value True" processed />
<input checked=" value True" processed />
<input checked=" True " processed />

View File

@ -4,6 +4,13 @@
var dynamicUrl = "~/SomeUrl";
}
@functions {
public Task DoSomething()
{
return Task.FromResult(true);
}
}
<html manifest="~/Person">
<head>
<base href="~/A+Really(Crazy),Url.Is:This/@Model.Name/Detail" target="_blank">
@ -33,6 +40,7 @@
<menuitem icon=~/Person />
</menu>
<object data="~/Person" archive="~/Person/@Model.Name" data="~/Person" archive="~/Person/@Model.Name" />
<object archive="@if(Model.Name != null) { <text>~/Person/@Model.Name</text> } else { await DoSomething(); <text>~/Person</text> } " />
<applet archive="~/A+Really(Crazy),Url.Is:This/@Model.Name/Detail" />
</body>
</html>

View File

@ -7,6 +7,14 @@
var stringVar = "value";
string nullVar = null;
}
@functions {
public Task DoSomething()
{
return Task.FromResult(true);
}
}
<input checked="@true" />
<input checked="@trueVar" />
<input checked="@false" />
@ -20,4 +28,5 @@
<input checked="@null" />
<input checked=" @nullVar" />
<input checked="@nullVar " />
<input checked=" @null @stringVar @trueVar" />
<input checked=" @null @stringVar @trueVar" />
<input checked=" @if (trueVar) { <text>True</text> } else { await DoSomething(); <text>False</text> } " />