/// <summary> /// Writes a string followed by a line terminator /// </summary> /// <param name="value">The string to write</param> public override void WriteLine(string value) { var context = TestExecutionContext.GetTestExecutionContext(); if (context != null && context.CurrentResult != null) { context.CurrentResult.OutWriter.WriteLine(value); } else { _defaultWriter.WriteLine(value); } }
private bool TrySendToListener(string text) { var context = TestExecutionContext.GetTestExecutionContext(); if (context == null || context.Listener == null) { return(false); } string testName = context.CurrentTest != null ? context.CurrentTest.FullName : null; context.Listener.TestOutput(new TestOutput(text, _streamName, testName)); return(true); }