/// <summary>
        /// Notifies observers that a test run has been started.
        /// </summary>
        /// <param name="e">The event data.</param>
        protected internal virtual void OnTestRunStarting(TestRunStartingEventArgs e)
        {
            #region Legacy logging code

            // Log the filter information
            if (LogWriter != null)
            {
                LogWriter.TestRunFilterSelected(e.TestRunFilter);
            }

            if (e.EnqueuedAssemblies > 0)
            {
                LogWriter.UnitTestHarnessStage(this, HarnessName, TestStage.Starting);
            }
            else
            {
                LogWriter.Warning(Properties.UnitTestMessage.UnitTestHarness_TestAssembliesNotActionable);
            }

            #endregion

            var handler = TestRunStarting;
            if (handler != null)
            {
                handler(this, e);
            }
        }
        /// <summary>
        /// Determine what test assemblies need to be executed. Enqueue tasks
        /// for the unit test assembly providers to run the tests.
        /// </summary>
        private void PrepareTestAssemblyTasks()
        {
            UnitTestSettings settings = Settings;
            TestRunFilter    filter   = CreateTestRunFilter(settings);

            foreach (Assembly assembly in Settings.TestAssemblies)
            {
                EnqueueTestAssembly(assembly, filter);
            }

            TestRunStartingEventArgs startingArguments = new TestRunStartingEventArgs(settings, filter)
            {
                TestHarnessName    = HarnessName,
                EnqueuedAssemblies = _validTestAssemblies,
            };

            OnTestRunStarting(startingArguments);
        }
Esempio n. 3
0
 /// <summary>
 /// Process the starting of the test run.
 /// </summary>
 /// <param name="sender">The source object.</param>
 /// <param name="e">The event data.</param>
 private void OnTestRunStarting(object sender, TestRunStartingEventArgs e)
 {
     if (_d != null && e != null)
     {
         _d.Title = e.TestHarnessName;
         _d.TotalScenarios = _h.TestMethodCount;
     }
 }
Esempio n. 4
0
    /// <summary>
    /// Determine what test assemblies need to be executed. Enqueue tasks 
    /// for the unit test assembly providers to run the tests.
    /// </summary>
    private void PrepareTestAssemblyTasks()
    {
      UnitTestSettings settings = Settings;
      TestRunFilter filter = CreateTestRunFilter(settings);

      foreach (Assembly assembly in Settings.TestAssemblies)
      {
        EnqueueTestAssembly(assembly, filter);
      }

      TestRunStartingEventArgs startingArguments = new TestRunStartingEventArgs(settings, filter)
      {
        TestHarnessName = HarnessName,
        EnqueuedAssemblies = _validTestAssemblies,
      };

      OnTestRunStarting(startingArguments);
    }
Esempio n. 5
0
    /// <summary>
    /// Notifies observers that a test run has been started.
    /// </summary>
    /// <param name="e">The event data.</param>
    protected internal virtual void OnTestRunStarting(TestRunStartingEventArgs e)
    {
      #region Legacy logging code

      // Log the filter information
      if (LogWriter != null)
      {
        LogWriter.TestRunFilterSelected(e.TestRunFilter);
      }

      if (e.EnqueuedAssemblies > 0)
      {
        LogWriter.UnitTestHarnessStage(this, HarnessName, TestStage.Starting);
      }
      else
      {
        LogWriter.Warning(Properties.UnitTestMessage.UnitTestHarness_TestAssembliesNotActionable);
      }

      #endregion

      var handler = TestRunStarting;
      if (handler != null)
      {
        handler(this, e);
      }
    }
 /// <summary>
 /// Calls the test run starting event.
 /// </summary>
 /// <param name="e">The event data.</param>
 public void SendTestRunStarting(TestRunStartingEventArgs e)
 {
   _harness.OnTestRunStarting(e);
 }
 /// <summary>
 /// Calls the test run starting event.
 /// </summary>
 /// <param name="e">The event data.</param>
 public void SendTestRunStarting(TestRunStartingEventArgs e)
 {
     _harness.OnTestRunStarting(e);
 }