Пример #1
0
 public TestProcess(string applicationID, AsyncTestFixture fixture, ProcessStartInfo startInfo, string processID)
     : base(fixture)
 {
     this.applicationID = applicationID;
     ProcessID          = processID;
     this.startInfo     = startInfo;
     this.entryPoint    = registeredApplications[startInfo.FileName];
     breakpoints        = new ConcurrentDictionary <string, TestBreakpoint>();
 }
Пример #2
0
        public static TestProcess WaitProcessStart(string applicationName, AsyncTestFixture fixture)
        {
            AutoResetEvent wait, cont;

            lock (runningProcesses) {
                TestProcess runningProcess = runningProcesses.Keys.Where(p => string.Equals(p.startInfo.FileName, applicationName, StringComparison.Ordinal)).FirstOrDefault();
                if (runningProcess != null)
                {
                    return(runningProcess);
                }
                wait = new AutoResetEvent(false);
                cont = new AutoResetEvent(false);
                waitStart.Add(applicationName, new Tuple <AutoResetEvent, AutoResetEvent>(wait, cont));
            }
            fixture.WaitOne(wait);
            TestProcess process = runningProcesses.Keys.Where(p => string.Equals(p.startInfo.FileName, applicationName, StringComparison.Ordinal)).Single();

            cont.Set();
            return(process);
        }
Пример #3
0
 public AsyncTestObjectBase(AsyncTestFixture fixture)
 {
     Fixture = fixture;
 }
Пример #4
0
 public TestBreakpoint(string name, AsyncTestFixture fixture, TestProcess process)
     : base(fixture)
 {
     this.name    = name;
     this.process = process;
 }
 public AsyncTestObjectBase(AsyncTestFixture fixture) {
     Fixture = fixture;
 }
 public static TestProcess WaitProcessStart(string applicationName, AsyncTestFixture fixture) {
     AutoResetEvent wait, cont;
     lock(runningProcesses) {
         TestProcess runningProcess = runningProcesses.Keys.Where(p => string.Equals(p.startInfo.FileName, applicationName, StringComparison.Ordinal)).FirstOrDefault();
         if(runningProcess != null) return runningProcess;
         wait = new AutoResetEvent(false);
         cont = new AutoResetEvent(false);
         waitStart.Add(applicationName, new Tuple<AutoResetEvent, AutoResetEvent>(wait, cont));
     }
     fixture.WaitOne(wait);
     TestProcess process = runningProcesses.Keys.Where(p => string.Equals(p.startInfo.FileName, applicationName, StringComparison.Ordinal)).Single();
     cont.Set();
     return process;
 }
 public TestProcess(AsyncTestFixture fixture, ProcessStartInfo startInfo)
     : base(fixture) {
     this.startInfo = startInfo;
     this.entryPoint = registeredApplications[startInfo.FileName];
     breakpoints = new ConcurrentDictionary<string, TestBreakpoint>();
 }
 public TestBreakpoint(AsyncTestFixture fixture) : base(fixture) { }
 public TestBreakpoint(string name, AsyncTestFixture fixture, TestProcess process)
     : base(fixture) {
     this.name = name;
     this.process = process;
 }