public void WhenIdAndRemoveDependenciesSpecified_PackageIsUninstalledIfThereAreNoDependenciesAndDependenciesOfPackageAreRemoved() { // Arrange RemovePackageCommand cmd = new RemovePackageCommand().AutoConfigure(); Mock<IPackageManager> mockManager = cmd.AttachPackageManager(); cmd.Id = "Foo"; cmd.RemoveDependencies = SwitchParameter.Present; // Act cmd.Execute(); // Assert mockManager.Verify(m => m.UninstallPackage("Foo", null, false, true)); }
public void WhenIdSpecified_PackageIsUninstalledIfNothingDependsOnItButDependenciesOfPackageAreNotRemoved() { // Arrange RemovePackageCommand cmd = new RemovePackageCommand().AutoConfigure(); Mock<IPackageManager> mockManager = cmd.AttachPackageManager(); cmd.Id = "Foo"; // Act cmd.Execute(); // Assert mockManager.Verify(m => m.UninstallPackage("Foo", null, false, false)); }