From 497565a52c8e48c3a6ab934fa8ce0f7bbd184286 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 18 Feb 2016 16:00:58 -0800 Subject: [PATCH] Updating test TFMs for custom test discovery --- .../HttpsTests.cs | 4 +-- .../ResponseBodyTests.cs | 2 +- .../project.json | 28 ++++++++--------- .../HttpsTests.cs | 4 +-- .../RequestBodyTests.cs | 2 +- .../ResponseBodyTests.cs | 2 +- .../SkipOffDomainAttribute.cs | 2 +- .../project.json | 31 +++++++++---------- 8 files changed, 36 insertions(+), 39 deletions(-) diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/HttpsTests.cs b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/HttpsTests.cs index 7616dc5392..bffcf16ceb 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/HttpsTests.cs +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/HttpsTests.cs @@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.Server.WebListener private async Task SendRequestAsync(string uri, X509Certificate cert = null) { -#if DNX451 +#if NET451 var handler = new WebRequestHandler(); #else var handler = new WinHttpHandler(); @@ -133,7 +133,7 @@ namespace Microsoft.AspNetCore.Server.WebListener private async Task SendRequestAsync(string uri, string upload) { -#if DNX451 +#if NET451 var handler = new WebRequestHandler(); #else var handler = new WinHttpHandler(); diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseBodyTests.cs b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseBodyTests.cs index 42224e5df3..b87a5fbfcb 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseBodyTests.cs +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseBodyTests.cs @@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Server.WebListener { httpContext.Response.Headers["Content-lenGth"] = " 30 "; Stream stream = httpContext.Response.Body; -#if DNX451 +#if NET451 stream.EndWrite(stream.BeginWrite(new byte[10], 0, 10, null, null)); #else await stream.WriteAsync(new byte[10], 0, 10); diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json index 43df05c50c..001a9e016a 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json @@ -1,15 +1,22 @@ { "testRunner": "xunit", - "commands": { - "test": "xunit.runner.aspnet" - }, "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.NETCore.Platforms": "1.0.1-*", + "xunit": "2.1.0" }, "frameworks": { - "dnx451": { + "dnxcore50": { + "dependencies": { + "System.Net.Http.WinHttpHandler": "4.0.0-*", + "System.Net.Requests": "4.0.11-*", + "System.Net.WebHeaderCollection": "4.0.1-*", + "dotnet-test-xunit": "1.0.0-dev-*" + }, + "imports": "portable-net451+win8" + }, + "net451": { "frameworkAssemblies": { "System.Net.Http": "", "System.Net.Http.WebRequest": "", @@ -18,15 +25,6 @@ "dependencies": { "xunit.runner.console": "2.1.0" } - }, - "dnxcore50": { - "dependencies": { - "System.Net.Http.WinHttpHandler": "4.0.0-*", - "System.Net.Requests": "4.0.11-*", - "System.Net.WebHeaderCollection": "4.0.1-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" - }, - "imports": "portable-net451+win8" } } -} \ No newline at end of file +} diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/HttpsTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/HttpsTests.cs index 05931b0ad1..73f915d3b8 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/HttpsTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/HttpsTests.cs @@ -107,7 +107,7 @@ namespace Microsoft.Net.Http.Server private async Task SendRequestAsync(string uri, X509Certificate cert = null) { -#if DNX451 +#if NET451 WebRequestHandler handler = new WebRequestHandler(); #else WinHttpHandler handler = new WinHttpHandler(); @@ -125,7 +125,7 @@ namespace Microsoft.Net.Http.Server private async Task SendRequestAsync(string uri, string upload) { -#if DNX451 +#if NET451 WebRequestHandler handler = new WebRequestHandler(); #else WinHttpHandler handler = new WinHttpHandler(); diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs index b9423dac99..d647cd70d9 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs @@ -51,7 +51,7 @@ namespace Microsoft.Net.Http.Server Assert.Equal("Hello World", response); } } -#if DNX451 +#if NET451 [Fact] public async Task RequestBody_ReadBeginEnd_Success() { diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs index ec1b6a8006..39dc2adcbc 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs @@ -122,7 +122,7 @@ namespace Microsoft.Net.Http.Server var context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 30 "; Stream stream = context.Response.Body; -#if DNX451 +#if NET451 stream.EndWrite(stream.BeginWrite(new byte[10], 0, 10, null, null)); #else await stream.WriteAsync(new byte[10], 0, 10); diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/SkipOffDomainAttribute.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/SkipOffDomainAttribute.cs index 737d9e1f94..bbe6c7fdbc 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/SkipOffDomainAttribute.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/SkipOffDomainAttribute.cs @@ -18,7 +18,7 @@ namespace Microsoft.Net.Http.Server { try { -#if DNX451 +#if NET451 return !string.IsNullOrEmpty(System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain().Name); #endif } diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json index 5fcc744ab5..1abe854726 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json @@ -1,35 +1,34 @@ { "testRunner": "xunit", - "commands": { - "test": "xunit.runner.aspnet" - }, "dependencies": { "Microsoft.Net.Http.Server": "0.1.0-*", "Microsoft.Net.WebSockets.Server": "0.1.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" + "xunit": "2.1.0" }, "frameworks": { - "dnx451": { - "frameworkAssemblies": { - "System.DirectoryServices": "", - "System.Net.Http": "", - "System.Net.Http.WebRequest": "" - }, - "dependencies": { - "xunit.runner.console": "2.1.0" - } - }, "dnxcore50": { "dependencies": { "System.Net.Http": "4.0.1-*", "System.Net.Http.WinHttpHandler": "4.0.0-*", "System.Net.Requests": "4.0.11-*", "System.Net.WebSockets.Client": "4.0.0-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" + "dotnet-test-xunit": "1.0.0-dev-*" }, "imports": "portable-net451+win8" + }, + "net451": { + "frameworkAssemblies": { + "System.DirectoryServices": "", + "System.Net.Http": "", + "System.Net.Http.WebRequest": "", + "System.Runtime": "", + "System.Threading.Tasks": "" + }, + "dependencies": { + "xunit.runner.console": "2.1.0" + } } } -} \ No newline at end of file +}