Workaround https://github.com/aspnet/External/issues/21 in a couple more tests
- led to Travis build failures
This commit is contained in:
parent
774219b2ef
commit
aaa47d5e0e
|
|
@ -12,14 +12,13 @@ using Microsoft.AspNet.Hosting;
|
|||
using Microsoft.AspNet.Http.Internal;
|
||||
using Microsoft.AspNet.Mvc.ModelBinding;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.AspNet.Testing.xunit;
|
||||
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
||||
using Microsoft.AspNet.Routing;
|
||||
using Microsoft.Framework.Caching;
|
||||
using Microsoft.AspNet.Testing.xunit;
|
||||
using Microsoft.Framework.Caching.Memory;
|
||||
using Microsoft.Framework.WebEncoders.Testing;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
using Microsoft.Framework.WebEncoders.Testing;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||
{
|
||||
|
|
@ -28,8 +27,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
|||
[Theory]
|
||||
[InlineData(null, "test.jpg", "test.jpg")]
|
||||
[InlineData("abcd.jpg", "test.jpg", "test.jpg")]
|
||||
[InlineData(null, "~/test.jpg", "/virtualRoot/test.jpg")]
|
||||
[InlineData("abcd.jpg", "~/test.jpg", "/virtualRoot/test.jpg")]
|
||||
[InlineData(null, "~/test.jpg", "virtualRoot/test.jpg")]
|
||||
[InlineData("abcd.jpg", "~/test.jpg", "virtualRoot/test.jpg")]
|
||||
public void Process_SrcDefaultsToTagHelperOutputSrcAttributeAddedByOtherTagHelper(
|
||||
string src,
|
||||
string srcOutput,
|
||||
|
|
@ -52,9 +51,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
|||
var hostingEnvironment = MakeHostingEnvironment();
|
||||
var viewContext = MakeViewContext();
|
||||
var urlHelper = new Mock<IUrlHelper>();
|
||||
|
||||
// Ensure expanded path does not look like an absolute path on Linux, avoiding
|
||||
// https://github.com/aspnet/External/issues/21
|
||||
urlHelper
|
||||
.Setup(urlhelper => urlhelper.Content(It.IsAny<string>()))
|
||||
.Returns(new Func<string, string>(url => url.Replace("~/", "/virtualRoot/")));
|
||||
.Returns(new Func<string, string>(url => url.Replace("~/", "virtualRoot/")));
|
||||
|
||||
var helper = new ImageTagHelper(
|
||||
hostingEnvironment,
|
||||
MakeCache(),
|
||||
|
|
|
|||
|
|
@ -16,10 +16,9 @@ using Microsoft.AspNet.Mvc.TagHelpers.Internal;
|
|||
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
||||
using Microsoft.AspNet.Routing;
|
||||
using Microsoft.AspNet.Testing.xunit;
|
||||
using Microsoft.Framework.Caching;
|
||||
using Microsoft.Dnx.Runtime;
|
||||
using Microsoft.Framework.Caching.Memory;
|
||||
using Microsoft.Framework.Logging;
|
||||
using Microsoft.Dnx.Runtime;
|
||||
using Microsoft.Framework.WebEncoders.Testing;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
|
@ -31,8 +30,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
|||
[Theory]
|
||||
[InlineData(null, "test.css", "test.css")]
|
||||
[InlineData("abcd.css", "test.css", "test.css")]
|
||||
[InlineData(null, "~/test.css", "/virtualRoot/test.css")]
|
||||
[InlineData("abcd.css", "~/test.css", "/virtualRoot/test.css")]
|
||||
[InlineData(null, "~/test.css", "virtualRoot/test.css")]
|
||||
[InlineData("abcd.css", "~/test.css", "virtualRoot/test.css")]
|
||||
public void Process_HrefDefaultsToTagHelperOutputHrefAttributeAddedByOtherTagHelper(
|
||||
string href,
|
||||
string hrefOutput,
|
||||
|
|
@ -56,9 +55,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
|||
var hostingEnvironment = MakeHostingEnvironment();
|
||||
var viewContext = MakeViewContext();
|
||||
var urlHelper = new Mock<IUrlHelper>();
|
||||
|
||||
// Ensure expanded path does not look like an absolute path on Linux, avoiding
|
||||
// https://github.com/aspnet/External/issues/21
|
||||
urlHelper
|
||||
.Setup(urlhelper => urlhelper.Content(It.IsAny<string>()))
|
||||
.Returns(new Func<string, string>(url => url.Replace("~/", "/virtualRoot/")));
|
||||
.Returns(new Func<string, string>(url => url.Replace("~/", "virtualRoot/")));
|
||||
|
||||
var helper = new LinkTagHelper(
|
||||
logger.Object,
|
||||
hostingEnvironment,
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@ using Microsoft.AspNet.Mvc.TagHelpers.Internal;
|
|||
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
||||
using Microsoft.AspNet.Routing;
|
||||
using Microsoft.AspNet.Testing.xunit;
|
||||
using Microsoft.Dnx.Runtime;
|
||||
using Microsoft.Framework.Caching;
|
||||
using Microsoft.Framework.Caching.Memory;
|
||||
using Microsoft.Framework.Logging;
|
||||
using Microsoft.Dnx.Runtime;
|
||||
using Microsoft.Framework.WebEncoders;
|
||||
using Microsoft.Framework.WebEncoders.Testing;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
|
@ -32,8 +31,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
|||
[Theory]
|
||||
[InlineData(null, "test.js", "test.js")]
|
||||
[InlineData("abcd.js", "test.js", "test.js")]
|
||||
[InlineData(null, "~/test.js", "/virtualRoot/test.js")]
|
||||
[InlineData("abcd.js", "~/test.js", "/virtualRoot/test.js")]
|
||||
[InlineData(null, "~/test.js", "virtualRoot/test.js")]
|
||||
[InlineData("abcd.js", "~/test.js", "virtualRoot/test.js")]
|
||||
public void Process_SrcDefaultsToTagHelperOutputSrcAttributeAddedByOtherTagHelper(
|
||||
string src,
|
||||
string srcOutput,
|
||||
|
|
@ -57,9 +56,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
|||
var hostingEnvironment = MakeHostingEnvironment();
|
||||
var viewContext = MakeViewContext();
|
||||
var urlHelper = new Mock<IUrlHelper>();
|
||||
|
||||
// Ensure expanded path does not look like an absolute path on Linux, avoiding
|
||||
// https://github.com/aspnet/External/issues/21
|
||||
urlHelper
|
||||
.Setup(urlhelper => urlhelper.Content(It.IsAny<string>()))
|
||||
.Returns(new Func<string, string>(url => url.Replace("~/", "/virtualRoot/")));
|
||||
.Returns(new Func<string, string>(url => url.Replace("~/", "virtualRoot/")));
|
||||
|
||||
var helper = new ScriptTagHelper(
|
||||
logger.Object,
|
||||
hostingEnvironment,
|
||||
|
|
|
|||
Loading…
Reference in New Issue