diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs index 46689ae315..03b2fdd1e2 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs @@ -4,6 +4,7 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; namespace Microsoft.AspNetCore.Mvc.FunctionalTests @@ -17,7 +18,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests public HttpClient Client { get; } - [Fact] + [ConditionalFact] + // https://github.com/aspnet/Mvc/issues/2727 + [FrameworkSkipCondition(RuntimeFrameworks.Mono)] public async Task FileFromDisk_CanBeEnabled_WithMiddleware() { // Arrange & Act @@ -34,7 +37,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests Assert.Equal("This is a sample text file", body); } - [Fact] + [ConditionalFact] + // https://github.com/aspnet/Mvc/issues/2727 + [FrameworkSkipCondition(RuntimeFrameworks.Mono)] public async Task FileFromDisk_ReturnsFileWithFileName() { // Arrange & Act diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/LinkGenerationTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/LinkGenerationTests.cs index 2cb4374d11..ab29918aee 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/LinkGenerationTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/LinkGenerationTests.cs @@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests // Assert Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); - // Location.ToString() in mono returns file://url. (see https://github.com/aspnet/External/issues/21) + // Location.ToString() in mono returns file://url. (https://github.com/aspnet/External/issues/21) Assert.Equal( TestPlatformHelper.IsMono ? new Uri(expected) : new Uri(expected, UriKind.Relative), response.Headers.Location); diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/TempDataTest.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/TempDataTest.cs index 6bc653acf2..95202807e5 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/TempDataTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/TempDataTest.cs @@ -74,7 +74,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests } [ConditionalFact] - [FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "aspnet/External#21, redirect scheme is file:.")] + // Mono issue - https://github.com/aspnet/External/issues/21 + [FrameworkSkipCondition(RuntimeFrameworks.Mono)] public async Task Redirect_RetainsTempData_EvenIfAccessed() { // Arrange @@ -139,7 +140,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests } [ConditionalFact] - [FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "aspnet/External#21, redirect scheme is file:.")] + // Mono issue - https://github.com/aspnet/External/issues/21 + [FrameworkSkipCondition(RuntimeFrameworks.Mono)] public async Task TempData_ValidTypes_RoundTripProperly() { // Arrange diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ImageTagHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ImageTagHelperTest.cs index d6b50785f8..3435150b40 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ImageTagHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ImageTagHelperTest.cs @@ -31,19 +31,20 @@ namespace Microsoft.AspNetCore.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, string expectedSrcPrefix) { // Arrange - var allAttributes = new TagHelperAttributeList - { - { "alt", new HtmlString("Testing") }, - { "asp-append-version", true }, - }; + var allAttributes = new TagHelperAttributeList( + new TagHelperAttributeList + { + { "alt", new HtmlString("Testing") }, + { "asp-append-version", true }, + }); var context = MakeTagHelperContext(allAttributes); var outputAttributes = new TagHelperAttributeList { @@ -59,9 +60,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers var viewContext = MakeViewContext(); var urlHelper = new Mock(); + // 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())) - .Returns(new Func(url => url.Replace("~/", "/virtualRoot/"))); + .Returns(new Func(url => url.Replace("~/", "virtualRoot/"))); var urlHelperFactory = new Mock(); urlHelperFactory .Setup(f => f.GetUrlHelper(It.IsAny())) diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/LinkTagHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/LinkTagHelperTest.cs index 5b5d6bc963..372004fb3e 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/LinkTagHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/LinkTagHelperTest.cs @@ -35,8 +35,8 @@ namespace Microsoft.AspNetCore.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, @@ -60,9 +60,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers var viewContext = MakeViewContext(); var urlHelper = new Mock(); + // 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())) - .Returns(new Func(url => url.Replace("~/", "/virtualRoot/"))); + .Returns(new Func(url => url.Replace("~/", "virtualRoot/"))); var urlHelperFactory = new Mock(); urlHelperFactory .Setup(f => f.GetUrlHelper(It.IsAny())) diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs index 2fe7d520dc..ebcc42c29d 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs @@ -36,8 +36,8 @@ namespace Microsoft.AspNetCore.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, @@ -61,9 +61,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers var viewContext = MakeViewContext(); var urlHelper = new Mock(); + // 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())) - .Returns(new Func(url => url.Replace("~/", "/virtualRoot/"))); + .Returns(new Func(url => url.Replace("~/", "virtualRoot/"))); var urlHelperFactory = new Mock(); urlHelperFactory .Setup(f => f.GetUrlHelper(It.IsAny()))