Class MockerDiagnosticsSnapshot
Represents a provider-neutral diagnostics snapshot captured from a Mocker instance.
Implements
Inherited Members
Namespace: FastMoq.Models
Assembly: FastMoq.Core.dll
Syntax
public sealed record MockerDiagnosticsSnapshot : IEquatable<MockerDiagnosticsSnapshot>
Constructors
MockerDiagnosticsSnapshot(string, IReadOnlyList<TrackedMockDiagnosticsEntry>, IReadOnlyList<ConstructorSelectionDiagnosticsEntry>, IReadOnlyList<InstanceRegistrationDiagnosticsEntry>, IReadOnlyList<CapturedLogDiagnosticsEntry>)
Initializes a new instance of the MockerDiagnosticsSnapshot class.
Declaration
public MockerDiagnosticsSnapshot(string providerName, IReadOnlyList<TrackedMockDiagnosticsEntry> trackedMocks, IReadOnlyList<ConstructorSelectionDiagnosticsEntry> constructorSelections, IReadOnlyList<InstanceRegistrationDiagnosticsEntry> instanceRegistrations, IReadOnlyList<CapturedLogDiagnosticsEntry> logEntries)
Parameters
| Type | Name | Description |
|---|---|---|
| string | providerName | The active provider name used when the snapshot was created. |
| IReadOnlyList<TrackedMockDiagnosticsEntry> | trackedMocks | The tracked mocks currently registered in the mocker. |
| IReadOnlyList<ConstructorSelectionDiagnosticsEntry> | constructorSelections | The constructor selections recorded during component creation. |
| IReadOnlyList<InstanceRegistrationDiagnosticsEntry> | instanceRegistrations | The current instance registrations configured on the mocker. |
| IReadOnlyList<CapturedLogDiagnosticsEntry> | logEntries | The captured log entries currently stored on the mocker. |
Properties
ConstructorSelections
Gets the constructor selections recorded during component creation.
Declaration
public IReadOnlyList<ConstructorSelectionDiagnosticsEntry> ConstructorSelections { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ConstructorSelectionDiagnosticsEntry> |
InstanceRegistrations
Gets the current instance registrations configured on the mocker.
Declaration
public IReadOnlyList<InstanceRegistrationDiagnosticsEntry> InstanceRegistrations { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<InstanceRegistrationDiagnosticsEntry> |
LogEntries
Gets the captured log entries currently stored on the mocker.
Declaration
public IReadOnlyList<CapturedLogDiagnosticsEntry> LogEntries { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<CapturedLogDiagnosticsEntry> |
ProviderName
Gets the active provider name used when the snapshot was created.
Declaration
public string ProviderName { get; }
Property Value
| Type | Description |
|---|---|
| string |
TrackedMocks
Gets the tracked mocks currently registered in the mocker.
Declaration
public IReadOnlyList<TrackedMockDiagnosticsEntry> TrackedMocks { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<TrackedMockDiagnosticsEntry> |
Methods
ToDebugView()
Formats the snapshot into a readable multi-line diagnostics view.
Declaration
public string ToDebugView()
Returns
| Type | Description |
|---|---|
| string | A readable multi-line diagnostics dump. |
ToJson(bool)
Serializes the snapshot to JSON for machine-readable diagnostics output.
Declaration
public string ToJson(bool indented = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | indented | True to format the JSON with indentation. |
Returns
| Type | Description |
|---|---|
| string | A JSON representation of the current diagnostics snapshot. |