This commit is contained in:
BrennanConroy 2016-03-23 16:33:06 -07:00
parent dfb7f2f9b2
commit f272d993de
3 changed files with 18 additions and 23 deletions

View File

@ -66,21 +66,11 @@ namespace ServerComparison.FunctionalTests
using (logger.BeginScope("HelloWorldTest"))
{
string content = null;
if (serverType == ServerType.IISExpress)
{
content = File.ReadAllText("Http.config");
}
else if (serverType == ServerType.Nginx)
{
content = File.ReadAllText("nginx.conf");
}
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
ServerConfigTemplateContent = content,
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType),
SiteName = "HttpTestSite", // This is configured in the Http.config
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"
};

View File

@ -1,8 +1,8 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using Microsoft.AspNetCore.Server.Testing;
namespace ServerComparison.FunctionalTests
{
@ -12,5 +12,20 @@ namespace ServerComparison.FunctionalTests
{
return Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "ServerComparison.TestSites"));
}
public static string GetConfigContent(ServerType serverType)
{
string content = null;
if (serverType == ServerType.IISExpress)
{
content = File.ReadAllText("Http.config");
}
else if (serverType == ServerType.Nginx)
{
content = File.ReadAllText("nginx.conf");
}
return content;
}
}
}

View File

@ -136,21 +136,11 @@ namespace ServerComparison.FunctionalTests
using (logger.BeginScope("ResponseFormatsTest"))
{
string content = null;
if (serverType == ServerType.IISExpress)
{
content = File.ReadAllText("Http.config");
}
else if (serverType == ServerType.Nginx)
{
content = File.ReadAllText("nginx.conf");
}
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "Responses",
ServerConfigTemplateContent = content,
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType),
SiteName = "HttpTestSite", // This is configured in the Http.config
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"
};