(t *testing.T)
| 2236 | } |
| 2237 | |
| 2238 | func TestContextBindWithQuery(t *testing.T) { |
| 2239 | w := httptest.NewRecorder() |
| 2240 | c, _ := CreateTestContext(w) |
| 2241 | |
| 2242 | c.Request, _ = http.NewRequest(http.MethodPost, "/?foo=bar&bar=foo", strings.NewReader("foo=unused")) |
| 2243 | |
| 2244 | var obj struct { |
| 2245 | Foo string `form:"foo"` |
| 2246 | Bar string `form:"bar"` |
| 2247 | } |
| 2248 | require.NoError(t, c.BindQuery(&obj)) |
| 2249 | assert.Equal(t, "foo", obj.Bar) |
| 2250 | assert.Equal(t, "bar", obj.Foo) |
| 2251 | assert.Equal(t, 0, w.Body.Len()) |
| 2252 | } |
| 2253 | |
| 2254 | func TestContextBindWithYAML(t *testing.T) { |
| 2255 | w := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected