Documentation ¶
Index ¶
- func TestEmptyResponse(t *testing.T, w *httptest.ResponseRecorder)
- func TestErrorExpectedResponse(t *testing.T, router *mux.Router, method, url string, data io.Reader, ...)
- func TestGetErrorExpectedResponse(t *testing.T, router *mux.Router, url, accessToken, msg string, code int, ...)
- func TestListValidResponse(t *testing.T, router *mux.Router, path, entity, accessToken string, ...)
- func TestListValidResponseWithParams(t *testing.T, router *mux.Router, path, entity, accessToken string, ...)
- func TestPostErrorExpectedResponse(t *testing.T, router *mux.Router, url string, data io.Reader, ...)
- func TestPutErrorExpectedResponse(t *testing.T, router *mux.Router, url string, data io.Reader, ...)
- func TestResponseBody(t *testing.T, w *httptest.ResponseRecorder, expected string)
- func TestResponseForError(t *testing.T, w *httptest.ResponseRecorder, msg string, code int)
- func TestResponseObject(t *testing.T, w *httptest.ResponseRecorder, expected interface{}, code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestEmptyResponse ¶
func TestEmptyResponse(t *testing.T, w *httptest.ResponseRecorder)
TestEmptyResponse tests an empty 204 response
func TestErrorExpectedResponse ¶
func TestErrorExpectedResponse(t *testing.T, router *mux.Router, method, url string, data io.Reader, accessToken, msg string, code int, assertExpectations func())
TestErrorExpectedResponse is the generic test code for testing for a bad response
func TestGetErrorExpectedResponse ¶
func TestGetErrorExpectedResponse(t *testing.T, router *mux.Router, url, accessToken, msg string, code int, assertExpectations func())
TestGetErrorExpectedResponse ...
func TestListValidResponse ¶
func TestListValidResponse(t *testing.T, router *mux.Router, path, entity, accessToken string, items []interface{}, assertExpectations func())
TestListValidResponse ...
func TestListValidResponseWithParams ¶
func TestListValidResponseWithParams(t *testing.T, router *mux.Router, path, entity, accessToken string, items []interface{}, assertExpectations func(), params map[string]string)
TestListValidResponseWithParams tests a list endpoint for a valid response with default settings
func TestPostErrorExpectedResponse ¶
func TestPostErrorExpectedResponse(t *testing.T, router *mux.Router, url string, data io.Reader, accessToken, msg string, code int, assertExpectations func())
TestPostErrorExpectedResponse ...
func TestPutErrorExpectedResponse ¶
func TestPutErrorExpectedResponse(t *testing.T, router *mux.Router, url string, data io.Reader, accessToken, msg string, code int, assertExpectations func())
TestPutErrorExpectedResponse ...
func TestResponseBody ¶
func TestResponseBody(t *testing.T, w *httptest.ResponseRecorder, expected string)
TestResponseBody tests response body is equal to expected string
func TestResponseForError ¶
TestResponseForError tests a response w to see if it returned an error msg with http code
func TestResponseObject ¶
func TestResponseObject(t *testing.T, w *httptest.ResponseRecorder, expected interface{}, code int)
TestResponseObject tests response body is equal to expected object in JSON form
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.