Fix test that depended on old output directory layout

This commit is contained in:
Daniel Plaisted 2017-09-01 13:53:17 -07:00
parent 546eff28c2
commit 27dc8032dd
3 changed files with 20 additions and 7 deletions

View file

@ -0,0 +1,17 @@
using System.IO;
namespace Microsoft.DotNet.New.Tests
{
public class AspNetNuGetConfiguration
{
public static void WriteNuGetConfigWithAspNetPrivateFeeds(string path)
{
string resourceName = "dotnet-new.Tests.NuGet.tempaspnetpatch.config";
using (Stream input = typeof(GivenThatIWantANewAppWithSpecifiedType).Assembly.GetManifestResourceStream(resourceName))
using (Stream output = File.OpenWrite(path))
{
input.CopyTo(output);
}
}
}
}

View file

@ -45,7 +45,8 @@ namespace Microsoft.DotNet.New.Tests
var packagesDirectory = Path.Combine(rootPath, "packages");
// For testing the 2.1 templates - some of their packages are currently only in private feeds.
var configFile = Path.Combine(rootPath, "..", "..", "..", "..", "..", "NuGet.tempaspnetpatch.config");
var configFile = Path.Combine(rootPath, "NuGet.Config");
AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(configFile);
// For "normal" builds, once the packages needed for 2.1 templates are in the public feeds
//var configFile = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config");

View file

@ -51,12 +51,7 @@ namespace Microsoft.DotNet.New.Tests
if (useNuGetConfigForAspNet)
{
string resourceName = "dotnet-new.Tests.NuGet.tempaspnetpatch.config";
using (Stream input = typeof(GivenThatIWantANewAppWithSpecifiedType).Assembly.GetManifestResourceStream(resourceName))
using (Stream output = File.OpenWrite(Path.Combine(rootPath, "NuGet.Config")))
{
input.CopyTo(output);
}
AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(Path.Combine(rootPath, "NuGet.Config"));
}
if (skipSpaWebpackSteps)