Table of Contents

Property TestClassInstance

Namespace
Xunit
Assembly
xunit.v3.core.dll

TestClassInstance

Gets the instance of the test class; will return null outside of the context of a test. Static test methods do not create test class instances, so this will always be null for static test methods.

object? TestClassInstance { get; }

Property Value

object

Remarks

This value will only be available when PipelineStage is TestExecution and TestStatus is Running, and only after the test class has been created. It will become null again immediately after the test class has been disposed.