Revert "Fixing tests"
- wrong fix especially now that test encoders work as expected
- touch up `HtmlHelperTest` and `RazorViewTest` since test encoders are now consistent
- remove references to old `Microsoft.Extensions.WebEncoders.Testing` package
This reverts commit a9d5876cd9.
- but leave `FormTagHelperTest` and `ValidationMessageTagHelperTest` cleanup alone
nit: use `string.Empty` in `HtmlHelperLinkGenerationTest`
This commit is contained in:
parent
c0b9dd1208
commit
ff91e796c1
|
|
@ -206,10 +206,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
writer.Write(" ");
|
writer.Write(" ");
|
||||||
writer.Write(key);
|
writer.Write(key);
|
||||||
writer.Write("=\"");
|
writer.Write("=\"");
|
||||||
if (!string.IsNullOrEmpty(attribute.Value))
|
encoder.Encode(writer, attribute.Value);
|
||||||
{
|
|
||||||
encoder.Encode(writer, attribute.Value);
|
|
||||||
}
|
|
||||||
writer.Write("\"");
|
writer.Write("\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,7 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
|
||||||
throw new ArgumentNullException(nameof(encoder));
|
throw new ArgumentNullException(nameof(encoder));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(_input))
|
encoder.Encode(writer, _input);
|
||||||
{
|
|
||||||
encoder.Encode(writer, _input);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string DebuggerToString()
|
private string DebuggerToString()
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@
|
||||||
"warningsAsErrors": true
|
"warningsAsErrors": true
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Mvc" : "6.0.0-*",
|
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TestCommon": { "version": "6.0.0-*", "type": "build" },
|
|
||||||
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
||||||
|
"Microsoft.AspNet.Mvc.TestCommon": {
|
||||||
|
"version": "6.0.0-*",
|
||||||
|
"type": "build"
|
||||||
|
},
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"Moq": "4.2.1312.1622",
|
"Moq": "4.2.1312.1622",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,19 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Http": "1.0.0-*",
|
"Microsoft.AspNet.Http": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
||||||
|
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TestCommon": {
|
"Microsoft.AspNet.Mvc.TestCommon": {
|
||||||
"version": "6.0.0-*",
|
"version": "6.0.0-*",
|
||||||
"type": "build"
|
"type": "build"
|
||||||
},
|
},
|
||||||
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
|
||||||
"Microsoft.AspNet.Mvc.TestDiagnosticListener.Sources": {
|
"Microsoft.AspNet.Mvc.TestDiagnosticListener.Sources": {
|
||||||
"version": "6.0.0-*",
|
"version": "6.0.0-*",
|
||||||
"type": "build"
|
"type": "build"
|
||||||
},
|
},
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
|
||||||
"Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*",
|
"Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"Moq": "4.2.1312.1622",
|
"Moq": "4.2.1312.1622",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"Moq": "4.2.1312.1622",
|
"Moq": "4.2.1312.1622",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"Moq": "4.2.1312.1622",
|
"Moq": "4.2.1312.1622",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"Moq": "4.2.1312.1622",
|
"Moq": "4.2.1312.1622",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
"Microsoft.AspNet.Mvc.Formatters.Xml" : "6.0.0-*",
|
"Microsoft.AspNet.Mvc.Formatters.Xml" : "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TestCommon": { "type": "build", "version": "6.0.0-*" },
|
"Microsoft.AspNet.Mvc.TestCommon": { "type": "build", "version": "6.0.0-*" },
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"Moq": "4.2.1312.1622",
|
"Moq": "4.2.1312.1622",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|
@ -62,10 +62,10 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Globbed script tag with existing file -->
|
<!-- Globbed script tag with existing file -->
|
||||||
HtmlEncode[[]]<script src="HtmlEncode[[/styles/site.js]]"></script>
|
<script src="HtmlEncode[[/styles/site.js]]"></script>
|
||||||
|
|
||||||
<!-- Globbed script tag with existing file and exclude -->
|
<!-- Globbed script tag with existing file and exclude -->
|
||||||
HtmlEncode[[]]<script src="HtmlEncode[[/styles/site.js]]"></script><script src="HtmlEncode[[/styles/sub/site2.js]]"></script>
|
<script src="HtmlEncode[[/styles/site.js]]"></script><script src="HtmlEncode[[/styles/sub/site2.js]]"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Globbed script tag missing include
|
// Globbed script tag missing include
|
||||||
|
|
@ -76,16 +76,16 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Globbed script tag with comma separated include pattern -->
|
<!-- Globbed script tag with comma separated include pattern -->
|
||||||
HtmlEncode[[]]<script src="HtmlEncode[[/styles/site.js]]"></script><script src="HtmlEncode[[/styles/sub/site2.js]]"></script><script src="HtmlEncode[[/styles/sub/site3.js]]"></script>
|
<script src="HtmlEncode[[/styles/site.js]]"></script><script src="HtmlEncode[[/styles/sub/site2.js]]"></script><script src="HtmlEncode[[/styles/sub/site3.js]]"></script>
|
||||||
|
|
||||||
<!-- Globbed script tag with missing file -->
|
<!-- Globbed script tag with missing file -->
|
||||||
HtmlEncode[[]]
|
|
||||||
|
|
||||||
<!-- Globbed script tag with file outside of webroot -->
|
<!-- Globbed script tag with file outside of webroot -->
|
||||||
HtmlEncode[[]]
|
|
||||||
|
|
||||||
<!-- Globbed script tag with file outside of webroot -->
|
<!-- Globbed script tag with file outside of webroot -->
|
||||||
HtmlEncode[[]]
|
|
||||||
|
|
||||||
<script src="HtmlEncode[[/styles/site.js]]">
|
<script src="HtmlEncode[[/styles/site.js]]">
|
||||||
// Globbed script tag with existing file and static src
|
// Globbed script tag with existing file and static src
|
||||||
|
|
@ -110,9 +110,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Globbed script tag with existing files and version -->
|
<!-- Globbed script tag with existing files and version -->
|
||||||
HtmlEncode[[]]<script src="HtmlEncode[[/styles/site.js?v=jx1PJjLX32-xgQQx2BxnckU9QH9DVKkm4-M5bSK869I]]"></script><script src="HtmlEncode[[/styles/sub/site2.js?v=pwJaxaQxnb-rPAdF2JlAp4xiPNq1XuJFd6TyOOfNF-0]]"></script><script src="HtmlEncode[[/styles/sub/site3.js?v=lmeAMiqm76lnGyqHhu6PIBHAC0Vt46mgVB_KaG_gGdA]]"></script>
|
<script src="HtmlEncode[[/styles/site.js?v=jx1PJjLX32-xgQQx2BxnckU9QH9DVKkm4-M5bSK869I]]"></script><script src="HtmlEncode[[/styles/sub/site2.js?v=pwJaxaQxnb-rPAdF2JlAp4xiPNq1XuJFd6TyOOfNF-0]]"></script><script src="HtmlEncode[[/styles/sub/site3.js?v=lmeAMiqm76lnGyqHhu6PIBHAC0Vt46mgVB_KaG_gGdA]]"></script>
|
||||||
|
|
||||||
<!-- Globbed script tag with existing file, exclude and version -->
|
<!-- Globbed script tag with existing file, exclude and version -->
|
||||||
HtmlEncode[[]]<script src="HtmlEncode[[/styles/site.js?v=jx1PJjLX32-xgQQx2BxnckU9QH9DVKkm4-M5bSK869I]]"></script><script src="HtmlEncode[[/styles/sub/site2.js?v=pwJaxaQxnb-rPAdF2JlAp4xiPNq1XuJFd6TyOOfNF-0]]"></script>
|
<script src="HtmlEncode[[/styles/site.js?v=jx1PJjLX32-xgQQx2BxnckU9QH9DVKkm4-M5bSK869I]]"></script><script src="HtmlEncode[[/styles/sub/site2.js?v=pwJaxaQxnb-rPAdF2JlAp4xiPNq1XuJFd6TyOOfNF-0]]"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -44,7 +44,6 @@
|
||||||
"Microsoft.AspNet.WebUtilities": "1.0.0-*",
|
"Microsoft.AspNet.WebUtilities": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
|
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"ModelBindingWebSite": "1.0.0",
|
"ModelBindingWebSite": "1.0.0",
|
||||||
"MvcSample.Web": "1.0.0",
|
"MvcSample.Web": "1.0.0",
|
||||||
"PrecompilationWebSite": "1.0.0",
|
"PrecompilationWebSite": "1.0.0",
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
"type": "build"
|
"type": "build"
|
||||||
},
|
},
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.Localization": "6.0.0-*",
|
|
||||||
"Microsoft.AspNet.Mvc.TestCommon": { "version": "6.0.0-*", "type": "build" },
|
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
|
||||||
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Mvc.Localization": "6.0.0-*",
|
||||||
|
"Microsoft.AspNet.Mvc.TestCommon": {
|
||||||
|
"version": "6.0.0-*",
|
||||||
|
"type": "build"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,12 @@
|
||||||
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.Razor": "6.0.0-*",
|
"Microsoft.AspNet.Mvc.Razor": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.Razor.Host": "6.0.0-*",
|
"Microsoft.AspNet.Mvc.Razor.Host": "6.0.0-*",
|
||||||
|
"Microsoft.AspNet.Mvc.TestCommon": {
|
||||||
|
"version": "6.0.0-*",
|
||||||
|
"type": "build"
|
||||||
|
},
|
||||||
"Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-*",
|
"Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TestCommon": { "version": "6.0.0-*", "type": "build" },
|
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
|
|
|
||||||
|
|
@ -914,7 +914,6 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
"]]BodyContent" +
|
"]]BodyContent" +
|
||||||
"foo-content" +
|
"foo-content" +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
"HtmlEncode[[]]" +
|
|
||||||
Environment.NewLine;
|
Environment.NewLine;
|
||||||
|
|
||||||
var page = new TestableRazorPage(v =>
|
var page = new TestableRazorPage(v =>
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,8 @@
|
||||||
"type": "build"
|
"type": "build"
|
||||||
},
|
},
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"Microsoft.Dnx.Runtime": "1.0.0-*",
|
"Microsoft.Dnx.Runtime": "1.0.0-*",
|
||||||
|
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
|
|
|
||||||
|
|
@ -45,15 +45,15 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
modelWithNull,
|
modelWithNull,
|
||||||
modelWithText,
|
modelWithText,
|
||||||
};
|
};
|
||||||
var noneSelected = "<option>HtmlEncode[[]]</option>" + Environment.NewLine +
|
var noneSelected = "<option></option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[outer text]]</option>" + Environment.NewLine +
|
"<option>HtmlEncode[[outer text]]</option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[inner text]]</option>" + Environment.NewLine +
|
"<option>HtmlEncode[[inner text]]</option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine;
|
"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine;
|
||||||
var innerSelected = "<option>HtmlEncode[[]]</option>" + Environment.NewLine +
|
var innerSelected = "<option></option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[outer text]]</option>" + Environment.NewLine +
|
"<option>HtmlEncode[[outer text]]</option>" + Environment.NewLine +
|
||||||
"<option selected=\"HtmlEncode[[selected]]\">HtmlEncode[[inner text]]</option>" + Environment.NewLine +
|
"<option selected=\"HtmlEncode[[selected]]\">HtmlEncode[[inner text]]</option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine;
|
"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine;
|
||||||
var outerSelected = "<option>HtmlEncode[[]]</option>" + Environment.NewLine +
|
var outerSelected = "<option></option>" + Environment.NewLine +
|
||||||
"<option selected=\"HtmlEncode[[selected]]\">HtmlEncode[[outer text]]</option>" + Environment.NewLine +
|
"<option selected=\"HtmlEncode[[selected]]\">HtmlEncode[[outer text]]</option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[inner text]]</option>" + Environment.NewLine +
|
"<option>HtmlEncode[[inner text]]</option>" + Environment.NewLine +
|
||||||
"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine;
|
"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine;
|
||||||
|
|
|
||||||
|
|
@ -48,35 +48,32 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
{ null, typeof(Model), null,
|
{ null, typeof(Model), null,
|
||||||
new NameAndId("Text", "Text"),
|
new NameAndId("Text", "Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[]]" },
|
Environment.NewLine },
|
||||||
|
|
||||||
{ modelWithNull, typeof(Model), modelWithNull.Text,
|
{ modelWithNull, typeof(Model), modelWithNull.Text,
|
||||||
new NameAndId("Text", "Text"),
|
new NameAndId("Text", "Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[]]"},
|
Environment.NewLine },
|
||||||
{ modelWithText, typeof(Model), modelWithText.Text,
|
{ modelWithText, typeof(Model), modelWithText.Text,
|
||||||
new NameAndId("Text", "Text"),
|
new NameAndId("Text", "Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[outer text]]" },
|
Environment.NewLine + "HtmlEncode[[outer text]]" },
|
||||||
|
|
||||||
{ modelWithNull, typeof(NestedModel), modelWithNull.NestedModel.Text,
|
{ modelWithNull, typeof(NestedModel), modelWithNull.NestedModel.Text,
|
||||||
new NameAndId("NestedModel.Text", "NestedModel_Text"),
|
new NameAndId("NestedModel.Text", "NestedModel_Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[]]" },
|
Environment.NewLine },
|
||||||
|
|
||||||
{ modelWithText, typeof(NestedModel), modelWithText.NestedModel.Text,
|
{ modelWithText, typeof(NestedModel), modelWithText.NestedModel.Text,
|
||||||
new NameAndId("NestedModel.Text", "NestedModel_Text"),
|
new NameAndId("NestedModel.Text", "NestedModel_Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[inner text]]" },
|
Environment.NewLine + "HtmlEncode[[inner text]]" },
|
||||||
|
|
||||||
{ models, typeof(Model), models[0].Text,
|
{ models, typeof(Model), models[0].Text,
|
||||||
new NameAndId("[0].Text", "z0__Text"),
|
new NameAndId("[0].Text", "z0__Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[]]" },
|
Environment.NewLine },
|
||||||
|
|
||||||
{ models, typeof(Model), models[1].Text,
|
{ models, typeof(Model), models[1].Text,
|
||||||
new NameAndId("[1].Text", "z1__Text"),
|
new NameAndId("[1].Text", "z1__Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[outer text]]" },
|
Environment.NewLine + "HtmlEncode[[outer text]]" },
|
||||||
|
|
||||||
{ models, typeof(NestedModel), models[0].NestedModel.Text,
|
{ models, typeof(NestedModel), models[0].NestedModel.Text,
|
||||||
new NameAndId("[0].NestedModel.Text", "z0__NestedModel_Text"),
|
new NameAndId("[0].NestedModel.Text", "z0__NestedModel_Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[]]" },
|
Environment.NewLine },
|
||||||
|
|
||||||
{ models, typeof(NestedModel), models[1].NestedModel.Text,
|
{ models, typeof(NestedModel), models[1].NestedModel.Text,
|
||||||
new NameAndId("[1].NestedModel.Text", "z1__NestedModel_Text"),
|
new NameAndId("[1].NestedModel.Text", "z1__NestedModel_Text"),
|
||||||
Environment.NewLine + "HtmlEncode[[inner text]]" },
|
Environment.NewLine + "HtmlEncode[[inner text]]" },
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
},
|
},
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
GetRouteValuesAsString(routeValues),
|
GetRouteValuesAsString(routeValues),
|
||||||
fragment,
|
fragment,
|
||||||
GetHtmlAttributesAsString(htmlAttributes));
|
GetHtmlAttributesAsString(htmlAttributes));
|
||||||
expectedLink = expectedLink.Replace("HtmlEncode[[]]", "");
|
expectedLink = expectedLink.Replace("HtmlEncode[[]]", string.Empty);
|
||||||
|
|
||||||
var urlHelper = new Mock<IUrlHelper>();
|
var urlHelper = new Mock<IUrlHelper>();
|
||||||
urlHelper.Setup(h => h.Action(It.IsAny<UrlActionContext>()))
|
urlHelper.Setup(h => h.Action(It.IsAny<UrlActionContext>()))
|
||||||
|
|
@ -122,7 +122,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
GetRouteValuesAsString(routeValues),
|
GetRouteValuesAsString(routeValues),
|
||||||
fragment,
|
fragment,
|
||||||
GetHtmlAttributesAsString(htmlAttributes));
|
GetHtmlAttributesAsString(htmlAttributes));
|
||||||
expectedLink = expectedLink.Replace("HtmlEncode[[]]", "");
|
expectedLink = expectedLink.Replace("HtmlEncode[[]]", string.Empty);
|
||||||
|
|
||||||
var urlHelper = new Mock<IUrlHelper>();
|
var urlHelper = new Mock<IUrlHelper>();
|
||||||
urlHelper
|
urlHelper
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
var data = new TheoryData<object, string>
|
var data = new TheoryData<object, string>
|
||||||
{
|
{
|
||||||
{ null, string.Empty },
|
{ null, string.Empty },
|
||||||
// Object overload does not special case the empty string.
|
{ string.Empty, string.Empty },
|
||||||
{ string.Empty, "HtmlEncode[[]]" },
|
|
||||||
{ "<\">", "HtmlEncode[[<\">]]" },
|
{ "<\">", "HtmlEncode[[<\">]]" },
|
||||||
{ "<br />", "HtmlEncode[[<br />]]" },
|
{ "<br />", "HtmlEncode[[<br />]]" },
|
||||||
{ "<b>bold</b>", "HtmlEncode[[<b>bold</b>]]" },
|
{ "<b>bold</b>", "HtmlEncode[[<b>bold</b>]]" },
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,8 @@
|
||||||
},
|
},
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
|
||||||
"Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*",
|
"Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*",
|
||||||
"Microsoft.Extensions.WebEncoders.Testing": "1.0.0-*",
|
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
|
||||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue