/// <summary>
        /// Creates an observable test context.
        /// </summary>
        /// <param name="manager">The test context manager.</param>
        /// <param name="testStep">The test step.</param>
        /// <param name="parent">The parent test context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="manager"/> or <paramref name="testStep"/> is null.</exception>
        public ObservableTestContext(ObservableTestContextManager manager, TestStep testStep, ITestContext parent)
        {
            if (manager == null)
                throw new ArgumentNullException("manager");
            if (testStep == null)
                throw new ArgumentNullException("testStep");

            this.manager = manager;
            this.testStep = testStep;
            this.parent = parent;

            logWriter = new ObservableTestLogWriter(MessageSink, testStep.Id);
            externallyVisibleLogWriter = new FallbackMarkupDocumentWriter(logWriter,
                parent != null ? parent.LogWriter : new NullMarkupDocumentWriter());

            data = new UserDataCollection();
        }
Example #2
0
        private void RunTests(UnmanagedTestRepository repository, IProgressMonitor progressMonitor)
        {
            ITestContextManager testContextManager = new ObservableTestContextManager(TestContextTrackerAccessor.Instance, MessageSink);
            ITestCommandFactory testCommandFactory = new DefaultTestCommandFactory();
            ITestCommand rootTestCommand = testCommandFactory.BuildCommands(TestModel, TestExecutionOptions.FilterSet, TestExecutionOptions.ExactFilter, testContextManager);
            reporter = new AssertionFailureReporter(repository);
            this.repository = repository;

            if (rootTestCommand != null)
            {
                if (TestExecutionOptions.SkipTestExecution)
                {
                    SkipAll(rootTestCommand, null);
                }
                else
                {
                    RunAll(progressMonitor, rootTestCommand);
                }
            }
        }