Documentation
¶
Index ¶
- type Callback
- type Checker
- func (c *Checker) Cb(cb Callback)
- func (c *Checker) Check() *Checker
- func (c *Checker) GetUrl() string
- func (c *Checker) HasBody(body []byte) *Checker
- func (c *Checker) HasCookie(key, expectedValue string) *Checker
- func (c *Checker) HasHeader(key, expectedValue string) *Checker
- func (c *Checker) HasHeaders(headers map[string]string) *Checker
- func (c *Checker) HasJson(value interface{}) *Checker
- func (c *Checker) HasStatus(status int) *Checker
- func (c *Checker) HasString(body string) *Checker
- func (c *Checker) HasXml(value interface{}) *Checker
- func (c *Checker) PersistCookie(cookie string)
- func (c *Checker) SetTesting(t *testing.T) *Checker
- func (c *Checker) Test(method, path string) *Checker
- func (c *Checker) TestRequest(request *http.Request) *Checker
- func (c *Checker) UnpersistCookie(cookie string)
- func (c *Checker) WithBody(body []byte) *Checker
- func (c *Checker) WithCookie(key, value string) *Checker
- func (c *Checker) WithHeader(key, value string) *Checker
- func (c *Checker) WithHeaders(headers map[string]string) *Checker
- func (c *Checker) WithJson(value interface{}) *Checker
- func (c *Checker) WithString(body string) *Checker
- func (c *Checker) WithXml(value interface{}) *Checker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
func (*Checker) Check ¶
Will make reqeust to built request object. After request is made, it will save response object for future assertions Responsibility of this method is also to start and stop HTTP server
func (*Checker) HasHeader ¶
Will check if response contains header on provided key with provided value
func (*Checker) HasHeaders ¶
Will check if response contains a provided headers map
func (*Checker) HasString ¶
Convenience wrapper for HasBody Checks if body is equal to the given string
func (*Checker) PersistCookie ¶
enables a cookie to be preserved between requests
func (*Checker) Test ¶
Prepare for testing some part of code which lives on provided path and method.
func (*Checker) TestRequest ¶
If you want to provide you custom http.Request instance, you can do it using this method In this case internal http.Request instance won't be created, and passed instane will be used for making request
func (*Checker) UnpersistCookie ¶
the specified cookie will not be preserved during requests anymore
func (*Checker) WithCookie ¶
Will ckeck if response contains cookie with provided key and value
func (*Checker) WithHeader ¶
Will put header on request
func (*Checker) WithHeaders ¶
Will put a map of headers on request
func (*Checker) WithString ¶
Adds the string to the body