FastMoq
Search Results for

    Show / Hide Table of Contents

    Struct TimesSpec

    Provider agnostic verification specification. Uses a single verification mode with an optional count where applicable.

    Implements
    IEquatable<TimesSpec>
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: FastMoq.Providers
    Assembly: FastMoq.Abstractions.dll
    Syntax
    public readonly record struct TimesSpec : IEquatable<TimesSpec>

    Properties

    Count

    Gets the expected invocation count when the selected Mode requires one.

    Declaration
    public int? Count { get; }
    Property Value
    Type Description
    int?

    Mode

    Gets the verification mode.

    Declaration
    public TimesSpecMode Mode { get; }
    Property Value
    Type Description
    TimesSpecMode

    NeverCalled

    Gets a specification that requires zero invocations.

    Declaration
    public static TimesSpec NeverCalled { get; }
    Property Value
    Type Description
    TimesSpec

    Once

    Gets a specification that requires exactly one invocation.

    Declaration
    public static TimesSpec Once { get; }
    Property Value
    Type Description
    TimesSpec

    Methods

    AtLeast(int)

    Creates a specification that requires at least count invocations.

    Declaration
    public static TimesSpec AtLeast(int count)
    Parameters
    Type Name Description
    int count

    The minimum required invocation count.

    Returns
    Type Description
    TimesSpec

    A verification specification for a minimum count.

    AtMost(int)

    Creates a specification that allows at most count invocations.

    Declaration
    public static TimesSpec AtMost(int count)
    Parameters
    Type Name Description
    int count

    The maximum allowed invocation count.

    Returns
    Type Description
    TimesSpec

    A verification specification for a maximum count.

    Exactly(int)

    Creates a specification that requires exactly count invocations.

    Declaration
    public static TimesSpec Exactly(int count)
    Parameters
    Type Name Description
    int count

    The required invocation count.

    Returns
    Type Description
    TimesSpec

    A verification specification for an exact count.

    Never()

    Creates a specification that requires zero invocations.

    Declaration
    public static TimesSpec Never()
    Returns
    Type Description
    TimesSpec

    A verification specification for no invocations.

    Implements

    IEquatable<T>

    Extension Methods

    TestClassExtensions.GetMemberName<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMember<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetProperty<TObject>(TObject, string)
    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-08 00:16 UTC