isUseCaseExecutionEntry<C extends UseCaseCommand> function

Matcher isUseCaseExecutionEntry<C extends UseCaseCommand>({
  1. Object? command = _unspecified,
  2. Object? id = _unspecified,
  3. UseCaseExecutionPhase? phase,
  4. Object? result = _unspecified,
  5. Object? groupKey = _unspecified,
  6. Object? reason = _unspecified,
  7. Object? instructions = _unspecified,
  8. Object? createdAt = _unspecified,
  9. Object? queuedAt = _unspecified,
  10. Object? startedAt = _unspecified,
  11. Object? finishedAt = _unspecified,
})

Matches an execution entry whose command has exact Dart type C.

Implementation

test.Matcher isUseCaseExecutionEntry<C extends UseCaseCommand>({
  final Object? command = _unspecified,
  final Object? id = _unspecified,
  final UseCaseExecutionPhase? phase,
  final Object? result = _unspecified,
  final Object? groupKey = _unspecified,
  final Object? reason = _unspecified,
  final Object? instructions = _unspecified,
  final Object? createdAt = _unspecified,
  final Object? queuedAt = _unspecified,
  final Object? startedAt = _unspecified,
  final Object? finishedAt = _unspecified,
}) {
  test.TypeMatcher<UseCaseExecutionEntry<UseCaseCommand>> matcher = test
      .isA<UseCaseExecutionEntry<UseCaseCommand>>()
      .having(
        (final UseCaseExecutionEntry<UseCaseCommand> value) => value.command,
        'command type',
        test.isA<C>(),
      );
  if (!identical(command, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.command,
      'command',
      command,
    );
  }
  if (!identical(id, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.id,
      'id',
      id,
    );
  }
  if (phase != null) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.phase,
      'phase',
      phase,
    );
  }
  if (!identical(result, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.result,
      'result',
      result,
    );
  }
  if (!identical(groupKey, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.groupKey,
      'groupKey',
      groupKey,
    );
  }
  if (!identical(reason, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.reason,
      'reason',
      reason,
    );
  }
  if (!identical(instructions, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.instructions,
      'instructions',
      instructions,
    );
  }
  if (!identical(createdAt, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.createdAt,
      'createdAt',
      createdAt,
    );
  }
  if (!identical(queuedAt, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.queuedAt,
      'queuedAt',
      queuedAt,
    );
  }
  if (!identical(startedAt, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.startedAt,
      'startedAt',
      startedAt,
    );
  }
  if (!identical(finishedAt, _unspecified)) {
    matcher = matcher.having(
      (final UseCaseExecutionEntry<UseCaseCommand> value) => value.finishedAt,
      'finishedAt',
      finishedAt,
    );
  }
  return matcher;
}