OLD | NEW |
1 library googleapis_beta.language.v1beta1.test; | 1 library googleapis_beta.language.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 checkAnalyzeEntitiesRequest(api.AnalyzeEntitiesRequest o) { | 66 checkAnalyzeEntitiesRequest(api.AnalyzeEntitiesRequest o) { |
67 buildCounterAnalyzeEntitiesRequest++; | 67 buildCounterAnalyzeEntitiesRequest++; |
68 if (buildCounterAnalyzeEntitiesRequest < 3) { | 68 if (buildCounterAnalyzeEntitiesRequest < 3) { |
69 checkDocument(o.document); | 69 checkDocument(o.document); |
70 unittest.expect(o.encodingType, unittest.equals('foo')); | 70 unittest.expect(o.encodingType, unittest.equals('foo')); |
71 } | 71 } |
72 buildCounterAnalyzeEntitiesRequest--; | 72 buildCounterAnalyzeEntitiesRequest--; |
73 } | 73 } |
74 | 74 |
75 buildUnnamed3641() { | 75 buildUnnamed3473() { |
76 var o = new core.List<api.Entity>(); | 76 var o = new core.List<api.Entity>(); |
77 o.add(buildEntity()); | 77 o.add(buildEntity()); |
78 o.add(buildEntity()); | 78 o.add(buildEntity()); |
79 return o; | 79 return o; |
80 } | 80 } |
81 | 81 |
82 checkUnnamed3641(core.List<api.Entity> o) { | 82 checkUnnamed3473(core.List<api.Entity> o) { |
83 unittest.expect(o, unittest.hasLength(2)); | 83 unittest.expect(o, unittest.hasLength(2)); |
84 checkEntity(o[0]); | 84 checkEntity(o[0]); |
85 checkEntity(o[1]); | 85 checkEntity(o[1]); |
86 } | 86 } |
87 | 87 |
88 core.int buildCounterAnalyzeEntitiesResponse = 0; | 88 core.int buildCounterAnalyzeEntitiesResponse = 0; |
89 buildAnalyzeEntitiesResponse() { | 89 buildAnalyzeEntitiesResponse() { |
90 var o = new api.AnalyzeEntitiesResponse(); | 90 var o = new api.AnalyzeEntitiesResponse(); |
91 buildCounterAnalyzeEntitiesResponse++; | 91 buildCounterAnalyzeEntitiesResponse++; |
92 if (buildCounterAnalyzeEntitiesResponse < 3) { | 92 if (buildCounterAnalyzeEntitiesResponse < 3) { |
93 o.entities = buildUnnamed3641(); | 93 o.entities = buildUnnamed3473(); |
94 o.language = "foo"; | 94 o.language = "foo"; |
95 } | 95 } |
96 buildCounterAnalyzeEntitiesResponse--; | 96 buildCounterAnalyzeEntitiesResponse--; |
97 return o; | 97 return o; |
98 } | 98 } |
99 | 99 |
100 checkAnalyzeEntitiesResponse(api.AnalyzeEntitiesResponse o) { | 100 checkAnalyzeEntitiesResponse(api.AnalyzeEntitiesResponse o) { |
101 buildCounterAnalyzeEntitiesResponse++; | 101 buildCounterAnalyzeEntitiesResponse++; |
102 if (buildCounterAnalyzeEntitiesResponse < 3) { | 102 if (buildCounterAnalyzeEntitiesResponse < 3) { |
103 checkUnnamed3641(o.entities); | 103 checkUnnamed3473(o.entities); |
104 unittest.expect(o.language, unittest.equals('foo')); | 104 unittest.expect(o.language, unittest.equals('foo')); |
105 } | 105 } |
106 buildCounterAnalyzeEntitiesResponse--; | 106 buildCounterAnalyzeEntitiesResponse--; |
107 } | 107 } |
108 | 108 |
109 core.int buildCounterAnalyzeSentimentRequest = 0; | 109 core.int buildCounterAnalyzeSentimentRequest = 0; |
110 buildAnalyzeSentimentRequest() { | 110 buildAnalyzeSentimentRequest() { |
111 var o = new api.AnalyzeSentimentRequest(); | 111 var o = new api.AnalyzeSentimentRequest(); |
112 buildCounterAnalyzeSentimentRequest++; | 112 buildCounterAnalyzeSentimentRequest++; |
113 if (buildCounterAnalyzeSentimentRequest < 3) { | 113 if (buildCounterAnalyzeSentimentRequest < 3) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 checkAnnotateTextRequest(api.AnnotateTextRequest o) { | 162 checkAnnotateTextRequest(api.AnnotateTextRequest o) { |
163 buildCounterAnnotateTextRequest++; | 163 buildCounterAnnotateTextRequest++; |
164 if (buildCounterAnnotateTextRequest < 3) { | 164 if (buildCounterAnnotateTextRequest < 3) { |
165 checkDocument(o.document); | 165 checkDocument(o.document); |
166 unittest.expect(o.encodingType, unittest.equals('foo')); | 166 unittest.expect(o.encodingType, unittest.equals('foo')); |
167 checkFeatures(o.features); | 167 checkFeatures(o.features); |
168 } | 168 } |
169 buildCounterAnnotateTextRequest--; | 169 buildCounterAnnotateTextRequest--; |
170 } | 170 } |
171 | 171 |
172 buildUnnamed3642() { | 172 buildUnnamed3474() { |
173 var o = new core.List<api.Entity>(); | 173 var o = new core.List<api.Entity>(); |
174 o.add(buildEntity()); | 174 o.add(buildEntity()); |
175 o.add(buildEntity()); | 175 o.add(buildEntity()); |
176 return o; | 176 return o; |
177 } | 177 } |
178 | 178 |
179 checkUnnamed3642(core.List<api.Entity> o) { | 179 checkUnnamed3474(core.List<api.Entity> o) { |
180 unittest.expect(o, unittest.hasLength(2)); | 180 unittest.expect(o, unittest.hasLength(2)); |
181 checkEntity(o[0]); | 181 checkEntity(o[0]); |
182 checkEntity(o[1]); | 182 checkEntity(o[1]); |
183 } | 183 } |
184 | 184 |
185 buildUnnamed3643() { | 185 buildUnnamed3475() { |
186 var o = new core.List<api.Sentence>(); | 186 var o = new core.List<api.Sentence>(); |
187 o.add(buildSentence()); | 187 o.add(buildSentence()); |
188 o.add(buildSentence()); | 188 o.add(buildSentence()); |
189 return o; | 189 return o; |
190 } | 190 } |
191 | 191 |
192 checkUnnamed3643(core.List<api.Sentence> o) { | 192 checkUnnamed3475(core.List<api.Sentence> o) { |
193 unittest.expect(o, unittest.hasLength(2)); | 193 unittest.expect(o, unittest.hasLength(2)); |
194 checkSentence(o[0]); | 194 checkSentence(o[0]); |
195 checkSentence(o[1]); | 195 checkSentence(o[1]); |
196 } | 196 } |
197 | 197 |
198 buildUnnamed3644() { | 198 buildUnnamed3476() { |
199 var o = new core.List<api.Token>(); | 199 var o = new core.List<api.Token>(); |
200 o.add(buildToken()); | 200 o.add(buildToken()); |
201 o.add(buildToken()); | 201 o.add(buildToken()); |
202 return o; | 202 return o; |
203 } | 203 } |
204 | 204 |
205 checkUnnamed3644(core.List<api.Token> o) { | 205 checkUnnamed3476(core.List<api.Token> o) { |
206 unittest.expect(o, unittest.hasLength(2)); | 206 unittest.expect(o, unittest.hasLength(2)); |
207 checkToken(o[0]); | 207 checkToken(o[0]); |
208 checkToken(o[1]); | 208 checkToken(o[1]); |
209 } | 209 } |
210 | 210 |
211 core.int buildCounterAnnotateTextResponse = 0; | 211 core.int buildCounterAnnotateTextResponse = 0; |
212 buildAnnotateTextResponse() { | 212 buildAnnotateTextResponse() { |
213 var o = new api.AnnotateTextResponse(); | 213 var o = new api.AnnotateTextResponse(); |
214 buildCounterAnnotateTextResponse++; | 214 buildCounterAnnotateTextResponse++; |
215 if (buildCounterAnnotateTextResponse < 3) { | 215 if (buildCounterAnnotateTextResponse < 3) { |
216 o.documentSentiment = buildSentiment(); | 216 o.documentSentiment = buildSentiment(); |
217 o.entities = buildUnnamed3642(); | 217 o.entities = buildUnnamed3474(); |
218 o.language = "foo"; | 218 o.language = "foo"; |
219 o.sentences = buildUnnamed3643(); | 219 o.sentences = buildUnnamed3475(); |
220 o.tokens = buildUnnamed3644(); | 220 o.tokens = buildUnnamed3476(); |
221 } | 221 } |
222 buildCounterAnnotateTextResponse--; | 222 buildCounterAnnotateTextResponse--; |
223 return o; | 223 return o; |
224 } | 224 } |
225 | 225 |
226 checkAnnotateTextResponse(api.AnnotateTextResponse o) { | 226 checkAnnotateTextResponse(api.AnnotateTextResponse o) { |
227 buildCounterAnnotateTextResponse++; | 227 buildCounterAnnotateTextResponse++; |
228 if (buildCounterAnnotateTextResponse < 3) { | 228 if (buildCounterAnnotateTextResponse < 3) { |
229 checkSentiment(o.documentSentiment); | 229 checkSentiment(o.documentSentiment); |
230 checkUnnamed3642(o.entities); | 230 checkUnnamed3474(o.entities); |
231 unittest.expect(o.language, unittest.equals('foo')); | 231 unittest.expect(o.language, unittest.equals('foo')); |
232 checkUnnamed3643(o.sentences); | 232 checkUnnamed3475(o.sentences); |
233 checkUnnamed3644(o.tokens); | 233 checkUnnamed3476(o.tokens); |
234 } | 234 } |
235 buildCounterAnnotateTextResponse--; | 235 buildCounterAnnotateTextResponse--; |
236 } | 236 } |
237 | 237 |
238 core.int buildCounterDependencyEdge = 0; | 238 core.int buildCounterDependencyEdge = 0; |
239 buildDependencyEdge() { | 239 buildDependencyEdge() { |
240 var o = new api.DependencyEdge(); | 240 var o = new api.DependencyEdge(); |
241 buildCounterDependencyEdge++; | 241 buildCounterDependencyEdge++; |
242 if (buildCounterDependencyEdge < 3) { | 242 if (buildCounterDependencyEdge < 3) { |
243 o.headTokenIndex = 42; | 243 o.headTokenIndex = 42; |
(...skipping 30 matching lines...) Expand all Loading... |
274 buildCounterDocument++; | 274 buildCounterDocument++; |
275 if (buildCounterDocument < 3) { | 275 if (buildCounterDocument < 3) { |
276 unittest.expect(o.content, unittest.equals('foo')); | 276 unittest.expect(o.content, unittest.equals('foo')); |
277 unittest.expect(o.gcsContentUri, unittest.equals('foo')); | 277 unittest.expect(o.gcsContentUri, unittest.equals('foo')); |
278 unittest.expect(o.language, unittest.equals('foo')); | 278 unittest.expect(o.language, unittest.equals('foo')); |
279 unittest.expect(o.type, unittest.equals('foo')); | 279 unittest.expect(o.type, unittest.equals('foo')); |
280 } | 280 } |
281 buildCounterDocument--; | 281 buildCounterDocument--; |
282 } | 282 } |
283 | 283 |
284 buildUnnamed3645() { | 284 buildUnnamed3477() { |
285 var o = new core.List<api.EntityMention>(); | 285 var o = new core.List<api.EntityMention>(); |
286 o.add(buildEntityMention()); | 286 o.add(buildEntityMention()); |
287 o.add(buildEntityMention()); | 287 o.add(buildEntityMention()); |
288 return o; | 288 return o; |
289 } | 289 } |
290 | 290 |
291 checkUnnamed3645(core.List<api.EntityMention> o) { | 291 checkUnnamed3477(core.List<api.EntityMention> o) { |
292 unittest.expect(o, unittest.hasLength(2)); | 292 unittest.expect(o, unittest.hasLength(2)); |
293 checkEntityMention(o[0]); | 293 checkEntityMention(o[0]); |
294 checkEntityMention(o[1]); | 294 checkEntityMention(o[1]); |
295 } | 295 } |
296 | 296 |
297 buildUnnamed3646() { | 297 buildUnnamed3478() { |
298 var o = new core.Map<core.String, core.String>(); | 298 var o = new core.Map<core.String, core.String>(); |
299 o["x"] = "foo"; | 299 o["x"] = "foo"; |
300 o["y"] = "foo"; | 300 o["y"] = "foo"; |
301 return o; | 301 return o; |
302 } | 302 } |
303 | 303 |
304 checkUnnamed3646(core.Map<core.String, core.String> o) { | 304 checkUnnamed3478(core.Map<core.String, core.String> o) { |
305 unittest.expect(o, unittest.hasLength(2)); | 305 unittest.expect(o, unittest.hasLength(2)); |
306 unittest.expect(o["x"], unittest.equals('foo')); | 306 unittest.expect(o["x"], unittest.equals('foo')); |
307 unittest.expect(o["y"], unittest.equals('foo')); | 307 unittest.expect(o["y"], unittest.equals('foo')); |
308 } | 308 } |
309 | 309 |
310 core.int buildCounterEntity = 0; | 310 core.int buildCounterEntity = 0; |
311 buildEntity() { | 311 buildEntity() { |
312 var o = new api.Entity(); | 312 var o = new api.Entity(); |
313 buildCounterEntity++; | 313 buildCounterEntity++; |
314 if (buildCounterEntity < 3) { | 314 if (buildCounterEntity < 3) { |
315 o.mentions = buildUnnamed3645(); | 315 o.mentions = buildUnnamed3477(); |
316 o.metadata = buildUnnamed3646(); | 316 o.metadata = buildUnnamed3478(); |
317 o.name = "foo"; | 317 o.name = "foo"; |
318 o.salience = 42.0; | 318 o.salience = 42.0; |
319 o.type = "foo"; | 319 o.type = "foo"; |
320 } | 320 } |
321 buildCounterEntity--; | 321 buildCounterEntity--; |
322 return o; | 322 return o; |
323 } | 323 } |
324 | 324 |
325 checkEntity(api.Entity o) { | 325 checkEntity(api.Entity o) { |
326 buildCounterEntity++; | 326 buildCounterEntity++; |
327 if (buildCounterEntity < 3) { | 327 if (buildCounterEntity < 3) { |
328 checkUnnamed3645(o.mentions); | 328 checkUnnamed3477(o.mentions); |
329 checkUnnamed3646(o.metadata); | 329 checkUnnamed3478(o.metadata); |
330 unittest.expect(o.name, unittest.equals('foo')); | 330 unittest.expect(o.name, unittest.equals('foo')); |
331 unittest.expect(o.salience, unittest.equals(42.0)); | 331 unittest.expect(o.salience, unittest.equals(42.0)); |
332 unittest.expect(o.type, unittest.equals('foo')); | 332 unittest.expect(o.type, unittest.equals('foo')); |
333 } | 333 } |
334 buildCounterEntity--; | 334 buildCounterEntity--; |
335 } | 335 } |
336 | 336 |
337 core.int buildCounterEntityMention = 0; | 337 core.int buildCounterEntityMention = 0; |
338 buildEntityMention() { | 338 buildEntityMention() { |
339 var o = new api.EntityMention(); | 339 var o = new api.EntityMention(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 checkSentiment(api.Sentiment o) { | 429 checkSentiment(api.Sentiment o) { |
430 buildCounterSentiment++; | 430 buildCounterSentiment++; |
431 if (buildCounterSentiment < 3) { | 431 if (buildCounterSentiment < 3) { |
432 unittest.expect(o.magnitude, unittest.equals(42.0)); | 432 unittest.expect(o.magnitude, unittest.equals(42.0)); |
433 unittest.expect(o.polarity, unittest.equals(42.0)); | 433 unittest.expect(o.polarity, unittest.equals(42.0)); |
434 } | 434 } |
435 buildCounterSentiment--; | 435 buildCounterSentiment--; |
436 } | 436 } |
437 | 437 |
438 buildUnnamed3647() { | 438 buildUnnamed3479() { |
439 var o = new core.Map<core.String, core.Object>(); | 439 var o = new core.Map<core.String, core.Object>(); |
440 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 440 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
441 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 441 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
442 return o; | 442 return o; |
443 } | 443 } |
444 | 444 |
445 checkUnnamed3647(core.Map<core.String, core.Object> o) { | 445 checkUnnamed3479(core.Map<core.String, core.Object> o) { |
446 unittest.expect(o, unittest.hasLength(2)); | 446 unittest.expect(o, unittest.hasLength(2)); |
447 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')); | 447 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')); |
448 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')); | 448 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')); |
449 } | 449 } |
450 | 450 |
451 buildUnnamed3648() { | 451 buildUnnamed3480() { |
452 var o = new core.List<core.Map<core.String, core.Object>>(); | 452 var o = new core.List<core.Map<core.String, core.Object>>(); |
453 o.add(buildUnnamed3647()); | 453 o.add(buildUnnamed3479()); |
454 o.add(buildUnnamed3647()); | 454 o.add(buildUnnamed3479()); |
455 return o; | 455 return o; |
456 } | 456 } |
457 | 457 |
458 checkUnnamed3648(core.List<core.Map<core.String, core.Object>> o) { | 458 checkUnnamed3480(core.List<core.Map<core.String, core.Object>> o) { |
459 unittest.expect(o, unittest.hasLength(2)); | 459 unittest.expect(o, unittest.hasLength(2)); |
460 checkUnnamed3647(o[0]); | 460 checkUnnamed3479(o[0]); |
461 checkUnnamed3647(o[1]); | 461 checkUnnamed3479(o[1]); |
462 } | 462 } |
463 | 463 |
464 core.int buildCounterStatus = 0; | 464 core.int buildCounterStatus = 0; |
465 buildStatus() { | 465 buildStatus() { |
466 var o = new api.Status(); | 466 var o = new api.Status(); |
467 buildCounterStatus++; | 467 buildCounterStatus++; |
468 if (buildCounterStatus < 3) { | 468 if (buildCounterStatus < 3) { |
469 o.code = 42; | 469 o.code = 42; |
470 o.details = buildUnnamed3648(); | 470 o.details = buildUnnamed3480(); |
471 o.message = "foo"; | 471 o.message = "foo"; |
472 } | 472 } |
473 buildCounterStatus--; | 473 buildCounterStatus--; |
474 return o; | 474 return o; |
475 } | 475 } |
476 | 476 |
477 checkStatus(api.Status o) { | 477 checkStatus(api.Status o) { |
478 buildCounterStatus++; | 478 buildCounterStatus++; |
479 if (buildCounterStatus < 3) { | 479 if (buildCounterStatus < 3) { |
480 unittest.expect(o.code, unittest.equals(42)); | 480 unittest.expect(o.code, unittest.equals(42)); |
481 checkUnnamed3648(o.details); | 481 checkUnnamed3480(o.details); |
482 unittest.expect(o.message, unittest.equals('foo')); | 482 unittest.expect(o.message, unittest.equals('foo')); |
483 } | 483 } |
484 buildCounterStatus--; | 484 buildCounterStatus--; |
485 } | 485 } |
486 | 486 |
487 core.int buildCounterTextSpan = 0; | 487 core.int buildCounterTextSpan = 0; |
488 buildTextSpan() { | 488 buildTextSpan() { |
489 var o = new api.TextSpan(); | 489 var o = new api.TextSpan(); |
490 buildCounterTextSpan++; | 490 buildCounterTextSpan++; |
491 if (buildCounterTextSpan < 3) { | 491 if (buildCounterTextSpan < 3) { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 res.annotateText(arg_request).then(unittest.expectAsync(((api.AnnotateText
Response response) { | 825 res.annotateText(arg_request).then(unittest.expectAsync(((api.AnnotateText
Response response) { |
826 checkAnnotateTextResponse(response); | 826 checkAnnotateTextResponse(response); |
827 }))); | 827 }))); |
828 }); | 828 }); |
829 | 829 |
830 }); | 830 }); |
831 | 831 |
832 | 832 |
833 } | 833 } |
834 | 834 |
OLD | NEW |