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 |
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. |