From 5cb8ad3d87acf4778a13a94efb5d9d854916135f Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Fri, 4 Sep 2015 01:07:03 -0700 Subject: [PATCH] Skipped tests using file paths not supported on Mono --- .../ErrorPageMiddlewareTest.cs | 38 +++++++++++++++---- .../project.json | 1 + 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/ErrorPageMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Tests/ErrorPageMiddlewareTest.cs index e845ce1841..00f8e4fedb 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/ErrorPageMiddlewareTest.cs +++ b/test/Microsoft.AspNet.Diagnostics.Tests/ErrorPageMiddlewareTest.cs @@ -15,14 +15,32 @@ using Microsoft.Framework.Caching; using Microsoft.Framework.Logging; using Microsoft.Dnx.Runtime; using Xunit; +using Microsoft.AspNet.Testing; namespace Microsoft.AspNet.Diagnostics { public class ErrorPageMiddlewareTest { + public static TheoryData RelativePathsData + { + get + { + var data = new TheoryData + { + "TestFiles/SourceFile.txt" + }; + + if (!TestPlatformHelper.IsMono) + { + data.Add(@"TestFiles\SourceFile.txt"); + } + + return data; + } + } + [Theory] - [InlineData("TestFiles/SourceFile.txt")] - [InlineData(@"TestFiles\SourceFile.txt")] + [MemberData(nameof(RelativePathsData))] public void UsesDefaultFileProvider_IfNotProvidedOnOptions(string relativePath) { // Arrange & Act @@ -42,11 +60,18 @@ namespace Microsoft.AspNet.Diagnostics get { var rootPath = Directory.GetCurrentDirectory(); - return new TheoryData() + + var data = new TheoryData() { - Path.Combine(rootPath, "TestFiles/SourceFile.txt"), - Path.Combine(rootPath, @"TestFiles\SourceFile.txt") + Path.Combine(rootPath, "TestFiles/SourceFile.txt") }; + + if (!TestPlatformHelper.IsMono) + { + Path.Combine(rootPath, @"TestFiles\SourceFile.txt"); + } + + return data; } } @@ -72,8 +97,7 @@ namespace Microsoft.AspNet.Diagnostics } [Theory] - [InlineData("TestFiles/SourceFile.txt")] - [InlineData(@"TestFiles\SourceFile.txt")] + [MemberData(nameof(RelativePathsData))] public void DisplaysSourceCodeLines_ForRelativePaths(string relativePath) { // Arrange diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/project.json b/test/Microsoft.AspNet.Diagnostics.Tests/project.json index 6ff8d441c4..c6f0cfbfcf 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/project.json +++ b/test/Microsoft.AspNet.Diagnostics.Tests/project.json @@ -6,6 +6,7 @@ "Microsoft.AspNet.Diagnostics.Elm": "1.0.0-*", "Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", + "Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.Framework.DependencyInjection": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" },