diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/FileVersionProvider.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/FileVersionProvider.cs index a103cb5876..fd9c42ed37 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/FileVersionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/FileVersionProvider.cs @@ -56,7 +56,7 @@ public string AddFileVersionToPath([NotNull] string path) } Uri uri; - if (Uri.TryCreate(resolvedPath, UriKind.Absolute, out uri)) + if (Uri.TryCreate(resolvedPath, UriKind.Absolute, out uri) && !uri.IsFile) { // Don't append version if the path is absolute. return path; diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/HtmlGenerationTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/HtmlGenerationTest.cs index 0af1109ca4..8d4d3a49f0 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/HtmlGenerationTest.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/HtmlGenerationTest.cs @@ -59,12 +59,6 @@ public class HtmlGenerationTest [InlineData("AttributesWithBooleanValues", null)] public async Task HtmlGenerationWebSite_GeneratesExpectedResults(string action, string antiforgeryPath) { - // This uses FileVersionProvider which uses Uri.TryCreate - https://github.com/aspnet/External/issues/21 - if (TestPlatformHelper.IsMono && (action == "Link" || action == "Script" || action == "Image")) - { - return; - } - // Arrange var server = TestHelper.CreateServer(_app, SiteName, _configureServices); var client = server.CreateClient(); @@ -124,12 +118,6 @@ public async Task HtmlGenerationWebSite_GeneratesExpectedResults(string action, [InlineData("AttributesWithBooleanValues", null)] public async Task HtmlGenerationWebSite_GenerateEncodedResults(string action, string antiforgeryPath) { - // This uses FileVersionProvider which uses Uri.TryCreate - https://github.com/aspnet/External/issues/21 - if (TestPlatformHelper.IsMono && (action == "Link" || action == "Script")) - { - return; - } - // Arrange var server = TestHelper.CreateServer(_app, SiteName, services => { @@ -582,4 +570,4 @@ public async Task EditorTemplateWithSpecificModel_RendersWithCorrectMetadata() Assert.Equal(expected, response); } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ImageTagHelperTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ImageTagHelperTest.cs index cc41fe4104..2fad3a89a1 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ImageTagHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ImageTagHelperTest.cs @@ -135,9 +135,7 @@ public void PreservesOrderOfSourceAttributesWhenRun() } } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void RendersImageTag_AddsFileVersion() { // Arrange @@ -209,9 +207,7 @@ public void RendersImageTag_DoesNotAddFileVersion() Assert.Equal("/images/test-image.png", srcAttribute.Value); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void RendersImageTag_AddsFileVersion_WithRequestPathBase() { // Arrange @@ -337,4 +333,4 @@ private static IUrlHelper MakeUrlHelper() return urlHelper.Object; } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/FileVersionProviderTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/FileVersionProviderTest.cs index 06a591446b..96248811c8 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/FileVersionProviderTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/FileVersionProviderTest.cs @@ -17,9 +17,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal { public class FileVersionProviderTest { - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Theory] [InlineData("/hello/world", "/hello/world?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk")] [InlineData("/hello/world?q=test", "/hello/world?q=test&v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk")] [InlineData("/hello/world?q=foo&bar", "/hello/world?q=foo&bar&v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk")] @@ -42,9 +40,7 @@ public void AddsVersionToFiles_WhenCacheIsAbsent(string filePath, string expecte } // Verifies if the stream is closed after reading. - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void AddsVersionToFiles_DoesNotLockFileAfterReading() { // Arrange @@ -75,9 +71,7 @@ public void AddsVersionToFiles_DoesNotLockFileAfterReading() Assert.Throws(() => fileVersionProvider.AddFileVersionToPath("/hello/world")); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Theory] [InlineData("/testApp/hello/world", true, "/testApp")] [InlineData("/testApp/foo/bar/hello/world", true, "/testApp/foo/bar")] [InlineData("/test/testApp/hello/world", false, "/testApp")] @@ -100,9 +94,7 @@ public void AddsVersionToFiles_PathContainingAppName( Assert.Equal(filePath + "?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", result); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void DoesNotAddVersion_IfFileNotFound() { // Arrange @@ -120,9 +112,7 @@ public void DoesNotAddVersion_IfFileNotFound() Assert.Equal("http://contoso.com/hello/world", result); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void ReturnsValueFromCache() { // Arrange @@ -140,9 +130,7 @@ public void ReturnsValueFromCache() Assert.Equal("FromCache", result); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Theory] [InlineData("/hello/world", "/hello/world", null)] [InlineData("/testApp/hello/world", "/hello/world", "/testApp")] public void SetsValueInCache(string filePath, string watchPath, string requestPathBase) @@ -235,4 +223,4 @@ private static PathString GetRequestPathBase(string requestPathBase = null) return new PathString(requestPathBase); } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LinkTagHelperTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LinkTagHelperTest.cs index d2847eb5e9..f6b2e0dae2 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LinkTagHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LinkTagHelperTest.cs @@ -678,9 +678,7 @@ public void RendersLinkTagsForGlobbedHrefResults_UsingProvidedEncoder() output.PostElement.GetContent()); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void RendersLinkTags_AddsFileVersion() { // Arrange @@ -720,9 +718,7 @@ public void RendersLinkTags_AddsFileVersion() Assert.Equal("/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].Value); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void RendersLinkTags_AddsFileVersion_WithRequestPathBase() { // Arrange @@ -762,9 +758,7 @@ public void RendersLinkTags_AddsFileVersion_WithRequestPathBase() Assert.Equal("/bar/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].Value); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public void RendersLinkTags_GlobbedHref_AddsFileVersion() { // Arrange @@ -914,4 +908,4 @@ private static IUrlHelper MakeUrlHelper() return urlHelper.Object; } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs index aeeba1e271..0b510cca2f 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs @@ -733,9 +733,7 @@ public async Task RendersScriptTagsForGlobbedSrcResults_UsesProvidedEncoder() Assert.Equal("", output.PostElement.GetContent()); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public async Task RenderScriptTags_WithFileVersion() { // Arrange @@ -772,9 +770,7 @@ public async Task RenderScriptTags_WithFileVersion() Assert.Equal("/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].Value); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public async Task RenderScriptTags_WithFileVersion_AndRequestPathBase() { // Arrange @@ -811,9 +807,7 @@ public async Task RenderScriptTags_WithFileVersion_AndRequestPathBase() Assert.Equal("/bar/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].Value); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public async Task RenderScriptTags_FallbackSrc_WithFileVersion() { // Arrange @@ -857,9 +851,7 @@ public async Task RenderScriptTags_FallbackSrc_WithFileVersion() "<\\/script>\"));", output.PostElement.GetContent()); } - [ConditionalTheory] - // Mono issue - https://github.com/aspnet/External/issues/21 - [FrameworkSkipCondition(RuntimeFrameworks.Mono)] + [Fact] public async Task RenderScriptTags_GlobbedSrc_WithFileVersion() { // Arrange @@ -1012,4 +1004,4 @@ private static IUrlHelper MakeUrlHelper() return urlHelper.Object; } } -} \ No newline at end of file +}