HTTPStatusCodef asserts that a specified handler returns a specified status code. assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") Returns whether the assertion was successful (true) or not (false).
(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{})
| 799 | // |
| 800 | // Returns whether the assertion was successful (true) or not (false). |
| 801 | func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { |
| 802 | if h, ok := t.(tHelper); ok { |
| 803 | h.Helper() |
| 804 | } |
| 805 | if assert.HTTPStatusCodef(t, handler, method, url, values, statuscode, msg, args...) { |
| 806 | return |
| 807 | } |
| 808 | t.FailNow() |
| 809 | } |
| 810 | |
| 811 | // HTTPSuccess asserts that a specified handler returns a success status code. |
| 812 | // |
no test coverage detected
searching dependent graphs…