FakeUseCase<Input, Output> class
General-purpose fake use case for submit and operation tasks.
- Inheritance
-
- Object
- BlocxBaseUseCase<
Input, Output> - FakeUseCase
Constructors
-
FakeUseCase({Output handler(Input input)?, Output? returnValue, bool shouldFail = false, Object? failureError, Completer<
void> ? completer, Duration delay = Duration.zero, BlocxEventHub? eventHub, BlocxCommandType? commandType, List<BlocxCommandType> ? commandTypes})
Properties
- commandType → BlocxCommandType?
-
Optional single CRUD command type executed by this use case.
no setterinherited
-
commandTypes
→ List<
BlocxCommandType> -
List of CRUD command types executed by this use case.
no setterinherited
-
completer
↔ Completer<
void> ? -
getter/setter pair
- delay ↔ Duration
-
getter/setter pair
- eventHub → BlocxEventHub?
-
The BlocxEventHub used to broadcast entity command events when
commandType or commandTypes is configured.
no setterinherited
- eventOrigin → BlocxEventOrigin?
-
Optional origin metadata attached to emitted BlocxEntityEvents.
no setterinherited
- failureError ↔ Object?
-
getter/setter pair
- handler → Output Function(Input input)?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
recordedInputs
→ List<
Input> -
final
- returnValue ↔ Output?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldFail ↔ bool
-
getter/setter pair
Methods
-
execute(
Input input) → Future< BlocxUseCaseResult< Output> > -
Entry point for callers. Do not override.
inherited
-
failureResult(
Object error, StackTrace stackTrace) → FutureOr< BlocxUseCaseResult< Output> > -
Wraps an unhandled exception into a BlocxUseCaseResult.
inherited
-
handleBroadcastError(
Object error, StackTrace stackTrace) → void -
Optional side-effect hook for logging or reporting errors that occur during
entity resolution or event broadcasting after a successful perform.
inherited
-
handleError(
Object error, StackTrace stackTrace) → void -
Optional side-effect hook for logging, analytics, or crash reporting.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
perform(
Input input) → Future< BlocxUseCaseResult< Output> > -
The business logic implementation.
override
-
resolveCommandEntities(
Input input, Output output) → List< BlocxBaseEntity> -
Resolves the affected BlocxBaseEntity instances from
inputandoutputto broadcast to eventHub.inherited -
shouldBroadcastCommandResult(
Input input, Output output) → bool -
Whether a successful
outputshould trigger command event broadcasting.inherited -
success(
Output data) → BlocxUseCaseResult< Output> -
Shorthand for
BlocxUseCaseSuccess(data).inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited