MCPcopy Index your code
hub / github.com/labstack/echo / TestValueBinder_BindError

Function TestValueBinder_BindError

binder_test.go:185–198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

183}
184
185func TestValueBinder_BindError(t *testing.T) {
186 c := createTestContext("/api/user/999?nr=en&id=nope", nil, nil)
187 b := QueryParamsBinder(c)
188
189 id := int64(99)
190 nr := int64(88)
191 err := b.Int64("id", &id).
192 Int64("nr", &nr).
193 BindError()
194
195 assert.EqualError(t, err, "code=400, message=failed to bind field value to int64, err=strconv.ParseInt: parsing \"nope\": invalid syntax, field=id")
196 assert.Nil(t, b.errors)
197 assert.Nil(t, b.BindError())
198}
199
200func TestValueBinder_GetValues(t *testing.T) {
201 var testCases = []struct {

Callers

nothing calls this directly

Calls 4

createTestContextFunction · 0.85
QueryParamsBinderFunction · 0.85
BindErrorMethod · 0.80
Int64Method · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…