(MockBehavior.Strict).Object)
{
}
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlStringTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlStringTest.cs
index bbdd4dae4e..29a479f899 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlStringTest.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlStringTest.cs
@@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
var writer = new StringWriter();
// Act
- content.WriteTo(writer, new CommonTestEncoder());
+ content.WriteTo(writer, new HtmlTestEncoder());
// Assert
Assert.Equal(expectedText, writer.ToString());
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/TagBuilderTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/TagBuilderTest.cs
index db4448f305..b38f143010 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/TagBuilderTest.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/TagBuilderTest.cs
@@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.IO;
-using Microsoft.AspNet.Html.Abstractions;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Extensions.WebEncoders.Testing;
using Xunit;
@@ -85,7 +84,7 @@ namespace Microsoft.AspNet.Mvc.Core.Rendering
// Act
using (var writer = new StringWriter())
{
- tagBuilder.WriteTo(writer, new NullTestEncoder());
+ tagBuilder.WriteTo(writer, new HtmlTestEncoder());
// Assert
Assert.Equal(expectedOutput, writer.ToString());
@@ -116,7 +115,7 @@ namespace Microsoft.AspNet.Mvc.Core.Rendering
// Act
using (var writer = new StringWriter())
{
- tagBuilder.WriteTo(writer, new CommonTestEncoder());
+ tagBuilder.WriteTo(writer, new HtmlTestEncoder());
// Assert
Assert.Equal("HelloHtmlEncode[[, World!]]
", writer.ToString());
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewComponentTests.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewComponentTests.cs
index 4e3c01a1d0..aa86de03e8 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewComponentTests.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewComponentTests.cs
@@ -1,10 +1,10 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using System.Text.Encodings.Web;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Mvc.ViewComponents;
using Microsoft.AspNet.Mvc.ViewFeatures;
-using Microsoft.Extensions.WebEncoders;
using Xunit;
namespace Microsoft.AspNet.Mvc
@@ -49,7 +49,7 @@ namespace Microsoft.AspNet.Mvc
// Arrange
var viewComponent = new TestViewComponent();
var expectedContent = "TestContent&";
- var expectedEncodedContent = new HtmlString(new HtmlEncoder().HtmlEncode(expectedContent));
+ var expectedEncodedContent = new HtmlString(HtmlEncoder.Default.Encode(expectedContent));
// Act
var actualResult = viewComponent.Content(expectedContent);
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultEditorTemplatesTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultEditorTemplatesTest.cs
index de94dc89dd..fbae8c2fdf 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultEditorTemplatesTest.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultEditorTemplatesTest.cs
@@ -8,6 +8,7 @@ using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Text;
+using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Microsoft.AspNet.Html.Abstractions;
using Microsoft.AspNet.Http;
@@ -18,7 +19,6 @@ using Microsoft.AspNet.Mvc.TestCommon;
using Microsoft.AspNet.Mvc.ViewEngines;
using Microsoft.AspNet.Mvc.ViewFeatures.Internal;
using Microsoft.AspNet.Testing;
-using Microsoft.Extensions.WebEncoders;
using Moq;
using Xunit;
@@ -919,14 +919,14 @@ Environment.NewLine;
get { return _innerHelper.TempData; }
}
- public IUrlEncoder UrlEncoder
+ public UrlEncoder UrlEncoder
{
get { return _innerHelper.UrlEncoder; }
}
- public IJavaScriptStringEncoder JavaScriptStringEncoder
+ public JavaScriptEncoder JavaScriptEncoder
{
- get { return _innerHelper.JavaScriptStringEncoder; }
+ get { return _innerHelper.JavaScriptEncoder; }
}
public void Contextualize(ViewContext viewContext)
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultHtmlGeneratorTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultHtmlGeneratorTest.cs
index 3b804faaba..35aefb46ae 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultHtmlGeneratorTest.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/DefaultHtmlGeneratorTest.cs
@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Text.Encodings.Web;
using Microsoft.AspNet.Antiforgery;
using Microsoft.AspNet.Http.Internal;
using Microsoft.AspNet.Mvc.Abstractions;
@@ -14,7 +15,6 @@ using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Mvc.ViewEngines;
using Microsoft.AspNet.Routing;
using Microsoft.Extensions.OptionsModel;
-using Microsoft.Extensions.WebEncoders;
using Moq;
using Xunit;
@@ -645,7 +645,7 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
{
var mvcViewOptionsAccessor = new Mock>();
mvcViewOptionsAccessor.SetupGet(accessor => accessor.Value).Returns(new MvcViewOptions());
- var htmlEncoder = Mock.Of();
+ var htmlEncoder = Mock.Of();
var antiforgery = Mock.Of();
var optionsAccessor = new Mock>();
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringCollectionTextWriterTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringCollectionTextWriterTest.cs
index 4e8f1a7ac2..8249a4e3bb 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringCollectionTextWriterTest.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringCollectionTextWriterTest.cs
@@ -175,7 +175,7 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
// Act
source.Write("Hello world");
source.Write(new char[1], 0, 1);
- source.CopyTo(target, new CommonTestEncoder());
+ source.CopyTo(target, new HtmlTestEncoder());
// Assert
// Make sure content was written to the source.
@@ -197,7 +197,7 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
// Act
source.WriteLine("Hello world");
source.Write(new[] { 'x', 'a', 'b', 'c' }, 1, 3);
- source.CopyTo(target, new CommonTestEncoder());
+ source.CopyTo(target, new HtmlTestEncoder());
// Assert
Assert.Equal(expected, target.ToString());
diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringHtmlContentTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringHtmlContentTest.cs
index c470bfb6e2..3a677f85e7 100644
--- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringHtmlContentTest.cs
+++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/StringHtmlContentTest.cs
@@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
// Assert
using (var writer = new StringWriter())
{
- content.WriteTo(writer, new CommonTestEncoder());
+ content.WriteTo(writer, new HtmlTestEncoder());
Assert.Equal("HtmlEncode[[Hello World]]", writer.ToString());
}
}
diff --git a/test/WebSites/ActivatorWebSite/TagHelpers/HiddenTagHelper.cs b/test/WebSites/ActivatorWebSite/TagHelpers/HiddenTagHelper.cs
index a0e48bf734..cb4bfbb218 100644
--- a/test/WebSites/ActivatorWebSite/TagHelpers/HiddenTagHelper.cs
+++ b/test/WebSites/ActivatorWebSite/TagHelpers/HiddenTagHelper.cs
@@ -1,19 +1,19 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Mvc.ViewFeatures;
using Microsoft.AspNet.Mvc.ViewFeatures.Internal;
using Microsoft.AspNet.Razor.TagHelpers;
-using Microsoft.Extensions.WebEncoders;
namespace ActivatorWebSite.TagHelpers
{
[HtmlTargetElement("span")]
public class HiddenTagHelper : TagHelper
{
- public HiddenTagHelper(IHtmlHelper htmlHelper, IHtmlEncoder htmlEncoder)
+ public HiddenTagHelper(IHtmlHelper htmlHelper, HtmlEncoder htmlEncoder)
{
HtmlHelper = htmlHelper;
HtmlEncoder = htmlEncoder;
@@ -21,7 +21,7 @@ namespace ActivatorWebSite.TagHelpers
public IHtmlHelper HtmlHelper { get; }
- public IHtmlEncoder HtmlEncoder { get; }
+ public HtmlEncoder HtmlEncoder { get; }
[HtmlAttributeNotBound]
[ViewContext]
diff --git a/test/WebSites/FiltersWebSite/AuthorizeBasicMiddleware.cs b/test/WebSites/FiltersWebSite/AuthorizeBasicMiddleware.cs
index 22ce823aaf..92c4719f20 100644
--- a/test/WebSites/FiltersWebSite/AuthorizeBasicMiddleware.cs
+++ b/test/WebSites/FiltersWebSite/AuthorizeBasicMiddleware.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using System.Text.Encodings.Web;
using Microsoft.AspNet.Authentication;
using Microsoft.AspNet.Builder;
-using Microsoft.Extensions.WebEncoders;
using Microsoft.Extensions.Logging;
namespace FiltersWebSite
@@ -13,7 +13,7 @@ namespace FiltersWebSite
public AuthorizeBasicMiddleware(
RequestDelegate next,
ILoggerFactory loggerFactory,
- IUrlEncoder encoder,
+ UrlEncoder encoder,
string authScheme) :
base(next,
new BasicOptions { AuthenticationScheme = authScheme },