Run() public method

Begin running the test harness.
Make sure to subscribe to the Complete event before calling this method, in some harnesses this may be a synchronous Run followed immediately by the Complete event being fired.
public Run ( ) : void
return void
Example #1
0
        public void Run(UnitTestSettings settings)
        {
            // Avoid having the Run method called twice
            if (_harness != null)
            {
                return;
            }

            _harness = settings.TestHarness;
            if (_harness == null)
            {
                throw new InvalidOperationException(Properties.UnitTestMessage.UnitTestSystem_Run_NoTestHarnessInSettings);
            }

            if (settings.TestService == null && !settings.TestServiceSetterCalled)
            {
                SetTestService(settings);
            }

            _harness.Settings = settings;
            _harness.TestHarnessCompleted += (sender, args) => OnTestHarnessCompleted(args);

            if (settings.StartRunImmediately)
            {
                _harness.Run();
            }
        }
Example #2
0
        public void Run(UnitTestSettings settings)
        {
            // Avoid having the Run method called twice
            if (_harness != null)
            {
                return;
            }

            _harness = settings.TestHarness;
            if (_harness == null)
            {
                throw new InvalidOperationException("NoTestHarnessInSettings");
            }

            // Conside re-setting the test service only in our default case
            if (settings.TestService is SilverlightTestService)
            {
                SetTestService(settings);
            }

            _harness.Settings = settings;
            _harness.TestHarnessCompleted += (sender, args) => OnTestHarnessCompleted(args);

            if (settings.StartRunImmediately)
            {
                _harness.Run();
            }
        }