FastMoq
Search Results for

    Show / Hide Table of Contents

    Class MockerHttpMoqExtensions

    Moq-specific HTTP setup compatibility helpers that remain available from the provider package. These helpers intentionally stay in the FastMoq.Extensions namespace for low-churn migration, while new tests prefer the provider-neutral HTTP helpers in FastMoq.Core.

    Inheritance
    object
    MockerHttpMoqExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastMoq.Extensions
    Assembly: FastMoq.Provider.Moq.dll
    Syntax
    public static class MockerHttpMoqExtensions

    Methods

    SetupHttpMessage(object, Func<HttpResponseMessage>, Expression?, Expression?)

    Sets up an HTTP message handler using Moq compatibility behavior. Prefer WhenHttpRequest(...) or WhenHttpRequestJson(...) in new tests when protected-member setup is not required.

    Declaration
    public static void SetupHttpMessage(this object mocker, Func<HttpResponseMessage> messageFunc, Expression? request = null, Expression? cancellationToken = null)
    Parameters
    Type Name Description
    object mocker
    Func<HttpResponseMessage> messageFunc
    Expression request
    Expression cancellationToken

    SetupMessageAsync<TMock, TReturn>(object, Expression<Func<TMock, Task<TReturn>>>, Func<TReturn>)

    Sets up an asynchronous member using Moq compatibility behavior.

    Declaration
    public static void SetupMessageAsync<TMock, TReturn>(this object mocker, Expression<Func<TMock, Task<TReturn>>> expression, Func<TReturn> messageFunc) where TMock : class
    Parameters
    Type Name Description
    object mocker
    Expression<Func<TMock, Task<TReturn>>> expression
    Func<TReturn> messageFunc
    Type Parameters
    Name Description
    TMock
    TReturn

    SetupMessageProtectedAsync<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)

    Sets up an asynchronous protected member using Moq compatibility behavior.

    Declaration
    public static void SetupMessageProtectedAsync<TMock, TReturn>(this object mocker, string methodOrPropertyName, Func<TReturn> messageFunc, params object?[]? args) where TMock : class
    Parameters
    Type Name Description
    object mocker
    string methodOrPropertyName
    Func<TReturn> messageFunc
    object[] args
    Type Parameters
    Name Description
    TMock
    TReturn

    SetupMessageProtected<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)

    Sets up a protected member using Moq compatibility behavior.

    Declaration
    public static void SetupMessageProtected<TMock, TReturn>(this object mocker, string methodOrPropertyName, Func<TReturn> messageFunc, params object?[]? args) where TMock : class
    Parameters
    Type Name Description
    object mocker
    string methodOrPropertyName
    Func<TReturn> messageFunc
    object[] args
    Type Parameters
    Name Description
    TMock
    TReturn

    SetupMessage<TMock, TReturn>(object, Expression<Func<TMock, TReturn>>, Func<TReturn>)

    Sets up a synchronous member using Moq compatibility behavior.

    Declaration
    public static void SetupMessage<TMock, TReturn>(this object mocker, Expression<Func<TMock, TReturn>> expression, Func<TReturn> messageFunc) where TMock : class
    Parameters
    Type Name Description
    object mocker
    Expression<Func<TMock, TReturn>> expression
    Func<TReturn> messageFunc
    Type Parameters
    Name Description
    TMock
    TReturn
    In this article
    Back to top
    Generated 2026-04-08 12:38 UTC