Table of Contents

Class TextCapture

Namespace
NUnit.Framework.Internal.Execution
Assembly
nunit.framework.dll

The TextCapture class intercepts console output and writes it to the current execution context, if one is present on the thread. If no execution context is found, the output is written to a default destination, normally the original destination of the intercepted output.

public class TextCapture : TextWriter, IDisposable, IAsyncDisposable
Inheritance
TextCapture
Implements
Inherited Members

Constructors

TextCapture(TextWriter)

Construct a TextCapture object

public TextCapture(TextWriter defaultWriter)

Parameters

defaultWriter TextWriter

The default destination for non-intercepted output

Properties

Encoding

Gets the Encoding in use by this TextWriter

public override Encoding Encoding { get; }

Property Value

Encoding

Methods

Write(char)

Writes a single character

public override void Write(char value)

Parameters

value char

The char to write

Write(string?)

Writes a string

public override void Write(string? value)

Parameters

value string

The string to write

WriteLine(string?)

Writes a string followed by a line terminator

public override void WriteLine(string? value)

Parameters

value string

The string to write