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

Function testBindOkay

bind_test.go:700–716  ·  view source on GitHub ↗
(t *testing.T, r io.Reader, query url.Values, ctype string)

Source from the content-addressed store, hash-verified

698}
699
700func testBindOkay(t *testing.T, r io.Reader, query url.Values, ctype string) {
701 e := New()
702 path := "/"
703 if len(query) > 0 {
704 path += "?" + query.Encode()
705 }
706 req := httptest.NewRequest(http.MethodPost, path, r)
707 rec := httptest.NewRecorder()
708 c := e.NewContext(req, rec)
709 req.Header.Set(HeaderContentType, ctype)
710 u := new(user)
711 err := c.Bind(u)
712 if assert.Equal(t, nil, err) {
713 assert.Equal(t, 1, u.ID)
714 assert.Equal(t, "Jon Snow", u.Name)
715 }
716}
717
718func testBindArrayOkay(t *testing.T, r io.Reader, query url.Values, ctype string) {
719 e := New()

Callers 4

TestBindJSONFunction · 0.85
TestBindXMLFunction · 0.85
TestBindFormFunction · 0.85
TestBindMultipartFormFunction · 0.85

Calls 4

BindMethod · 0.95
NewFunction · 0.85
NewContextMethod · 0.80
SetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…