Revert "Remove dangling test workarounds for and mentions of closed bugs"
This reverts commit d26cc11e13.
This commit is contained in:
parent
efd38a6dd1
commit
9e4f4c76cc
|
|
@ -4,6 +4,7 @@
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
|
|
@ -17,7 +18,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
|
|
||||||
public HttpClient Client { get; }
|
public HttpClient Client { get; }
|
||||||
|
|
||||||
[Fact]
|
[ConditionalFact]
|
||||||
|
// https://github.com/aspnet/Mvc/issues/2727
|
||||||
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
public async Task FileFromDisk_CanBeEnabled_WithMiddleware()
|
public async Task FileFromDisk_CanBeEnabled_WithMiddleware()
|
||||||
{
|
{
|
||||||
// Arrange & Act
|
// Arrange & Act
|
||||||
|
|
@ -34,7 +37,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
Assert.Equal("This is a sample text file", body);
|
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()
|
public async Task FileFromDisk_ReturnsFileWithFileName()
|
||||||
{
|
{
|
||||||
// Arrange & Act
|
// Arrange & Act
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);
|
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(
|
Assert.Equal(
|
||||||
TestPlatformHelper.IsMono ? new Uri(expected) : new Uri(expected, UriKind.Relative),
|
TestPlatformHelper.IsMono ? new Uri(expected) : new Uri(expected, UriKind.Relative),
|
||||||
response.Headers.Location);
|
response.Headers.Location);
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[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()
|
public async Task Redirect_RetainsTempData_EvenIfAccessed()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -139,7 +140,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[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()
|
public async Task TempData_ValidTypes_RoundTripProperly()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -31,19 +31,20 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(null, "test.jpg", "test.jpg")]
|
[InlineData(null, "test.jpg", "test.jpg")]
|
||||||
[InlineData("abcd.jpg", "test.jpg", "test.jpg")]
|
[InlineData("abcd.jpg", "test.jpg", "test.jpg")]
|
||||||
[InlineData(null, "~/test.jpg", "/virtualRoot/test.jpg")]
|
[InlineData(null, "~/test.jpg", "virtualRoot/test.jpg")]
|
||||||
[InlineData("abcd.jpg", "~/test.jpg", "/virtualRoot/test.jpg")]
|
[InlineData("abcd.jpg", "~/test.jpg", "virtualRoot/test.jpg")]
|
||||||
public void Process_SrcDefaultsToTagHelperOutputSrcAttributeAddedByOtherTagHelper(
|
public void Process_SrcDefaultsToTagHelperOutputSrcAttributeAddedByOtherTagHelper(
|
||||||
string src,
|
string src,
|
||||||
string srcOutput,
|
string srcOutput,
|
||||||
string expectedSrcPrefix)
|
string expectedSrcPrefix)
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var allAttributes = new TagHelperAttributeList
|
var allAttributes = new TagHelperAttributeList(
|
||||||
{
|
new TagHelperAttributeList
|
||||||
{ "alt", new HtmlString("Testing") },
|
{
|
||||||
{ "asp-append-version", true },
|
{ "alt", new HtmlString("Testing") },
|
||||||
};
|
{ "asp-append-version", true },
|
||||||
|
});
|
||||||
var context = MakeTagHelperContext(allAttributes);
|
var context = MakeTagHelperContext(allAttributes);
|
||||||
var outputAttributes = new TagHelperAttributeList
|
var outputAttributes = new TagHelperAttributeList
|
||||||
{
|
{
|
||||||
|
|
@ -59,9 +60,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
var viewContext = MakeViewContext();
|
var viewContext = MakeViewContext();
|
||||||
var urlHelper = new Mock<IUrlHelper>();
|
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
|
urlHelper
|
||||||
.Setup(urlhelper => urlhelper.Content(It.IsAny<string>()))
|
.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 urlHelperFactory = new Mock<IUrlHelperFactory>();
|
var urlHelperFactory = new Mock<IUrlHelperFactory>();
|
||||||
urlHelperFactory
|
urlHelperFactory
|
||||||
.Setup(f => f.GetUrlHelper(It.IsAny<ActionContext>()))
|
.Setup(f => f.GetUrlHelper(It.IsAny<ActionContext>()))
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(null, "test.css", "test.css")]
|
[InlineData(null, "test.css", "test.css")]
|
||||||
[InlineData("abcd.css", "test.css", "test.css")]
|
[InlineData("abcd.css", "test.css", "test.css")]
|
||||||
[InlineData(null, "~/test.css", "/virtualRoot/test.css")]
|
[InlineData(null, "~/test.css", "virtualRoot/test.css")]
|
||||||
[InlineData("abcd.css", "~/test.css", "/virtualRoot/test.css")]
|
[InlineData("abcd.css", "~/test.css", "virtualRoot/test.css")]
|
||||||
public void Process_HrefDefaultsToTagHelperOutputHrefAttributeAddedByOtherTagHelper(
|
public void Process_HrefDefaultsToTagHelperOutputHrefAttributeAddedByOtherTagHelper(
|
||||||
string href,
|
string href,
|
||||||
string hrefOutput,
|
string hrefOutput,
|
||||||
|
|
@ -60,9 +60,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
var viewContext = MakeViewContext();
|
var viewContext = MakeViewContext();
|
||||||
var urlHelper = new Mock<IUrlHelper>();
|
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
|
urlHelper
|
||||||
.Setup(urlhelper => urlhelper.Content(It.IsAny<string>()))
|
.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 urlHelperFactory = new Mock<IUrlHelperFactory>();
|
var urlHelperFactory = new Mock<IUrlHelperFactory>();
|
||||||
urlHelperFactory
|
urlHelperFactory
|
||||||
.Setup(f => f.GetUrlHelper(It.IsAny<ActionContext>()))
|
.Setup(f => f.GetUrlHelper(It.IsAny<ActionContext>()))
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(null, "test.js", "test.js")]
|
[InlineData(null, "test.js", "test.js")]
|
||||||
[InlineData("abcd.js", "test.js", "test.js")]
|
[InlineData("abcd.js", "test.js", "test.js")]
|
||||||
[InlineData(null, "~/test.js", "/virtualRoot/test.js")]
|
[InlineData(null, "~/test.js", "virtualRoot/test.js")]
|
||||||
[InlineData("abcd.js", "~/test.js", "/virtualRoot/test.js")]
|
[InlineData("abcd.js", "~/test.js", "virtualRoot/test.js")]
|
||||||
public void Process_SrcDefaultsToTagHelperOutputSrcAttributeAddedByOtherTagHelper(
|
public void Process_SrcDefaultsToTagHelperOutputSrcAttributeAddedByOtherTagHelper(
|
||||||
string src,
|
string src,
|
||||||
string srcOutput,
|
string srcOutput,
|
||||||
|
|
@ -61,9 +61,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
var viewContext = MakeViewContext();
|
var viewContext = MakeViewContext();
|
||||||
var urlHelper = new Mock<IUrlHelper>();
|
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
|
urlHelper
|
||||||
.Setup(urlhelper => urlhelper.Content(It.IsAny<string>()))
|
.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 urlHelperFactory = new Mock<IUrlHelperFactory>();
|
var urlHelperFactory = new Mock<IUrlHelperFactory>();
|
||||||
urlHelperFactory
|
urlHelperFactory
|
||||||
.Setup(f => f.GetUrlHelper(It.IsAny<ActionContext>()))
|
.Setup(f => f.GetUrlHelper(It.IsAny<ActionContext>()))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue