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

                if (!Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180121F0"))
                {
                    Tools.InstallJava(@"C:\Users\Courtel\Downloads\Java\jre-8u121-windows-i586.exe");
                }
                if (!Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180131F0"))
                {
                    Tools.InstallJava(@"C:\Users\Courtel\Downloads\Java\jre-8u131-windows-i586.exe");
                }
                if (!Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180144F0"))
                {
                    Tools.InstallJava(@"C:\Users\Courtel\Downloads\Java\jre-8u144-windows-i586.exe");
                }
                if (!Tools.ProductsContains(installedProducts, "26A24AE4-039D-4CA4-87B4-2F32180152F0"))
                {
                    Tools.InstallJava(@"C:\Users\Courtel\Downloads\Java\jre-8u152-windows-i586.exe");
                }

                installedProducts = SUT.GetMsiProducts();
                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"));
            }
Exemplo n.º 2
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"));
                }
            }
Exemplo n.º 3
0
            public void ProperlyInitializeProperties_WhenCalled()
            {
                // Arrange
                SUT action = new SUT(Tools.GetXmlFragment("UninstallMsiByGuid.CustAct"));

                // Act

                // Assert
                Assert.AreEqual(action.MsiProductCodes, "AEBC-14__-DEFAEC%;81309-ADECB-_AED_%");
                Assert.AreEqual(action.Exceptions, @"ADE__-8942394-AEBEA__%");
                Assert.IsTrue(action.DontUninstallIfNoException);
                Assert.IsTrue(action.KillProcess);
                Assert.AreEqual(action.KillAfter, 1);
            }
Exemplo n.º 4
0
            public void InstallRemoteMsiManager_WhenAskedToDoSo()
            {
                // Arrange
                SUT action      = new SUT(Tools.GetXmlFragment("Install Remote Msi Manager.CustAct"));
                var finalResult = Tools.GetReturnCodeAction();

                // Act
                List <CU.MsiProduct> installedProducts = CU.GetMsiProducts();

                action.Run(ref finalResult);
                installedProducts = CU.GetMsiProducts();

                // Assert
                Assert.IsTrue(Tools.ProductsContains(installedProducts, "D0A41530-E762-4C7D-8A72-E2D0E07C8A2E"));
                Assert.AreEqual(0, finalResult.ReturnValue);
            }
Exemplo n.º 5
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);
            }
Exemplo n.º 6
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);
            }
Exemplo n.º 7
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);
            }