MCPcopy Create free account
hub / github.com/goadesign/goa / TestClientBuildRequest

Function TestClientBuildRequest

http/codegen/client_encode_test.go:194–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func TestClientBuildRequest(t *testing.T) {
195 cases := []struct {
196 Name string
197 DSL func()
198 }{
199 {"path-string", testdata.PayloadPathStringDSL},
200 {"path-string-required", testdata.PayloadPathStringValidateDSL},
201 {"path-string-default", testdata.PayloadPathStringDefaultDSL},
202 {"path-object", testdata.PayloadPathObjectDSL},
203 }
204 for _, c := range cases {
205 t.Run(c.Name, func(t *testing.T) {
206 root := RunHTTPDSL(t, c.DSL)
207 services := CreateHTTPServices(root)
208 fs := ClientFiles("", services)
209 require.Len(t, fs, 2)
210 sections := fs[1].SectionTemplates
211 require.Greater(t, len(sections), 2)
212 code := codegen.SectionCode(t, sections[1])
213 testutil.AssertGo(t, "testdata/golden/client_build_request_"+c.Name+".go.golden", code)
214 })
215 }
216}

Callers

nothing calls this directly

Calls 6

SectionCodeFunction · 0.92
AssertGoFunction · 0.92
RunHTTPDSLFunction · 0.85
CreateHTTPServicesFunction · 0.85
ClientFilesFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected