Skip to content

Commit

Permalink
Fix test that depended on old output directory layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Sep 1, 2017
1 parent 546eff2 commit 27dc803
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
17 changes: 17 additions & 0 deletions test/dotnet-new.Tests/AspNetNuGetConfiguration.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}
3 changes: 2 additions & 1 deletion test/dotnet-new.Tests/GivenThatIWantANewApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public void RestoreDoesNotUseAnyCliProducedPackagesOnItsTemplates()
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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ public void TemplateRestoresAndBuildsWithoutWarnings(

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)
Expand Down

0 comments on commit 27dc803

Please sign in to comment.