From d26cc11e13f258ec8c28767c0af3df5d4c7a62ec Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 4 Jan 2016 11:54:41 -0800 Subject: [PATCH] Remove dangling test workarounds for and mentions of closed bugs - not all aspnet/External#21 workarounds are needed - no need to work around aspnet/Mvc#2727 --- .../FileResultTests.cs | 9 ++------- .../LinkGenerationTests.cs | 2 +- .../TempDataTest.cs | 6 ++---- .../ImageTagHelperTest.cs | 19 ++++++++----------- .../LinkTagHelperTest.cs | 8 +++----- .../ScriptTagHelperTest.cs | 8 +++----- 6 files changed, 19 insertions(+), 33 deletions(-) diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs index 03b2fdd1e2..46689ae315 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/FileResultTests.cs @@ -4,7 +4,6 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; using Xunit; namespace Microsoft.AspNetCore.Mvc.FunctionalTests @@ -18,9 +17,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests public HttpClient Client { get; } - [ConditionalFact] - // https://github.com/aspnet/Mvc/issues/2727 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public async Task FileFromDisk_CanBeEnabled_WithMiddleware() { // Arrange & Act @@ -37,9 +34,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests Assert.Equal("This is a sample text file", body); } - [ConditionalFact] - // https://github.com/aspnet/Mvc/issues/2727 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] 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 ab29918aee..2cb4374d11 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. (https://github.com/aspnet/External/issues/21) + // Location.ToString() in mono returns file://url. (see 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 95202807e5..6bc653acf2 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/TempDataTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/TempDataTest.cs @@ -74,8 +74,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests } [ConditionalFact] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "aspnet/External#21, redirect scheme is file:.")] public async Task Redirect_RetainsTempData_EvenIfAccessed() { // Arrange @@ -140,8 +139,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests } [ConditionalFact] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "aspnet/External#21, redirect scheme is file:.")] 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 3435150b40..d6b50785f8 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ImageTagHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ImageTagHelperTest.cs @@ -31,20 +31,19 @@ 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( - new TagHelperAttributeList - { - { "alt", new HtmlString("Testing") }, - { "asp-append-version", true }, - }); + var allAttributes = new TagHelperAttributeList + { + { "alt", new HtmlString("Testing") }, + { "asp-append-version", true }, + }; var context = MakeTagHelperContext(allAttributes); var outputAttributes = new TagHelperAttributeList { @@ -60,11 +59,9 @@ 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 372004fb3e..5b5d6bc963 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,11 +60,9 @@ 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 ebcc42c29d..2fe7d520dc 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,11 +61,9 @@ 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()))