toSimplifiedStateEnum method

SimplifiedStateEnum toSimplifiedStateEnum({
  1. required bool isFlaky,
})

Implementation

SimplifiedStateEnum toSimplifiedStateEnum({required bool isFlaky}) {
  switch (status) {
    case Status.pending:
      return SimplifiedStateEnum.pending;
    case Status.running:
      return SimplifiedStateEnum.running;
    case Status.complete:
      switch (result) {
        case Result.success:
          return isFlaky ? SimplifiedStateEnum.completeSuccessButFlaky : SimplifiedStateEnum.completeSuccess;
        case Result.skipped:
          return SimplifiedStateEnum.completeSkipped;
        case Result.failure:
        case Result.error:
          return SimplifiedStateEnum.completeFailureOrError;
        default:
          throw Exception;
      }
    default:
      throw Exception;
  }
}