Пример #1
0
 public void TestRunNoArguments()
 {
     InstallerEditorExeUtils.RunOptions options = new InstallerEditorExeUtils.RunOptions();
     InstallerEditorExeUtils.RunResult  r       = InstallerEditorExeUtils.Run(options);
     Assert.AreEqual("Installer Editor", r.WindowTitle);
     Assert.AreEqual(0, r.ExitCode);
 }
Пример #2
0
 public void TestRunHelp()
 {
     InstallerEditorExeUtils.RunOptions options = new InstallerEditorExeUtils.RunOptions();
     options.args = "/?";
     InstallerEditorExeUtils.RunResult r = InstallerEditorExeUtils.Run(options);
     Assert.AreEqual("Installer Editor Help", r.WindowTitle);
     Assert.AreEqual(2, r.ExitCode);
 }
Пример #3
0
 public void DumpControls()
 {
     InstallerEditorExeUtils.RunOptions options = new InstallerEditorExeUtils.RunOptions();
     using (Process p = InstallerEditorExeUtils.Detach(options))
     {
         Thread.Sleep(2000);
         p.WaitForInputIdle();
         UIAutomation.DumpControl(AutomationElement.FromHandle(p.MainWindowHandle));
         p.CloseMainWindow();
         p.WaitForExit();
     }
 }
Пример #4
0
        public void TestRunFileIsADirectory()
        {
            //TODO: High: ok button on error window is not automatically clicked on windows 7 ultimate x64

            InstallerEditorExeUtils.RunOptions options = new InstallerEditorExeUtils.RunOptions();
            options.args = Environment.SystemDirectory;
            ProcessStartInfo pi = new ProcessStartInfo(InstallerEditorExeUtils.Executable, options.CommandLineArgs);

            using (Application installerEditor = Application.Launch(pi))
            {
                List <Window> windows = installerEditor.GetWindows();
                Assert.AreEqual(windows.Count, 2);
                Window errorWindow = windows[1];
                Assert.IsNotNull(errorWindow);
                Assert.AreEqual(errorWindow.Title, "Error");
                Button exitButton = UIAutomation.Find <Button>(errorWindow, "OK");
                exitButton.Click();
                while (!installerEditor.HasExited)
                {
                    Thread.Sleep(100);
                }
                Assert.AreEqual(-3, installerEditor.Process.ExitCode);
            }
        }