public void CallRemovePackageWillDeleteNuspecAndNupkgFileBeforeDeletingTheWholePackageDirectory() { // Arrange var fileSystem = new MockFileSystemWithDeleteVerification(); fileSystem.AddFile("A.2.0\\A.2.0.nupkg"); fileSystem.AddFile("A.2.0\\A.2.0.nuspec"); fileSystem.AddFile("A.2.0\\random"); fileSystem.AddFile("A.2.0\\content\\file.txt"); fileSystem.AddFile("A.2.0\\readme.txt"); var configFileSystem = new MockFileSystem(); var repository = new SharedPackageRepository(new DefaultPackagePathResolver(fileSystem), fileSystem, configFileSystem); // Act repository.RemovePackage(PackageUtility.CreatePackage("A", "2.0")); // Assert Assert.False(fileSystem.FileExists("A.2.0\\A.2.0.nupkg")); Assert.False(fileSystem.FileExists("A.2.0\\A.2.0.nuspec")); Assert.False(fileSystem.DirectoryExists("A.2.0")); Assert.True(fileSystem.IsFileDeleted("A.2.0\\A.2.0.nupkg")); Assert.True(fileSystem.IsFileDeleted("A.2.0\\A.2.0.nuspec")); }