Struct TimesSpec
Provider agnostic verification specification. Uses a single verification mode with an optional count where applicable.
Implements
Inherited Members
Namespace: FastMoq.Providers
Assembly: FastMoq.Abstractions.dll
Syntax
public readonly record struct TimesSpec : IEquatable<TimesSpec>
Properties
Count
Gets the expected invocation count when the selected Mode requires one.
Declaration
public int? Count { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Mode
Gets the verification mode.
Declaration
public TimesSpecMode Mode { get; }
Property Value
| Type | Description |
|---|---|
| TimesSpecMode |
NeverCalled
Gets a specification that requires zero invocations.
Declaration
public static TimesSpec NeverCalled { get; }
Property Value
| Type | Description |
|---|---|
| TimesSpec |
Once
Gets a specification that requires exactly one invocation.
Declaration
public static TimesSpec Once { get; }
Property Value
| Type | Description |
|---|---|
| TimesSpec |
Methods
AtLeast(int)
Creates a specification that requires at least count invocations.
Declaration
public static TimesSpec AtLeast(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | The minimum required invocation count. |
Returns
| Type | Description |
|---|---|
| TimesSpec | A verification specification for a minimum count. |
AtMost(int)
Creates a specification that allows at most count invocations.
Declaration
public static TimesSpec AtMost(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | The maximum allowed invocation count. |
Returns
| Type | Description |
|---|---|
| TimesSpec | A verification specification for a maximum count. |
Exactly(int)
Creates a specification that requires exactly count invocations.
Declaration
public static TimesSpec Exactly(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | The required invocation count. |
Returns
| Type | Description |
|---|---|
| TimesSpec | A verification specification for an exact count. |
Never()
Creates a specification that requires zero invocations.
Declaration
public static TimesSpec Never()
Returns
| Type | Description |
|---|---|
| TimesSpec | A verification specification for no invocations. |