Class MockerPolicyOptions
Groups the default policy settings that shape how a Mocker resolves built-ins and creates mocks. Per-call options may still override the relevant creation or invocation behavior where supported.
Inherited Members
Namespace: FastMoq
Assembly: FastMoq.Core.dll
Syntax
public sealed class MockerPolicyOptions
Properties
DefaultConstructorAmbiguityBehavior
Controls how FastMoq resolves constructor ambiguity when multiple equally viable constructors remain after candidate filtering. The default preserves the existing throw behavior for backward compatibility.
Declaration
public ConstructorAmbiguityBehavior DefaultConstructorAmbiguityBehavior { get; set; }
Property Value
| Type | Description |
|---|---|
| ConstructorAmbiguityBehavior |
DefaultFallbackToNonPublicConstructors
Indicates whether instance creation should fall back to non-public constructors by default when no public constructor can satisfy the request.
Declaration
public bool DefaultFallbackToNonPublicConstructors { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
DefaultFallbackToNonPublicMethods
Indicates whether method invocation helpers should consider non-public methods by default when matching a target member.
Declaration
public bool DefaultFallbackToNonPublicMethods { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
DefaultStrictMockCreation
Controls the default strict-vs-loose behavior for provider-backed mock creation paths. When not set, FastMoq falls back to FailOnUnconfigured. This applies to provider-backed and legacy mock creation helpers, but not to the optional database helper package's DbContext-specific mock creation path, which stays on the supported DbContext helper behavior.
Declaration
public bool? DefaultStrictMockCreation { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
EnabledBuiltInTypeResolutions
Controls which built-in type resolutions FastMoq applies automatically when a requested type has not been explicitly registered by the test.
Declaration
public BuiltInTypeResolutionFlags EnabledBuiltInTypeResolutions { get; set; }
Property Value
| Type | Description |
|---|---|
| BuiltInTypeResolutionFlags |