Convert tests to K test.
This commit is contained in:
parent
546af5ddee
commit
aed5b9a1c9
|
|
@ -12,7 +12,6 @@ using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.FeatureModel;
|
using Microsoft.AspNet.FeatureModel;
|
||||||
using Microsoft.AspNet.PipelineCore;
|
using Microsoft.AspNet.PipelineCore;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Extensions;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.WebListener.Test
|
namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
|
@ -18,13 +17,11 @@ using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.WebListener.Test
|
namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
{
|
{
|
||||||
using AppFunc = Func<object, Task>;
|
|
||||||
|
|
||||||
public class HttpsTests
|
public class HttpsTests
|
||||||
{
|
{
|
||||||
private const string Address = "https://localhost:9090/";
|
private const string Address = "https://localhost:9090/";
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "TODO: Add trait filtering support so these SSL tests don't get run on teamcity or the command line."), Trait("scheme", "https")]
|
||||||
public async Task Https_200OK_Success()
|
public async Task Https_200OK_Success()
|
||||||
{
|
{
|
||||||
using (Utilities.CreateHttpsServer(env =>
|
using (Utilities.CreateHttpsServer(env =>
|
||||||
|
|
@ -37,7 +34,7 @@ namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "TODO: Add trait filtering support so these SSL tests don't get run on teamcity or the command line."), Trait("scheme", "https")]
|
||||||
public async Task Https_SendHelloWorld_Success()
|
public async Task Https_SendHelloWorld_Success()
|
||||||
{
|
{
|
||||||
using (Utilities.CreateHttpsServer(env =>
|
using (Utilities.CreateHttpsServer(env =>
|
||||||
|
|
@ -53,7 +50,7 @@ namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "TODO: Add trait filtering support so these SSL tests don't get run on teamcity or the command line."), Trait("scheme", "https")]
|
||||||
public async Task Https_EchoHelloWorld_Success()
|
public async Task Https_EchoHelloWorld_Success()
|
||||||
{
|
{
|
||||||
using (Utilities.CreateHttpsServer(env =>
|
using (Utilities.CreateHttpsServer(env =>
|
||||||
|
|
@ -72,7 +69,7 @@ namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "TODO: Add trait filtering support so these SSL tests don't get run on teamcity or the command line."), Trait("scheme", "https")]
|
||||||
public async Task Https_ClientCertNotSent_ClientCertNotPresent()
|
public async Task Https_ClientCertNotSent_ClientCertNotPresent()
|
||||||
{
|
{
|
||||||
using (Utilities.CreateHttpsServer(async env =>
|
using (Utilities.CreateHttpsServer(async env =>
|
||||||
|
|
@ -89,7 +86,7 @@ namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "TODO: Add trait filtering support so these SSL tests don't get run on teamcity or the command line."), Trait("scheme", "https")]
|
||||||
public async Task Https_ClientCertRequested_ClientCertPresent()
|
public async Task Https_ClientCertRequested_ClientCertPresent()
|
||||||
{
|
{
|
||||||
using (Utilities.CreateHttpsServer(async env =>
|
using (Utilities.CreateHttpsServer(async env =>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ using Microsoft.AspNet.Hosting.Server;
|
||||||
using Microsoft.AspNet.HttpFeature;
|
using Microsoft.AspNet.HttpFeature;
|
||||||
using Microsoft.AspNet.PipelineCore;
|
using Microsoft.AspNet.PipelineCore;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Extensions;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.WebListener.Test
|
namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,20 @@ using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.WebListener.Test
|
namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
{
|
{
|
||||||
using AppFunc = Func<object, Task>;
|
|
||||||
|
|
||||||
public class ResponseSendFileTests
|
public class ResponseSendFileTests
|
||||||
{
|
{
|
||||||
private const string Address = "http://localhost:8080/";
|
private const string Address = "http://localhost:8080/";
|
||||||
private static readonly string AbsoluteFilePath = Environment.CurrentDirectory + "\\Microsoft.AspNet.Server.WebListener.dll";
|
private readonly string AbsoluteFilePath;
|
||||||
private static readonly string RelativeFilePath = "Microsoft.AspNet.Server.WebListener.dll";
|
private readonly string RelativeFilePath;
|
||||||
private static readonly long FileLength = new FileInfo(AbsoluteFilePath).Length;
|
private readonly long FileLength;
|
||||||
|
|
||||||
|
public ResponseSendFileTests()
|
||||||
|
{
|
||||||
|
AbsoluteFilePath = Directory.GetFiles(Environment.CurrentDirectory).First();
|
||||||
|
RelativeFilePath = Path.GetFileName(AbsoluteFilePath);
|
||||||
|
FileLength = new FileInfo(AbsoluteFilePath).Length;
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task ResponseSendFile_SupportKeys_Present()
|
public async Task ResponseSendFile_SupportKeys_Present()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Abstractions;
|
using Microsoft.AspNet.Abstractions;
|
||||||
using Microsoft.AspNet.Hosting.Server;
|
using Microsoft.AspNet.Hosting.Server;
|
||||||
|
|
||||||
|
// These tests can't run in parallel because they all use the same port.
|
||||||
|
[assembly: Xunit.CollectionBehaviorAttribute(Xunit.CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true)]
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.WebListener.Test
|
namespace Microsoft.AspNet.Server.WebListener.Test
|
||||||
{
|
{
|
||||||
using AppFunc = Func<object, Task>;
|
using AppFunc = Func<object, Task>;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
{
|
{
|
||||||
"version" : "0.1-alpha-*",
|
"version" : "0.1-alpha-*",
|
||||||
|
"commands": {
|
||||||
|
"test": "Xunit.KRunner"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"Xunit.KRunner": "0.1-alpha-*",
|
||||||
|
"xunit.abstractions": "2.0.0-aspnet-*",
|
||||||
|
"xunit.assert": "2.0.0-aspnet-*",
|
||||||
|
"xunit.core": "2.0.0-aspnet-*",
|
||||||
|
"xunit.execution": "2.0.0-aspnet-*",
|
||||||
"Microsoft.AspNet.Server.WebListener" : "",
|
"Microsoft.AspNet.Server.WebListener" : "",
|
||||||
"Microsoft.AspNet.Abstractions" : "0.1-alpha-*",
|
"Microsoft.AspNet.Abstractions" : "0.1-alpha-*",
|
||||||
"Microsoft.AspNet.ConfigurationModel": "0.1-alpha-*",
|
"Microsoft.AspNet.ConfigurationModel": "0.1-alpha-*",
|
||||||
|
|
@ -11,13 +19,12 @@
|
||||||
"Microsoft.AspNet.Hosting": "0.1-alpha-*"
|
"Microsoft.AspNet.Hosting": "0.1-alpha-*"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"net45": {
|
"net45": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"XUnit": "1.9.2",
|
"System.Runtime": "",
|
||||||
"XUnit.Extensions": "1.9.2",
|
"System.Net.Http": "",
|
||||||
"System.Net.Http": "",
|
"System.Net.Http.WebRequest": ""
|
||||||
"System.Net.Http.WebRequest": ""
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue