(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestBuildBodyTypes(t *testing.T) { |
| 74 | const svcName = "test service" |
| 75 | |
| 76 | cases := []struct { |
| 77 | Name string |
| 78 | DSL func() |
| 79 | |
| 80 | ExpectedType typ |
| 81 | ExpectedFormat string |
| 82 | ExpectedResponseTypes rt |
| 83 | ExpectedExtraTypes map[string]typ |
| 84 | }{{ |
| 85 | Name: "string_body", |
| 86 | DSL: dsls.StringBodyDSL(svcName, "string_body"), |
| 87 | |
| 88 | ExpectedType: tstring, |
| 89 | ExpectedResponseTypes: rt{204: tempty}, |
| 90 | }, { |
| 91 | Name: "alias_string_body", |
| 92 | DSL: dsls.AliasStringBodyDSL(svcName, "alias_string_body"), |
| 93 | |
| 94 | ExpectedType: tuuid, |
| 95 | ExpectedResponseTypes: rt{204: tempty}, |
| 96 | }, { |
| 97 | Name: "object_body", |
| 98 | DSL: dsls.ObjectBodyDSL(svcName, "object_body"), |
| 99 | |
| 100 | ExpectedType: tobj("name", tstring, "age", tint), |
| 101 | ExpectedResponseTypes: rt{204: tempty}, |
| 102 | }, { |
| 103 | Name: "map_body", |
| 104 | DSL: dsls.MapBodyDSL(svcName, "map_body"), |
| 105 | |
| 106 | ExpectedType: tmap(), |
| 107 | ExpectedResponseTypes: rt{204: tempty}, |
| 108 | }, { |
| 109 | Name: "streaming_string_body", |
| 110 | DSL: dsls.RequestStreamingStringBody(svcName, "streaming_string_body"), |
| 111 | |
| 112 | ExpectedType: tstring, |
| 113 | ExpectedResponseTypes: rt{204: tempty}, |
| 114 | }, { |
| 115 | Name: "streaming_object_body", |
| 116 | DSL: dsls.RequestStreamingObjectBody(svcName, "streaming_object_body"), |
| 117 | |
| 118 | ExpectedType: tobj("name", tstring, "age", tint), |
| 119 | ExpectedResponseTypes: rt{204: tempty}, |
| 120 | }, { |
| 121 | Name: "string_response_body", |
| 122 | DSL: dsls.StringResponseBodyDSL(svcName, "string_response_body"), |
| 123 | |
| 124 | ExpectedType: tempty, |
| 125 | ExpectedResponseTypes: rt{200: tstring}, |
| 126 | }, { |
| 127 | Name: "object_response_body", |
| 128 | DSL: dsls.ObjectResponseBodyDSL(svcName, "object_response_body"), |
| 129 | |
| 130 | ExpectedType: tempty, |
nothing calls this directly
no test coverage detected