Table of Contents

Method IsTestClassDisposable

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

IsTestClassDisposable(TContext, object)

Determine whether a test class instance should be disposed. The pipeline will only call DisposeTestClassInstance(TContext, object) if this returns true. By default, looks to see if the class implements IAsyncDisposable or IDisposable.

protected virtual bool IsTestClassDisposable(TContext ctxt, object testClassInstance)

Parameters

ctxt TContext

The context that describes the current test

testClassInstance object

The test class instance

Returns

bool

Remarks

This method runs during Running and any exceptions thrown will contribute to test failure.