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

Function TestResponseDecoder

grpc/codegen/client_test.go:76–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestResponseDecoder(t *testing.T) {
77 cases := []struct {
78 Name string
79 DSL func()
80 }{
81 {"response-decoder-result-with-views", testdata.MessageResultTypeWithViewsDSL},
82 {"response-decoder-result-with-explicit-view", testdata.MessageResultTypeWithExplicitViewDSL},
83 {"response-decoder-result-array", testdata.MessageArrayDSL},
84 {"response-decoder-result-primitive", testdata.UnaryRPCNoPayloadDSL},
85 {"response-decoder-result-with-metadata", testdata.MessageWithMetadataDSL},
86 {"response-decoder-result-with-validate", testdata.MessageWithValidateDSL},
87 {"response-decoder-result-collection", testdata.MessageResultTypeCollectionDSL},
88 {"response-decoder-server-streaming", testdata.ServerStreamingUserTypeDSL},
89 {"response-decoder-server-streaming-result-with-views", testdata.ServerStreamingResultWithViewsDSL},
90 {"response-decoder-client-streaming", testdata.ClientStreamingRPCDSL},
91 {"response-decoder-bidirectional-streaming", testdata.BidirectionalStreamingRPCDSL},
92 }
93 for _, c := range cases {
94 t.Run(c.Name, func(t *testing.T) {
95 root := RunGRPCDSL(t, c.DSL)
96 services := CreateGRPCServices(root)
97 fs := ClientFiles("", services)
98 require.Len(t, fs, 2)
99 sections := fs[1].Section("response-decoder")
100 require.NotEmpty(t, sections)
101 code := codegen.SectionsCode(t, sections)
102 testutil.AssertGo(t, "testdata/golden/response_decoder_"+c.Name+".go.golden", code)
103 })
104 }
105}

Callers

nothing calls this directly

Calls 7

SectionsCodeFunction · 0.92
AssertGoFunction · 0.92
RunGRPCDSLFunction · 0.85
CreateGRPCServicesFunction · 0.85
SectionMethod · 0.80
ClientFilesFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected