Class InstanceModel<TClass>
Class InstanceModel represents a type and how to create that type's instance. Implements the InstanceModel
Inherited Members
Namespace: FastMoq.Models
Assembly: FastMoq.Core.dll
Syntax
[ExcludeFromCodeCoverage]
public class InstanceModel<TClass> : InstanceModel, IInstanceModel, IHistoryModel
Type Parameters
| Name | Description |
|---|---|
| TClass | The type of the t class. |
Constructors
InstanceModel()
Declaration
public InstanceModel()
InstanceModel(IInstanceModel)
Declaration
public InstanceModel(IInstanceModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| IInstanceModel | model |
InstanceModel(Func<Mocker, object?, TClass>?)
Initializes a new instance model that creates TClass values by using a factory delegate that can inspect the current Mocker and an optional context value.
Declaration
public InstanceModel(Func<Mocker, object?, TClass>? createFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Mocker, object, TClass> | createFunc | The factory delegate used to create instances, or null to rely on constructor-based resolution. |
InstanceModel(Func<Mocker, object?, TClass>?, List<object?>)
Declaration
public InstanceModel(Func<Mocker, object?, TClass>? createFunc, List<object?> arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Mocker, object, TClass> | createFunc | |
| List<object> | arguments |
InstanceModel(Func<Mocker, TClass>?)
Declaration
public InstanceModel(Func<Mocker, TClass>? createFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Mocker, TClass> | createFunc |
InstanceModel(Func<Mocker, TClass>?, List<object?>)
Declaration
public InstanceModel(Func<Mocker, TClass>? createFunc, List<object?> arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Mocker, TClass> | createFunc | |
| List<object> | arguments |
Properties
CreateFunc
Gets or sets the create function.
Declaration
public InstanceFunction? CreateFunc { get; set; }
Property Value
| Type | Description |
|---|---|
| InstanceFunction | The create function. |
InstanceType
Gets the type of the instance.
Declaration
public override Type InstanceType { get; }
Property Value
| Type | Description |
|---|---|
| Type | The type of the instance. |