public static Thread startProcessUnderDebugger(string executableToStart)
 {
     if (executableToStart == null)
     {
         return(null);
     }
     DI.log.info("Starting process under debugger: {0}", executableToStart);
     return(O2Thread.mtaThread(
                () =>
     {
         DI.o2MDbg.execSync(O2MDbgCommands.run(executableToStart));
         DI.o2MDbg.BreakPoints.addArchivedBreakpoints();
         DI.o2MDbg.execSync(O2MDbgCommands.stepInto());
     }));
 }
        public void startO2MDbgAndRunTestProcess()
        {
            o2MDbg = new O2MDbg();
            o2MDbg.o2MdbgIsReady.WaitOne(); // make sure the o2Mdbg is ready
            Assert.That(File.Exists(mockObjects_CompiledExe.PathToCreatedAssemblyFile), "Test exe file was not created");
            //  Processes.Sleep(1000);  // give it 1s to start the process

            Assert.That(!o2MDbg.IsActive && !o2MDbg.IsRunning, "At this stage both o2MDbg.IsActive and o2MDbg.IsRunning should be false");
            Assert.That(o2MDbg.lastCommandExecutionMessage != "", "o2MDbg.lastCommandExecutionMessage was empty");

            // start test process
            o2MDbg.execSync(O2MDbgCommands.run(mockObjects_CompiledExe.PathToCreatedAssemblyFile));
            //Processes.Sleep(1000);  // give it 1s to start
            Assert.That(o2MDbg.IsActive && !o2MDbg.IsRunning, "At this stage both o2MDbg.IsActive should be true and o2MDbg.IsRunning should be false");
        }