(t *testing.T, method, path, badPath, body, badBody string)
| 1016 | } |
| 1017 | |
| 1018 | func testFormBindingForTimeFailFormat(t *testing.T, method, path, badPath, body, badBody string) { |
| 1019 | b := Form |
| 1020 | assert.Equal(t, "form", b.Name()) |
| 1021 | |
| 1022 | obj := FooStructForTimeTypeFailFormat{} |
| 1023 | req := requestWithBody(method, path, body) |
| 1024 | if method == http.MethodPost { |
| 1025 | req.Header.Add("Content-Type", MIMEPOSTForm) |
| 1026 | } |
| 1027 | err := b.Bind(req, &obj) |
| 1028 | require.Error(t, err) |
| 1029 | |
| 1030 | obj = FooStructForTimeTypeFailFormat{} |
| 1031 | req = requestWithBody(method, badPath, badBody) |
| 1032 | err = JSON.Bind(req, &obj) |
| 1033 | require.Error(t, err) |
| 1034 | } |
| 1035 | |
| 1036 | func testFormBindingForTimeFailLocation(t *testing.T, method, path, badPath, body, badBody string) { |
| 1037 | b := Form |
no test coverage detected