コード例 #1
0
        public override void Run()
        {
            projects = new List <IProject>();

            IMember  m               = TestableCondition.GetMember(Owner);
            IClass   c               = (m != null) ? m.DeclaringType : TestableCondition.GetClass(Owner);
            IProject project         = TestableCondition.GetProject(Owner);
            string   namespaceFilter = TestableCondition.GetNamespace(Owner);

            if (project != null)
            {
                projects.Add(project);
            }
            else if (UnitTestsPad.Instance != null)
            {
                projects.AddRange(UnitTestsPad.Instance.TestTreeView.GetProjects());
            }

            if (projects.Count > 0)
            {
                runningTestCommand = this;
                try {
                    BeforeRun();
                    if (IsRunningTest)
                    {
                        currentProject = projects[0];
                        Run(currentProject, namespaceFilter, c, m);
                    }
                } catch {
                    runningTestCommand = null;
                    throw;
                }
            }
        }
コード例 #2
0
		public override void Run()
		{
			projects = new List<IProject>();
			
			IMember m = TestableCondition.GetMember(Owner);
			IClass c = (m != null) ? m.DeclaringType : TestableCondition.GetClass(Owner);
			IProject project = TestableCondition.GetProject(Owner);
			string namespaceFilter = TestableCondition.GetNamespace(Owner);
			
			if (project != null) {
				projects.Add(project);
			} else if (UnitTestsPad.Instance != null) {
				projects.AddRange(UnitTestsPad.Instance.TestTreeView.GetProjects());
			}
			
			if (projects.Count > 0) {
				runningTestCommand = this;
				try {
					BeforeRun();
					if (IsRunningTest) {
						currentProject = projects[0];
						Run(currentProject, namespaceFilter, c, m);
					}
				} catch {
					runningTestCommand = null;
					throw;
				}
			}
		}
コード例 #3
0
        /// <summary>
        /// Called by derived classes when a single test run
        /// is finished.
        /// </summary>
        protected void TestsFinished()
        {
            WorkbenchSingleton.AssertMainThread();

            // Read the rest of the file just in case.
            testResultsMonitor.Stop();
            testResultsMonitor.Read();
            StopMonitoring();

            projects.Remove(currentProject);
            if (projects.Count > 0)
            {
                currentProject = projects[0];
                Run(currentProject, null, null, null);
            }
            else
            {
                runningTestCommand = null;
                UpdateUnitTestsPadToolbar();
                if (TaskService.SomethingWentWrong && ErrorListPad.ShowAfterBuild)
                {
                    ShowErrorList();
                }
                OnAfterRunTests();
            }
        }
コード例 #4
0
        /// <summary>
        /// Stops running the tests.
        /// </summary>
        public void Stop()
        {
            StopActiveTestRunner();

            runningTestCommand = null;
            UpdateUnitTestsPadToolbar();

            OnStop();
        }
コード例 #5
0
        public override void Run()
        {
            AbstractRunTestCommand runTestCommand = AbstractRunTestCommand.RunningTestCommand;

            if (runTestCommand != null)
            {
                runTestCommand.Stop();
            }
        }
コード例 #6
0
		public override void Run()
		{
			GetUnitTestsPad();
			
			selectedTests = GetSelectedTests();
			if (selectedTests.HasProjects) {
				runningTestCommand = this;
				BeforeRun();
				BuildAndRunTests();
			}
		}
コード例 #7
0
		public override void Run()
		{
			GetUnitTestsPad(context.OpenUnitTestsPad);
			
			selectedTests = new SelectedTests(Owner, this.unitTestsPad.GetProjects());
			if (selectedTests.HasProjects) {
				runningTestCommand = this;
				BeforeRun();
				BuildAndRunTests();
			}
		}
コード例 #8
0
        public override void Run()
        {
            GetUnitTestsPad();

            selectedTests = GetSelectedTests();
            if (selectedTests.HasProjects)
            {
                runningTestCommand = this;
                BeforeRun();
                BuildAndRunTests();
            }
        }
コード例 #9
0
        /// <summary>
        /// Stops running the tests.
        /// </summary>
        public void Stop()
        {
            runningTestCommand = null;
            UpdateUnitTestsPadToolbar();

            projects.Clear();

            testResultsMonitor.Stop();
            StopMonitoring();

            OnStop();
        }
コード例 #10
0
        public override void Run()
        {
            GetUnitTestsPad(context.OpenUnitTestsPad);

            selectedTests = new SelectedTests(Owner, this.unitTestsPad.GetProjects());
            if (selectedTests.HasProjects)
            {
                runningTestCommand = this;
                BeforeRun();
                BuildAndRunTests();
            }
        }
コード例 #11
0
 /// <summary>
 /// Called by derived classes when a single test run
 /// is finished.
 /// </summary>
 protected void TestRunCompleted()
 {
     StopActiveTestRunner();
     selectedTests.RemoveFirstProject();
     if (selectedTests.HasProjects)
     {
         RunTests(selectedTests);
     }
     else
     {
         StopProgressMonitor();
         runningTestCommand = null;
         UpdateUnitTestsPadToolbar();
         ShowErrorList();
         OnAfterRunTests();
     }
 }
コード例 #12
0
		protected override void OnBeforeBuild()
		{
			IsOnBeforeBuildMethodCalled = true;
			RunningTestCommandPropertyWhenOnBeforeBuildCalled = AbstractRunTestCommand.RunningTestCommand;
			IsRunningTestWhenOnBeforeBuildCalled = AbstractRunTestCommand.IsRunningTest;
		}
コード例 #13
0
		/// <summary>
		/// Called by derived classes when a single test run
		/// is finished.
		/// </summary>
		protected void TestRunCompleted()
		{
			StopActiveTestRunner();
			selectedTests.RemoveFirstProject();
			if (selectedTests.HasProjects) {
				RunTests(selectedTests);
			} else {
				StopProgressMonitor();
				runningTestCommand = null;
				UpdateUnitTestsPadToolbar();
				ShowErrorList();
				OnAfterRunTests();
			}
		}
コード例 #14
0
		/// <summary>
		/// Stops running the tests.
		/// </summary>
		public void Stop()
		{
			StopActiveTestRunner();
			
			runningTestCommand = null;
			UpdateUnitTestsPadToolbar();
			
			OnStop();
		}
コード例 #15
0
		/// <summary>
		/// Stops running the tests.
		/// </summary>
		public void Stop()
		{
			runningTestCommand = null;
			UpdateUnitTestsPadToolbar();
			
			projects.Clear();
			
			testResultsMonitor.Stop();
			StopMonitoring();

			OnStop();
		}
コード例 #16
0
		/// <summary>
		/// Called by derived classes when a single test run
		/// is finished.
		/// </summary>
		protected void TestsFinished()
		{
			// Read the rest of the file just in case.
			testResultsMonitor.Stop();
			testResultsMonitor.Read();
			StopMonitoring();
			
			projects.Remove(currentProject);
			if (projects.Count > 0) {
				currentProject = projects[0];
				Run(currentProject, null, null, null);
			} else {
				runningTestCommand = null;
				UpdateUnitTestsPadToolbar();
				if (TaskService.SomethingWentWrong && ErrorListPad.ShowAfterBuild) {
					ShowErrorList();
				}
				OnAfterRunTests();
			}
		}