HTTPStatusCode asserts that a specified handler returns a specified status code. assert.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{})
| 784 | // |
| 785 | // Returns whether the assertion was successful (true) or not (false). |
| 786 | func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { |
| 787 | if h, ok := t.(tHelper); ok { |
| 788 | h.Helper() |
| 789 | } |
| 790 | if assert.HTTPStatusCode(t, handler, method, url, values, statuscode, msgAndArgs...) { |
| 791 | return |
| 792 | } |
| 793 | t.FailNow() |
| 794 | } |
| 795 | |
| 796 | // HTTPStatusCodef asserts that a specified handler returns a specified status code. |
| 797 | // |
no test coverage detected
searching dependent graphs…