Convert tests to K test.

This commit is contained in:
Chris Ross 2014-03-25 15:42:50 -07:00
parent 546af5ddee
commit aed5b9a1c9
6 changed files with 33 additions and 23 deletions

View File

@ -12,7 +12,6 @@ using System.Threading.Tasks;
using Microsoft.AspNet.FeatureModel;
using Microsoft.AspNet.PipelineCore;
using Xunit;
using Xunit.Extensions;
namespace Microsoft.AspNet.Server.WebListener.Test
{

View File

@ -5,7 +5,6 @@
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
@ -18,13 +17,11 @@ using Xunit;
namespace Microsoft.AspNet.Server.WebListener.Test
{
using AppFunc = Func<object, Task>;
public class HttpsTests
{
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()
{
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()
{
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()
{
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()
{
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()
{
using (Utilities.CreateHttpsServer(async env =>

View File

@ -16,7 +16,6 @@ using Microsoft.AspNet.Hosting.Server;
using Microsoft.AspNet.HttpFeature;
using Microsoft.AspNet.PipelineCore;
using Xunit;
using Xunit.Extensions;
namespace Microsoft.AspNet.Server.WebListener.Test
{

View File

@ -20,15 +20,20 @@ using Xunit;
namespace Microsoft.AspNet.Server.WebListener.Test
{
using AppFunc = Func<object, Task>;
public class ResponseSendFileTests
{
private const string Address = "http://localhost:8080/";
private static readonly string AbsoluteFilePath = Environment.CurrentDirectory + "\\Microsoft.AspNet.Server.WebListener.dll";
private static readonly string RelativeFilePath = "Microsoft.AspNet.Server.WebListener.dll";
private static readonly long FileLength = new FileInfo(AbsoluteFilePath).Length;
private readonly string AbsoluteFilePath;
private readonly string RelativeFilePath;
private readonly long FileLength;
public ResponseSendFileTests()
{
AbsoluteFilePath = Directory.GetFiles(Environment.CurrentDirectory).First();
RelativeFilePath = Path.GetFileName(AbsoluteFilePath);
FileLength = new FileInfo(AbsoluteFilePath).Length;
}
[Fact]
public async Task ResponseSendFile_SupportKeys_Present()
{

View File

@ -4,6 +4,9 @@ using System.Threading.Tasks;
using Microsoft.AspNet.Abstractions;
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
{
using AppFunc = Func<object, Task>;

View File

@ -1,6 +1,14 @@
{
"version" : "0.1-alpha-*",
"commands": {
"test": "Xunit.KRunner"
},
"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.Abstractions" : "0.1-alpha-*",
"Microsoft.AspNet.ConfigurationModel": "0.1-alpha-*",
@ -11,13 +19,12 @@
"Microsoft.AspNet.Hosting": "0.1-alpha-*"
},
"configurations": {
"net45": {
"dependencies": {
"XUnit": "1.9.2",
"XUnit.Extensions": "1.9.2",
"System.Net.Http": "",
"System.Net.Http.WebRequest": ""
}
}
"net45": {
"dependencies": {
"System.Runtime": "",
"System.Net.Http": "",
"System.Net.Http.WebRequest": ""
}
}
}
}