Example #1
0
        /// <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();
        }
        /// <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();
        }