Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ContentTypeJSON string associated with content-type json ContentTypeJSON contentType = "application/json" // ContentTypeHTML string associated with content-type html ContentTypeHTML contentType = "text/html" // ContentTypePlain ContentTypePlain contentType = "text/plain; charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
func EncodeJSON ¶
EncodeJSON encodes json data in bytes
func EncodeString ¶
EncodeJSON encodes json data in bytes
Types ¶
type ExpectedResponse ¶
type ExpectedResponse struct { StatusCode int ResponseType contentType Body interface{} }
ExpectedResponse stores expected response basic data
type HTTPTest ¶
HTTPTest encapsulates data for testing needs
func (*HTTPTest) CompareHTTPResponse ¶
func (test *HTTPTest) CompareHTTPResponse(rr *httptest.ResponseRecorder, expected ExpectedResponse)
CompareHTTPResponse compares expected response with real one
Click to show internal directories.
Click to hide internal directories.