Example #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);
        }
Example #2
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);
            }
        }
Example #3
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);
        }
        protected override void OnCreateTests()
        {
            NUnitService testService = NUnitService.Instance;

            foreach (SolutionItem e in combine.Items)
            {
                UnitTest t = testService.BuildTest(e);
                if (t != null)
                {
                    Tests.Add(t);
                }
            }
        }
Example #5
0
        protected override void OnCreateTests()
        {
            NUnitService testService = NUnitService.Instance;

            foreach (WorkspaceItem e in workspace.Items)
            {
                UnitTest t = testService.BuildTest(e);
                if (t != null)
                {
                    Tests.Add(t);
                }
            }
        }
Example #6
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();
            }
        }
Example #7
0
        protected void OnShowOptions()
        {
            UnitTest test = CurrentNode.DataItem as UnitTest;

            NUnitService.ShowOptionsDialog(test);
        }