Interface ITestAct
- Namespace
- Mokkit.Act
- Assembly
- Mokkit.dll
Represents the fluent interface for chaining act operations in the AAA (Arrange-Act-Assert) pattern. Act is a first-class phase, symmetric with Mokkit.Arrange.ITestArrange and Mokkit.Inspect.ITestInspect: it performs the operation(s) under test and — like Arrange — may produce artifacts (through captures or a returned result) that later phases observe.
public interface ITestActMethods
GetAwaiter()
Gets an awaiter that allows the act chain to be awaited using the async/await pattern. This enables the use of 'await' directly on the act chain.
ITestActAwaiter GetAwaiter()Returns
- ITestActAwaiter
-
An awaiter for the act operation chain.
Returning<T>(Func<ITestHost, Task<T>>)
Runs the pending act steps and then a producer that yields a result, turning the chain into a
result-bearing act. This backs the "return" vocabulary flavor (var r = await Act.DoThing(...)),
where an act operation returns the artifact directly instead of capturing it through an out parameter.
ITestAct<T> Returning<T>(Func<ITestHost, Task<T>> producerFn)Parameters
producerFnFunc<ITestHost, Task<T>>-
The asynchronous function that performs the operation and returns its result.
Returns
- ITestAct<T>
-
A result-bearing act that can be awaited to yield the produced value.
Type Parameters
T-
The type of the produced result.
Returning<T>(Func<ITestHost, T>)
Runs the pending act steps and then a synchronous producer that yields a result.
ITestAct<T> Returning<T>(Func<ITestHost, T> producerFn)Parameters
producerFnFunc<ITestHost, T>-
The synchronous function that performs the operation and returns its result.
Returns
- ITestAct<T>
-
A result-bearing act that can be awaited to yield the produced value.
Type Parameters
T-
The type of the produced result.
Then(ActAsyncFn)
Chains an asynchronous act function to be executed in sequence.
ITestAct Then(ActAsyncFn actFn)Parameters
actFnActAsyncFn-
The asynchronous act function to execute.
Returns
- ITestAct
-
The current Mokkit.Act.ITestAct instance for method chaining.
Then(ActFn)
Chains a synchronous act function to be executed in sequence.
ITestAct Then(ActFn actFn)Parameters
actFnActFn-
The synchronous act function to execute.
Returns
- ITestAct
-
The current Mokkit.Act.ITestAct instance for method chaining.