Interface IOperation
Non-generic interface for operations, allowing type-erased storage in collections. This interface is implemented by Operation<TRequest, TResponse, TState>.
public interface IOperation
- Extension Methods
Properties
DerivedFrom
The request derivations for this operation. Defines how this operation's requests can be derived from other operations' responses.
IReadOnlyList<RequestDerivation> DerivedFrom { get; }
Property Value
Name
The name of the operation.
string Name { get; }
Property Value
Polling
The polling setup for this operation. Defines how to poll for completion when this operation triggers a TerminatingStepFunction. The polling request is created using a derivation defined on the polling operation.
PollingSetup Polling { get; }
Property Value
RequestType
The Type of the request sent to this operation.
Type RequestType { get; }
Property Value
ResponseType
The Type of the response received from this operation.
Type ResponseType { get; }
Property Value
Methods
ExecuteAsync(TestingContext, object)
Executes the operation against the system and returns the response. Error conditions such as exceptions, network timeouts, internal server errors etc should be converted to appropriate 'error' response objects and returned to the caller.
Task<object> ExecuteAsync(TestingContext context, object request)
Parameters
contextTestingContextThe testing context.
requestobjectThe request to execute.
Returns
ExplainInvalidResponse(object, IState, object)
Returns an explanation of why the observed response did not match the expected response.
string ExplainInvalidResponse(object request, IState state, object observedResponse)
Parameters
Returns
ExplainInvalidResponse(object, StateProfile, object)
Returns an explanation of why the observed response did not match the expected response.
string ExplainInvalidResponse(object request, StateProfile stateProfile, object observedResponse)
Parameters
requestobjectstateProfileStateProfileobservedResponseobject
Returns
Invoke(object, IState)
Returns all possible next states and optional step functions given a request and state.
IList<(object, StateProfile)> Invoke(object request, IState state)
Parameters
Returns
- IList<(object, StateProfile)>
Verify(object, IState, object)
Indicates whether the observed response is valid given the request and state. If valid, it also returns a (potentially) updated state as well as an optional step function that runs concurrently with the rest of the system.
(bool, StateProfile) Verify(object request, IState state, object observedResponse)
Parameters
Returns
- (bool, StateProfile)
Verify(object, StateProfile, object)
Indicates whether the observed response is valid given the request and state profile. If valid, it also returns a (potentially) updated state as well as an optional step function that runs concurrently with the rest of the system.
(bool, StateProfile) Verify(object request, StateProfile stateProfile, object observedResponse)
Parameters
requestobjectstateProfileStateProfileobservedResponseobject
Returns
- (bool, StateProfile)
With(object, string)
Creates an OperationInput with the given request bound to this operation.
OperationInput With(object request, string label = null)
Parameters
Returns
- OperationInput
An OperationInput instance.