Inheritance: PackageManagementCommand
Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }