SnapshotPathContext Class

public sealed class SnapshotPathContext : IEquatable<SnapshotPathContext>

No documentation is available.

Implements

Constructors

NameDescription
SnapshotPathContext(FullPath, string?, string, int, SnapshotType, int, string?, SnapshotTestContext?, SnapshotSettings, int, string?)

SnapshotPathContext(FullPath, string?, string, int, SnapshotType, int, string?, SnapshotTestContext?, SnapshotSettings, int, string?)

SnapshotPathContext.cs
public SnapshotPathContext(FullPath SourceFilePath, string? ClassName, string MethodName, int LineNumber, SnapshotType Type, int Index, string? Extension, SnapshotTestContext? TestContext, SnapshotSettings Settings, int SnapshotCount = 1, string? MemberName = null)

Parameters

SourceFilePath FullPath
ClassName string?
MethodName string
LineNumber int
Type SnapshotType
Index int
Extension string?
TestContext SnapshotTestContext?
Settings SnapshotSettings
SnapshotCount int
MemberName string?

No documentation is available.

Properties

NameDescription
ClassNameSimple name of the type declaring the test, or null when it is unknown.
Extension
Index
LineNumber
MemberNameMember name captured by the compiler at the call site, or null when the assertion did not provide one. Unlike SnapshotPathContext.MethodName, it never needs the test framework nor the call stack, but it describes the method that called the assertion rather than the test method.
MethodNameName of the test method the snapshot belongs to.
Settings
SnapshotCount
SourceFilePath
TestContext
Type

Simple name of the type declaring the test, or null when it is unknown.

public string? ClassName { get; init; }

Property value

string?

Remarks

Unless the value was provided explicitly, it comes from SnapshotPathContext.TestContext when the test framework exposes it, and from the call stack otherwise. The walk is the most expensive part of an assertion and runs the first time a name the test framework did not provide is read; a strategy that reads neither this nor SnapshotPathContext.MethodName never pays for it.

public string? Extension { get; init; }

Property value

string?

No documentation is available.

public int Index { get; init; }

Property value

int

No documentation is available.

public int LineNumber { get; init; }

Property value

int

No documentation is available.

Member name captured by the compiler at the call site, or null when the assertion did not provide one. Unlike SnapshotPathContext.MethodName, it never needs the test framework nor the call stack, but it describes the method that called the assertion rather than the test method.

public string? MemberName { get; init; }

Property value

string?

Name of the test method the snapshot belongs to.

public string MethodName { get; init; }

Property value

string

Remarks

Unless the value was provided explicitly, it comes from SnapshotPathContext.TestContext when the test framework exposes it, and from the call stack otherwise. The walk is the most expensive part of an assertion and runs the first time a name the test framework did not provide is read. Use SnapshotPathContext.MemberName when the name the compiler captured at the call site is enough.

public SnapshotSettings Settings { get; init; }

Property value

SnapshotSettings

No documentation is available.

public int SnapshotCount { get; init; }

Property value

int

No documentation is available.

public FullPath SourceFilePath { get; init; }

Property value

FullPath

No documentation is available.

public SnapshotTestContext? TestContext { get; init; }

Property value

SnapshotTestContext?

No documentation is available.

public SnapshotType Type { get; init; }

Property value

SnapshotType

No documentation is available.

Methods

NameDescription
Equals(SnapshotPathContext?)
Equals(object?)
GetHashCode()
ToString()

Equals overloads

Equals(SnapshotPathContext?)

public bool Equals(SnapshotPathContext? other)
Parameters
other SnapshotPathContext?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(SnapshotPathContext?, SnapshotPathContext?)
operator !=(SnapshotPathContext?, SnapshotPathContext?)

operator ==(SnapshotPathContext?, SnapshotPathContext?)

public static bool operator ==(SnapshotPathContext? left, SnapshotPathContext? right)

No documentation is available.

operator !=(SnapshotPathContext?, SnapshotPathContext?)

public static bool operator !=(SnapshotPathContext? left, SnapshotPathContext? right)

No documentation is available.