HTTPStatusCodef asserts that a specified handler returns a specified status code. require.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{})
| 812 | // |
| 813 | // Returns whether the assertion was successful (true) or not (false). |
| 814 | func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { |
| 815 | if h, ok := t.(tHelper); ok { |
| 816 | h.Helper() |
| 817 | } |
| 818 | if assert.HTTPStatusCodef(t, handler, method, url, values, statuscode, msg, args...) { |
| 819 | return |
| 820 | } |
| 821 | t.FailNow() |
| 822 | } |
| 823 | |
| 824 | // HTTPSuccess asserts that a specified handler returns a success status code. |
| 825 | // |
no test coverage detected