Skip to content

Commit 9099124

Browse files
Copilotdsplaisted
andcommitted
Enhanced test to verify .config manifest update and root directory checks
Co-authored-by: dsplaisted <[email protected]>
1 parent 5c42f9d commit 9099124

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,15 @@ public void WhenRunWithExistingManifestInConfigDirectoryItShouldAddToExistingMan
333333
var manifestPackages = _toolManifestFinder.Find();
334334
manifestPackages.Should().HaveCount(1);
335335
manifestPackages.First().PackageId.Should().Be(_packageIdA);
336+
337+
// Verify that the manifest under the .config folder has been updated
338+
_fileSystem.File.Exists(configManifestPath).Should().BeTrue("the .config manifest file should exist");
339+
var configManifestContent = _fileSystem.File.ReadAllText(configManifestPath);
340+
configManifestContent.Should().Contain(_packageIdA.ToString(), "the .config manifest should contain the installed tool");
341+
configManifestContent.Should().NotBe(_jsonContent, "the .config manifest should have been updated with the new tool");
342+
343+
// Verify that no manifest exists in the root folder after the install command is run
344+
_fileSystem.File.Exists(_manifestFilePath).Should().BeFalse("no manifest should exist in the root folder");
336345
}
337346

338347
private ToolInstallLocalCommand GetDefaultTestToolInstallLocalCommand()

0 commit comments

Comments
 (0)