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

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.