Documentation ¶
Index ¶
- type API
- type Assert
- type Assertion
- func (assertion *Assertion) Assert() error
- func (assertion *Assertion) ReturnStatus(code int) *Assertion
- func (assertion *Assertion) ReturnStatus200() *Assertion
- func (assertion *Assertion) ReturnStatus201() *Assertion
- func (assertion *Assertion) ReturnStatus400() *Assertion
- func (assertion *Assertion) ReturnsBody(content string) *Assertion
- func (assertion *Assertion) ReturnsContentTypeJSON() *Assertion
- func (assertion *Assertion) ReturnsSchemaMatching(schema string) *Assertion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API Struct
func (*API) WithHeader ¶
WithHeader adds a header to the request
type Assert ¶
Assert the required interface for assertion functions
func BodyContentMatches ¶
BodyContentMatches Checks JSONCotent matches expected content
func JSONSchema ¶
JSONSchema validates the response body against a schema
func StatusEqual ¶
StatusEqual checks the response status equals the expected code
type Assertion ¶
type Assertion struct {
// contains filtered or unexported fields
}
Assertion struct to wrap asserions
func (*Assertion) ReturnStatus ¶
ReturnStatus {code} checks the response is the expected code.
func (*Assertion) ReturnStatus200 ¶
ReturnStatus200 checks the response was 200
func (*Assertion) ReturnStatus201 ¶
ReturnStatus201 checks the response was 200
func (*Assertion) ReturnStatus400 ¶
ReturnStatus400 checks the response was 400
func (*Assertion) ReturnsBody ¶
ReturnsBody chexks the returned body matches the expected body
func (*Assertion) ReturnsContentTypeJSON ¶
ReturnsContentTypeJSON checks the returned content type was JSON
func (*Assertion) ReturnsSchemaMatching ¶
ReturnsSchemaMatching asserts the schema matches the one provided