(t *testing.T, method, path, badPath, body, badBody string)
| 856 | } |
| 857 | |
| 858 | func testFormBindingEmbeddedStruct(t *testing.T, method, path, badPath, body, badBody string) { |
| 859 | b := Form |
| 860 | assert.Equal(t, "form", b.Name()) |
| 861 | |
| 862 | obj := QueryTest{} |
| 863 | req := requestWithBody(method, path, body) |
| 864 | if method == http.MethodPost { |
| 865 | req.Header.Add("Content-Type", MIMEPOSTForm) |
| 866 | } |
| 867 | err := b.Bind(req, &obj) |
| 868 | require.NoError(t, err) |
| 869 | assert.Equal(t, 1, obj.Page) |
| 870 | assert.Equal(t, 2, obj.Size) |
| 871 | assert.Equal(t, "test-appkey", obj.Appkey) |
| 872 | } |
| 873 | |
| 874 | func testFormBinding(t *testing.T, method, path, badPath, body, badBody string) { |
| 875 | b := Form |
no test coverage detected