Table of Contents

Class CaptureConsoleAttribute

Namespace
Xunit
Assembly
xunit.v3.core.dll

Captures Console output (Out and/or Error) and reports it to the test output helper.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
public sealed class CaptureConsoleAttribute : BeforeAfterTestAttribute, IBeforeAfterTestAttribute
Inheritance
CaptureConsoleAttribute
Implements
Inherited Members

Properties

CaptureError

Gets or sets a flag to indicate whether to override Error.

public bool CaptureError { get; set; }

Property Value

bool

CaptureOut

Gets or sets a flag to indicate whether to override Out (which includes the Write and WriteLine methods on Console).

public bool CaptureOut { get; set; }

Property Value

bool

Methods

Before(MethodInfo, IXunitTest)

This method is called before the test method is executed.

public override void Before(MethodInfo methodUnderTest, IXunitTest test)

Parameters

methodUnderTest MethodInfo

The method under test

test IXunitTest

The current ITest