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
MockerHttpMoqExtensions
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
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 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 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 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 Parameters
| Name |
Description |
| TMock |
|
| TReturn |
|