(t *testing.T, method, path, badPath, body, badBody string)
| 998 | } |
| 999 | |
| 1000 | func testFormBindingForTimeNotFormat(t *testing.T, method, path, badPath, body, badBody string) { |
| 1001 | b := Form |
| 1002 | assert.Equal(t, "form", b.Name()) |
| 1003 | |
| 1004 | obj := FooStructForTimeTypeNotFormat{} |
| 1005 | req := requestWithBody(method, path, body) |
| 1006 | if method == http.MethodPost { |
| 1007 | req.Header.Add("Content-Type", MIMEPOSTForm) |
| 1008 | } |
| 1009 | err := b.Bind(req, &obj) |
| 1010 | require.Error(t, err) |
| 1011 | |
| 1012 | obj = FooStructForTimeTypeNotFormat{} |
| 1013 | req = requestWithBody(method, badPath, badBody) |
| 1014 | err = JSON.Bind(req, &obj) |
| 1015 | require.Error(t, err) |
| 1016 | } |
| 1017 | |
| 1018 | func testFormBindingForTimeFailFormat(t *testing.T, method, path, badPath, body, badBody string) { |
| 1019 | b := Form |
no test coverage detected