Table of Contents

Struct StackFrameInfo

Namespace
Xunit.Runner.Common
Assembly
xunit.v3.runner.common.dll

Represents the top of a stack frame, typically taken from an exception or failure information.

public readonly struct StackFrameInfo
Inherited Members

Constructors

StackFrameInfo(string?, int)

Represents the top of a stack frame, typically taken from an exception or failure information.

public StackFrameInfo(string? fileName, int lineNumber)

Parameters

fileName string

The file name from the stack frame

lineNumber int

The line number from the stack frame

Fields

None

Get a default (unknown) stack frame info.

public static readonly StackFrameInfo None

Field Value

StackFrameInfo

Properties

FileName

Gets the filename of the stack frame. May be null if the stack frame is not known.

public string? FileName { get; }

Property Value

string

IsEmpty

Returns true if this is an empty stack frame (e.g., None).

public bool IsEmpty { get; }

Property Value

bool

LineNumber

Gets the line number of the stack frame. May be 0 if the stack frame is not known.

public int LineNumber { get; }

Property Value

int

Methods

FromErrorMetadata(IErrorMetadata?)

Creates a stack frame info from error metadata.

public static StackFrameInfo FromErrorMetadata(IErrorMetadata? errorMetadata)

Parameters

errorMetadata IErrorMetadata

The error to inspect

Returns

StackFrameInfo

The stack frame info