@@ -73,6 +73,13 @@ final class AsyncIntegrationTests: GRPCTestCase {
73
73
}
74
74
}
75
75
76
+ func testUnaryWrapper( ) {
77
+ XCTAsyncTest {
78
+ let response = try await self . echo. get ( . with { $0. text = " hello " } )
79
+ XCTAssertEqual ( response. text, " Swift echo get: hello " )
80
+ }
81
+ }
82
+
76
83
func testClientStreaming( ) {
77
84
XCTAsyncTest {
78
85
let collect = self . echo. makeCollectCall ( )
@@ -96,15 +103,28 @@ final class AsyncIntegrationTests: GRPCTestCase {
96
103
}
97
104
}
98
105
106
+ func testClientStreamingWrapper( ) {
107
+ XCTAsyncTest {
108
+ let requests : [ Echo_EchoRequest ] = [
109
+ . with { $0. text = " boyle " } ,
110
+ . with { $0. text = " jeffers " } ,
111
+ . with { $0. text = " holt " } ,
112
+ ]
113
+
114
+ let response = try await self . echo. collect ( requests)
115
+ XCTAssertEqual ( response. text, " Swift echo collect: boyle jeffers holt " )
116
+ }
117
+ }
118
+
99
119
func testServerStreaming( ) {
100
120
XCTAsyncTest {
101
121
let expand = self . echo. makeExpandCall ( . with { $0. text = " boyle jeffers holt " } )
102
122
103
123
let initialMetadata = try await expand. initialMetadata
104
124
initialMetadata. assertFirst ( " 200 " , forName: " :status " )
105
125
106
- let respones = try await expand. responses. map { $0. text } . collect ( )
107
- XCTAssertEqual ( respones , [
126
+ let responses = try await expand. responses. map { $0. text } . collect ( )
127
+ XCTAssertEqual ( responses , [
108
128
" Swift echo expand (0): boyle " ,
109
129
" Swift echo expand (1): jeffers " ,
110
130
" Swift echo expand (2): holt " ,
@@ -118,6 +138,18 @@ final class AsyncIntegrationTests: GRPCTestCase {
118
138
}
119
139
}
120
140
141
+ func testServerStreamingWrapper( ) {
142
+ XCTAsyncTest {
143
+ let responseStream = self . echo. expand ( . with { $0. text = " boyle jeffers holt " } )
144
+ let responses = try await responseStream. map { $0. text } . collect ( )
145
+ XCTAssertEqual ( responses, [
146
+ " Swift echo expand (0): boyle " ,
147
+ " Swift echo expand (1): jeffers " ,
148
+ " Swift echo expand (2): holt " ,
149
+ ] )
150
+ }
151
+ }
152
+
121
153
func testBidirectionalStreaming( ) {
122
154
XCTAsyncTest {
123
155
let update = self . echo. makeUpdateCall ( )
@@ -145,6 +177,24 @@ final class AsyncIntegrationTests: GRPCTestCase {
145
177
XCTAssertTrue ( status. isOk)
146
178
}
147
179
}
180
+
181
+ func testBidirectionalStreamingWrapper( ) {
182
+ XCTAsyncTest {
183
+ let requests : [ Echo_EchoRequest ] = [
184
+ . with { $0. text = " boyle " } ,
185
+ . with { $0. text = " jeffers " } ,
186
+ . with { $0. text = " holt " } ,
187
+ ]
188
+
189
+ let responseStream = self . echo. update ( requests)
190
+ let responses = try await responseStream. map { $0. text } . collect ( )
191
+ XCTAssertEqual ( responses, [
192
+ " Swift echo update (0): boyle " ,
193
+ " Swift echo update (1): jeffers " ,
194
+ " Swift echo update (2): holt " ,
195
+ ] )
196
+ }
197
+ }
148
198
}
149
199
150
200
extension HPACKHeaders {
0 commit comments