dart_frog_test library

A testing library which makes it easy to test Dart frog services.

Classes

TestRequestContext
A context used to test Dart Frog handlers.

Properties

isAccepted → Matcher
Asserts if the response is a HttpStatus.accepted.
read-only
isBadGateway → Matcher
Asserts if the response is a HttpStatus.badGateway.
read-only
isBadRequest → Matcher
Asserts if the response is a HttpStatus.badRequest.
read-only
isConflict → Matcher
Asserts if the response is a HttpStatus.conflict.
read-only
isCreated → Matcher
Asserts if the response is a HttpStatus.created.
read-only
isExpectationFailed → Matcher
Asserts if the response is a HttpStatus.expectationFailed.
read-only
isFailedDependency → Matcher
Asserts if the response is a HttpStatus.failedDependency.
read-only
isForbidden → Matcher
Asserts if the response is a HttpStatus.forbidden.
read-only
isFound → Matcher
Asserts if the response is a HttpStatus.found.
read-only
isGatewayTimeout → Matcher
Asserts if the response is a HttpStatus.gatewayTimeout.
read-only
isInternalServerError → Matcher
Asserts if the response is a HttpStatus.internalServerError.
read-only
isMethodNotAllowed → Matcher
Asserts if the response is a HttpStatus.methodNotAllowed.
read-only
isMovedPermanently → Matcher
Asserts if the response is a HttpStatus.movedPermanently.
read-only
isNoContent → Matcher
Asserts if the response is a HttpStatus.noContent.
read-only
isNotAcceptable → Matcher
Asserts if the response is a HttpStatus.notAcceptable.
read-only
isNotFound → Matcher
Asserts if the response is a HttpStatus.notFound.
read-only
isNotImplemented → Matcher
Asserts if the response is a HttpStatus.notImplemented.
read-only
isNotModified → Matcher
Asserts if the response is a HttpStatus.notModified.
read-only
isOk → Matcher
Asserts if the response is a HttpStatus.ok.
read-only
isPreconditionFailed → Matcher
Asserts if the response is a HttpStatus.preconditionFailed.
read-only
isPreconditionRequired → Matcher
Asserts if the response is a HttpStatus.preconditionRequired.
read-only
isRequestedRangeNotSatisfiable → Matcher
Asserts if the response is a HttpStatus.requestedRangeNotSatisfiable.
read-only
isRequestEntityTooLarge → Matcher
Asserts if the response is a HttpStatus.requestEntityTooLarge.
read-only
isRequestHeaderFieldsTooLarge → Matcher
Asserts if the response is a HttpStatus.requestHeaderFieldsTooLarge.
read-only
isRequestTimeout → Matcher
Asserts if the response is a HttpStatus.requestTimeout.
read-only
isSeeOther → Matcher
Asserts if the response is a HttpStatus.seeOther.
read-only
isServiceUnavailable → Matcher
Asserts if the response is a HttpStatus.serviceUnavailable.
read-only
isTooManyRequests → Matcher
Asserts if the response is a HttpStatus.tooManyRequests.
read-only
isUnauthorized → Matcher
Asserts if the response is a HttpStatus.unauthorized.
read-only
isUnavailableForLegalReasons → Matcher
Asserts if the response is a HttpStatus.unavailableForLegalReasons.
read-only
isUnsupportedMediaType → Matcher
Asserts if the response is a HttpStatus.unsupportedMediaType.
read-only
isUpgradeRequired → Matcher
Asserts if the response is a HttpStatus.upgradeRequired.
read-only

Functions

expectBody(Response response, String expectedBody) → void
Expects the response body to match the given expectedBody.
expectJsonBody(Response response, dynamic expectedBody) → void
Expects the response body to be a JSON object that matches the given expectedBody.
expectNotAllowedMethods(FutureOr<Response> handler(RequestContext), {required TestRequestContext contextBuilder(HttpMethod), required List<HttpMethod> allowedMethods}) Future<void>
Expect that all methods except allowedMethods are not supported.
hasStatus(int statusCode) → Matcher
Asserts if the response status code is statusCode.