Documentation ¶
Index ¶
- type Func
- func BodyEquals(value string) Func
- func BodyLength(length int) Func
- func BodyMatchString(pattern string) Func
- func Header(key, value string) Func
- func HeaderEquals(key, value string) Func
- func HeaderNotEquals(key, value string) Func
- func HeaderNotPresent(key string) Func
- func HeaderPresent(key string) Func
- func JSON(data interface{}) Func
- func JSONSchema(schema string) Func
- func RedirectTo(uri string) Func
- func StatusClientError() Func
- func StatusEqual(code int) Func
- func StatusError() Func
- func StatusOk() Func
- func StatusRange(start, end int) Func
- func StatusRedirect() Func
- func StatusServerError() Func
- func Type(kind string) Func
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Func ¶
Func represents the required interface for assertion functions.
func BodyEquals ¶
BodyEquals asserts as strict equality comparison the response body with a given string string.
func BodyMatchString ¶
BodyMatchString asserts a response body matching a string expression. Regular expressions can be used as value to perform the specific assertions.
func Header ¶
Header asserts a response header field value matches. Regular expressions can be used as value to perform the specific assertions.
func HeaderEquals ¶
HeaderEquals asserts a response header field value is equal to the given value.
func HeaderNotEquals ¶
HeaderNotEquals asserts a response header field with the given value.
func HeaderNotPresent ¶
HeaderNotPresent asserts if a header field is not present in the response.
func HeaderPresent ¶
HeaderPresent asserts if a header field is present in the response.
func JSON ¶
func JSON(data interface{}) Func
JSON deeply and strictly compares the JSON response body with the given JSON structure.
func JSONSchema ¶
JSONSchema validates the response body againts the given JSON schema.
func RedirectTo ¶
RedirectTo asserts the server response redirects to the given URL pattern. Regular expressions are supported.
func StatusClientError ¶
func StatusClientError() Func
StatusClientError asserts the response status code as client error response (>= 400 && < 500).
func StatusEqual ¶
StatusEqual asserts the response status code with the given number.
func StatusError ¶
func StatusError() Func
StatusError asserts the response status code as server error response (>= 400 && < 600).
func StatusOk ¶
func StatusOk() Func
StatusOk asserts the response status code as valid response (>= 200 && < 400).
func StatusRange ¶
StatusRange asserts the response status code if it is within the given numeric range.
func StatusRedirect ¶
func StatusRedirect() Func
StatusRedirect asserts the response status code as server redirect status (= 301 || = 302).
func StatusServerError ¶
func StatusServerError() Func
StatusServerError asserts the response status code as server error response (>= 500 && < 600).