Ejemplo n.º 1
0
            public void TestInitialize()
            {
                List <CU.MsiProduct> installedProducts = CU.GetMsiProducts();

                if (Tools.ProductsContains(installedProducts, "D0A41530-E762-4C7D-8A72-E2D0E07C8A2E"))
                {
                    CU  action      = new CU(Tools.GetXmlFragment("UnInstallRemoteMsiManager.custAct"));
                    var finalResult = Tools.GetReturnCodeAction();
                    action.Run(ref finalResult);

                    installedProducts = CU.GetMsiProducts();
                    Assert.IsFalse(Tools.ProductsContains(installedProducts, "D0A41530-E762-4C7D-8A72-E2D0E07C8A2E"));
                }
            }
Ejemplo n.º 2
0
            public void UninstallOneProduct_WhenOnlyOneProductMatch()
            {
                // Arrange
                SUT action      = new SUT(Tools.GetXmlFragment("UninstallMsiByGuid-OneProduct.CustAct"));
                var finalResult = Tools.GetReturnCodeAction();
                List <SUT.MsiProduct> installedProducts = SUT.GetMsiProducts();
                int productCountBefore = installedProducts.Count;
                int productCountAfter;

                // Act
                action.Run(ref finalResult);
                installedProducts = SUT.GetMsiProducts();
                productCountAfter = installedProducts.Count;

                // Asset
                Assert.IsFalse(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180121F0"));
                Assert.IsTrue(productCountBefore == productCountAfter + 1);
            }
Ejemplo n.º 3
0
            public void UninstallAllJavaExceptU152_WhenPatternMatchAllAndExceptionListU152()
            {
                // Arrange
                SUT action      = new SUT(Tools.GetXmlFragment("UninstallMsiByGuid-AllJavaExceptU152.CustAct"));
                var finalResult = Tools.GetReturnCodeAction();
                List <SUT.MsiProduct> installedProducts = SUT.GetMsiProducts();
                int productCountBefore = installedProducts.Count;
                int productCountAfter;

                // Act
                action.Run(ref finalResult);
                installedProducts = SUT.GetMsiProducts();
                productCountAfter = installedProducts.Count;

                // Asset
                Assert.IsFalse(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180121F0"));
                Assert.IsFalse(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180131F0"));
                Assert.IsFalse(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180144F0"));
                Assert.IsTrue(productCountBefore == productCountAfter + 3);
            }
Ejemplo n.º 4
0
            public void UninstallNothing_WhenPatternDoesNotMatchAnything()
            {
                // Arrange
                SUT action      = new SUT(Tools.GetXmlFragment("UninstallMsiByGuid-PatternDoesNotMatchanything.CustAct"));
                var finalResult = Tools.GetReturnCodeAction();
                List <SUT.MsiProduct> installedProducts = SUT.GetMsiProducts();
                int productCountBefore = installedProducts.Count;
                int productCountAfter;

                // Act
                action.Run(ref finalResult);
                installedProducts = SUT.GetMsiProducts();
                productCountAfter = installedProducts.Count;

                // Asset

                Assert.IsTrue(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180121F0"));
                Assert.IsTrue(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180131F0"));
                Assert.IsTrue(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180144F0"));
                Assert.IsTrue(Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180152F0"));
                Assert.IsTrue(productCountBefore == productCountAfter);
            }