Skip to content

Commit 6c059f9

Browse files
committed
Add test to show it uses manifest if needed by default
1 parent 6ac6981 commit 6c059f9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/dotnet.Tests/CommandTests/Tool/Install/ToolInstallLocalCommandTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,29 @@ public void GivenNoManifestFileAndCreateManifestIfNeededFlagItShouldCreateManife
408408
_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, ".config", "dotnet-tools.json")).Should().BeTrue();
409409
}
410410

411+
[Fact]
412+
public void GivenNoManifestFileItUsesCreateManifestIfNeededByDefault()
413+
{
414+
_fileSystem.File.Delete(_manifestFilePath);
415+
416+
ParseResult parseResult =
417+
Parser.Instance.Parse(
418+
$"dotnet tool install {_packageIdA.ToString()}");
419+
420+
421+
var installLocalCommand = new ToolInstallLocalCommand(
422+
parseResult,
423+
_packageIdA,
424+
_toolPackageDownloaderMock,
425+
_toolManifestFinder,
426+
_toolManifestEditor,
427+
_localToolsResolverCache,
428+
_reporter);
429+
430+
installLocalCommand.Execute().Should().Be(0);
431+
_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, ".config", "dotnet-tools.json")).Should().BeTrue();
432+
}
433+
411434
[Fact]
412435
public void GivenNoManifestFileAndCreateManifestIfNeededFlagItShouldCreateManifestInSln()
413436
{

0 commit comments

Comments
 (0)