HTTPStatusCode asserts that a specified handler returns a specified status code. require.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) Returns whether the assertion was successful (true) or not (false).
(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{})
| 797 | // |
| 798 | // Returns whether the assertion was successful (true) or not (false). |
| 799 | func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { |
| 800 | if h, ok := t.(tHelper); ok { |
| 801 | h.Helper() |
| 802 | } |
| 803 | if assert.HTTPStatusCode(t, handler, method, url, values, statuscode, msgAndArgs...) { |
| 804 | return |
| 805 | } |
| 806 | t.FailNow() |
| 807 | } |
| 808 | |
| 809 | // HTTPStatusCodef asserts that a specified handler returns a specified status code. |
| 810 | // |
no test coverage detected