FastMoq
Search Results for

    Show / Hide Table of Contents

    Class MockerDiagnosticsSnapshot

    Represents a provider-neutral diagnostics snapshot captured from a Mocker instance.

    Inheritance
    object
    MockerDiagnosticsSnapshot
    Implements
    IEquatable<MockerDiagnosticsSnapshot>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    Implements

    IEquatable<T>

    Extension Methods

    ObjectExtensions.RaiseIfNull<T>(T?, string?, string?, int?, string?)
    TestClassExtensions.GetFieldValue<TObject>(TObject, string, TObject?)
    TestClassExtensions.GetField<TObject>(TObject, string)
    TestClassExtensions.GetMemberName<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMember<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMethodValue<TObject>(TObject, string, object?, params object[])
    TestClassExtensions.GetMethod<TObject>(TObject, string)
    TestClassExtensions.GetPropertyValue<TObject>(TObject, string, object?)
    TestClassExtensions.GetProperty<TObject>(TObject, string)
    TestClassExtensions.SetFieldValue<TObject>(TObject, string, object?)
    TestClassExtensions.SetPropertyValue<TObject>(TObject, string, object?)
    MockerHttpMoqExtensions.SetupHttpMessage(object, Func<HttpResponseMessage>, Expression?, Expression?)
    MockerHttpMoqExtensions.SetupMessageAsync<TMock, TReturn>(object, Expression<Func<TMock, Task<TReturn>>>, Func<TReturn>)
    MockerHttpMoqExtensions.SetupMessageProtectedAsync<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)
    MockerHttpMoqExtensions.SetupMessageProtected<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)
    MockerHttpMoqExtensions.SetupMessage<TMock, TReturn>(object, Expression<Func<TMock, TReturn>>, Func<TReturn>)
    TestClassExtensions.GetFieldInfo<TType>(object, string)
    TestClassExtensions.GetFieldValue<T>(object?, FieldInfo)
    TestClassExtensions.GetFieldValue<T, TType>(object, string)
    In this article
    Back to top
    Generated 2026-04-29 03:53 UTC