Helper
This commit is contained in:
parent
dfb7f2f9b2
commit
f272d993de
|
|
@ -66,21 +66,11 @@ namespace ServerComparison.FunctionalTests
|
||||||
|
|
||||||
using (logger.BeginScope("HelloWorldTest"))
|
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)
|
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(), serverType, runtimeFlavor, architecture)
|
||||||
{
|
{
|
||||||
ApplicationBaseUriHint = applicationBaseUrl,
|
ApplicationBaseUriHint = applicationBaseUrl,
|
||||||
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
|
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
|
||||||
ServerConfigTemplateContent = content,
|
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType),
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"
|
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Microsoft.AspNetCore.Server.Testing;
|
||||||
|
|
||||||
namespace ServerComparison.FunctionalTests
|
namespace ServerComparison.FunctionalTests
|
||||||
{
|
{
|
||||||
|
|
@ -12,5 +12,20 @@ namespace ServerComparison.FunctionalTests
|
||||||
{
|
{
|
||||||
return Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "ServerComparison.TestSites"));
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -136,21 +136,11 @@ namespace ServerComparison.FunctionalTests
|
||||||
|
|
||||||
using (logger.BeginScope("ResponseFormatsTest"))
|
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)
|
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(), serverType, runtimeFlavor, architecture)
|
||||||
{
|
{
|
||||||
ApplicationBaseUriHint = applicationBaseUrl,
|
ApplicationBaseUriHint = applicationBaseUrl,
|
||||||
EnvironmentName = "Responses",
|
EnvironmentName = "Responses",
|
||||||
ServerConfigTemplateContent = content,
|
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType),
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"
|
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue