OLD | NEW |
1 library googleapis_beta.speech.v1beta1.test; | 1 library googleapis_beta.speech.v1beta1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 return o; | 82 return o; |
83 } | 83 } |
84 | 84 |
85 checkEmpty(api.Empty o) { | 85 checkEmpty(api.Empty o) { |
86 buildCounterEmpty++; | 86 buildCounterEmpty++; |
87 if (buildCounterEmpty < 3) { | 87 if (buildCounterEmpty < 3) { |
88 } | 88 } |
89 buildCounterEmpty--; | 89 buildCounterEmpty--; |
90 } | 90 } |
91 | 91 |
92 buildUnnamed3722() { | 92 buildUnnamed3304() { |
93 var o = new core.List<api.Operation>(); | 93 var o = new core.List<api.Operation>(); |
94 o.add(buildOperation()); | 94 o.add(buildOperation()); |
95 o.add(buildOperation()); | 95 o.add(buildOperation()); |
96 return o; | 96 return o; |
97 } | 97 } |
98 | 98 |
99 checkUnnamed3722(core.List<api.Operation> o) { | 99 checkUnnamed3304(core.List<api.Operation> o) { |
100 unittest.expect(o, unittest.hasLength(2)); | 100 unittest.expect(o, unittest.hasLength(2)); |
101 checkOperation(o[0]); | 101 checkOperation(o[0]); |
102 checkOperation(o[1]); | 102 checkOperation(o[1]); |
103 } | 103 } |
104 | 104 |
105 core.int buildCounterListOperationsResponse = 0; | 105 core.int buildCounterListOperationsResponse = 0; |
106 buildListOperationsResponse() { | 106 buildListOperationsResponse() { |
107 var o = new api.ListOperationsResponse(); | 107 var o = new api.ListOperationsResponse(); |
108 buildCounterListOperationsResponse++; | 108 buildCounterListOperationsResponse++; |
109 if (buildCounterListOperationsResponse < 3) { | 109 if (buildCounterListOperationsResponse < 3) { |
110 o.nextPageToken = "foo"; | 110 o.nextPageToken = "foo"; |
111 o.operations = buildUnnamed3722(); | 111 o.operations = buildUnnamed3304(); |
112 } | 112 } |
113 buildCounterListOperationsResponse--; | 113 buildCounterListOperationsResponse--; |
114 return o; | 114 return o; |
115 } | 115 } |
116 | 116 |
117 checkListOperationsResponse(api.ListOperationsResponse o) { | 117 checkListOperationsResponse(api.ListOperationsResponse o) { |
118 buildCounterListOperationsResponse++; | 118 buildCounterListOperationsResponse++; |
119 if (buildCounterListOperationsResponse < 3) { | 119 if (buildCounterListOperationsResponse < 3) { |
120 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 120 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
121 checkUnnamed3722(o.operations); | 121 checkUnnamed3304(o.operations); |
122 } | 122 } |
123 buildCounterListOperationsResponse--; | 123 buildCounterListOperationsResponse--; |
124 } | 124 } |
125 | 125 |
126 buildUnnamed3723() { | 126 buildUnnamed3305() { |
127 var o = new core.Map<core.String, core.Object>(); | 127 var o = new core.Map<core.String, core.Object>(); |
128 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 128 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
129 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 129 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
130 return o; | 130 return o; |
131 } | 131 } |
132 | 132 |
133 checkUnnamed3723(core.Map<core.String, core.Object> o) { | 133 checkUnnamed3305(core.Map<core.String, core.Object> o) { |
134 unittest.expect(o, unittest.hasLength(2)); | 134 unittest.expect(o, unittest.hasLength(2)); |
135 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 135 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
136 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 136 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
137 } | 137 } |
138 | 138 |
139 buildUnnamed3724() { | 139 buildUnnamed3306() { |
140 var o = new core.Map<core.String, core.Object>(); | 140 var o = new core.Map<core.String, core.Object>(); |
141 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 141 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
142 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 142 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
143 return o; | 143 return o; |
144 } | 144 } |
145 | 145 |
146 checkUnnamed3724(core.Map<core.String, core.Object> o) { | 146 checkUnnamed3306(core.Map<core.String, core.Object> o) { |
147 unittest.expect(o, unittest.hasLength(2)); | 147 unittest.expect(o, unittest.hasLength(2)); |
148 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 148 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
149 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 149 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
150 } | 150 } |
151 | 151 |
152 core.int buildCounterOperation = 0; | 152 core.int buildCounterOperation = 0; |
153 buildOperation() { | 153 buildOperation() { |
154 var o = new api.Operation(); | 154 var o = new api.Operation(); |
155 buildCounterOperation++; | 155 buildCounterOperation++; |
156 if (buildCounterOperation < 3) { | 156 if (buildCounterOperation < 3) { |
157 o.done = true; | 157 o.done = true; |
158 o.error = buildStatus(); | 158 o.error = buildStatus(); |
159 o.metadata = buildUnnamed3723(); | 159 o.metadata = buildUnnamed3305(); |
160 o.name = "foo"; | 160 o.name = "foo"; |
161 o.response = buildUnnamed3724(); | 161 o.response = buildUnnamed3306(); |
162 } | 162 } |
163 buildCounterOperation--; | 163 buildCounterOperation--; |
164 return o; | 164 return o; |
165 } | 165 } |
166 | 166 |
167 checkOperation(api.Operation o) { | 167 checkOperation(api.Operation o) { |
168 buildCounterOperation++; | 168 buildCounterOperation++; |
169 if (buildCounterOperation < 3) { | 169 if (buildCounterOperation < 3) { |
170 unittest.expect(o.done, unittest.isTrue); | 170 unittest.expect(o.done, unittest.isTrue); |
171 checkStatus(o.error); | 171 checkStatus(o.error); |
172 checkUnnamed3723(o.metadata); | 172 checkUnnamed3305(o.metadata); |
173 unittest.expect(o.name, unittest.equals('foo')); | 173 unittest.expect(o.name, unittest.equals('foo')); |
174 checkUnnamed3724(o.response); | 174 checkUnnamed3306(o.response); |
175 } | 175 } |
176 buildCounterOperation--; | 176 buildCounterOperation--; |
177 } | 177 } |
178 | 178 |
179 core.int buildCounterRecognitionAudio = 0; | 179 core.int buildCounterRecognitionAudio = 0; |
180 buildRecognitionAudio() { | 180 buildRecognitionAudio() { |
181 var o = new api.RecognitionAudio(); | 181 var o = new api.RecognitionAudio(); |
182 buildCounterRecognitionAudio++; | 182 buildCounterRecognitionAudio++; |
183 if (buildCounterRecognitionAudio < 3) { | 183 if (buildCounterRecognitionAudio < 3) { |
184 o.content = "foo"; | 184 o.content = "foo"; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 unittest.expect(o.encoding, unittest.equals('foo')); | 219 unittest.expect(o.encoding, unittest.equals('foo')); |
220 unittest.expect(o.languageCode, unittest.equals('foo')); | 220 unittest.expect(o.languageCode, unittest.equals('foo')); |
221 unittest.expect(o.maxAlternatives, unittest.equals(42)); | 221 unittest.expect(o.maxAlternatives, unittest.equals(42)); |
222 unittest.expect(o.profanityFilter, unittest.isTrue); | 222 unittest.expect(o.profanityFilter, unittest.isTrue); |
223 unittest.expect(o.sampleRate, unittest.equals(42)); | 223 unittest.expect(o.sampleRate, unittest.equals(42)); |
224 checkSpeechContext(o.speechContext); | 224 checkSpeechContext(o.speechContext); |
225 } | 225 } |
226 buildCounterRecognitionConfig--; | 226 buildCounterRecognitionConfig--; |
227 } | 227 } |
228 | 228 |
229 buildUnnamed3725() { | 229 buildUnnamed3307() { |
230 var o = new core.List<core.String>(); | 230 var o = new core.List<core.String>(); |
231 o.add("foo"); | 231 o.add("foo"); |
232 o.add("foo"); | 232 o.add("foo"); |
233 return o; | 233 return o; |
234 } | 234 } |
235 | 235 |
236 checkUnnamed3725(core.List<core.String> o) { | 236 checkUnnamed3307(core.List<core.String> o) { |
237 unittest.expect(o, unittest.hasLength(2)); | 237 unittest.expect(o, unittest.hasLength(2)); |
238 unittest.expect(o[0], unittest.equals('foo')); | 238 unittest.expect(o[0], unittest.equals('foo')); |
239 unittest.expect(o[1], unittest.equals('foo')); | 239 unittest.expect(o[1], unittest.equals('foo')); |
240 } | 240 } |
241 | 241 |
242 core.int buildCounterSpeechContext = 0; | 242 core.int buildCounterSpeechContext = 0; |
243 buildSpeechContext() { | 243 buildSpeechContext() { |
244 var o = new api.SpeechContext(); | 244 var o = new api.SpeechContext(); |
245 buildCounterSpeechContext++; | 245 buildCounterSpeechContext++; |
246 if (buildCounterSpeechContext < 3) { | 246 if (buildCounterSpeechContext < 3) { |
247 o.phrases = buildUnnamed3725(); | 247 o.phrases = buildUnnamed3307(); |
248 } | 248 } |
249 buildCounterSpeechContext--; | 249 buildCounterSpeechContext--; |
250 return o; | 250 return o; |
251 } | 251 } |
252 | 252 |
253 checkSpeechContext(api.SpeechContext o) { | 253 checkSpeechContext(api.SpeechContext o) { |
254 buildCounterSpeechContext++; | 254 buildCounterSpeechContext++; |
255 if (buildCounterSpeechContext < 3) { | 255 if (buildCounterSpeechContext < 3) { |
256 checkUnnamed3725(o.phrases); | 256 checkUnnamed3307(o.phrases); |
257 } | 257 } |
258 buildCounterSpeechContext--; | 258 buildCounterSpeechContext--; |
259 } | 259 } |
260 | 260 |
261 core.int buildCounterSpeechRecognitionAlternative = 0; | 261 core.int buildCounterSpeechRecognitionAlternative = 0; |
262 buildSpeechRecognitionAlternative() { | 262 buildSpeechRecognitionAlternative() { |
263 var o = new api.SpeechRecognitionAlternative(); | 263 var o = new api.SpeechRecognitionAlternative(); |
264 buildCounterSpeechRecognitionAlternative++; | 264 buildCounterSpeechRecognitionAlternative++; |
265 if (buildCounterSpeechRecognitionAlternative < 3) { | 265 if (buildCounterSpeechRecognitionAlternative < 3) { |
266 o.confidence = 42.0; | 266 o.confidence = 42.0; |
267 o.transcript = "foo"; | 267 o.transcript = "foo"; |
268 } | 268 } |
269 buildCounterSpeechRecognitionAlternative--; | 269 buildCounterSpeechRecognitionAlternative--; |
270 return o; | 270 return o; |
271 } | 271 } |
272 | 272 |
273 checkSpeechRecognitionAlternative(api.SpeechRecognitionAlternative o) { | 273 checkSpeechRecognitionAlternative(api.SpeechRecognitionAlternative o) { |
274 buildCounterSpeechRecognitionAlternative++; | 274 buildCounterSpeechRecognitionAlternative++; |
275 if (buildCounterSpeechRecognitionAlternative < 3) { | 275 if (buildCounterSpeechRecognitionAlternative < 3) { |
276 unittest.expect(o.confidence, unittest.equals(42.0)); | 276 unittest.expect(o.confidence, unittest.equals(42.0)); |
277 unittest.expect(o.transcript, unittest.equals('foo')); | 277 unittest.expect(o.transcript, unittest.equals('foo')); |
278 } | 278 } |
279 buildCounterSpeechRecognitionAlternative--; | 279 buildCounterSpeechRecognitionAlternative--; |
280 } | 280 } |
281 | 281 |
282 buildUnnamed3726() { | 282 buildUnnamed3308() { |
283 var o = new core.List<api.SpeechRecognitionAlternative>(); | 283 var o = new core.List<api.SpeechRecognitionAlternative>(); |
284 o.add(buildSpeechRecognitionAlternative()); | 284 o.add(buildSpeechRecognitionAlternative()); |
285 o.add(buildSpeechRecognitionAlternative()); | 285 o.add(buildSpeechRecognitionAlternative()); |
286 return o; | 286 return o; |
287 } | 287 } |
288 | 288 |
289 checkUnnamed3726(core.List<api.SpeechRecognitionAlternative> o) { | 289 checkUnnamed3308(core.List<api.SpeechRecognitionAlternative> o) { |
290 unittest.expect(o, unittest.hasLength(2)); | 290 unittest.expect(o, unittest.hasLength(2)); |
291 checkSpeechRecognitionAlternative(o[0]); | 291 checkSpeechRecognitionAlternative(o[0]); |
292 checkSpeechRecognitionAlternative(o[1]); | 292 checkSpeechRecognitionAlternative(o[1]); |
293 } | 293 } |
294 | 294 |
295 core.int buildCounterSpeechRecognitionResult = 0; | 295 core.int buildCounterSpeechRecognitionResult = 0; |
296 buildSpeechRecognitionResult() { | 296 buildSpeechRecognitionResult() { |
297 var o = new api.SpeechRecognitionResult(); | 297 var o = new api.SpeechRecognitionResult(); |
298 buildCounterSpeechRecognitionResult++; | 298 buildCounterSpeechRecognitionResult++; |
299 if (buildCounterSpeechRecognitionResult < 3) { | 299 if (buildCounterSpeechRecognitionResult < 3) { |
300 o.alternatives = buildUnnamed3726(); | 300 o.alternatives = buildUnnamed3308(); |
301 } | 301 } |
302 buildCounterSpeechRecognitionResult--; | 302 buildCounterSpeechRecognitionResult--; |
303 return o; | 303 return o; |
304 } | 304 } |
305 | 305 |
306 checkSpeechRecognitionResult(api.SpeechRecognitionResult o) { | 306 checkSpeechRecognitionResult(api.SpeechRecognitionResult o) { |
307 buildCounterSpeechRecognitionResult++; | 307 buildCounterSpeechRecognitionResult++; |
308 if (buildCounterSpeechRecognitionResult < 3) { | 308 if (buildCounterSpeechRecognitionResult < 3) { |
309 checkUnnamed3726(o.alternatives); | 309 checkUnnamed3308(o.alternatives); |
310 } | 310 } |
311 buildCounterSpeechRecognitionResult--; | 311 buildCounterSpeechRecognitionResult--; |
312 } | 312 } |
313 | 313 |
314 buildUnnamed3727() { | 314 buildUnnamed3309() { |
315 var o = new core.Map<core.String, core.Object>(); | 315 var o = new core.Map<core.String, core.Object>(); |
316 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 316 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
317 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 317 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
318 return o; | 318 return o; |
319 } | 319 } |
320 | 320 |
321 checkUnnamed3727(core.Map<core.String, core.Object> o) { | 321 checkUnnamed3309(core.Map<core.String, core.Object> o) { |
322 unittest.expect(o, unittest.hasLength(2)); | 322 unittest.expect(o, unittest.hasLength(2)); |
323 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 323 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
324 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 324 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
325 } | 325 } |
326 | 326 |
327 buildUnnamed3728() { | 327 buildUnnamed3310() { |
328 var o = new core.List<core.Map<core.String, core.Object>>(); | 328 var o = new core.List<core.Map<core.String, core.Object>>(); |
329 o.add(buildUnnamed3727()); | 329 o.add(buildUnnamed3309()); |
330 o.add(buildUnnamed3727()); | 330 o.add(buildUnnamed3309()); |
331 return o; | 331 return o; |
332 } | 332 } |
333 | 333 |
334 checkUnnamed3728(core.List<core.Map<core.String, core.Object>> o) { | 334 checkUnnamed3310(core.List<core.Map<core.String, core.Object>> o) { |
335 unittest.expect(o, unittest.hasLength(2)); | 335 unittest.expect(o, unittest.hasLength(2)); |
336 checkUnnamed3727(o[0]); | 336 checkUnnamed3309(o[0]); |
337 checkUnnamed3727(o[1]); | 337 checkUnnamed3309(o[1]); |
338 } | 338 } |
339 | 339 |
340 core.int buildCounterStatus = 0; | 340 core.int buildCounterStatus = 0; |
341 buildStatus() { | 341 buildStatus() { |
342 var o = new api.Status(); | 342 var o = new api.Status(); |
343 buildCounterStatus++; | 343 buildCounterStatus++; |
344 if (buildCounterStatus < 3) { | 344 if (buildCounterStatus < 3) { |
345 o.code = 42; | 345 o.code = 42; |
346 o.details = buildUnnamed3728(); | 346 o.details = buildUnnamed3310(); |
347 o.message = "foo"; | 347 o.message = "foo"; |
348 } | 348 } |
349 buildCounterStatus--; | 349 buildCounterStatus--; |
350 return o; | 350 return o; |
351 } | 351 } |
352 | 352 |
353 checkStatus(api.Status o) { | 353 checkStatus(api.Status o) { |
354 buildCounterStatus++; | 354 buildCounterStatus++; |
355 if (buildCounterStatus < 3) { | 355 if (buildCounterStatus < 3) { |
356 unittest.expect(o.code, unittest.equals(42)); | 356 unittest.expect(o.code, unittest.equals(42)); |
357 checkUnnamed3728(o.details); | 357 checkUnnamed3310(o.details); |
358 unittest.expect(o.message, unittest.equals('foo')); | 358 unittest.expect(o.message, unittest.equals('foo')); |
359 } | 359 } |
360 buildCounterStatus--; | 360 buildCounterStatus--; |
361 } | 361 } |
362 | 362 |
363 core.int buildCounterSyncRecognizeRequest = 0; | 363 core.int buildCounterSyncRecognizeRequest = 0; |
364 buildSyncRecognizeRequest() { | 364 buildSyncRecognizeRequest() { |
365 var o = new api.SyncRecognizeRequest(); | 365 var o = new api.SyncRecognizeRequest(); |
366 buildCounterSyncRecognizeRequest++; | 366 buildCounterSyncRecognizeRequest++; |
367 if (buildCounterSyncRecognizeRequest < 3) { | 367 if (buildCounterSyncRecognizeRequest < 3) { |
368 o.audio = buildRecognitionAudio(); | 368 o.audio = buildRecognitionAudio(); |
369 o.config = buildRecognitionConfig(); | 369 o.config = buildRecognitionConfig(); |
370 } | 370 } |
371 buildCounterSyncRecognizeRequest--; | 371 buildCounterSyncRecognizeRequest--; |
372 return o; | 372 return o; |
373 } | 373 } |
374 | 374 |
375 checkSyncRecognizeRequest(api.SyncRecognizeRequest o) { | 375 checkSyncRecognizeRequest(api.SyncRecognizeRequest o) { |
376 buildCounterSyncRecognizeRequest++; | 376 buildCounterSyncRecognizeRequest++; |
377 if (buildCounterSyncRecognizeRequest < 3) { | 377 if (buildCounterSyncRecognizeRequest < 3) { |
378 checkRecognitionAudio(o.audio); | 378 checkRecognitionAudio(o.audio); |
379 checkRecognitionConfig(o.config); | 379 checkRecognitionConfig(o.config); |
380 } | 380 } |
381 buildCounterSyncRecognizeRequest--; | 381 buildCounterSyncRecognizeRequest--; |
382 } | 382 } |
383 | 383 |
384 buildUnnamed3729() { | 384 buildUnnamed3311() { |
385 var o = new core.List<api.SpeechRecognitionResult>(); | 385 var o = new core.List<api.SpeechRecognitionResult>(); |
386 o.add(buildSpeechRecognitionResult()); | 386 o.add(buildSpeechRecognitionResult()); |
387 o.add(buildSpeechRecognitionResult()); | 387 o.add(buildSpeechRecognitionResult()); |
388 return o; | 388 return o; |
389 } | 389 } |
390 | 390 |
391 checkUnnamed3729(core.List<api.SpeechRecognitionResult> o) { | 391 checkUnnamed3311(core.List<api.SpeechRecognitionResult> o) { |
392 unittest.expect(o, unittest.hasLength(2)); | 392 unittest.expect(o, unittest.hasLength(2)); |
393 checkSpeechRecognitionResult(o[0]); | 393 checkSpeechRecognitionResult(o[0]); |
394 checkSpeechRecognitionResult(o[1]); | 394 checkSpeechRecognitionResult(o[1]); |
395 } | 395 } |
396 | 396 |
397 core.int buildCounterSyncRecognizeResponse = 0; | 397 core.int buildCounterSyncRecognizeResponse = 0; |
398 buildSyncRecognizeResponse() { | 398 buildSyncRecognizeResponse() { |
399 var o = new api.SyncRecognizeResponse(); | 399 var o = new api.SyncRecognizeResponse(); |
400 buildCounterSyncRecognizeResponse++; | 400 buildCounterSyncRecognizeResponse++; |
401 if (buildCounterSyncRecognizeResponse < 3) { | 401 if (buildCounterSyncRecognizeResponse < 3) { |
402 o.results = buildUnnamed3729(); | 402 o.results = buildUnnamed3311(); |
403 } | 403 } |
404 buildCounterSyncRecognizeResponse--; | 404 buildCounterSyncRecognizeResponse--; |
405 return o; | 405 return o; |
406 } | 406 } |
407 | 407 |
408 checkSyncRecognizeResponse(api.SyncRecognizeResponse o) { | 408 checkSyncRecognizeResponse(api.SyncRecognizeResponse o) { |
409 buildCounterSyncRecognizeResponse++; | 409 buildCounterSyncRecognizeResponse++; |
410 if (buildCounterSyncRecognizeResponse < 3) { | 410 if (buildCounterSyncRecognizeResponse < 3) { |
411 checkUnnamed3729(o.results); | 411 checkUnnamed3311(o.results); |
412 } | 412 } |
413 buildCounterSyncRecognizeResponse--; | 413 buildCounterSyncRecognizeResponse--; |
414 } | 414 } |
415 | 415 |
416 | 416 |
417 main() { | 417 main() { |
418 unittest.group("obj-schema-AsyncRecognizeRequest", () { | 418 unittest.group("obj-schema-AsyncRecognizeRequest", () { |
419 unittest.test("to-json--from-json", () { | 419 unittest.test("to-json--from-json", () { |
420 var o = buildAsyncRecognizeRequest(); | 420 var o = buildAsyncRecognizeRequest(); |
421 var od = new api.AsyncRecognizeRequest.fromJson(o.toJson()); | 421 var od = new api.AsyncRecognizeRequest.fromJson(o.toJson()); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 }), true); | 656 }), true); |
657 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { | 657 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { |
658 checkOperation(response); | 658 checkOperation(response); |
659 }))); | 659 }))); |
660 }); | 660 }); |
661 | 661 |
662 unittest.test("method--list", () { | 662 unittest.test("method--list", () { |
663 | 663 |
664 var mock = new HttpServerMock(); | 664 var mock = new HttpServerMock(); |
665 api.OperationsResourceApi res = new api.SpeechApi(mock).operations; | 665 api.OperationsResourceApi res = new api.SpeechApi(mock).operations; |
| 666 var arg_filter = "foo"; |
666 var arg_name = "foo"; | 667 var arg_name = "foo"; |
667 var arg_pageToken = "foo"; | 668 var arg_pageToken = "foo"; |
668 var arg_pageSize = 42; | 669 var arg_pageSize = 42; |
669 var arg_filter = "foo"; | |
670 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 670 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
671 var path = (req.url).path; | 671 var path = (req.url).path; |
672 var pathOffset = 0; | 672 var pathOffset = 0; |
673 var index; | 673 var index; |
674 var subPart; | 674 var subPart; |
675 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 675 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
676 pathOffset += 1; | 676 pathOffset += 1; |
677 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("v1beta1/operations")); | 677 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("v1beta1/operations")); |
678 pathOffset += 18; | 678 pathOffset += 18; |
679 | 679 |
680 var query = (req.url).query; | 680 var query = (req.url).query; |
681 var queryOffset = 0; | 681 var queryOffset = 0; |
682 var queryMap = {}; | 682 var queryMap = {}; |
683 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 683 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
684 parseBool(n) { | 684 parseBool(n) { |
685 if (n == "true") return true; | 685 if (n == "true") return true; |
686 if (n == "false") return false; | 686 if (n == "false") return false; |
687 if (n == null) return null; | 687 if (n == null) return null; |
688 throw new core.ArgumentError("Invalid boolean: $n"); | 688 throw new core.ArgumentError("Invalid boolean: $n"); |
689 } | 689 } |
690 if (query.length > 0) { | 690 if (query.length > 0) { |
691 for (var part in query.split("&")) { | 691 for (var part in query.split("&")) { |
692 var keyvalue = part.split("="); | 692 var keyvalue = part.split("="); |
693 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 693 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
694 } | 694 } |
695 } | 695 } |
| 696 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
696 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); | 697 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
697 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 698 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
698 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 699 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
699 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
700 | 700 |
701 | 701 |
702 var h = { | 702 var h = { |
703 "content-type" : "application/json; charset=utf-8", | 703 "content-type" : "application/json; charset=utf-8", |
704 }; | 704 }; |
705 var resp = convert.JSON.encode(buildListOperationsResponse()); | 705 var resp = convert.JSON.encode(buildListOperationsResponse()); |
706 return new async.Future.value(stringResponse(200, h, resp)); | 706 return new async.Future.value(stringResponse(200, h, resp)); |
707 }), true); | 707 }), true); |
708 res.list(name: arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize,
filter: arg_filter).then(unittest.expectAsync(((api.ListOperationsResponse resp
onse) { | 708 res.list(filter: arg_filter, name: arg_name, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListOperationsResponse resp
onse) { |
709 checkListOperationsResponse(response); | 709 checkListOperationsResponse(response); |
710 }))); | 710 }))); |
711 }); | 711 }); |
712 | 712 |
713 }); | 713 }); |
714 | 714 |
715 | 715 |
716 unittest.group("resource-SpeechResourceApi", () { | 716 unittest.group("resource-SpeechResourceApi", () { |
717 unittest.test("method--asyncrecognize", () { | 717 unittest.test("method--asyncrecognize", () { |
718 | 718 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 res.syncrecognize(arg_request).then(unittest.expectAsync(((api.SyncRecogni
zeResponse response) { | 806 res.syncrecognize(arg_request).then(unittest.expectAsync(((api.SyncRecogni
zeResponse response) { |
807 checkSyncRecognizeResponse(response); | 807 checkSyncRecognizeResponse(response); |
808 }))); | 808 }))); |
809 }); | 809 }); |
810 | 810 |
811 }); | 811 }); |
812 | 812 |
813 | 813 |
814 } | 814 } |
815 | 815 |
OLD | NEW |