コード例 #1
0
        private static void InstallAll()
        {
            WriteToConsoleWithColor(ConsoleColor.Yellow, "TEST: Install ALL");
            WriteToConsoleWithColor(ConsoleColor.Yellow, "This test verifies that all features have been insalled as expected");
            Console.WriteLine("Press enter to start test");
            Console.ReadLine();

            var config = new SetupConfigInstaller1
            {
                TypeOfInstallation = TypeOfInstallation.Install
            };

            RunTest(config);
        }
コード例 #2
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();
        }
コード例 #3
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();
        }