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

Function TestMethodExprIsPayloadStreaming

expr/method_test.go:225–255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

223}
224
225func TestMethodExprIsPayloadStreaming(t *testing.T) {
226 cases := map[string]struct {
227 stream expr.StreamKind
228 expected bool
229 }{
230 "no stream": {
231 stream: expr.NoStreamKind,
232 expected: false,
233 },
234 "client stream": {
235 stream: expr.ClientStreamKind,
236 expected: true,
237 },
238 "server stream": {
239 stream: expr.ServerStreamKind,
240 expected: false,
241 },
242 "BidirectionalStreamKind": {
243 stream: expr.BidirectionalStreamKind,
244 expected: true,
245 },
246 }
247 for k, tc := range cases {
248 m := expr.MethodExpr{
249 Stream: tc.stream,
250 }
251 if actual := m.IsPayloadStreaming(); actual != tc.expected {
252 t.Errorf("%s: got %#v, expected %#v", k, actual, tc.expected)
253 }
254 }
255}
256
257func TestMethodExprValidateInterceptors(t *testing.T) {
258 cases := []struct {

Callers

nothing calls this directly

Calls 1

IsPayloadStreamingMethod · 0.95

Tested by

no test coverage detected