Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: generated/googleapis_beta/test/language/v1beta1_test.dart

Issue 2571553005: Api-roll 43: 2016-12-13 (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 buildUnnamed3473() { 75 buildUnnamed3181() {
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 checkUnnamed3473(core.List<api.Entity> o) { 82 checkUnnamed3181(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 = buildUnnamed3473(); 93 o.entities = buildUnnamed3181();
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 checkUnnamed3473(o.entities); 103 checkUnnamed3181(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) {
114 o.document = buildDocument(); 114 o.document = buildDocument();
115 o.encodingType = "foo";
115 } 116 }
116 buildCounterAnalyzeSentimentRequest--; 117 buildCounterAnalyzeSentimentRequest--;
117 return o; 118 return o;
118 } 119 }
119 120
120 checkAnalyzeSentimentRequest(api.AnalyzeSentimentRequest o) { 121 checkAnalyzeSentimentRequest(api.AnalyzeSentimentRequest o) {
121 buildCounterAnalyzeSentimentRequest++; 122 buildCounterAnalyzeSentimentRequest++;
122 if (buildCounterAnalyzeSentimentRequest < 3) { 123 if (buildCounterAnalyzeSentimentRequest < 3) {
123 checkDocument(o.document); 124 checkDocument(o.document);
125 unittest.expect(o.encodingType, unittest.equals('foo'));
124 } 126 }
125 buildCounterAnalyzeSentimentRequest--; 127 buildCounterAnalyzeSentimentRequest--;
126 } 128 }
127 129
130 buildUnnamed3182() {
131 var o = new core.List<api.Sentence>();
132 o.add(buildSentence());
133 o.add(buildSentence());
134 return o;
135 }
136
137 checkUnnamed3182(core.List<api.Sentence> o) {
138 unittest.expect(o, unittest.hasLength(2));
139 checkSentence(o[0]);
140 checkSentence(o[1]);
141 }
142
128 core.int buildCounterAnalyzeSentimentResponse = 0; 143 core.int buildCounterAnalyzeSentimentResponse = 0;
129 buildAnalyzeSentimentResponse() { 144 buildAnalyzeSentimentResponse() {
130 var o = new api.AnalyzeSentimentResponse(); 145 var o = new api.AnalyzeSentimentResponse();
131 buildCounterAnalyzeSentimentResponse++; 146 buildCounterAnalyzeSentimentResponse++;
132 if (buildCounterAnalyzeSentimentResponse < 3) { 147 if (buildCounterAnalyzeSentimentResponse < 3) {
133 o.documentSentiment = buildSentiment(); 148 o.documentSentiment = buildSentiment();
134 o.language = "foo"; 149 o.language = "foo";
150 o.sentences = buildUnnamed3182();
135 } 151 }
136 buildCounterAnalyzeSentimentResponse--; 152 buildCounterAnalyzeSentimentResponse--;
137 return o; 153 return o;
138 } 154 }
139 155
140 checkAnalyzeSentimentResponse(api.AnalyzeSentimentResponse o) { 156 checkAnalyzeSentimentResponse(api.AnalyzeSentimentResponse o) {
141 buildCounterAnalyzeSentimentResponse++; 157 buildCounterAnalyzeSentimentResponse++;
142 if (buildCounterAnalyzeSentimentResponse < 3) { 158 if (buildCounterAnalyzeSentimentResponse < 3) {
143 checkSentiment(o.documentSentiment); 159 checkSentiment(o.documentSentiment);
144 unittest.expect(o.language, unittest.equals('foo')); 160 unittest.expect(o.language, unittest.equals('foo'));
161 checkUnnamed3182(o.sentences);
145 } 162 }
146 buildCounterAnalyzeSentimentResponse--; 163 buildCounterAnalyzeSentimentResponse--;
147 } 164 }
148 165
166 core.int buildCounterAnalyzeSyntaxRequest = 0;
167 buildAnalyzeSyntaxRequest() {
168 var o = new api.AnalyzeSyntaxRequest();
169 buildCounterAnalyzeSyntaxRequest++;
170 if (buildCounterAnalyzeSyntaxRequest < 3) {
171 o.document = buildDocument();
172 o.encodingType = "foo";
173 }
174 buildCounterAnalyzeSyntaxRequest--;
175 return o;
176 }
177
178 checkAnalyzeSyntaxRequest(api.AnalyzeSyntaxRequest o) {
179 buildCounterAnalyzeSyntaxRequest++;
180 if (buildCounterAnalyzeSyntaxRequest < 3) {
181 checkDocument(o.document);
182 unittest.expect(o.encodingType, unittest.equals('foo'));
183 }
184 buildCounterAnalyzeSyntaxRequest--;
185 }
186
187 buildUnnamed3183() {
188 var o = new core.List<api.Sentence>();
189 o.add(buildSentence());
190 o.add(buildSentence());
191 return o;
192 }
193
194 checkUnnamed3183(core.List<api.Sentence> o) {
195 unittest.expect(o, unittest.hasLength(2));
196 checkSentence(o[0]);
197 checkSentence(o[1]);
198 }
199
200 buildUnnamed3184() {
201 var o = new core.List<api.Token>();
202 o.add(buildToken());
203 o.add(buildToken());
204 return o;
205 }
206
207 checkUnnamed3184(core.List<api.Token> o) {
208 unittest.expect(o, unittest.hasLength(2));
209 checkToken(o[0]);
210 checkToken(o[1]);
211 }
212
213 core.int buildCounterAnalyzeSyntaxResponse = 0;
214 buildAnalyzeSyntaxResponse() {
215 var o = new api.AnalyzeSyntaxResponse();
216 buildCounterAnalyzeSyntaxResponse++;
217 if (buildCounterAnalyzeSyntaxResponse < 3) {
218 o.language = "foo";
219 o.sentences = buildUnnamed3183();
220 o.tokens = buildUnnamed3184();
221 }
222 buildCounterAnalyzeSyntaxResponse--;
223 return o;
224 }
225
226 checkAnalyzeSyntaxResponse(api.AnalyzeSyntaxResponse o) {
227 buildCounterAnalyzeSyntaxResponse++;
228 if (buildCounterAnalyzeSyntaxResponse < 3) {
229 unittest.expect(o.language, unittest.equals('foo'));
230 checkUnnamed3183(o.sentences);
231 checkUnnamed3184(o.tokens);
232 }
233 buildCounterAnalyzeSyntaxResponse--;
234 }
235
149 core.int buildCounterAnnotateTextRequest = 0; 236 core.int buildCounterAnnotateTextRequest = 0;
150 buildAnnotateTextRequest() { 237 buildAnnotateTextRequest() {
151 var o = new api.AnnotateTextRequest(); 238 var o = new api.AnnotateTextRequest();
152 buildCounterAnnotateTextRequest++; 239 buildCounterAnnotateTextRequest++;
153 if (buildCounterAnnotateTextRequest < 3) { 240 if (buildCounterAnnotateTextRequest < 3) {
154 o.document = buildDocument(); 241 o.document = buildDocument();
155 o.encodingType = "foo"; 242 o.encodingType = "foo";
156 o.features = buildFeatures(); 243 o.features = buildFeatures();
157 } 244 }
158 buildCounterAnnotateTextRequest--; 245 buildCounterAnnotateTextRequest--;
159 return o; 246 return o;
160 } 247 }
161 248
162 checkAnnotateTextRequest(api.AnnotateTextRequest o) { 249 checkAnnotateTextRequest(api.AnnotateTextRequest o) {
163 buildCounterAnnotateTextRequest++; 250 buildCounterAnnotateTextRequest++;
164 if (buildCounterAnnotateTextRequest < 3) { 251 if (buildCounterAnnotateTextRequest < 3) {
165 checkDocument(o.document); 252 checkDocument(o.document);
166 unittest.expect(o.encodingType, unittest.equals('foo')); 253 unittest.expect(o.encodingType, unittest.equals('foo'));
167 checkFeatures(o.features); 254 checkFeatures(o.features);
168 } 255 }
169 buildCounterAnnotateTextRequest--; 256 buildCounterAnnotateTextRequest--;
170 } 257 }
171 258
172 buildUnnamed3474() { 259 buildUnnamed3185() {
173 var o = new core.List<api.Entity>(); 260 var o = new core.List<api.Entity>();
174 o.add(buildEntity()); 261 o.add(buildEntity());
175 o.add(buildEntity()); 262 o.add(buildEntity());
176 return o; 263 return o;
177 } 264 }
178 265
179 checkUnnamed3474(core.List<api.Entity> o) { 266 checkUnnamed3185(core.List<api.Entity> o) {
180 unittest.expect(o, unittest.hasLength(2)); 267 unittest.expect(o, unittest.hasLength(2));
181 checkEntity(o[0]); 268 checkEntity(o[0]);
182 checkEntity(o[1]); 269 checkEntity(o[1]);
183 } 270 }
184 271
185 buildUnnamed3475() { 272 buildUnnamed3186() {
186 var o = new core.List<api.Sentence>(); 273 var o = new core.List<api.Sentence>();
187 o.add(buildSentence()); 274 o.add(buildSentence());
188 o.add(buildSentence()); 275 o.add(buildSentence());
189 return o; 276 return o;
190 } 277 }
191 278
192 checkUnnamed3475(core.List<api.Sentence> o) { 279 checkUnnamed3186(core.List<api.Sentence> o) {
193 unittest.expect(o, unittest.hasLength(2)); 280 unittest.expect(o, unittest.hasLength(2));
194 checkSentence(o[0]); 281 checkSentence(o[0]);
195 checkSentence(o[1]); 282 checkSentence(o[1]);
196 } 283 }
197 284
198 buildUnnamed3476() { 285 buildUnnamed3187() {
199 var o = new core.List<api.Token>(); 286 var o = new core.List<api.Token>();
200 o.add(buildToken()); 287 o.add(buildToken());
201 o.add(buildToken()); 288 o.add(buildToken());
202 return o; 289 return o;
203 } 290 }
204 291
205 checkUnnamed3476(core.List<api.Token> o) { 292 checkUnnamed3187(core.List<api.Token> o) {
206 unittest.expect(o, unittest.hasLength(2)); 293 unittest.expect(o, unittest.hasLength(2));
207 checkToken(o[0]); 294 checkToken(o[0]);
208 checkToken(o[1]); 295 checkToken(o[1]);
209 } 296 }
210 297
211 core.int buildCounterAnnotateTextResponse = 0; 298 core.int buildCounterAnnotateTextResponse = 0;
212 buildAnnotateTextResponse() { 299 buildAnnotateTextResponse() {
213 var o = new api.AnnotateTextResponse(); 300 var o = new api.AnnotateTextResponse();
214 buildCounterAnnotateTextResponse++; 301 buildCounterAnnotateTextResponse++;
215 if (buildCounterAnnotateTextResponse < 3) { 302 if (buildCounterAnnotateTextResponse < 3) {
216 o.documentSentiment = buildSentiment(); 303 o.documentSentiment = buildSentiment();
217 o.entities = buildUnnamed3474(); 304 o.entities = buildUnnamed3185();
218 o.language = "foo"; 305 o.language = "foo";
219 o.sentences = buildUnnamed3475(); 306 o.sentences = buildUnnamed3186();
220 o.tokens = buildUnnamed3476(); 307 o.tokens = buildUnnamed3187();
221 } 308 }
222 buildCounterAnnotateTextResponse--; 309 buildCounterAnnotateTextResponse--;
223 return o; 310 return o;
224 } 311 }
225 312
226 checkAnnotateTextResponse(api.AnnotateTextResponse o) { 313 checkAnnotateTextResponse(api.AnnotateTextResponse o) {
227 buildCounterAnnotateTextResponse++; 314 buildCounterAnnotateTextResponse++;
228 if (buildCounterAnnotateTextResponse < 3) { 315 if (buildCounterAnnotateTextResponse < 3) {
229 checkSentiment(o.documentSentiment); 316 checkSentiment(o.documentSentiment);
230 checkUnnamed3474(o.entities); 317 checkUnnamed3185(o.entities);
231 unittest.expect(o.language, unittest.equals('foo')); 318 unittest.expect(o.language, unittest.equals('foo'));
232 checkUnnamed3475(o.sentences); 319 checkUnnamed3186(o.sentences);
233 checkUnnamed3476(o.tokens); 320 checkUnnamed3187(o.tokens);
234 } 321 }
235 buildCounterAnnotateTextResponse--; 322 buildCounterAnnotateTextResponse--;
236 } 323 }
237 324
238 core.int buildCounterDependencyEdge = 0; 325 core.int buildCounterDependencyEdge = 0;
239 buildDependencyEdge() { 326 buildDependencyEdge() {
240 var o = new api.DependencyEdge(); 327 var o = new api.DependencyEdge();
241 buildCounterDependencyEdge++; 328 buildCounterDependencyEdge++;
242 if (buildCounterDependencyEdge < 3) { 329 if (buildCounterDependencyEdge < 3) {
243 o.headTokenIndex = 42; 330 o.headTokenIndex = 42;
(...skipping 30 matching lines...) Expand all
274 buildCounterDocument++; 361 buildCounterDocument++;
275 if (buildCounterDocument < 3) { 362 if (buildCounterDocument < 3) {
276 unittest.expect(o.content, unittest.equals('foo')); 363 unittest.expect(o.content, unittest.equals('foo'));
277 unittest.expect(o.gcsContentUri, unittest.equals('foo')); 364 unittest.expect(o.gcsContentUri, unittest.equals('foo'));
278 unittest.expect(o.language, unittest.equals('foo')); 365 unittest.expect(o.language, unittest.equals('foo'));
279 unittest.expect(o.type, unittest.equals('foo')); 366 unittest.expect(o.type, unittest.equals('foo'));
280 } 367 }
281 buildCounterDocument--; 368 buildCounterDocument--;
282 } 369 }
283 370
284 buildUnnamed3477() { 371 buildUnnamed3188() {
285 var o = new core.List<api.EntityMention>(); 372 var o = new core.List<api.EntityMention>();
286 o.add(buildEntityMention()); 373 o.add(buildEntityMention());
287 o.add(buildEntityMention()); 374 o.add(buildEntityMention());
288 return o; 375 return o;
289 } 376 }
290 377
291 checkUnnamed3477(core.List<api.EntityMention> o) { 378 checkUnnamed3188(core.List<api.EntityMention> o) {
292 unittest.expect(o, unittest.hasLength(2)); 379 unittest.expect(o, unittest.hasLength(2));
293 checkEntityMention(o[0]); 380 checkEntityMention(o[0]);
294 checkEntityMention(o[1]); 381 checkEntityMention(o[1]);
295 } 382 }
296 383
297 buildUnnamed3478() { 384 buildUnnamed3189() {
298 var o = new core.Map<core.String, core.String>(); 385 var o = new core.Map<core.String, core.String>();
299 o["x"] = "foo"; 386 o["x"] = "foo";
300 o["y"] = "foo"; 387 o["y"] = "foo";
301 return o; 388 return o;
302 } 389 }
303 390
304 checkUnnamed3478(core.Map<core.String, core.String> o) { 391 checkUnnamed3189(core.Map<core.String, core.String> o) {
305 unittest.expect(o, unittest.hasLength(2)); 392 unittest.expect(o, unittest.hasLength(2));
306 unittest.expect(o["x"], unittest.equals('foo')); 393 unittest.expect(o["x"], unittest.equals('foo'));
307 unittest.expect(o["y"], unittest.equals('foo')); 394 unittest.expect(o["y"], unittest.equals('foo'));
308 } 395 }
309 396
310 core.int buildCounterEntity = 0; 397 core.int buildCounterEntity = 0;
311 buildEntity() { 398 buildEntity() {
312 var o = new api.Entity(); 399 var o = new api.Entity();
313 buildCounterEntity++; 400 buildCounterEntity++;
314 if (buildCounterEntity < 3) { 401 if (buildCounterEntity < 3) {
315 o.mentions = buildUnnamed3477(); 402 o.mentions = buildUnnamed3188();
316 o.metadata = buildUnnamed3478(); 403 o.metadata = buildUnnamed3189();
317 o.name = "foo"; 404 o.name = "foo";
318 o.salience = 42.0; 405 o.salience = 42.0;
319 o.type = "foo"; 406 o.type = "foo";
320 } 407 }
321 buildCounterEntity--; 408 buildCounterEntity--;
322 return o; 409 return o;
323 } 410 }
324 411
325 checkEntity(api.Entity o) { 412 checkEntity(api.Entity o) {
326 buildCounterEntity++; 413 buildCounterEntity++;
327 if (buildCounterEntity < 3) { 414 if (buildCounterEntity < 3) {
328 checkUnnamed3477(o.mentions); 415 checkUnnamed3188(o.mentions);
329 checkUnnamed3478(o.metadata); 416 checkUnnamed3189(o.metadata);
330 unittest.expect(o.name, unittest.equals('foo')); 417 unittest.expect(o.name, unittest.equals('foo'));
331 unittest.expect(o.salience, unittest.equals(42.0)); 418 unittest.expect(o.salience, unittest.equals(42.0));
332 unittest.expect(o.type, unittest.equals('foo')); 419 unittest.expect(o.type, unittest.equals('foo'));
333 } 420 }
334 buildCounterEntity--; 421 buildCounterEntity--;
335 } 422 }
336 423
337 core.int buildCounterEntityMention = 0; 424 core.int buildCounterEntityMention = 0;
338 buildEntityMention() { 425 buildEntityMention() {
339 var o = new api.EntityMention(); 426 var o = new api.EntityMention();
340 buildCounterEntityMention++; 427 buildCounterEntityMention++;
341 if (buildCounterEntityMention < 3) { 428 if (buildCounterEntityMention < 3) {
342 o.text = buildTextSpan(); 429 o.text = buildTextSpan();
430 o.type = "foo";
343 } 431 }
344 buildCounterEntityMention--; 432 buildCounterEntityMention--;
345 return o; 433 return o;
346 } 434 }
347 435
348 checkEntityMention(api.EntityMention o) { 436 checkEntityMention(api.EntityMention o) {
349 buildCounterEntityMention++; 437 buildCounterEntityMention++;
350 if (buildCounterEntityMention < 3) { 438 if (buildCounterEntityMention < 3) {
351 checkTextSpan(o.text); 439 checkTextSpan(o.text);
440 unittest.expect(o.type, unittest.equals('foo'));
352 } 441 }
353 buildCounterEntityMention--; 442 buildCounterEntityMention--;
354 } 443 }
355 444
356 core.int buildCounterFeatures = 0; 445 core.int buildCounterFeatures = 0;
357 buildFeatures() { 446 buildFeatures() {
358 var o = new api.Features(); 447 var o = new api.Features();
359 buildCounterFeatures++; 448 buildCounterFeatures++;
360 if (buildCounterFeatures < 3) { 449 if (buildCounterFeatures < 3) {
361 o.extractDocumentSentiment = true; 450 o.extractDocumentSentiment = true;
(...skipping 12 matching lines...) Expand all
374 unittest.expect(o.extractSyntax, unittest.isTrue); 463 unittest.expect(o.extractSyntax, unittest.isTrue);
375 } 464 }
376 buildCounterFeatures--; 465 buildCounterFeatures--;
377 } 466 }
378 467
379 core.int buildCounterPartOfSpeech = 0; 468 core.int buildCounterPartOfSpeech = 0;
380 buildPartOfSpeech() { 469 buildPartOfSpeech() {
381 var o = new api.PartOfSpeech(); 470 var o = new api.PartOfSpeech();
382 buildCounterPartOfSpeech++; 471 buildCounterPartOfSpeech++;
383 if (buildCounterPartOfSpeech < 3) { 472 if (buildCounterPartOfSpeech < 3) {
473 o.aspect = "foo";
474 o.case_ = "foo";
475 o.form = "foo";
476 o.gender = "foo";
477 o.mood = "foo";
478 o.number = "foo";
479 o.person = "foo";
480 o.proper = "foo";
481 o.reciprocity = "foo";
384 o.tag = "foo"; 482 o.tag = "foo";
483 o.tense = "foo";
484 o.voice = "foo";
385 } 485 }
386 buildCounterPartOfSpeech--; 486 buildCounterPartOfSpeech--;
387 return o; 487 return o;
388 } 488 }
389 489
390 checkPartOfSpeech(api.PartOfSpeech o) { 490 checkPartOfSpeech(api.PartOfSpeech o) {
391 buildCounterPartOfSpeech++; 491 buildCounterPartOfSpeech++;
392 if (buildCounterPartOfSpeech < 3) { 492 if (buildCounterPartOfSpeech < 3) {
493 unittest.expect(o.aspect, unittest.equals('foo'));
494 unittest.expect(o.case_, unittest.equals('foo'));
495 unittest.expect(o.form, unittest.equals('foo'));
496 unittest.expect(o.gender, unittest.equals('foo'));
497 unittest.expect(o.mood, unittest.equals('foo'));
498 unittest.expect(o.number, unittest.equals('foo'));
499 unittest.expect(o.person, unittest.equals('foo'));
500 unittest.expect(o.proper, unittest.equals('foo'));
501 unittest.expect(o.reciprocity, unittest.equals('foo'));
393 unittest.expect(o.tag, unittest.equals('foo')); 502 unittest.expect(o.tag, unittest.equals('foo'));
503 unittest.expect(o.tense, unittest.equals('foo'));
504 unittest.expect(o.voice, unittest.equals('foo'));
394 } 505 }
395 buildCounterPartOfSpeech--; 506 buildCounterPartOfSpeech--;
396 } 507 }
397 508
398 core.int buildCounterSentence = 0; 509 core.int buildCounterSentence = 0;
399 buildSentence() { 510 buildSentence() {
400 var o = new api.Sentence(); 511 var o = new api.Sentence();
401 buildCounterSentence++; 512 buildCounterSentence++;
402 if (buildCounterSentence < 3) { 513 if (buildCounterSentence < 3) {
514 o.sentiment = buildSentiment();
403 o.text = buildTextSpan(); 515 o.text = buildTextSpan();
404 } 516 }
405 buildCounterSentence--; 517 buildCounterSentence--;
406 return o; 518 return o;
407 } 519 }
408 520
409 checkSentence(api.Sentence o) { 521 checkSentence(api.Sentence o) {
410 buildCounterSentence++; 522 buildCounterSentence++;
411 if (buildCounterSentence < 3) { 523 if (buildCounterSentence < 3) {
524 checkSentiment(o.sentiment);
412 checkTextSpan(o.text); 525 checkTextSpan(o.text);
413 } 526 }
414 buildCounterSentence--; 527 buildCounterSentence--;
415 } 528 }
416 529
417 core.int buildCounterSentiment = 0; 530 core.int buildCounterSentiment = 0;
418 buildSentiment() { 531 buildSentiment() {
419 var o = new api.Sentiment(); 532 var o = new api.Sentiment();
420 buildCounterSentiment++; 533 buildCounterSentiment++;
421 if (buildCounterSentiment < 3) { 534 if (buildCounterSentiment < 3) {
422 o.magnitude = 42.0; 535 o.magnitude = 42.0;
423 o.polarity = 42.0; 536 o.polarity = 42.0;
537 o.score = 42.0;
424 } 538 }
425 buildCounterSentiment--; 539 buildCounterSentiment--;
426 return o; 540 return o;
427 } 541 }
428 542
429 checkSentiment(api.Sentiment o) { 543 checkSentiment(api.Sentiment o) {
430 buildCounterSentiment++; 544 buildCounterSentiment++;
431 if (buildCounterSentiment < 3) { 545 if (buildCounterSentiment < 3) {
432 unittest.expect(o.magnitude, unittest.equals(42.0)); 546 unittest.expect(o.magnitude, unittest.equals(42.0));
433 unittest.expect(o.polarity, unittest.equals(42.0)); 547 unittest.expect(o.polarity, unittest.equals(42.0));
548 unittest.expect(o.score, unittest.equals(42.0));
434 } 549 }
435 buildCounterSentiment--; 550 buildCounterSentiment--;
436 } 551 }
437 552
438 buildUnnamed3479() { 553 buildUnnamed3190() {
439 var o = new core.Map<core.String, core.Object>(); 554 var o = new core.Map<core.String, core.Object>();
440 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 555 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
441 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 556 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
442 return o; 557 return o;
443 } 558 }
444 559
445 checkUnnamed3479(core.Map<core.String, core.Object> o) { 560 checkUnnamed3190(core.Map<core.String, core.Object> o) {
446 unittest.expect(o, unittest.hasLength(2)); 561 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')); 562 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')); 563 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 } 564 }
450 565
451 buildUnnamed3480() { 566 buildUnnamed3191() {
452 var o = new core.List<core.Map<core.String, core.Object>>(); 567 var o = new core.List<core.Map<core.String, core.Object>>();
453 o.add(buildUnnamed3479()); 568 o.add(buildUnnamed3190());
454 o.add(buildUnnamed3479()); 569 o.add(buildUnnamed3190());
455 return o; 570 return o;
456 } 571 }
457 572
458 checkUnnamed3480(core.List<core.Map<core.String, core.Object>> o) { 573 checkUnnamed3191(core.List<core.Map<core.String, core.Object>> o) {
459 unittest.expect(o, unittest.hasLength(2)); 574 unittest.expect(o, unittest.hasLength(2));
460 checkUnnamed3479(o[0]); 575 checkUnnamed3190(o[0]);
461 checkUnnamed3479(o[1]); 576 checkUnnamed3190(o[1]);
462 } 577 }
463 578
464 core.int buildCounterStatus = 0; 579 core.int buildCounterStatus = 0;
465 buildStatus() { 580 buildStatus() {
466 var o = new api.Status(); 581 var o = new api.Status();
467 buildCounterStatus++; 582 buildCounterStatus++;
468 if (buildCounterStatus < 3) { 583 if (buildCounterStatus < 3) {
469 o.code = 42; 584 o.code = 42;
470 o.details = buildUnnamed3480(); 585 o.details = buildUnnamed3191();
471 o.message = "foo"; 586 o.message = "foo";
472 } 587 }
473 buildCounterStatus--; 588 buildCounterStatus--;
474 return o; 589 return o;
475 } 590 }
476 591
477 checkStatus(api.Status o) { 592 checkStatus(api.Status o) {
478 buildCounterStatus++; 593 buildCounterStatus++;
479 if (buildCounterStatus < 3) { 594 if (buildCounterStatus < 3) {
480 unittest.expect(o.code, unittest.equals(42)); 595 unittest.expect(o.code, unittest.equals(42));
481 checkUnnamed3480(o.details); 596 checkUnnamed3191(o.details);
482 unittest.expect(o.message, unittest.equals('foo')); 597 unittest.expect(o.message, unittest.equals('foo'));
483 } 598 }
484 buildCounterStatus--; 599 buildCounterStatus--;
485 } 600 }
486 601
487 core.int buildCounterTextSpan = 0; 602 core.int buildCounterTextSpan = 0;
488 buildTextSpan() { 603 buildTextSpan() {
489 var o = new api.TextSpan(); 604 var o = new api.TextSpan();
490 buildCounterTextSpan++; 605 buildCounterTextSpan++;
491 if (buildCounterTextSpan < 3) { 606 if (buildCounterTextSpan < 3) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 676
562 unittest.group("obj-schema-AnalyzeSentimentResponse", () { 677 unittest.group("obj-schema-AnalyzeSentimentResponse", () {
563 unittest.test("to-json--from-json", () { 678 unittest.test("to-json--from-json", () {
564 var o = buildAnalyzeSentimentResponse(); 679 var o = buildAnalyzeSentimentResponse();
565 var od = new api.AnalyzeSentimentResponse.fromJson(o.toJson()); 680 var od = new api.AnalyzeSentimentResponse.fromJson(o.toJson());
566 checkAnalyzeSentimentResponse(od); 681 checkAnalyzeSentimentResponse(od);
567 }); 682 });
568 }); 683 });
569 684
570 685
686 unittest.group("obj-schema-AnalyzeSyntaxRequest", () {
687 unittest.test("to-json--from-json", () {
688 var o = buildAnalyzeSyntaxRequest();
689 var od = new api.AnalyzeSyntaxRequest.fromJson(o.toJson());
690 checkAnalyzeSyntaxRequest(od);
691 });
692 });
693
694
695 unittest.group("obj-schema-AnalyzeSyntaxResponse", () {
696 unittest.test("to-json--from-json", () {
697 var o = buildAnalyzeSyntaxResponse();
698 var od = new api.AnalyzeSyntaxResponse.fromJson(o.toJson());
699 checkAnalyzeSyntaxResponse(od);
700 });
701 });
702
703
571 unittest.group("obj-schema-AnnotateTextRequest", () { 704 unittest.group("obj-schema-AnnotateTextRequest", () {
572 unittest.test("to-json--from-json", () { 705 unittest.test("to-json--from-json", () {
573 var o = buildAnnotateTextRequest(); 706 var o = buildAnnotateTextRequest();
574 var od = new api.AnnotateTextRequest.fromJson(o.toJson()); 707 var od = new api.AnnotateTextRequest.fromJson(o.toJson());
575 checkAnnotateTextRequest(od); 708 checkAnnotateTextRequest(od);
576 }); 709 });
577 }); 710 });
578 711
579 712
580 unittest.group("obj-schema-AnnotateTextResponse", () { 713 unittest.group("obj-schema-AnnotateTextResponse", () {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 "content-type" : "application/json; charset=utf-8", 906 "content-type" : "application/json; charset=utf-8",
774 }; 907 };
775 var resp = convert.JSON.encode(buildAnalyzeSentimentResponse()); 908 var resp = convert.JSON.encode(buildAnalyzeSentimentResponse());
776 return new async.Future.value(stringResponse(200, h, resp)); 909 return new async.Future.value(stringResponse(200, h, resp));
777 }), true); 910 }), true);
778 res.analyzeSentiment(arg_request).then(unittest.expectAsync(((api.AnalyzeS entimentResponse response) { 911 res.analyzeSentiment(arg_request).then(unittest.expectAsync(((api.AnalyzeS entimentResponse response) {
779 checkAnalyzeSentimentResponse(response); 912 checkAnalyzeSentimentResponse(response);
780 }))); 913 })));
781 }); 914 });
782 915
916 unittest.test("method--analyzeSyntax", () {
917
918 var mock = new HttpServerMock();
919 api.DocumentsResourceApi res = new api.LanguageApi(mock).documents;
920 var arg_request = buildAnalyzeSyntaxRequest();
921 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
922 var obj = new api.AnalyzeSyntaxRequest.fromJson(json);
923 checkAnalyzeSyntaxRequest(obj);
924
925 var path = (req.url).path;
926 var pathOffset = 0;
927 var index;
928 var subPart;
929 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
930 pathOffset += 1;
931 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq uals("v1beta1/documents:analyzeSyntax"));
932 pathOffset += 31;
933
934 var query = (req.url).query;
935 var queryOffset = 0;
936 var queryMap = {};
937 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
938 parseBool(n) {
939 if (n == "true") return true;
940 if (n == "false") return false;
941 if (n == null) return null;
942 throw new core.ArgumentError("Invalid boolean: $n");
943 }
944 if (query.length > 0) {
945 for (var part in query.split("&")) {
946 var keyvalue = part.split("=");
947 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
948 }
949 }
950
951
952 var h = {
953 "content-type" : "application/json; charset=utf-8",
954 };
955 var resp = convert.JSON.encode(buildAnalyzeSyntaxResponse());
956 return new async.Future.value(stringResponse(200, h, resp));
957 }), true);
958 res.analyzeSyntax(arg_request).then(unittest.expectAsync(((api.AnalyzeSynt axResponse response) {
959 checkAnalyzeSyntaxResponse(response);
960 })));
961 });
962
783 unittest.test("method--annotateText", () { 963 unittest.test("method--annotateText", () {
784 964
785 var mock = new HttpServerMock(); 965 var mock = new HttpServerMock();
786 api.DocumentsResourceApi res = new api.LanguageApi(mock).documents; 966 api.DocumentsResourceApi res = new api.LanguageApi(mock).documents;
787 var arg_request = buildAnnotateTextRequest(); 967 var arg_request = buildAnnotateTextRequest();
788 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 968 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
789 var obj = new api.AnnotateTextRequest.fromJson(json); 969 var obj = new api.AnnotateTextRequest.fromJson(json);
790 checkAnnotateTextRequest(obj); 970 checkAnnotateTextRequest(obj);
791 971
792 var path = (req.url).path; 972 var path = (req.url).path;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 res.annotateText(arg_request).then(unittest.expectAsync(((api.AnnotateText Response response) { 1005 res.annotateText(arg_request).then(unittest.expectAsync(((api.AnnotateText Response response) {
826 checkAnnotateTextResponse(response); 1006 checkAnnotateTextResponse(response);
827 }))); 1007 })));
828 }); 1008 });
829 1009
830 }); 1010 });
831 1011
832 1012
833 } 1013 }
834 1014
OLDNEW
« no previous file with comments | « generated/googleapis_beta/test/genomics/v1beta2_test.dart ('k') | generated/googleapis_beta/test/logging/v2beta1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698