FastMoq
Search Results for

    Show / Hide Table of Contents

    Class IFastMockNSubstituteExtensions

    NSubstitute-specific convenience extensions for IFastMock<T>. These stay in the provider package so the core abstractions remain provider agnostic.

    Inheritance
    object
    IFastMockNSubstituteExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastMoq.Providers.NSubstituteProvider
    Assembly: FastMoq.Provider.NSubstitute.dll
    Syntax
    public static class IFastMockNSubstituteExtensions

    Methods

    AsNSubstitute<T>(IFastMock<T>)

    Returns the tracked substitute instance after validating that the active provider produced an NSubstitute substitute.

    Declaration
    public static T AsNSubstitute<T>(this IFastMock<T> fastMock) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    ClearReceivedCalls<T>(IFastMock<T>)

    Clears recorded calls on the tracked substitute.

    Declaration
    public static void ClearReceivedCalls<T>(this IFastMock<T> fastMock) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    Type Parameters
    Name Description
    T

    DidNotReceiveWithAnyArgs<T>(IFastMock<T>)

    NSubstitute convenience shortcut for fastMock.AsNSubstitute().DidNotReceiveWithAnyArgs().

    Declaration
    public static T DidNotReceiveWithAnyArgs<T>(this IFastMock<T> fastMock) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    DidNotReceive<T>(IFastMock<T>)

    NSubstitute convenience shortcut for fastMock.AsNSubstitute().DidNotReceive().

    Declaration
    public static T DidNotReceive<T>(this IFastMock<T> fastMock) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    ReceivedWithAnyArgs<T>(IFastMock<T>)

    NSubstitute convenience shortcut for fastMock.AsNSubstitute().ReceivedWithAnyArgs().

    Declaration
    public static T ReceivedWithAnyArgs<T>(this IFastMock<T> fastMock) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Received<T>(IFastMock<T>)

    NSubstitute convenience shortcut for fastMock.AsNSubstitute().Received().

    Declaration
    public static T Received<T>(this IFastMock<T> fastMock) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Received<T>(IFastMock<T>, int)

    NSubstitute convenience shortcut for fastMock.AsNSubstitute().Received(requiredNumberOfCalls).

    Declaration
    public static T Received<T>(this IFastMock<T> fastMock, int requiredNumberOfCalls) where T : class
    Parameters
    Type Name Description
    IFastMock<T> fastMock
    int requiredNumberOfCalls
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    In this article
    Back to top
    Generated 2026-04-08 12:38 UTC