Пример #1
0
        IAsyncOperation RunTest(ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true)
        {
            if (nav == null)
            {
                return(null);
            }
            UnitTest test = nav.DataItem as UnitTest;

            if (test == null)
            {
                return(null);
            }
            NUnitService.ResetResult(test.RootTest);

            this.buttonRunAll.Sensitive = false;
            this.buttonStop.Sensitive   = true;

            if (bringToFront)
            {
                IdeApp.Workbench.GetPad <TestPad> ().BringToFront();
            }
            runningTestOperation            = testService.RunTest(test, mode);
            runningTestOperation.Completed += (OperationHandler)DispatchService.GuiDispatch(new OperationHandler(OnTestSessionCompleted));
            return(runningTestOperation);
        }
Пример #2
0
        AsyncOperation RunTest(ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true)
        {
            if (nav == null)
            {
                return(null);
            }
            UnitTest test = nav.DataItem as UnitTest;

            if (test == null)
            {
                return(null);
            }
            NUnitService.ResetResult(test.RootTest);

            this.buttonRunAll.Sensitive = false;
            this.buttonStop.Sensitive   = true;

            if (bringToFront)
            {
                IdeApp.Workbench.GetPad <TestPad> ().BringToFront();
            }
            runningTestOperation = testService.RunTest(test, mode);
            runningTestOperation.Task.ContinueWith(t => OnTestSessionCompleted(), TaskScheduler.FromCurrentSynchronizationContext());
            return(runningTestOperation);
        }
Пример #3
0
        void RunTests()
        {
            try {
                NUnitService.ResetResult(test);

                TestContext ctx = new TestContext(monitor, resultsPad, context, DateTime.Now);
                test.Run(ctx);
                test.SaveResults();
                success = true;
            } catch (Exception ex) {
                LoggingService.LogError(ex.ToString());
                monitor.ReportRuntimeError(null, ex);
                success = false;
            } finally {
                monitor.FinishTestRun();
                runThread = null;
            }
            lock (this) {
                if (waitEvent != null)
                {
                    waitEvent.Set();
                }
            }
            if (Completed != null)
            {
                Completed(this);
            }
        }
Пример #4
0
        void RunTests()
        {
            try {
                NUnitService.ResetResult(test);

                TestContext ctx = new TestContext(monitor, resultsPad, context, DateTime.Now);
                test.Run(ctx);
                test.SaveResults();
            } catch (Exception ex) {
                LoggingService.LogError(ex.ToString());
                monitor.ReportRuntimeError(null, ex);
            } finally {
                monitor.FinishTestRun();
            }
        }