Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Tests/dotnet-new.Tests/BaseIntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,15 @@ internal static string InstallTestTemplate(string templateName, ITestOutputHelpe
/// <summary>
/// Packs test template package and returns path to it.
/// </summary>
internal static string PackTestNuGetPackage(ITestOutputHelper log, [CallerMemberName] string testName = "UnnamedTest")
internal string PackTestNuGetPackage(ITestOutputHelper log, [CallerMemberName] string testName = "UnnamedTest")
{
string outputLocation = CreateTemporaryFolder(testName, "TestNuGetPackage");
var testAsset = _testAssetsManager.CopyTestAsset("dotnet-new", callingMethod: testName, testAssetSubdirectory: "TestPackages").WithSource();
string testProject = Path.GetFileName(DotnetNewTestTemplatePackageProjectPath);
string testPath = testAsset.Path;

new DotnetPackCommand(log, DotnetNewTestTemplatePackageProjectPath, "-o", outputLocation)
string outputLocation = Path.Combine(testPath, "TestNuGetPackage");

new DotnetPackCommand(log, $"{testPath}\\{testProject}", "-o", outputLocation)
.Execute()
.Should()
.Pass();
Expand Down Expand Up @@ -184,6 +188,5 @@ private static string GetAndVerifyRepoRoot()
}
return repoRoot;
}

}
}
5 changes: 2 additions & 3 deletions src/Tests/dotnet-new.Tests/TemplateDiscoveryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ public TemplateDiscoveryTests(ITestOutputHelper log, TemplateDiscoveryTool templ
[Fact]
public async Task CanRunDiscoveryTool()
{
string home = CreateTemporaryFolder(folderName: "Home");
string testDir = CreateTemporaryFolder();
string testTemplatesPpackagePath = PackTestNuGetPackage(_log);
string testTemplatesPackagePath = PackTestNuGetPackage(_log);
using var packageManager = new PackageManager();
string packagePath = await packageManager.GetNuGetPackage(
templatePackName: "Microsoft.Azure.WebJobs.ProjectTemplates",
downloadDirectory: Path.GetDirectoryName(testTemplatesPpackagePath))
downloadDirectory: Path.GetDirectoryName(testTemplatesPackagePath))
.ConfigureAwait(false);

_templateDiscoveryTool.Run(
Expand Down