Пример #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"));
                }
            }
Пример #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);
            }
Пример #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);
            }
Пример #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);
            }