(t *testing.T)
| 291 | } |
| 292 | |
| 293 | func TestBindHeaderParamBadType(t *testing.T) { |
| 294 | e := New() |
| 295 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 296 | req.Header.Set("Id", "salamander") |
| 297 | rec := httptest.NewRecorder() |
| 298 | c := e.NewContext(req, rec) |
| 299 | u := new(user) |
| 300 | err := BindHeaders(c, u) |
| 301 | assert.Error(t, err) |
| 302 | |
| 303 | httpErr, ok := err.(*HTTPError) |
| 304 | if assert.True(t, ok) { |
| 305 | assert.Equal(t, http.StatusBadRequest, httpErr.Code) |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | func TestBindUnmarshalParam(t *testing.T) { |
| 310 | e := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…