コード例 #1
0
        public void Installer2_Install()
        {
            var config = new SetupConfigInstaller2
            {
                TypeOfInstallation = TypeOfInstallation.Install
            };

            var testBed = new MsiTestBed(config);
            Assert.IsTrue(testBed.Execute());
        }
コード例 #2
0
        public void Installer1_Install_DefaultFeature()
        {
            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.Install,
                FeatureOne = true,
                FeatureTwo = false
            };

            var testBed = new MsiTestBed(config);
            Assert.IsTrue(testBed.Execute());
        }
コード例 #3
0
        private static void Installer2_UnInstallAll_Failure()
        {
            WriteToConsoleWithColor(ConsoleColor.Yellow, "TEST: Installer2 UnInstall ALL");
            WriteToConsoleWithColor(ConsoleColor.Yellow, "This test will fail since not all files and registry keys are UnInstalled as expected");
            Console.WriteLine("Press enter to start test");
            Console.ReadLine();

            var config = new SetupConfigInstaller2
            {
                TypeOfInstallation = TypeOfInstallation.UnInstall,
                FilePathToTestData = @"TestData\Installer2_UnInstall.xml"
            };

            var testBed = new MsiTestBed(config);
            MsiInstaller.InstallMSI(testBed.Verifier.SetupConfiguration,
                ((SetupConfigBaseMsi)testBed.Verifier.SetupConfiguration).FilePathToMsiFile, true, true);

            var result = testBed.Execute();
            WriteResult(result);

            new TestCleaner().CleanMachine();
        }
コード例 #4
0
        private static void RepairFile()
        {
            WriteToConsoleWithColor(ConsoleColor.Yellow, "TEST: Repair File");
            WriteToConsoleWithColor(ConsoleColor.Yellow, "This test will delete an installed file and verify that the installer does repair the file");
            Console.WriteLine("Press enter to start test");
            Console.ReadLine();

            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.Repair,
                FeatureOne = true,
                FeatureTwo = true
            };

            var testBed = new MsiTestBed(config);
            MsiInstaller.InstallMSI(testBed.Verifier.SetupConfiguration,
                ((SetupConfigBaseMsi)testBed.Verifier.SetupConfiguration).FilePathToMsiFile, true, true);

            WriteToConsoleWithColor(ConsoleColor.Cyan, "Deleting file");
            FileSystemTool.RemoveFile(config.InstallFolderParameter + @"\Payload1.txt");

            var result = testBed.Execute();
            WriteResult(result);

            new TestCleaner().CleanMachine();
        }
コード例 #5
0
        private static void UninstallAll()
        {
            WriteToConsoleWithColor(ConsoleColor.Yellow, "TEST: UnInstall ALL");
            WriteToConsoleWithColor(ConsoleColor.Yellow, "This test verifies that all feature is removed from the machine as expected");
            Console.WriteLine("Press enter to start test");
            Console.ReadLine();

            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.UnInstall,
                FeatureOne = true,
                FeatureTwo = true
            };

            var testBed = new MsiTestBed(config);
            MsiInstaller.InstallMSI(testBed.Verifier.SetupConfiguration,
                ((SetupConfigBaseMsi) testBed.Verifier.SetupConfiguration).FilePathToMsiFile, true, true);

            var result = testBed.Execute();
            WriteResult(result);

            new TestCleaner().CleanMachine();
        }
コード例 #6
0
        private static void RunTest(SetupConfigBaseMsi config)
        {
            var testBed = new MsiTestBed(config);
            var result = testBed.Execute();
            WriteResult(result);

            new TestCleaner().CleanMachine();
        }
コード例 #7
0
        public void Installer1_RepairFile()
        {
            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.Repair
            };

            var testBed = new MsiTestBed(config);
            MsiInstaller.InstallMSI(testBed.Verifier.SetupConfiguration, ((SetupConfigBaseMsi)testBed.Verifier.SetupConfiguration).FilePathToMsiFile, true, true);
            FileSystemTool.RemoveFile(config.InstallFolderParameter + @"\Payload1.txt");
            Assert.IsTrue(testBed.Execute());
        }
コード例 #8
0
        public void Installer1_UnInstall()
        {
            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.UnInstall
            };

            MsiInstaller.InstallMSI(config, config.FilePathToMsiFile, true, true);

            var testBed = new MsiTestBed(config);
            Assert.IsTrue(testBed.Execute());
        }
コード例 #9
0
        public void Installer1_RepairNone()
        {
            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.Repair
            };

            var testBed = new MsiTestBed(config);
            MsiInstaller.InstallMSI(testBed.Verifier.SetupConfiguration, ((SetupConfigBaseMsi)testBed.Verifier.SetupConfiguration).FilePathToMsiFile, true, true);
            Assert.IsTrue(testBed.Execute());
        }