FastMoq
Search Results for

    Show / Hide Table of Contents

    Interface IDbContextMock

    Describes the DbContext-specific setup operations exposed by FastMoq's legacy DbContext mock wrappers.

    Namespace: FastMoq.Models
    Assembly: FastMoq.Database.dll
    Syntax
    public interface IDbContextMock

    Methods

    SetupDbContextSetMethods(PropertyInfo)

    Configures the Set<TEntity> style methods on the mocked DbContext for the supplied DbSet property.

    Declaration
    void SetupDbContextSetMethods(PropertyInfo propertyInfo)
    Parameters
    Type Name Description
    PropertyInfo propertyInfo

    The DbSet property being mapped back to the corresponding Set<TEntity> methods.

    SetupDbSetProperties(PropertyInfo, object)

    Configures DbSet-related properties on the mocked DbContext.

    Declaration
    void SetupDbSetProperties(PropertyInfo propertyInfo, object value)
    Parameters
    Type Name Description
    PropertyInfo propertyInfo

    The DbSet property to configure.

    object value

    The value the property should return.

    SetupDbSetPropertyGet(PropertyInfo, object)

    Configures the getter for a DbSet property on the mocked DbContext.

    Declaration
    void SetupDbSetPropertyGet(PropertyInfo propertyInfo, object value)
    Parameters
    Type Name Description
    PropertyInfo propertyInfo

    The DbSet property whose getter should be configured.

    object value

    The value the getter should return.

    SetupSetMethod(Type, Delegate, Type[]?, object?[]?)

    Configures the generic Set<TEntity> method for the supplied entity type.

    Declaration
    void SetupSetMethod(Type setType, Delegate propValueDelegate, Type[]? types = null, object?[]? parameters = null)
    Parameters
    Type Name Description
    Type setType

    The entity type represented by the configured DbSet.

    Delegate propValueDelegate

    A delegate that returns the DbSet instance for the configured entity type.

    Type[] types

    Optional generic type arguments to apply when building the setup expression.

    object[] parameters

    Optional method parameters to use while building the setup expression.

    Extension Methods

    ObjectExtensions.RaiseIfNull<T>(T?, string?, string?, int?, string?)
    TestClassExtensions.GetFieldValue<TObject>(TObject, string, TObject?)
    TestClassExtensions.GetField<TObject>(TObject, string)
    TestClassExtensions.GetMemberName<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMember<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMethodValue<TObject>(TObject, string, object?, params object[])
    TestClassExtensions.GetMethod<TObject>(TObject, string)
    TestClassExtensions.GetPropertyValue<TObject>(TObject, string, object?)
    TestClassExtensions.GetProperty<TObject>(TObject, string)
    TestClassExtensions.SetFieldValue<TObject>(TObject, string, object?)
    TestClassExtensions.SetPropertyValue<TObject>(TObject, string, object?)
    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-29 03:53 UTC