SnapshotPathContext Class
public sealed class SnapshotPathContext : IEquatable<SnapshotPathContext>No documentation is available.
- Implements
Constructors
| Name | Description |
|---|---|
| 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.cspublic 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
SourceFilePathFullPathClassNamestring?MethodNamestringLineNumberintTypeSnapshotTypeIndexintExtensionstring?TestContextSnapshotTestContext?SettingsSnapshotSettingsSnapshotCountintMemberNamestring?
No documentation is available.
Properties
| Name | Description |
|---|---|
| ClassName | Simple name of the type declaring the test, or null when it is unknown. |
| Extension | |
| Index | |
| LineNumber | |
| MemberName | 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. |
| MethodName | Name of the test method the snapshot belongs to. |
| Settings | |
| SnapshotCount | |
| SourceFilePath | |
| TestContext | |
| Type |
ClassName
SnapshotPathContext.csSimple name of the type declaring the test, or null when it is unknown.
public string? ClassName { get; init; }Property value
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.
Extension
SnapshotPathContext.csLineNumber
SnapshotPathContext.csMemberName
SnapshotPathContext.csMember 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
MethodName
SnapshotPathContext.csName of the test method the snapshot belongs to.
public string MethodName { get; init; }Property value
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.
Settings
SnapshotPathContext.csSnapshotCount
SnapshotPathContext.csSourceFilePath
SnapshotPathContext.csTestContext
SnapshotPathContext.csMethods
| Name | Description |
|---|---|
| Equals(SnapshotPathContext?) | |
| Equals(object?) | |
| GetHashCode() | |
| ToString() |
Equals overloads
Equals(SnapshotPathContext?)
public bool Equals(SnapshotPathContext? other)No documentation is available.
Equals(object?)
GetHashCode()
ToString()
Operators
| Name | Description |
|---|---|
| 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.