(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestClientMultipartNewFunc(t *testing.T) { |
| 91 | const genpkg = "gen" |
| 92 | cases := []struct { |
| 93 | Name string |
| 94 | DSL func() |
| 95 | }{ |
| 96 | {"client-multipart-body-primitive", testdata.PayloadMultipartPrimitiveDSL}, |
| 97 | {"client-multipart-body-user-type", testdata.PayloadMultipartUserTypeDSL}, |
| 98 | {"client-multipart-body-array-type", testdata.PayloadMultipartArrayTypeDSL}, |
| 99 | {"client-multipart-body-map-type", testdata.PayloadMultipartMapTypeDSL}, |
| 100 | {"client-multipart-with-param", testdata.PayloadMultipartWithParamDSL}, |
| 101 | {"client-multipart-with-params-and-headers", testdata.PayloadMultipartWithParamsAndHeadersDSL}, |
| 102 | } |
| 103 | for _, c := range cases { |
| 104 | t.Run(c.Name, func(t *testing.T) { |
| 105 | root := RunHTTPDSL(t, c.DSL) |
| 106 | services := CreateHTTPServices(root) |
| 107 | fs := ClientFiles(genpkg, services) |
| 108 | require.Len(t, fs, 2) |
| 109 | sections := fs[1].SectionTemplates |
| 110 | require.Greater(t, len(sections), 3) |
| 111 | code := codegen.SectionCode(t, sections[3]) |
| 112 | testutil.AssertGo(t, "testdata/golden/client_multipart_"+c.Name+".go.golden", code) |
| 113 | }) |
| 114 | } |
| 115 | } |
nothing calls this directly
no test coverage detected