Remove TestProjectHelpers from Server.IntegrationTesting

This commit is contained in:
John Luo 2017-05-15 19:11:37 -07:00
parent c8bf886e92
commit 68d1d4ce12
3 changed files with 3 additions and 35 deletions

View File

@ -1,33 +0,0 @@
// 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;
namespace Microsoft.AspNetCore.Server.IntegrationTesting.xunit
{
public class TestProjectHelpers
{
private const string SolutionName = "Hosting.sln";
public static string GetSolutionRoot()
{
var applicationBasePath = AppContext.BaseDirectory;
var directoryInfo = new DirectoryInfo(applicationBasePath);
do
{
var projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, SolutionName));
if (projectFileInfo.Exists)
{
return projectFileInfo.DirectoryName;
}
directoryInfo = directoryInfo.Parent;
}
while (directoryInfo.Parent != null);
throw new Exception($"Solution file {SolutionName} could not be found using {applicationBasePath}");
}
}
}

View File

@ -17,6 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />

View File

@ -5,7 +5,7 @@ using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Server.IntegrationTesting.xunit;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.Logging.Testing;
using Xunit;
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Hosting.FunctionalTests
{
var logger = loggerFactory.CreateLogger(nameof(ShutdownTest));
var applicationPath = Path.Combine(TestProjectHelpers.GetSolutionRoot(), "test",
var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test",
"Microsoft.AspNetCore.Hosting.TestSites");
var deploymentParameters = new DeploymentParameters(