(t *testing.T)
| 192 | } |
| 193 | |
| 194 | func 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 | } |
nothing calls this directly
no test coverage detected