statusCodeIsInRange function

Checker<Response> statusCodeIsInRange(
  1. int lower,
  2. int higher
)

Implementation

Checker<Response> statusCodeIsInRange(int lower, int higher) =>
    (Response resp) {
      if (resp.statusCode < lower || resp.statusCode > higher)
        return <Mismatch>[
          new RangeMismatch(lower, higher, resp.statusCode,
              customMessage: (m) =>
                  'Expected statuscode in range [${m.lower}, ${m.higher} but found ${m.actual}!')
        ];
      return <Mismatch>[];
    };