Class IFastMockMoqExtensions
Moq-specific convenience extensions for IFastMock and IFastMock<T>.
These stay in the provider package so the core abstractions remain provider agnostic.
Inheritance
IFastMockMoqExtensions
Assembly: FastMoq.Provider.Moq.dll
Syntax
public static class IFastMockMoqExtensions
Methods
AsMoq(IFastMock)
Returns the provider-native non-generic Moq.Mock instance for a tracked FastMoq mock.
Declaration
public static Mock AsMoq(this IFastMock fastMock)
Parameters
| Type |
Name |
Description |
| IFastMock |
fastMock |
Tracked FastMoq mock.
|
Returns
| Type |
Description |
| Mock |
The underlying non-generic Moq.Mock.
|
Exceptions
AsMoq<T>(IFastMock<T>)
Returns the provider-native Moq.Mock<T> instance for a tracked FastMoq mock.
Declaration
public static Mock<T> AsMoq<T>(this IFastMock<T> fastMock) where T : class
Parameters
| Type |
Name |
Description |
| IFastMock<T> |
fastMock |
Tracked FastMoq mock.
|
Returns
| Type |
Description |
| Mock<T> |
The underlying Moq.Mock<T>.
|
Type Parameters
| Name |
Description |
| T |
Mocked type.
|
Exceptions
Protected<T>(IFastMock<T>)
Moq convenience shortcut for fastMock.AsMoq().Protected().
Declaration
public static IProtectedMock<T> Protected<T>(this IFastMock<T> fastMock) where T : class
Parameters
Returns
| Type |
Description |
| IProtectedMock<T> |
|
Type Parameters
SetupGet<T, TProperty>(IFastMock<T>, Expression<Func<T, TProperty>>)
Moq convenience shortcut for fastMock.AsMoq().SetupGet(...).
Declaration
public static ISetupGetter<T, TProperty> SetupGet<T, TProperty>(this IFastMock<T> fastMock, Expression<Func<T, TProperty>> expression) where T : class
Parameters
Returns
| Type |
Description |
| ISetupGetter<T, TProperty> |
|
Type Parameters
| Name |
Description |
| T |
|
| TProperty |
|
SetupLoggerCallback(IFastMock<ILogger>, Action<LogLevel, EventId, string, Exception?>)
Moq logger compatibility shortcut for fastMock.AsMoq().SetupLoggerCallback(...).
Declaration
public static void SetupLoggerCallback(this IFastMock<ILogger> fastMock, Action<LogLevel, EventId, string, Exception?> callback)
Parameters
SetupLoggerCallback<TLogger>(IFastMock<TLogger>, Action<LogLevel, EventId, string, Exception?>)
Moq logger compatibility shortcut for fastMock.AsMoq().SetupLoggerCallback(...).
Declaration
public static void SetupLoggerCallback<TLogger>(this IFastMock<TLogger> fastMock, Action<LogLevel, EventId, string, Exception?> callback) where TLogger : class, ILogger
Parameters
Type Parameters
SetupSequence<T, TResult>(IFastMock<T>, Expression<Func<T, TResult>>)
Moq convenience shortcut for fastMock.AsMoq().SetupSequence(...).
Declaration
public static ISetupSequentialResult<TResult> SetupSequence<T, TResult>(this IFastMock<T> fastMock, Expression<Func<T, TResult>> expression) where T : class
Parameters
Returns
| Type |
Description |
| ISetupSequentialResult<TResult> |
|
Type Parameters
| Name |
Description |
| T |
|
| TResult |
|
Setup<T>(IFastMock<T>, Expression<Action<T>>)
Moq convenience shortcut for fastMock.AsMoq().Setup(...).
Declaration
public static ISetup<T> Setup<T>(this IFastMock<T> fastMock, Expression<Action<T>> expression) where T : class
Parameters
Returns
| Type |
Description |
| ISetup<T> |
|
Type Parameters
Setup<T, TResult>(IFastMock<T>, Expression<Func<T, TResult>>)
Moq convenience shortcut for fastMock.AsMoq().Setup(...).
Declaration
public static ISetup<T, TResult> Setup<T, TResult>(this IFastMock<T> fastMock, Expression<Func<T, TResult>> expression) where T : class
Parameters
Returns
| Type |
Description |
| ISetup<T, TResult> |
|
Type Parameters
| Name |
Description |
| T |
|
| TResult |
|
VerifyLogger(IFastMock<ILogger>, LogLevel, string, Exception?, int?, int)
Moq logger compatibility shortcut for fastMock.AsMoq().VerifyLogger(...).
Declaration
public static void VerifyLogger(this IFastMock<ILogger> fastMock, LogLevel logLevel, string message, Exception? exception, int? eventId = null, int times = 1)
Parameters
VerifyLogger(IFastMock<ILogger>, LogLevel, string, int)
Moq logger compatibility shortcut for fastMock.AsMoq().VerifyLogger(...).
Declaration
public static void VerifyLogger(this IFastMock<ILogger> fastMock, LogLevel logLevel, string message, int times = 1)
Parameters
VerifyLogger<TLogger>(IFastMock<TLogger>, LogLevel, string, Exception?, int?, int)
Moq logger compatibility shortcut for fastMock.AsMoq().VerifyLogger(...).
Declaration
public static void VerifyLogger<TLogger>(this IFastMock<TLogger> fastMock, LogLevel logLevel, string message, Exception? exception, int? eventId = null, int times = 1) where TLogger : class, ILogger
Parameters
Type Parameters
VerifyLogger<TLogger>(IFastMock<TLogger>, LogLevel, string, int)
Moq logger compatibility shortcut for fastMock.AsMoq().VerifyLogger(...).
Declaration
public static void VerifyLogger<TLogger>(this IFastMock<TLogger> fastMock, LogLevel logLevel, string message, int times = 1) where TLogger : class, ILogger
Parameters
Type Parameters