OLD | NEW |
| (Empty) |
1 library googleapis.books.v1.test; | |
2 | |
3 import "dart:core" as core; | |
4 import "dart:collection" as collection; | |
5 import "dart:async" as async; | |
6 import "dart:convert" as convert; | |
7 | |
8 import 'package:http/http.dart' as http; | |
9 import 'package:http/testing.dart' as http_testing; | |
10 import 'package:unittest/unittest.dart' as unittest; | |
11 import 'package:googleapis/common/common.dart' as common; | |
12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
13 import '../common/common_internal_test.dart' as common_test; | |
14 | |
15 import 'package:googleapis/books/v1.dart' as api; | |
16 | |
17 | |
18 | |
19 core.int buildCounterAnnotationClientVersionRanges = 0; | |
20 buildAnnotationClientVersionRanges() { | |
21 var o = new api.AnnotationClientVersionRanges(); | |
22 buildCounterAnnotationClientVersionRanges++; | |
23 if (buildCounterAnnotationClientVersionRanges < 3) { | |
24 o.cfiRange = buildBooksAnnotationsRange(); | |
25 o.contentVersion = "foo"; | |
26 o.gbImageRange = buildBooksAnnotationsRange(); | |
27 o.gbTextRange = buildBooksAnnotationsRange(); | |
28 o.imageCfiRange = buildBooksAnnotationsRange(); | |
29 } | |
30 buildCounterAnnotationClientVersionRanges--; | |
31 return o; | |
32 } | |
33 | |
34 checkAnnotationClientVersionRanges(api.AnnotationClientVersionRanges o) { | |
35 buildCounterAnnotationClientVersionRanges++; | |
36 if (buildCounterAnnotationClientVersionRanges < 3) { | |
37 checkBooksAnnotationsRange(o.cfiRange); | |
38 unittest.expect(o.contentVersion, unittest.equals('foo')); | |
39 checkBooksAnnotationsRange(o.gbImageRange); | |
40 checkBooksAnnotationsRange(o.gbTextRange); | |
41 checkBooksAnnotationsRange(o.imageCfiRange); | |
42 } | |
43 buildCounterAnnotationClientVersionRanges--; | |
44 } | |
45 | |
46 core.int buildCounterAnnotationCurrentVersionRanges = 0; | |
47 buildAnnotationCurrentVersionRanges() { | |
48 var o = new api.AnnotationCurrentVersionRanges(); | |
49 buildCounterAnnotationCurrentVersionRanges++; | |
50 if (buildCounterAnnotationCurrentVersionRanges < 3) { | |
51 o.cfiRange = buildBooksAnnotationsRange(); | |
52 o.contentVersion = "foo"; | |
53 o.gbImageRange = buildBooksAnnotationsRange(); | |
54 o.gbTextRange = buildBooksAnnotationsRange(); | |
55 o.imageCfiRange = buildBooksAnnotationsRange(); | |
56 } | |
57 buildCounterAnnotationCurrentVersionRanges--; | |
58 return o; | |
59 } | |
60 | |
61 checkAnnotationCurrentVersionRanges(api.AnnotationCurrentVersionRanges o) { | |
62 buildCounterAnnotationCurrentVersionRanges++; | |
63 if (buildCounterAnnotationCurrentVersionRanges < 3) { | |
64 checkBooksAnnotationsRange(o.cfiRange); | |
65 unittest.expect(o.contentVersion, unittest.equals('foo')); | |
66 checkBooksAnnotationsRange(o.gbImageRange); | |
67 checkBooksAnnotationsRange(o.gbTextRange); | |
68 checkBooksAnnotationsRange(o.imageCfiRange); | |
69 } | |
70 buildCounterAnnotationCurrentVersionRanges--; | |
71 } | |
72 | |
73 core.int buildCounterAnnotationLayerSummary = 0; | |
74 buildAnnotationLayerSummary() { | |
75 var o = new api.AnnotationLayerSummary(); | |
76 buildCounterAnnotationLayerSummary++; | |
77 if (buildCounterAnnotationLayerSummary < 3) { | |
78 o.allowedCharacterCount = 42; | |
79 o.limitType = "foo"; | |
80 o.remainingCharacterCount = 42; | |
81 } | |
82 buildCounterAnnotationLayerSummary--; | |
83 return o; | |
84 } | |
85 | |
86 checkAnnotationLayerSummary(api.AnnotationLayerSummary o) { | |
87 buildCounterAnnotationLayerSummary++; | |
88 if (buildCounterAnnotationLayerSummary < 3) { | |
89 unittest.expect(o.allowedCharacterCount, unittest.equals(42)); | |
90 unittest.expect(o.limitType, unittest.equals('foo')); | |
91 unittest.expect(o.remainingCharacterCount, unittest.equals(42)); | |
92 } | |
93 buildCounterAnnotationLayerSummary--; | |
94 } | |
95 | |
96 buildUnnamed498() { | |
97 var o = new core.List<core.String>(); | |
98 o.add("foo"); | |
99 o.add("foo"); | |
100 return o; | |
101 } | |
102 | |
103 checkUnnamed498(core.List<core.String> o) { | |
104 unittest.expect(o, unittest.hasLength(2)); | |
105 unittest.expect(o[0], unittest.equals('foo')); | |
106 unittest.expect(o[1], unittest.equals('foo')); | |
107 } | |
108 | |
109 core.int buildCounterAnnotation = 0; | |
110 buildAnnotation() { | |
111 var o = new api.Annotation(); | |
112 buildCounterAnnotation++; | |
113 if (buildCounterAnnotation < 3) { | |
114 o.afterSelectedText = "foo"; | |
115 o.beforeSelectedText = "foo"; | |
116 o.clientVersionRanges = buildAnnotationClientVersionRanges(); | |
117 o.created = core.DateTime.parse("2002-02-27T14:01:02"); | |
118 o.currentVersionRanges = buildAnnotationCurrentVersionRanges(); | |
119 o.data = "foo"; | |
120 o.deleted = true; | |
121 o.highlightStyle = "foo"; | |
122 o.id = "foo"; | |
123 o.kind = "foo"; | |
124 o.layerId = "foo"; | |
125 o.layerSummary = buildAnnotationLayerSummary(); | |
126 o.pageIds = buildUnnamed498(); | |
127 o.selectedText = "foo"; | |
128 o.selfLink = "foo"; | |
129 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
130 o.volumeId = "foo"; | |
131 } | |
132 buildCounterAnnotation--; | |
133 return o; | |
134 } | |
135 | |
136 checkAnnotation(api.Annotation o) { | |
137 buildCounterAnnotation++; | |
138 if (buildCounterAnnotation < 3) { | |
139 unittest.expect(o.afterSelectedText, unittest.equals('foo')); | |
140 unittest.expect(o.beforeSelectedText, unittest.equals('foo')); | |
141 checkAnnotationClientVersionRanges(o.clientVersionRanges); | |
142 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
143 checkAnnotationCurrentVersionRanges(o.currentVersionRanges); | |
144 unittest.expect(o.data, unittest.equals('foo')); | |
145 unittest.expect(o.deleted, unittest.isTrue); | |
146 unittest.expect(o.highlightStyle, unittest.equals('foo')); | |
147 unittest.expect(o.id, unittest.equals('foo')); | |
148 unittest.expect(o.kind, unittest.equals('foo')); | |
149 unittest.expect(o.layerId, unittest.equals('foo')); | |
150 checkAnnotationLayerSummary(o.layerSummary); | |
151 checkUnnamed498(o.pageIds); | |
152 unittest.expect(o.selectedText, unittest.equals('foo')); | |
153 unittest.expect(o.selfLink, unittest.equals('foo')); | |
154 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
155 unittest.expect(o.volumeId, unittest.equals('foo')); | |
156 } | |
157 buildCounterAnnotation--; | |
158 } | |
159 | |
160 core.int buildCounterAnnotationdata = 0; | |
161 buildAnnotationdata() { | |
162 var o = new api.Annotationdata(); | |
163 buildCounterAnnotationdata++; | |
164 if (buildCounterAnnotationdata < 3) { | |
165 o.annotationType = "foo"; | |
166 o.data = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
167 o.encodedData = "foo"; | |
168 o.id = "foo"; | |
169 o.kind = "foo"; | |
170 o.layerId = "foo"; | |
171 o.selfLink = "foo"; | |
172 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
173 o.volumeId = "foo"; | |
174 } | |
175 buildCounterAnnotationdata--; | |
176 return o; | |
177 } | |
178 | |
179 checkAnnotationdata(api.Annotationdata o) { | |
180 buildCounterAnnotationdata++; | |
181 if (buildCounterAnnotationdata < 3) { | |
182 unittest.expect(o.annotationType, unittest.equals('foo')); | |
183 var casted1 = (o.data) as core.Map; unittest.expect(casted1, unittest.hasLen
gth(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.
expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"
], unittest.equals('foo')); | |
184 unittest.expect(o.encodedData, unittest.equals('foo')); | |
185 unittest.expect(o.id, unittest.equals('foo')); | |
186 unittest.expect(o.kind, unittest.equals('foo')); | |
187 unittest.expect(o.layerId, unittest.equals('foo')); | |
188 unittest.expect(o.selfLink, unittest.equals('foo')); | |
189 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
190 unittest.expect(o.volumeId, unittest.equals('foo')); | |
191 } | |
192 buildCounterAnnotationdata--; | |
193 } | |
194 | |
195 buildUnnamed499() { | |
196 var o = new core.List<api.Annotation>(); | |
197 o.add(buildAnnotation()); | |
198 o.add(buildAnnotation()); | |
199 return o; | |
200 } | |
201 | |
202 checkUnnamed499(core.List<api.Annotation> o) { | |
203 unittest.expect(o, unittest.hasLength(2)); | |
204 checkAnnotation(o[0]); | |
205 checkAnnotation(o[1]); | |
206 } | |
207 | |
208 core.int buildCounterAnnotations = 0; | |
209 buildAnnotations() { | |
210 var o = new api.Annotations(); | |
211 buildCounterAnnotations++; | |
212 if (buildCounterAnnotations < 3) { | |
213 o.items = buildUnnamed499(); | |
214 o.kind = "foo"; | |
215 o.nextPageToken = "foo"; | |
216 o.totalItems = 42; | |
217 } | |
218 buildCounterAnnotations--; | |
219 return o; | |
220 } | |
221 | |
222 checkAnnotations(api.Annotations o) { | |
223 buildCounterAnnotations++; | |
224 if (buildCounterAnnotations < 3) { | |
225 checkUnnamed499(o.items); | |
226 unittest.expect(o.kind, unittest.equals('foo')); | |
227 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
228 unittest.expect(o.totalItems, unittest.equals(42)); | |
229 } | |
230 buildCounterAnnotations--; | |
231 } | |
232 | |
233 core.int buildCounterAnnotationsSummaryLayers = 0; | |
234 buildAnnotationsSummaryLayers() { | |
235 var o = new api.AnnotationsSummaryLayers(); | |
236 buildCounterAnnotationsSummaryLayers++; | |
237 if (buildCounterAnnotationsSummaryLayers < 3) { | |
238 o.allowedCharacterCount = 42; | |
239 o.layerId = "foo"; | |
240 o.limitType = "foo"; | |
241 o.remainingCharacterCount = 42; | |
242 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
243 } | |
244 buildCounterAnnotationsSummaryLayers--; | |
245 return o; | |
246 } | |
247 | |
248 checkAnnotationsSummaryLayers(api.AnnotationsSummaryLayers o) { | |
249 buildCounterAnnotationsSummaryLayers++; | |
250 if (buildCounterAnnotationsSummaryLayers < 3) { | |
251 unittest.expect(o.allowedCharacterCount, unittest.equals(42)); | |
252 unittest.expect(o.layerId, unittest.equals('foo')); | |
253 unittest.expect(o.limitType, unittest.equals('foo')); | |
254 unittest.expect(o.remainingCharacterCount, unittest.equals(42)); | |
255 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
256 } | |
257 buildCounterAnnotationsSummaryLayers--; | |
258 } | |
259 | |
260 buildUnnamed500() { | |
261 var o = new core.List<api.AnnotationsSummaryLayers>(); | |
262 o.add(buildAnnotationsSummaryLayers()); | |
263 o.add(buildAnnotationsSummaryLayers()); | |
264 return o; | |
265 } | |
266 | |
267 checkUnnamed500(core.List<api.AnnotationsSummaryLayers> o) { | |
268 unittest.expect(o, unittest.hasLength(2)); | |
269 checkAnnotationsSummaryLayers(o[0]); | |
270 checkAnnotationsSummaryLayers(o[1]); | |
271 } | |
272 | |
273 core.int buildCounterAnnotationsSummary = 0; | |
274 buildAnnotationsSummary() { | |
275 var o = new api.AnnotationsSummary(); | |
276 buildCounterAnnotationsSummary++; | |
277 if (buildCounterAnnotationsSummary < 3) { | |
278 o.kind = "foo"; | |
279 o.layers = buildUnnamed500(); | |
280 } | |
281 buildCounterAnnotationsSummary--; | |
282 return o; | |
283 } | |
284 | |
285 checkAnnotationsSummary(api.AnnotationsSummary o) { | |
286 buildCounterAnnotationsSummary++; | |
287 if (buildCounterAnnotationsSummary < 3) { | |
288 unittest.expect(o.kind, unittest.equals('foo')); | |
289 checkUnnamed500(o.layers); | |
290 } | |
291 buildCounterAnnotationsSummary--; | |
292 } | |
293 | |
294 buildUnnamed501() { | |
295 var o = new core.List<api.Annotationdata>(); | |
296 o.add(buildAnnotationdata()); | |
297 o.add(buildAnnotationdata()); | |
298 return o; | |
299 } | |
300 | |
301 checkUnnamed501(core.List<api.Annotationdata> o) { | |
302 unittest.expect(o, unittest.hasLength(2)); | |
303 checkAnnotationdata(o[0]); | |
304 checkAnnotationdata(o[1]); | |
305 } | |
306 | |
307 core.int buildCounterAnnotationsdata = 0; | |
308 buildAnnotationsdata() { | |
309 var o = new api.Annotationsdata(); | |
310 buildCounterAnnotationsdata++; | |
311 if (buildCounterAnnotationsdata < 3) { | |
312 o.items = buildUnnamed501(); | |
313 o.kind = "foo"; | |
314 o.nextPageToken = "foo"; | |
315 o.totalItems = 42; | |
316 } | |
317 buildCounterAnnotationsdata--; | |
318 return o; | |
319 } | |
320 | |
321 checkAnnotationsdata(api.Annotationsdata o) { | |
322 buildCounterAnnotationsdata++; | |
323 if (buildCounterAnnotationsdata < 3) { | |
324 checkUnnamed501(o.items); | |
325 unittest.expect(o.kind, unittest.equals('foo')); | |
326 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
327 unittest.expect(o.totalItems, unittest.equals(42)); | |
328 } | |
329 buildCounterAnnotationsdata--; | |
330 } | |
331 | |
332 core.int buildCounterBooksAnnotationsRange = 0; | |
333 buildBooksAnnotationsRange() { | |
334 var o = new api.BooksAnnotationsRange(); | |
335 buildCounterBooksAnnotationsRange++; | |
336 if (buildCounterBooksAnnotationsRange < 3) { | |
337 o.endOffset = "foo"; | |
338 o.endPosition = "foo"; | |
339 o.startOffset = "foo"; | |
340 o.startPosition = "foo"; | |
341 } | |
342 buildCounterBooksAnnotationsRange--; | |
343 return o; | |
344 } | |
345 | |
346 checkBooksAnnotationsRange(api.BooksAnnotationsRange o) { | |
347 buildCounterBooksAnnotationsRange++; | |
348 if (buildCounterBooksAnnotationsRange < 3) { | |
349 unittest.expect(o.endOffset, unittest.equals('foo')); | |
350 unittest.expect(o.endPosition, unittest.equals('foo')); | |
351 unittest.expect(o.startOffset, unittest.equals('foo')); | |
352 unittest.expect(o.startPosition, unittest.equals('foo')); | |
353 } | |
354 buildCounterBooksAnnotationsRange--; | |
355 } | |
356 | |
357 core.int buildCounterBooksCloudloadingResource = 0; | |
358 buildBooksCloudloadingResource() { | |
359 var o = new api.BooksCloudloadingResource(); | |
360 buildCounterBooksCloudloadingResource++; | |
361 if (buildCounterBooksCloudloadingResource < 3) { | |
362 o.author = "foo"; | |
363 o.processingState = "foo"; | |
364 o.title = "foo"; | |
365 o.volumeId = "foo"; | |
366 } | |
367 buildCounterBooksCloudloadingResource--; | |
368 return o; | |
369 } | |
370 | |
371 checkBooksCloudloadingResource(api.BooksCloudloadingResource o) { | |
372 buildCounterBooksCloudloadingResource++; | |
373 if (buildCounterBooksCloudloadingResource < 3) { | |
374 unittest.expect(o.author, unittest.equals('foo')); | |
375 unittest.expect(o.processingState, unittest.equals('foo')); | |
376 unittest.expect(o.title, unittest.equals('foo')); | |
377 unittest.expect(o.volumeId, unittest.equals('foo')); | |
378 } | |
379 buildCounterBooksCloudloadingResource--; | |
380 } | |
381 | |
382 core.int buildCounterBooksVolumesRecommendedRateResponse = 0; | |
383 buildBooksVolumesRecommendedRateResponse() { | |
384 var o = new api.BooksVolumesRecommendedRateResponse(); | |
385 buildCounterBooksVolumesRecommendedRateResponse++; | |
386 if (buildCounterBooksVolumesRecommendedRateResponse < 3) { | |
387 o.consistencyToken = "foo"; | |
388 } | |
389 buildCounterBooksVolumesRecommendedRateResponse--; | |
390 return o; | |
391 } | |
392 | |
393 checkBooksVolumesRecommendedRateResponse(api.BooksVolumesRecommendedRateResponse
o) { | |
394 buildCounterBooksVolumesRecommendedRateResponse++; | |
395 if (buildCounterBooksVolumesRecommendedRateResponse < 3) { | |
396 unittest.expect(o.consistencyToken, unittest.equals('foo')); | |
397 } | |
398 buildCounterBooksVolumesRecommendedRateResponse--; | |
399 } | |
400 | |
401 core.int buildCounterBookshelf = 0; | |
402 buildBookshelf() { | |
403 var o = new api.Bookshelf(); | |
404 buildCounterBookshelf++; | |
405 if (buildCounterBookshelf < 3) { | |
406 o.access = "foo"; | |
407 o.created = core.DateTime.parse("2002-02-27T14:01:02"); | |
408 o.description = "foo"; | |
409 o.id = 42; | |
410 o.kind = "foo"; | |
411 o.selfLink = "foo"; | |
412 o.title = "foo"; | |
413 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
414 o.volumeCount = 42; | |
415 o.volumesLastUpdated = core.DateTime.parse("2002-02-27T14:01:02"); | |
416 } | |
417 buildCounterBookshelf--; | |
418 return o; | |
419 } | |
420 | |
421 checkBookshelf(api.Bookshelf o) { | |
422 buildCounterBookshelf++; | |
423 if (buildCounterBookshelf < 3) { | |
424 unittest.expect(o.access, unittest.equals('foo')); | |
425 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
426 unittest.expect(o.description, unittest.equals('foo')); | |
427 unittest.expect(o.id, unittest.equals(42)); | |
428 unittest.expect(o.kind, unittest.equals('foo')); | |
429 unittest.expect(o.selfLink, unittest.equals('foo')); | |
430 unittest.expect(o.title, unittest.equals('foo')); | |
431 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
432 unittest.expect(o.volumeCount, unittest.equals(42)); | |
433 unittest.expect(o.volumesLastUpdated, unittest.equals(core.DateTime.parse("2
002-02-27T14:01:02"))); | |
434 } | |
435 buildCounterBookshelf--; | |
436 } | |
437 | |
438 buildUnnamed502() { | |
439 var o = new core.List<api.Bookshelf>(); | |
440 o.add(buildBookshelf()); | |
441 o.add(buildBookshelf()); | |
442 return o; | |
443 } | |
444 | |
445 checkUnnamed502(core.List<api.Bookshelf> o) { | |
446 unittest.expect(o, unittest.hasLength(2)); | |
447 checkBookshelf(o[0]); | |
448 checkBookshelf(o[1]); | |
449 } | |
450 | |
451 core.int buildCounterBookshelves = 0; | |
452 buildBookshelves() { | |
453 var o = new api.Bookshelves(); | |
454 buildCounterBookshelves++; | |
455 if (buildCounterBookshelves < 3) { | |
456 o.items = buildUnnamed502(); | |
457 o.kind = "foo"; | |
458 } | |
459 buildCounterBookshelves--; | |
460 return o; | |
461 } | |
462 | |
463 checkBookshelves(api.Bookshelves o) { | |
464 buildCounterBookshelves++; | |
465 if (buildCounterBookshelves < 3) { | |
466 checkUnnamed502(o.items); | |
467 unittest.expect(o.kind, unittest.equals('foo')); | |
468 } | |
469 buildCounterBookshelves--; | |
470 } | |
471 | |
472 core.int buildCounterConcurrentAccessRestriction = 0; | |
473 buildConcurrentAccessRestriction() { | |
474 var o = new api.ConcurrentAccessRestriction(); | |
475 buildCounterConcurrentAccessRestriction++; | |
476 if (buildCounterConcurrentAccessRestriction < 3) { | |
477 o.deviceAllowed = true; | |
478 o.kind = "foo"; | |
479 o.maxConcurrentDevices = 42; | |
480 o.message = "foo"; | |
481 o.nonce = "foo"; | |
482 o.reasonCode = "foo"; | |
483 o.restricted = true; | |
484 o.signature = "foo"; | |
485 o.source = "foo"; | |
486 o.timeWindowSeconds = 42; | |
487 o.volumeId = "foo"; | |
488 } | |
489 buildCounterConcurrentAccessRestriction--; | |
490 return o; | |
491 } | |
492 | |
493 checkConcurrentAccessRestriction(api.ConcurrentAccessRestriction o) { | |
494 buildCounterConcurrentAccessRestriction++; | |
495 if (buildCounterConcurrentAccessRestriction < 3) { | |
496 unittest.expect(o.deviceAllowed, unittest.isTrue); | |
497 unittest.expect(o.kind, unittest.equals('foo')); | |
498 unittest.expect(o.maxConcurrentDevices, unittest.equals(42)); | |
499 unittest.expect(o.message, unittest.equals('foo')); | |
500 unittest.expect(o.nonce, unittest.equals('foo')); | |
501 unittest.expect(o.reasonCode, unittest.equals('foo')); | |
502 unittest.expect(o.restricted, unittest.isTrue); | |
503 unittest.expect(o.signature, unittest.equals('foo')); | |
504 unittest.expect(o.source, unittest.equals('foo')); | |
505 unittest.expect(o.timeWindowSeconds, unittest.equals(42)); | |
506 unittest.expect(o.volumeId, unittest.equals('foo')); | |
507 } | |
508 buildCounterConcurrentAccessRestriction--; | |
509 } | |
510 | |
511 core.int buildCounterDictlayerdataCommon = 0; | |
512 buildDictlayerdataCommon() { | |
513 var o = new api.DictlayerdataCommon(); | |
514 buildCounterDictlayerdataCommon++; | |
515 if (buildCounterDictlayerdataCommon < 3) { | |
516 o.title = "foo"; | |
517 } | |
518 buildCounterDictlayerdataCommon--; | |
519 return o; | |
520 } | |
521 | |
522 checkDictlayerdataCommon(api.DictlayerdataCommon o) { | |
523 buildCounterDictlayerdataCommon++; | |
524 if (buildCounterDictlayerdataCommon < 3) { | |
525 unittest.expect(o.title, unittest.equals('foo')); | |
526 } | |
527 buildCounterDictlayerdataCommon--; | |
528 } | |
529 | |
530 core.int buildCounterDictlayerdataDictSource = 0; | |
531 buildDictlayerdataDictSource() { | |
532 var o = new api.DictlayerdataDictSource(); | |
533 buildCounterDictlayerdataDictSource++; | |
534 if (buildCounterDictlayerdataDictSource < 3) { | |
535 o.attribution = "foo"; | |
536 o.url = "foo"; | |
537 } | |
538 buildCounterDictlayerdataDictSource--; | |
539 return o; | |
540 } | |
541 | |
542 checkDictlayerdataDictSource(api.DictlayerdataDictSource o) { | |
543 buildCounterDictlayerdataDictSource++; | |
544 if (buildCounterDictlayerdataDictSource < 3) { | |
545 unittest.expect(o.attribution, unittest.equals('foo')); | |
546 unittest.expect(o.url, unittest.equals('foo')); | |
547 } | |
548 buildCounterDictlayerdataDictSource--; | |
549 } | |
550 | |
551 core.int buildCounterDictlayerdataDictWordsDerivativesSource = 0; | |
552 buildDictlayerdataDictWordsDerivativesSource() { | |
553 var o = new api.DictlayerdataDictWordsDerivativesSource(); | |
554 buildCounterDictlayerdataDictWordsDerivativesSource++; | |
555 if (buildCounterDictlayerdataDictWordsDerivativesSource < 3) { | |
556 o.attribution = "foo"; | |
557 o.url = "foo"; | |
558 } | |
559 buildCounterDictlayerdataDictWordsDerivativesSource--; | |
560 return o; | |
561 } | |
562 | |
563 checkDictlayerdataDictWordsDerivativesSource(api.DictlayerdataDictWordsDerivativ
esSource o) { | |
564 buildCounterDictlayerdataDictWordsDerivativesSource++; | |
565 if (buildCounterDictlayerdataDictWordsDerivativesSource < 3) { | |
566 unittest.expect(o.attribution, unittest.equals('foo')); | |
567 unittest.expect(o.url, unittest.equals('foo')); | |
568 } | |
569 buildCounterDictlayerdataDictWordsDerivativesSource--; | |
570 } | |
571 | |
572 core.int buildCounterDictlayerdataDictWordsDerivatives = 0; | |
573 buildDictlayerdataDictWordsDerivatives() { | |
574 var o = new api.DictlayerdataDictWordsDerivatives(); | |
575 buildCounterDictlayerdataDictWordsDerivatives++; | |
576 if (buildCounterDictlayerdataDictWordsDerivatives < 3) { | |
577 o.source = buildDictlayerdataDictWordsDerivativesSource(); | |
578 o.text = "foo"; | |
579 } | |
580 buildCounterDictlayerdataDictWordsDerivatives--; | |
581 return o; | |
582 } | |
583 | |
584 checkDictlayerdataDictWordsDerivatives(api.DictlayerdataDictWordsDerivatives o)
{ | |
585 buildCounterDictlayerdataDictWordsDerivatives++; | |
586 if (buildCounterDictlayerdataDictWordsDerivatives < 3) { | |
587 checkDictlayerdataDictWordsDerivativesSource(o.source); | |
588 unittest.expect(o.text, unittest.equals('foo')); | |
589 } | |
590 buildCounterDictlayerdataDictWordsDerivatives--; | |
591 } | |
592 | |
593 buildUnnamed503() { | |
594 var o = new core.List<api.DictlayerdataDictWordsDerivatives>(); | |
595 o.add(buildDictlayerdataDictWordsDerivatives()); | |
596 o.add(buildDictlayerdataDictWordsDerivatives()); | |
597 return o; | |
598 } | |
599 | |
600 checkUnnamed503(core.List<api.DictlayerdataDictWordsDerivatives> o) { | |
601 unittest.expect(o, unittest.hasLength(2)); | |
602 checkDictlayerdataDictWordsDerivatives(o[0]); | |
603 checkDictlayerdataDictWordsDerivatives(o[1]); | |
604 } | |
605 | |
606 core.int buildCounterDictlayerdataDictWordsExamplesSource = 0; | |
607 buildDictlayerdataDictWordsExamplesSource() { | |
608 var o = new api.DictlayerdataDictWordsExamplesSource(); | |
609 buildCounterDictlayerdataDictWordsExamplesSource++; | |
610 if (buildCounterDictlayerdataDictWordsExamplesSource < 3) { | |
611 o.attribution = "foo"; | |
612 o.url = "foo"; | |
613 } | |
614 buildCounterDictlayerdataDictWordsExamplesSource--; | |
615 return o; | |
616 } | |
617 | |
618 checkDictlayerdataDictWordsExamplesSource(api.DictlayerdataDictWordsExamplesSour
ce o) { | |
619 buildCounterDictlayerdataDictWordsExamplesSource++; | |
620 if (buildCounterDictlayerdataDictWordsExamplesSource < 3) { | |
621 unittest.expect(o.attribution, unittest.equals('foo')); | |
622 unittest.expect(o.url, unittest.equals('foo')); | |
623 } | |
624 buildCounterDictlayerdataDictWordsExamplesSource--; | |
625 } | |
626 | |
627 core.int buildCounterDictlayerdataDictWordsExamples = 0; | |
628 buildDictlayerdataDictWordsExamples() { | |
629 var o = new api.DictlayerdataDictWordsExamples(); | |
630 buildCounterDictlayerdataDictWordsExamples++; | |
631 if (buildCounterDictlayerdataDictWordsExamples < 3) { | |
632 o.source = buildDictlayerdataDictWordsExamplesSource(); | |
633 o.text = "foo"; | |
634 } | |
635 buildCounterDictlayerdataDictWordsExamples--; | |
636 return o; | |
637 } | |
638 | |
639 checkDictlayerdataDictWordsExamples(api.DictlayerdataDictWordsExamples o) { | |
640 buildCounterDictlayerdataDictWordsExamples++; | |
641 if (buildCounterDictlayerdataDictWordsExamples < 3) { | |
642 checkDictlayerdataDictWordsExamplesSource(o.source); | |
643 unittest.expect(o.text, unittest.equals('foo')); | |
644 } | |
645 buildCounterDictlayerdataDictWordsExamples--; | |
646 } | |
647 | |
648 buildUnnamed504() { | |
649 var o = new core.List<api.DictlayerdataDictWordsExamples>(); | |
650 o.add(buildDictlayerdataDictWordsExamples()); | |
651 o.add(buildDictlayerdataDictWordsExamples()); | |
652 return o; | |
653 } | |
654 | |
655 checkUnnamed504(core.List<api.DictlayerdataDictWordsExamples> o) { | |
656 unittest.expect(o, unittest.hasLength(2)); | |
657 checkDictlayerdataDictWordsExamples(o[0]); | |
658 checkDictlayerdataDictWordsExamples(o[1]); | |
659 } | |
660 | |
661 core.int buildCounterDictlayerdataDictWordsSensesConjugations = 0; | |
662 buildDictlayerdataDictWordsSensesConjugations() { | |
663 var o = new api.DictlayerdataDictWordsSensesConjugations(); | |
664 buildCounterDictlayerdataDictWordsSensesConjugations++; | |
665 if (buildCounterDictlayerdataDictWordsSensesConjugations < 3) { | |
666 o.type = "foo"; | |
667 o.value = "foo"; | |
668 } | |
669 buildCounterDictlayerdataDictWordsSensesConjugations--; | |
670 return o; | |
671 } | |
672 | |
673 checkDictlayerdataDictWordsSensesConjugations(api.DictlayerdataDictWordsSensesCo
njugations o) { | |
674 buildCounterDictlayerdataDictWordsSensesConjugations++; | |
675 if (buildCounterDictlayerdataDictWordsSensesConjugations < 3) { | |
676 unittest.expect(o.type, unittest.equals('foo')); | |
677 unittest.expect(o.value, unittest.equals('foo')); | |
678 } | |
679 buildCounterDictlayerdataDictWordsSensesConjugations--; | |
680 } | |
681 | |
682 buildUnnamed505() { | |
683 var o = new core.List<api.DictlayerdataDictWordsSensesConjugations>(); | |
684 o.add(buildDictlayerdataDictWordsSensesConjugations()); | |
685 o.add(buildDictlayerdataDictWordsSensesConjugations()); | |
686 return o; | |
687 } | |
688 | |
689 checkUnnamed505(core.List<api.DictlayerdataDictWordsSensesConjugations> o) { | |
690 unittest.expect(o, unittest.hasLength(2)); | |
691 checkDictlayerdataDictWordsSensesConjugations(o[0]); | |
692 checkDictlayerdataDictWordsSensesConjugations(o[1]); | |
693 } | |
694 | |
695 core.int buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource = 0; | |
696 buildDictlayerdataDictWordsSensesDefinitionsExamplesSource() { | |
697 var o = new api.DictlayerdataDictWordsSensesDefinitionsExamplesSource(); | |
698 buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource++; | |
699 if (buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource < 3) { | |
700 o.attribution = "foo"; | |
701 o.url = "foo"; | |
702 } | |
703 buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource--; | |
704 return o; | |
705 } | |
706 | |
707 checkDictlayerdataDictWordsSensesDefinitionsExamplesSource(api.DictlayerdataDict
WordsSensesDefinitionsExamplesSource o) { | |
708 buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource++; | |
709 if (buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource < 3) { | |
710 unittest.expect(o.attribution, unittest.equals('foo')); | |
711 unittest.expect(o.url, unittest.equals('foo')); | |
712 } | |
713 buildCounterDictlayerdataDictWordsSensesDefinitionsExamplesSource--; | |
714 } | |
715 | |
716 core.int buildCounterDictlayerdataDictWordsSensesDefinitionsExamples = 0; | |
717 buildDictlayerdataDictWordsSensesDefinitionsExamples() { | |
718 var o = new api.DictlayerdataDictWordsSensesDefinitionsExamples(); | |
719 buildCounterDictlayerdataDictWordsSensesDefinitionsExamples++; | |
720 if (buildCounterDictlayerdataDictWordsSensesDefinitionsExamples < 3) { | |
721 o.source = buildDictlayerdataDictWordsSensesDefinitionsExamplesSource(); | |
722 o.text = "foo"; | |
723 } | |
724 buildCounterDictlayerdataDictWordsSensesDefinitionsExamples--; | |
725 return o; | |
726 } | |
727 | |
728 checkDictlayerdataDictWordsSensesDefinitionsExamples(api.DictlayerdataDictWordsS
ensesDefinitionsExamples o) { | |
729 buildCounterDictlayerdataDictWordsSensesDefinitionsExamples++; | |
730 if (buildCounterDictlayerdataDictWordsSensesDefinitionsExamples < 3) { | |
731 checkDictlayerdataDictWordsSensesDefinitionsExamplesSource(o.source); | |
732 unittest.expect(o.text, unittest.equals('foo')); | |
733 } | |
734 buildCounterDictlayerdataDictWordsSensesDefinitionsExamples--; | |
735 } | |
736 | |
737 buildUnnamed506() { | |
738 var o = new core.List<api.DictlayerdataDictWordsSensesDefinitionsExamples>(); | |
739 o.add(buildDictlayerdataDictWordsSensesDefinitionsExamples()); | |
740 o.add(buildDictlayerdataDictWordsSensesDefinitionsExamples()); | |
741 return o; | |
742 } | |
743 | |
744 checkUnnamed506(core.List<api.DictlayerdataDictWordsSensesDefinitionsExamples> o
) { | |
745 unittest.expect(o, unittest.hasLength(2)); | |
746 checkDictlayerdataDictWordsSensesDefinitionsExamples(o[0]); | |
747 checkDictlayerdataDictWordsSensesDefinitionsExamples(o[1]); | |
748 } | |
749 | |
750 core.int buildCounterDictlayerdataDictWordsSensesDefinitions = 0; | |
751 buildDictlayerdataDictWordsSensesDefinitions() { | |
752 var o = new api.DictlayerdataDictWordsSensesDefinitions(); | |
753 buildCounterDictlayerdataDictWordsSensesDefinitions++; | |
754 if (buildCounterDictlayerdataDictWordsSensesDefinitions < 3) { | |
755 o.definition = "foo"; | |
756 o.examples = buildUnnamed506(); | |
757 } | |
758 buildCounterDictlayerdataDictWordsSensesDefinitions--; | |
759 return o; | |
760 } | |
761 | |
762 checkDictlayerdataDictWordsSensesDefinitions(api.DictlayerdataDictWordsSensesDef
initions o) { | |
763 buildCounterDictlayerdataDictWordsSensesDefinitions++; | |
764 if (buildCounterDictlayerdataDictWordsSensesDefinitions < 3) { | |
765 unittest.expect(o.definition, unittest.equals('foo')); | |
766 checkUnnamed506(o.examples); | |
767 } | |
768 buildCounterDictlayerdataDictWordsSensesDefinitions--; | |
769 } | |
770 | |
771 buildUnnamed507() { | |
772 var o = new core.List<api.DictlayerdataDictWordsSensesDefinitions>(); | |
773 o.add(buildDictlayerdataDictWordsSensesDefinitions()); | |
774 o.add(buildDictlayerdataDictWordsSensesDefinitions()); | |
775 return o; | |
776 } | |
777 | |
778 checkUnnamed507(core.List<api.DictlayerdataDictWordsSensesDefinitions> o) { | |
779 unittest.expect(o, unittest.hasLength(2)); | |
780 checkDictlayerdataDictWordsSensesDefinitions(o[0]); | |
781 checkDictlayerdataDictWordsSensesDefinitions(o[1]); | |
782 } | |
783 | |
784 core.int buildCounterDictlayerdataDictWordsSensesSource = 0; | |
785 buildDictlayerdataDictWordsSensesSource() { | |
786 var o = new api.DictlayerdataDictWordsSensesSource(); | |
787 buildCounterDictlayerdataDictWordsSensesSource++; | |
788 if (buildCounterDictlayerdataDictWordsSensesSource < 3) { | |
789 o.attribution = "foo"; | |
790 o.url = "foo"; | |
791 } | |
792 buildCounterDictlayerdataDictWordsSensesSource--; | |
793 return o; | |
794 } | |
795 | |
796 checkDictlayerdataDictWordsSensesSource(api.DictlayerdataDictWordsSensesSource o
) { | |
797 buildCounterDictlayerdataDictWordsSensesSource++; | |
798 if (buildCounterDictlayerdataDictWordsSensesSource < 3) { | |
799 unittest.expect(o.attribution, unittest.equals('foo')); | |
800 unittest.expect(o.url, unittest.equals('foo')); | |
801 } | |
802 buildCounterDictlayerdataDictWordsSensesSource--; | |
803 } | |
804 | |
805 core.int buildCounterDictlayerdataDictWordsSensesSynonymsSource = 0; | |
806 buildDictlayerdataDictWordsSensesSynonymsSource() { | |
807 var o = new api.DictlayerdataDictWordsSensesSynonymsSource(); | |
808 buildCounterDictlayerdataDictWordsSensesSynonymsSource++; | |
809 if (buildCounterDictlayerdataDictWordsSensesSynonymsSource < 3) { | |
810 o.attribution = "foo"; | |
811 o.url = "foo"; | |
812 } | |
813 buildCounterDictlayerdataDictWordsSensesSynonymsSource--; | |
814 return o; | |
815 } | |
816 | |
817 checkDictlayerdataDictWordsSensesSynonymsSource(api.DictlayerdataDictWordsSenses
SynonymsSource o) { | |
818 buildCounterDictlayerdataDictWordsSensesSynonymsSource++; | |
819 if (buildCounterDictlayerdataDictWordsSensesSynonymsSource < 3) { | |
820 unittest.expect(o.attribution, unittest.equals('foo')); | |
821 unittest.expect(o.url, unittest.equals('foo')); | |
822 } | |
823 buildCounterDictlayerdataDictWordsSensesSynonymsSource--; | |
824 } | |
825 | |
826 core.int buildCounterDictlayerdataDictWordsSensesSynonyms = 0; | |
827 buildDictlayerdataDictWordsSensesSynonyms() { | |
828 var o = new api.DictlayerdataDictWordsSensesSynonyms(); | |
829 buildCounterDictlayerdataDictWordsSensesSynonyms++; | |
830 if (buildCounterDictlayerdataDictWordsSensesSynonyms < 3) { | |
831 o.source = buildDictlayerdataDictWordsSensesSynonymsSource(); | |
832 o.text = "foo"; | |
833 } | |
834 buildCounterDictlayerdataDictWordsSensesSynonyms--; | |
835 return o; | |
836 } | |
837 | |
838 checkDictlayerdataDictWordsSensesSynonyms(api.DictlayerdataDictWordsSensesSynony
ms o) { | |
839 buildCounterDictlayerdataDictWordsSensesSynonyms++; | |
840 if (buildCounterDictlayerdataDictWordsSensesSynonyms < 3) { | |
841 checkDictlayerdataDictWordsSensesSynonymsSource(o.source); | |
842 unittest.expect(o.text, unittest.equals('foo')); | |
843 } | |
844 buildCounterDictlayerdataDictWordsSensesSynonyms--; | |
845 } | |
846 | |
847 buildUnnamed508() { | |
848 var o = new core.List<api.DictlayerdataDictWordsSensesSynonyms>(); | |
849 o.add(buildDictlayerdataDictWordsSensesSynonyms()); | |
850 o.add(buildDictlayerdataDictWordsSensesSynonyms()); | |
851 return o; | |
852 } | |
853 | |
854 checkUnnamed508(core.List<api.DictlayerdataDictWordsSensesSynonyms> o) { | |
855 unittest.expect(o, unittest.hasLength(2)); | |
856 checkDictlayerdataDictWordsSensesSynonyms(o[0]); | |
857 checkDictlayerdataDictWordsSensesSynonyms(o[1]); | |
858 } | |
859 | |
860 core.int buildCounterDictlayerdataDictWordsSenses = 0; | |
861 buildDictlayerdataDictWordsSenses() { | |
862 var o = new api.DictlayerdataDictWordsSenses(); | |
863 buildCounterDictlayerdataDictWordsSenses++; | |
864 if (buildCounterDictlayerdataDictWordsSenses < 3) { | |
865 o.conjugations = buildUnnamed505(); | |
866 o.definitions = buildUnnamed507(); | |
867 o.partOfSpeech = "foo"; | |
868 o.pronunciation = "foo"; | |
869 o.pronunciationUrl = "foo"; | |
870 o.source = buildDictlayerdataDictWordsSensesSource(); | |
871 o.syllabification = "foo"; | |
872 o.synonyms = buildUnnamed508(); | |
873 } | |
874 buildCounterDictlayerdataDictWordsSenses--; | |
875 return o; | |
876 } | |
877 | |
878 checkDictlayerdataDictWordsSenses(api.DictlayerdataDictWordsSenses o) { | |
879 buildCounterDictlayerdataDictWordsSenses++; | |
880 if (buildCounterDictlayerdataDictWordsSenses < 3) { | |
881 checkUnnamed505(o.conjugations); | |
882 checkUnnamed507(o.definitions); | |
883 unittest.expect(o.partOfSpeech, unittest.equals('foo')); | |
884 unittest.expect(o.pronunciation, unittest.equals('foo')); | |
885 unittest.expect(o.pronunciationUrl, unittest.equals('foo')); | |
886 checkDictlayerdataDictWordsSensesSource(o.source); | |
887 unittest.expect(o.syllabification, unittest.equals('foo')); | |
888 checkUnnamed508(o.synonyms); | |
889 } | |
890 buildCounterDictlayerdataDictWordsSenses--; | |
891 } | |
892 | |
893 buildUnnamed509() { | |
894 var o = new core.List<api.DictlayerdataDictWordsSenses>(); | |
895 o.add(buildDictlayerdataDictWordsSenses()); | |
896 o.add(buildDictlayerdataDictWordsSenses()); | |
897 return o; | |
898 } | |
899 | |
900 checkUnnamed509(core.List<api.DictlayerdataDictWordsSenses> o) { | |
901 unittest.expect(o, unittest.hasLength(2)); | |
902 checkDictlayerdataDictWordsSenses(o[0]); | |
903 checkDictlayerdataDictWordsSenses(o[1]); | |
904 } | |
905 | |
906 core.int buildCounterDictlayerdataDictWordsSource = 0; | |
907 buildDictlayerdataDictWordsSource() { | |
908 var o = new api.DictlayerdataDictWordsSource(); | |
909 buildCounterDictlayerdataDictWordsSource++; | |
910 if (buildCounterDictlayerdataDictWordsSource < 3) { | |
911 o.attribution = "foo"; | |
912 o.url = "foo"; | |
913 } | |
914 buildCounterDictlayerdataDictWordsSource--; | |
915 return o; | |
916 } | |
917 | |
918 checkDictlayerdataDictWordsSource(api.DictlayerdataDictWordsSource o) { | |
919 buildCounterDictlayerdataDictWordsSource++; | |
920 if (buildCounterDictlayerdataDictWordsSource < 3) { | |
921 unittest.expect(o.attribution, unittest.equals('foo')); | |
922 unittest.expect(o.url, unittest.equals('foo')); | |
923 } | |
924 buildCounterDictlayerdataDictWordsSource--; | |
925 } | |
926 | |
927 core.int buildCounterDictlayerdataDictWords = 0; | |
928 buildDictlayerdataDictWords() { | |
929 var o = new api.DictlayerdataDictWords(); | |
930 buildCounterDictlayerdataDictWords++; | |
931 if (buildCounterDictlayerdataDictWords < 3) { | |
932 o.derivatives = buildUnnamed503(); | |
933 o.examples = buildUnnamed504(); | |
934 o.senses = buildUnnamed509(); | |
935 o.source = buildDictlayerdataDictWordsSource(); | |
936 } | |
937 buildCounterDictlayerdataDictWords--; | |
938 return o; | |
939 } | |
940 | |
941 checkDictlayerdataDictWords(api.DictlayerdataDictWords o) { | |
942 buildCounterDictlayerdataDictWords++; | |
943 if (buildCounterDictlayerdataDictWords < 3) { | |
944 checkUnnamed503(o.derivatives); | |
945 checkUnnamed504(o.examples); | |
946 checkUnnamed509(o.senses); | |
947 checkDictlayerdataDictWordsSource(o.source); | |
948 } | |
949 buildCounterDictlayerdataDictWords--; | |
950 } | |
951 | |
952 buildUnnamed510() { | |
953 var o = new core.List<api.DictlayerdataDictWords>(); | |
954 o.add(buildDictlayerdataDictWords()); | |
955 o.add(buildDictlayerdataDictWords()); | |
956 return o; | |
957 } | |
958 | |
959 checkUnnamed510(core.List<api.DictlayerdataDictWords> o) { | |
960 unittest.expect(o, unittest.hasLength(2)); | |
961 checkDictlayerdataDictWords(o[0]); | |
962 checkDictlayerdataDictWords(o[1]); | |
963 } | |
964 | |
965 core.int buildCounterDictlayerdataDict = 0; | |
966 buildDictlayerdataDict() { | |
967 var o = new api.DictlayerdataDict(); | |
968 buildCounterDictlayerdataDict++; | |
969 if (buildCounterDictlayerdataDict < 3) { | |
970 o.source = buildDictlayerdataDictSource(); | |
971 o.words = buildUnnamed510(); | |
972 } | |
973 buildCounterDictlayerdataDict--; | |
974 return o; | |
975 } | |
976 | |
977 checkDictlayerdataDict(api.DictlayerdataDict o) { | |
978 buildCounterDictlayerdataDict++; | |
979 if (buildCounterDictlayerdataDict < 3) { | |
980 checkDictlayerdataDictSource(o.source); | |
981 checkUnnamed510(o.words); | |
982 } | |
983 buildCounterDictlayerdataDict--; | |
984 } | |
985 | |
986 core.int buildCounterDictlayerdata = 0; | |
987 buildDictlayerdata() { | |
988 var o = new api.Dictlayerdata(); | |
989 buildCounterDictlayerdata++; | |
990 if (buildCounterDictlayerdata < 3) { | |
991 o.common = buildDictlayerdataCommon(); | |
992 o.dict = buildDictlayerdataDict(); | |
993 o.kind = "foo"; | |
994 } | |
995 buildCounterDictlayerdata--; | |
996 return o; | |
997 } | |
998 | |
999 checkDictlayerdata(api.Dictlayerdata o) { | |
1000 buildCounterDictlayerdata++; | |
1001 if (buildCounterDictlayerdata < 3) { | |
1002 checkDictlayerdataCommon(o.common); | |
1003 checkDictlayerdataDict(o.dict); | |
1004 unittest.expect(o.kind, unittest.equals('foo')); | |
1005 } | |
1006 buildCounterDictlayerdata--; | |
1007 } | |
1008 | |
1009 core.int buildCounterDownloadAccessRestriction = 0; | |
1010 buildDownloadAccessRestriction() { | |
1011 var o = new api.DownloadAccessRestriction(); | |
1012 buildCounterDownloadAccessRestriction++; | |
1013 if (buildCounterDownloadAccessRestriction < 3) { | |
1014 o.deviceAllowed = true; | |
1015 o.downloadsAcquired = 42; | |
1016 o.justAcquired = true; | |
1017 o.kind = "foo"; | |
1018 o.maxDownloadDevices = 42; | |
1019 o.message = "foo"; | |
1020 o.nonce = "foo"; | |
1021 o.reasonCode = "foo"; | |
1022 o.restricted = true; | |
1023 o.signature = "foo"; | |
1024 o.source = "foo"; | |
1025 o.volumeId = "foo"; | |
1026 } | |
1027 buildCounterDownloadAccessRestriction--; | |
1028 return o; | |
1029 } | |
1030 | |
1031 checkDownloadAccessRestriction(api.DownloadAccessRestriction o) { | |
1032 buildCounterDownloadAccessRestriction++; | |
1033 if (buildCounterDownloadAccessRestriction < 3) { | |
1034 unittest.expect(o.deviceAllowed, unittest.isTrue); | |
1035 unittest.expect(o.downloadsAcquired, unittest.equals(42)); | |
1036 unittest.expect(o.justAcquired, unittest.isTrue); | |
1037 unittest.expect(o.kind, unittest.equals('foo')); | |
1038 unittest.expect(o.maxDownloadDevices, unittest.equals(42)); | |
1039 unittest.expect(o.message, unittest.equals('foo')); | |
1040 unittest.expect(o.nonce, unittest.equals('foo')); | |
1041 unittest.expect(o.reasonCode, unittest.equals('foo')); | |
1042 unittest.expect(o.restricted, unittest.isTrue); | |
1043 unittest.expect(o.signature, unittest.equals('foo')); | |
1044 unittest.expect(o.source, unittest.equals('foo')); | |
1045 unittest.expect(o.volumeId, unittest.equals('foo')); | |
1046 } | |
1047 buildCounterDownloadAccessRestriction--; | |
1048 } | |
1049 | |
1050 buildUnnamed511() { | |
1051 var o = new core.List<api.DownloadAccessRestriction>(); | |
1052 o.add(buildDownloadAccessRestriction()); | |
1053 o.add(buildDownloadAccessRestriction()); | |
1054 return o; | |
1055 } | |
1056 | |
1057 checkUnnamed511(core.List<api.DownloadAccessRestriction> o) { | |
1058 unittest.expect(o, unittest.hasLength(2)); | |
1059 checkDownloadAccessRestriction(o[0]); | |
1060 checkDownloadAccessRestriction(o[1]); | |
1061 } | |
1062 | |
1063 core.int buildCounterDownloadAccesses = 0; | |
1064 buildDownloadAccesses() { | |
1065 var o = new api.DownloadAccesses(); | |
1066 buildCounterDownloadAccesses++; | |
1067 if (buildCounterDownloadAccesses < 3) { | |
1068 o.downloadAccessList = buildUnnamed511(); | |
1069 o.kind = "foo"; | |
1070 } | |
1071 buildCounterDownloadAccesses--; | |
1072 return o; | |
1073 } | |
1074 | |
1075 checkDownloadAccesses(api.DownloadAccesses o) { | |
1076 buildCounterDownloadAccesses++; | |
1077 if (buildCounterDownloadAccesses < 3) { | |
1078 checkUnnamed511(o.downloadAccessList); | |
1079 unittest.expect(o.kind, unittest.equals('foo')); | |
1080 } | |
1081 buildCounterDownloadAccesses--; | |
1082 } | |
1083 | |
1084 core.int buildCounterGeolayerdataCommon = 0; | |
1085 buildGeolayerdataCommon() { | |
1086 var o = new api.GeolayerdataCommon(); | |
1087 buildCounterGeolayerdataCommon++; | |
1088 if (buildCounterGeolayerdataCommon < 3) { | |
1089 o.lang = "foo"; | |
1090 o.previewImageUrl = "foo"; | |
1091 o.snippet = "foo"; | |
1092 o.snippetUrl = "foo"; | |
1093 o.title = "foo"; | |
1094 } | |
1095 buildCounterGeolayerdataCommon--; | |
1096 return o; | |
1097 } | |
1098 | |
1099 checkGeolayerdataCommon(api.GeolayerdataCommon o) { | |
1100 buildCounterGeolayerdataCommon++; | |
1101 if (buildCounterGeolayerdataCommon < 3) { | |
1102 unittest.expect(o.lang, unittest.equals('foo')); | |
1103 unittest.expect(o.previewImageUrl, unittest.equals('foo')); | |
1104 unittest.expect(o.snippet, unittest.equals('foo')); | |
1105 unittest.expect(o.snippetUrl, unittest.equals('foo')); | |
1106 unittest.expect(o.title, unittest.equals('foo')); | |
1107 } | |
1108 buildCounterGeolayerdataCommon--; | |
1109 } | |
1110 | |
1111 core.int buildCounterGeolayerdataGeoBoundary = 0; | |
1112 buildGeolayerdataGeoBoundary() { | |
1113 var o = new api.GeolayerdataGeoBoundary(); | |
1114 buildCounterGeolayerdataGeoBoundary++; | |
1115 if (buildCounterGeolayerdataGeoBoundary < 3) { | |
1116 o.latitude = 42; | |
1117 o.longitude = 42; | |
1118 } | |
1119 buildCounterGeolayerdataGeoBoundary--; | |
1120 return o; | |
1121 } | |
1122 | |
1123 checkGeolayerdataGeoBoundary(api.GeolayerdataGeoBoundary o) { | |
1124 buildCounterGeolayerdataGeoBoundary++; | |
1125 if (buildCounterGeolayerdataGeoBoundary < 3) { | |
1126 unittest.expect(o.latitude, unittest.equals(42)); | |
1127 unittest.expect(o.longitude, unittest.equals(42)); | |
1128 } | |
1129 buildCounterGeolayerdataGeoBoundary--; | |
1130 } | |
1131 | |
1132 buildUnnamed512() { | |
1133 var o = new core.List<api.GeolayerdataGeoBoundary>(); | |
1134 o.add(buildGeolayerdataGeoBoundary()); | |
1135 o.add(buildGeolayerdataGeoBoundary()); | |
1136 return o; | |
1137 } | |
1138 | |
1139 checkUnnamed512(core.List<api.GeolayerdataGeoBoundary> o) { | |
1140 unittest.expect(o, unittest.hasLength(2)); | |
1141 checkGeolayerdataGeoBoundary(o[0]); | |
1142 checkGeolayerdataGeoBoundary(o[1]); | |
1143 } | |
1144 | |
1145 buildUnnamed513() { | |
1146 var o = new core.List<core.List<api.GeolayerdataGeoBoundary>>(); | |
1147 o.add(buildUnnamed512()); | |
1148 o.add(buildUnnamed512()); | |
1149 return o; | |
1150 } | |
1151 | |
1152 checkUnnamed513(core.List<core.List<api.GeolayerdataGeoBoundary>> o) { | |
1153 unittest.expect(o, unittest.hasLength(2)); | |
1154 checkUnnamed512(o[0]); | |
1155 checkUnnamed512(o[1]); | |
1156 } | |
1157 | |
1158 core.int buildCounterGeolayerdataGeoViewportHi = 0; | |
1159 buildGeolayerdataGeoViewportHi() { | |
1160 var o = new api.GeolayerdataGeoViewportHi(); | |
1161 buildCounterGeolayerdataGeoViewportHi++; | |
1162 if (buildCounterGeolayerdataGeoViewportHi < 3) { | |
1163 o.latitude = 42.0; | |
1164 o.longitude = 42.0; | |
1165 } | |
1166 buildCounterGeolayerdataGeoViewportHi--; | |
1167 return o; | |
1168 } | |
1169 | |
1170 checkGeolayerdataGeoViewportHi(api.GeolayerdataGeoViewportHi o) { | |
1171 buildCounterGeolayerdataGeoViewportHi++; | |
1172 if (buildCounterGeolayerdataGeoViewportHi < 3) { | |
1173 unittest.expect(o.latitude, unittest.equals(42.0)); | |
1174 unittest.expect(o.longitude, unittest.equals(42.0)); | |
1175 } | |
1176 buildCounterGeolayerdataGeoViewportHi--; | |
1177 } | |
1178 | |
1179 core.int buildCounterGeolayerdataGeoViewportLo = 0; | |
1180 buildGeolayerdataGeoViewportLo() { | |
1181 var o = new api.GeolayerdataGeoViewportLo(); | |
1182 buildCounterGeolayerdataGeoViewportLo++; | |
1183 if (buildCounterGeolayerdataGeoViewportLo < 3) { | |
1184 o.latitude = 42.0; | |
1185 o.longitude = 42.0; | |
1186 } | |
1187 buildCounterGeolayerdataGeoViewportLo--; | |
1188 return o; | |
1189 } | |
1190 | |
1191 checkGeolayerdataGeoViewportLo(api.GeolayerdataGeoViewportLo o) { | |
1192 buildCounterGeolayerdataGeoViewportLo++; | |
1193 if (buildCounterGeolayerdataGeoViewportLo < 3) { | |
1194 unittest.expect(o.latitude, unittest.equals(42.0)); | |
1195 unittest.expect(o.longitude, unittest.equals(42.0)); | |
1196 } | |
1197 buildCounterGeolayerdataGeoViewportLo--; | |
1198 } | |
1199 | |
1200 core.int buildCounterGeolayerdataGeoViewport = 0; | |
1201 buildGeolayerdataGeoViewport() { | |
1202 var o = new api.GeolayerdataGeoViewport(); | |
1203 buildCounterGeolayerdataGeoViewport++; | |
1204 if (buildCounterGeolayerdataGeoViewport < 3) { | |
1205 o.hi = buildGeolayerdataGeoViewportHi(); | |
1206 o.lo = buildGeolayerdataGeoViewportLo(); | |
1207 } | |
1208 buildCounterGeolayerdataGeoViewport--; | |
1209 return o; | |
1210 } | |
1211 | |
1212 checkGeolayerdataGeoViewport(api.GeolayerdataGeoViewport o) { | |
1213 buildCounterGeolayerdataGeoViewport++; | |
1214 if (buildCounterGeolayerdataGeoViewport < 3) { | |
1215 checkGeolayerdataGeoViewportHi(o.hi); | |
1216 checkGeolayerdataGeoViewportLo(o.lo); | |
1217 } | |
1218 buildCounterGeolayerdataGeoViewport--; | |
1219 } | |
1220 | |
1221 core.int buildCounterGeolayerdataGeo = 0; | |
1222 buildGeolayerdataGeo() { | |
1223 var o = new api.GeolayerdataGeo(); | |
1224 buildCounterGeolayerdataGeo++; | |
1225 if (buildCounterGeolayerdataGeo < 3) { | |
1226 o.boundary = buildUnnamed513(); | |
1227 o.cachePolicy = "foo"; | |
1228 o.countryCode = "foo"; | |
1229 o.latitude = 42.0; | |
1230 o.longitude = 42.0; | |
1231 o.mapType = "foo"; | |
1232 o.viewport = buildGeolayerdataGeoViewport(); | |
1233 o.zoom = 42; | |
1234 } | |
1235 buildCounterGeolayerdataGeo--; | |
1236 return o; | |
1237 } | |
1238 | |
1239 checkGeolayerdataGeo(api.GeolayerdataGeo o) { | |
1240 buildCounterGeolayerdataGeo++; | |
1241 if (buildCounterGeolayerdataGeo < 3) { | |
1242 checkUnnamed513(o.boundary); | |
1243 unittest.expect(o.cachePolicy, unittest.equals('foo')); | |
1244 unittest.expect(o.countryCode, unittest.equals('foo')); | |
1245 unittest.expect(o.latitude, unittest.equals(42.0)); | |
1246 unittest.expect(o.longitude, unittest.equals(42.0)); | |
1247 unittest.expect(o.mapType, unittest.equals('foo')); | |
1248 checkGeolayerdataGeoViewport(o.viewport); | |
1249 unittest.expect(o.zoom, unittest.equals(42)); | |
1250 } | |
1251 buildCounterGeolayerdataGeo--; | |
1252 } | |
1253 | |
1254 core.int buildCounterGeolayerdata = 0; | |
1255 buildGeolayerdata() { | |
1256 var o = new api.Geolayerdata(); | |
1257 buildCounterGeolayerdata++; | |
1258 if (buildCounterGeolayerdata < 3) { | |
1259 o.common = buildGeolayerdataCommon(); | |
1260 o.geo = buildGeolayerdataGeo(); | |
1261 o.kind = "foo"; | |
1262 } | |
1263 buildCounterGeolayerdata--; | |
1264 return o; | |
1265 } | |
1266 | |
1267 checkGeolayerdata(api.Geolayerdata o) { | |
1268 buildCounterGeolayerdata++; | |
1269 if (buildCounterGeolayerdata < 3) { | |
1270 checkGeolayerdataCommon(o.common); | |
1271 checkGeolayerdataGeo(o.geo); | |
1272 unittest.expect(o.kind, unittest.equals('foo')); | |
1273 } | |
1274 buildCounterGeolayerdata--; | |
1275 } | |
1276 | |
1277 buildUnnamed514() { | |
1278 var o = new core.List<api.Layersummary>(); | |
1279 o.add(buildLayersummary()); | |
1280 o.add(buildLayersummary()); | |
1281 return o; | |
1282 } | |
1283 | |
1284 checkUnnamed514(core.List<api.Layersummary> o) { | |
1285 unittest.expect(o, unittest.hasLength(2)); | |
1286 checkLayersummary(o[0]); | |
1287 checkLayersummary(o[1]); | |
1288 } | |
1289 | |
1290 core.int buildCounterLayersummaries = 0; | |
1291 buildLayersummaries() { | |
1292 var o = new api.Layersummaries(); | |
1293 buildCounterLayersummaries++; | |
1294 if (buildCounterLayersummaries < 3) { | |
1295 o.items = buildUnnamed514(); | |
1296 o.kind = "foo"; | |
1297 o.totalItems = 42; | |
1298 } | |
1299 buildCounterLayersummaries--; | |
1300 return o; | |
1301 } | |
1302 | |
1303 checkLayersummaries(api.Layersummaries o) { | |
1304 buildCounterLayersummaries++; | |
1305 if (buildCounterLayersummaries < 3) { | |
1306 checkUnnamed514(o.items); | |
1307 unittest.expect(o.kind, unittest.equals('foo')); | |
1308 unittest.expect(o.totalItems, unittest.equals(42)); | |
1309 } | |
1310 buildCounterLayersummaries--; | |
1311 } | |
1312 | |
1313 buildUnnamed515() { | |
1314 var o = new core.List<core.String>(); | |
1315 o.add("foo"); | |
1316 o.add("foo"); | |
1317 return o; | |
1318 } | |
1319 | |
1320 checkUnnamed515(core.List<core.String> o) { | |
1321 unittest.expect(o, unittest.hasLength(2)); | |
1322 unittest.expect(o[0], unittest.equals('foo')); | |
1323 unittest.expect(o[1], unittest.equals('foo')); | |
1324 } | |
1325 | |
1326 core.int buildCounterLayersummary = 0; | |
1327 buildLayersummary() { | |
1328 var o = new api.Layersummary(); | |
1329 buildCounterLayersummary++; | |
1330 if (buildCounterLayersummary < 3) { | |
1331 o.annotationCount = 42; | |
1332 o.annotationTypes = buildUnnamed515(); | |
1333 o.annotationsDataLink = "foo"; | |
1334 o.annotationsLink = "foo"; | |
1335 o.contentVersion = "foo"; | |
1336 o.dataCount = 42; | |
1337 o.id = "foo"; | |
1338 o.kind = "foo"; | |
1339 o.layerId = "foo"; | |
1340 o.selfLink = "foo"; | |
1341 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
1342 o.volumeAnnotationsVersion = "foo"; | |
1343 o.volumeId = "foo"; | |
1344 } | |
1345 buildCounterLayersummary--; | |
1346 return o; | |
1347 } | |
1348 | |
1349 checkLayersummary(api.Layersummary o) { | |
1350 buildCounterLayersummary++; | |
1351 if (buildCounterLayersummary < 3) { | |
1352 unittest.expect(o.annotationCount, unittest.equals(42)); | |
1353 checkUnnamed515(o.annotationTypes); | |
1354 unittest.expect(o.annotationsDataLink, unittest.equals('foo')); | |
1355 unittest.expect(o.annotationsLink, unittest.equals('foo')); | |
1356 unittest.expect(o.contentVersion, unittest.equals('foo')); | |
1357 unittest.expect(o.dataCount, unittest.equals(42)); | |
1358 unittest.expect(o.id, unittest.equals('foo')); | |
1359 unittest.expect(o.kind, unittest.equals('foo')); | |
1360 unittest.expect(o.layerId, unittest.equals('foo')); | |
1361 unittest.expect(o.selfLink, unittest.equals('foo')); | |
1362 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
1363 unittest.expect(o.volumeAnnotationsVersion, unittest.equals('foo')); | |
1364 unittest.expect(o.volumeId, unittest.equals('foo')); | |
1365 } | |
1366 buildCounterLayersummary--; | |
1367 } | |
1368 | |
1369 core.int buildCounterOffersItemsItems = 0; | |
1370 buildOffersItemsItems() { | |
1371 var o = new api.OffersItemsItems(); | |
1372 buildCounterOffersItemsItems++; | |
1373 if (buildCounterOffersItemsItems < 3) { | |
1374 o.author = "foo"; | |
1375 o.canonicalVolumeLink = "foo"; | |
1376 o.coverUrl = "foo"; | |
1377 o.description = "foo"; | |
1378 o.title = "foo"; | |
1379 o.volumeId = "foo"; | |
1380 } | |
1381 buildCounterOffersItemsItems--; | |
1382 return o; | |
1383 } | |
1384 | |
1385 checkOffersItemsItems(api.OffersItemsItems o) { | |
1386 buildCounterOffersItemsItems++; | |
1387 if (buildCounterOffersItemsItems < 3) { | |
1388 unittest.expect(o.author, unittest.equals('foo')); | |
1389 unittest.expect(o.canonicalVolumeLink, unittest.equals('foo')); | |
1390 unittest.expect(o.coverUrl, unittest.equals('foo')); | |
1391 unittest.expect(o.description, unittest.equals('foo')); | |
1392 unittest.expect(o.title, unittest.equals('foo')); | |
1393 unittest.expect(o.volumeId, unittest.equals('foo')); | |
1394 } | |
1395 buildCounterOffersItemsItems--; | |
1396 } | |
1397 | |
1398 buildUnnamed516() { | |
1399 var o = new core.List<api.OffersItemsItems>(); | |
1400 o.add(buildOffersItemsItems()); | |
1401 o.add(buildOffersItemsItems()); | |
1402 return o; | |
1403 } | |
1404 | |
1405 checkUnnamed516(core.List<api.OffersItemsItems> o) { | |
1406 unittest.expect(o, unittest.hasLength(2)); | |
1407 checkOffersItemsItems(o[0]); | |
1408 checkOffersItemsItems(o[1]); | |
1409 } | |
1410 | |
1411 core.int buildCounterOffersItems = 0; | |
1412 buildOffersItems() { | |
1413 var o = new api.OffersItems(); | |
1414 buildCounterOffersItems++; | |
1415 if (buildCounterOffersItems < 3) { | |
1416 o.artUrl = "foo"; | |
1417 o.id = "foo"; | |
1418 o.items = buildUnnamed516(); | |
1419 } | |
1420 buildCounterOffersItems--; | |
1421 return o; | |
1422 } | |
1423 | |
1424 checkOffersItems(api.OffersItems o) { | |
1425 buildCounterOffersItems++; | |
1426 if (buildCounterOffersItems < 3) { | |
1427 unittest.expect(o.artUrl, unittest.equals('foo')); | |
1428 unittest.expect(o.id, unittest.equals('foo')); | |
1429 checkUnnamed516(o.items); | |
1430 } | |
1431 buildCounterOffersItems--; | |
1432 } | |
1433 | |
1434 buildUnnamed517() { | |
1435 var o = new core.List<api.OffersItems>(); | |
1436 o.add(buildOffersItems()); | |
1437 o.add(buildOffersItems()); | |
1438 return o; | |
1439 } | |
1440 | |
1441 checkUnnamed517(core.List<api.OffersItems> o) { | |
1442 unittest.expect(o, unittest.hasLength(2)); | |
1443 checkOffersItems(o[0]); | |
1444 checkOffersItems(o[1]); | |
1445 } | |
1446 | |
1447 core.int buildCounterOffers = 0; | |
1448 buildOffers() { | |
1449 var o = new api.Offers(); | |
1450 buildCounterOffers++; | |
1451 if (buildCounterOffers < 3) { | |
1452 o.items = buildUnnamed517(); | |
1453 o.kind = "foo"; | |
1454 } | |
1455 buildCounterOffers--; | |
1456 return o; | |
1457 } | |
1458 | |
1459 checkOffers(api.Offers o) { | |
1460 buildCounterOffers++; | |
1461 if (buildCounterOffers < 3) { | |
1462 checkUnnamed517(o.items); | |
1463 unittest.expect(o.kind, unittest.equals('foo')); | |
1464 } | |
1465 buildCounterOffers--; | |
1466 } | |
1467 | |
1468 core.int buildCounterReadingPosition = 0; | |
1469 buildReadingPosition() { | |
1470 var o = new api.ReadingPosition(); | |
1471 buildCounterReadingPosition++; | |
1472 if (buildCounterReadingPosition < 3) { | |
1473 o.epubCfiPosition = "foo"; | |
1474 o.gbImagePosition = "foo"; | |
1475 o.gbTextPosition = "foo"; | |
1476 o.kind = "foo"; | |
1477 o.pdfPosition = "foo"; | |
1478 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
1479 o.volumeId = "foo"; | |
1480 } | |
1481 buildCounterReadingPosition--; | |
1482 return o; | |
1483 } | |
1484 | |
1485 checkReadingPosition(api.ReadingPosition o) { | |
1486 buildCounterReadingPosition++; | |
1487 if (buildCounterReadingPosition < 3) { | |
1488 unittest.expect(o.epubCfiPosition, unittest.equals('foo')); | |
1489 unittest.expect(o.gbImagePosition, unittest.equals('foo')); | |
1490 unittest.expect(o.gbTextPosition, unittest.equals('foo')); | |
1491 unittest.expect(o.kind, unittest.equals('foo')); | |
1492 unittest.expect(o.pdfPosition, unittest.equals('foo')); | |
1493 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
1494 unittest.expect(o.volumeId, unittest.equals('foo')); | |
1495 } | |
1496 buildCounterReadingPosition--; | |
1497 } | |
1498 | |
1499 core.int buildCounterRequestAccess = 0; | |
1500 buildRequestAccess() { | |
1501 var o = new api.RequestAccess(); | |
1502 buildCounterRequestAccess++; | |
1503 if (buildCounterRequestAccess < 3) { | |
1504 o.concurrentAccess = buildConcurrentAccessRestriction(); | |
1505 o.downloadAccess = buildDownloadAccessRestriction(); | |
1506 o.kind = "foo"; | |
1507 } | |
1508 buildCounterRequestAccess--; | |
1509 return o; | |
1510 } | |
1511 | |
1512 checkRequestAccess(api.RequestAccess o) { | |
1513 buildCounterRequestAccess++; | |
1514 if (buildCounterRequestAccess < 3) { | |
1515 checkConcurrentAccessRestriction(o.concurrentAccess); | |
1516 checkDownloadAccessRestriction(o.downloadAccess); | |
1517 unittest.expect(o.kind, unittest.equals('foo')); | |
1518 } | |
1519 buildCounterRequestAccess--; | |
1520 } | |
1521 | |
1522 core.int buildCounterReviewAuthor = 0; | |
1523 buildReviewAuthor() { | |
1524 var o = new api.ReviewAuthor(); | |
1525 buildCounterReviewAuthor++; | |
1526 if (buildCounterReviewAuthor < 3) { | |
1527 o.displayName = "foo"; | |
1528 } | |
1529 buildCounterReviewAuthor--; | |
1530 return o; | |
1531 } | |
1532 | |
1533 checkReviewAuthor(api.ReviewAuthor o) { | |
1534 buildCounterReviewAuthor++; | |
1535 if (buildCounterReviewAuthor < 3) { | |
1536 unittest.expect(o.displayName, unittest.equals('foo')); | |
1537 } | |
1538 buildCounterReviewAuthor--; | |
1539 } | |
1540 | |
1541 core.int buildCounterReviewSource = 0; | |
1542 buildReviewSource() { | |
1543 var o = new api.ReviewSource(); | |
1544 buildCounterReviewSource++; | |
1545 if (buildCounterReviewSource < 3) { | |
1546 o.description = "foo"; | |
1547 o.extraDescription = "foo"; | |
1548 o.url = "foo"; | |
1549 } | |
1550 buildCounterReviewSource--; | |
1551 return o; | |
1552 } | |
1553 | |
1554 checkReviewSource(api.ReviewSource o) { | |
1555 buildCounterReviewSource++; | |
1556 if (buildCounterReviewSource < 3) { | |
1557 unittest.expect(o.description, unittest.equals('foo')); | |
1558 unittest.expect(o.extraDescription, unittest.equals('foo')); | |
1559 unittest.expect(o.url, unittest.equals('foo')); | |
1560 } | |
1561 buildCounterReviewSource--; | |
1562 } | |
1563 | |
1564 core.int buildCounterReview = 0; | |
1565 buildReview() { | |
1566 var o = new api.Review(); | |
1567 buildCounterReview++; | |
1568 if (buildCounterReview < 3) { | |
1569 o.author = buildReviewAuthor(); | |
1570 o.content = "foo"; | |
1571 o.date = "foo"; | |
1572 o.fullTextUrl = "foo"; | |
1573 o.kind = "foo"; | |
1574 o.rating = "foo"; | |
1575 o.source = buildReviewSource(); | |
1576 o.title = "foo"; | |
1577 o.type = "foo"; | |
1578 o.volumeId = "foo"; | |
1579 } | |
1580 buildCounterReview--; | |
1581 return o; | |
1582 } | |
1583 | |
1584 checkReview(api.Review o) { | |
1585 buildCounterReview++; | |
1586 if (buildCounterReview < 3) { | |
1587 checkReviewAuthor(o.author); | |
1588 unittest.expect(o.content, unittest.equals('foo')); | |
1589 unittest.expect(o.date, unittest.equals('foo')); | |
1590 unittest.expect(o.fullTextUrl, unittest.equals('foo')); | |
1591 unittest.expect(o.kind, unittest.equals('foo')); | |
1592 unittest.expect(o.rating, unittest.equals('foo')); | |
1593 checkReviewSource(o.source); | |
1594 unittest.expect(o.title, unittest.equals('foo')); | |
1595 unittest.expect(o.type, unittest.equals('foo')); | |
1596 unittest.expect(o.volumeId, unittest.equals('foo')); | |
1597 } | |
1598 buildCounterReview--; | |
1599 } | |
1600 | |
1601 core.int buildCounterVolumeAccessInfoEpub = 0; | |
1602 buildVolumeAccessInfoEpub() { | |
1603 var o = new api.VolumeAccessInfoEpub(); | |
1604 buildCounterVolumeAccessInfoEpub++; | |
1605 if (buildCounterVolumeAccessInfoEpub < 3) { | |
1606 o.acsTokenLink = "foo"; | |
1607 o.downloadLink = "foo"; | |
1608 o.isAvailable = true; | |
1609 } | |
1610 buildCounterVolumeAccessInfoEpub--; | |
1611 return o; | |
1612 } | |
1613 | |
1614 checkVolumeAccessInfoEpub(api.VolumeAccessInfoEpub o) { | |
1615 buildCounterVolumeAccessInfoEpub++; | |
1616 if (buildCounterVolumeAccessInfoEpub < 3) { | |
1617 unittest.expect(o.acsTokenLink, unittest.equals('foo')); | |
1618 unittest.expect(o.downloadLink, unittest.equals('foo')); | |
1619 unittest.expect(o.isAvailable, unittest.isTrue); | |
1620 } | |
1621 buildCounterVolumeAccessInfoEpub--; | |
1622 } | |
1623 | |
1624 core.int buildCounterVolumeAccessInfoPdf = 0; | |
1625 buildVolumeAccessInfoPdf() { | |
1626 var o = new api.VolumeAccessInfoPdf(); | |
1627 buildCounterVolumeAccessInfoPdf++; | |
1628 if (buildCounterVolumeAccessInfoPdf < 3) { | |
1629 o.acsTokenLink = "foo"; | |
1630 o.downloadLink = "foo"; | |
1631 o.isAvailable = true; | |
1632 } | |
1633 buildCounterVolumeAccessInfoPdf--; | |
1634 return o; | |
1635 } | |
1636 | |
1637 checkVolumeAccessInfoPdf(api.VolumeAccessInfoPdf o) { | |
1638 buildCounterVolumeAccessInfoPdf++; | |
1639 if (buildCounterVolumeAccessInfoPdf < 3) { | |
1640 unittest.expect(o.acsTokenLink, unittest.equals('foo')); | |
1641 unittest.expect(o.downloadLink, unittest.equals('foo')); | |
1642 unittest.expect(o.isAvailable, unittest.isTrue); | |
1643 } | |
1644 buildCounterVolumeAccessInfoPdf--; | |
1645 } | |
1646 | |
1647 core.int buildCounterVolumeAccessInfo = 0; | |
1648 buildVolumeAccessInfo() { | |
1649 var o = new api.VolumeAccessInfo(); | |
1650 buildCounterVolumeAccessInfo++; | |
1651 if (buildCounterVolumeAccessInfo < 3) { | |
1652 o.accessViewStatus = "foo"; | |
1653 o.country = "foo"; | |
1654 o.downloadAccess = buildDownloadAccessRestriction(); | |
1655 o.driveImportedContentLink = "foo"; | |
1656 o.embeddable = true; | |
1657 o.epub = buildVolumeAccessInfoEpub(); | |
1658 o.explicitOfflineLicenseManagement = true; | |
1659 o.pdf = buildVolumeAccessInfoPdf(); | |
1660 o.publicDomain = true; | |
1661 o.quoteSharingAllowed = true; | |
1662 o.textToSpeechPermission = "foo"; | |
1663 o.viewOrderUrl = "foo"; | |
1664 o.viewability = "foo"; | |
1665 o.webReaderLink = "foo"; | |
1666 } | |
1667 buildCounterVolumeAccessInfo--; | |
1668 return o; | |
1669 } | |
1670 | |
1671 checkVolumeAccessInfo(api.VolumeAccessInfo o) { | |
1672 buildCounterVolumeAccessInfo++; | |
1673 if (buildCounterVolumeAccessInfo < 3) { | |
1674 unittest.expect(o.accessViewStatus, unittest.equals('foo')); | |
1675 unittest.expect(o.country, unittest.equals('foo')); | |
1676 checkDownloadAccessRestriction(o.downloadAccess); | |
1677 unittest.expect(o.driveImportedContentLink, unittest.equals('foo')); | |
1678 unittest.expect(o.embeddable, unittest.isTrue); | |
1679 checkVolumeAccessInfoEpub(o.epub); | |
1680 unittest.expect(o.explicitOfflineLicenseManagement, unittest.isTrue); | |
1681 checkVolumeAccessInfoPdf(o.pdf); | |
1682 unittest.expect(o.publicDomain, unittest.isTrue); | |
1683 unittest.expect(o.quoteSharingAllowed, unittest.isTrue); | |
1684 unittest.expect(o.textToSpeechPermission, unittest.equals('foo')); | |
1685 unittest.expect(o.viewOrderUrl, unittest.equals('foo')); | |
1686 unittest.expect(o.viewability, unittest.equals('foo')); | |
1687 unittest.expect(o.webReaderLink, unittest.equals('foo')); | |
1688 } | |
1689 buildCounterVolumeAccessInfo--; | |
1690 } | |
1691 | |
1692 core.int buildCounterVolumeLayerInfoLayers = 0; | |
1693 buildVolumeLayerInfoLayers() { | |
1694 var o = new api.VolumeLayerInfoLayers(); | |
1695 buildCounterVolumeLayerInfoLayers++; | |
1696 if (buildCounterVolumeLayerInfoLayers < 3) { | |
1697 o.layerId = "foo"; | |
1698 o.volumeAnnotationsVersion = "foo"; | |
1699 } | |
1700 buildCounterVolumeLayerInfoLayers--; | |
1701 return o; | |
1702 } | |
1703 | |
1704 checkVolumeLayerInfoLayers(api.VolumeLayerInfoLayers o) { | |
1705 buildCounterVolumeLayerInfoLayers++; | |
1706 if (buildCounterVolumeLayerInfoLayers < 3) { | |
1707 unittest.expect(o.layerId, unittest.equals('foo')); | |
1708 unittest.expect(o.volumeAnnotationsVersion, unittest.equals('foo')); | |
1709 } | |
1710 buildCounterVolumeLayerInfoLayers--; | |
1711 } | |
1712 | |
1713 buildUnnamed518() { | |
1714 var o = new core.List<api.VolumeLayerInfoLayers>(); | |
1715 o.add(buildVolumeLayerInfoLayers()); | |
1716 o.add(buildVolumeLayerInfoLayers()); | |
1717 return o; | |
1718 } | |
1719 | |
1720 checkUnnamed518(core.List<api.VolumeLayerInfoLayers> o) { | |
1721 unittest.expect(o, unittest.hasLength(2)); | |
1722 checkVolumeLayerInfoLayers(o[0]); | |
1723 checkVolumeLayerInfoLayers(o[1]); | |
1724 } | |
1725 | |
1726 core.int buildCounterVolumeLayerInfo = 0; | |
1727 buildVolumeLayerInfo() { | |
1728 var o = new api.VolumeLayerInfo(); | |
1729 buildCounterVolumeLayerInfo++; | |
1730 if (buildCounterVolumeLayerInfo < 3) { | |
1731 o.layers = buildUnnamed518(); | |
1732 } | |
1733 buildCounterVolumeLayerInfo--; | |
1734 return o; | |
1735 } | |
1736 | |
1737 checkVolumeLayerInfo(api.VolumeLayerInfo o) { | |
1738 buildCounterVolumeLayerInfo++; | |
1739 if (buildCounterVolumeLayerInfo < 3) { | |
1740 checkUnnamed518(o.layers); | |
1741 } | |
1742 buildCounterVolumeLayerInfo--; | |
1743 } | |
1744 | |
1745 core.int buildCounterVolumeRecommendedInfo = 0; | |
1746 buildVolumeRecommendedInfo() { | |
1747 var o = new api.VolumeRecommendedInfo(); | |
1748 buildCounterVolumeRecommendedInfo++; | |
1749 if (buildCounterVolumeRecommendedInfo < 3) { | |
1750 o.explanation = "foo"; | |
1751 } | |
1752 buildCounterVolumeRecommendedInfo--; | |
1753 return o; | |
1754 } | |
1755 | |
1756 checkVolumeRecommendedInfo(api.VolumeRecommendedInfo o) { | |
1757 buildCounterVolumeRecommendedInfo++; | |
1758 if (buildCounterVolumeRecommendedInfo < 3) { | |
1759 unittest.expect(o.explanation, unittest.equals('foo')); | |
1760 } | |
1761 buildCounterVolumeRecommendedInfo--; | |
1762 } | |
1763 | |
1764 core.int buildCounterVolumeSaleInfoListPrice = 0; | |
1765 buildVolumeSaleInfoListPrice() { | |
1766 var o = new api.VolumeSaleInfoListPrice(); | |
1767 buildCounterVolumeSaleInfoListPrice++; | |
1768 if (buildCounterVolumeSaleInfoListPrice < 3) { | |
1769 o.amount = 42.0; | |
1770 o.currencyCode = "foo"; | |
1771 } | |
1772 buildCounterVolumeSaleInfoListPrice--; | |
1773 return o; | |
1774 } | |
1775 | |
1776 checkVolumeSaleInfoListPrice(api.VolumeSaleInfoListPrice o) { | |
1777 buildCounterVolumeSaleInfoListPrice++; | |
1778 if (buildCounterVolumeSaleInfoListPrice < 3) { | |
1779 unittest.expect(o.amount, unittest.equals(42.0)); | |
1780 unittest.expect(o.currencyCode, unittest.equals('foo')); | |
1781 } | |
1782 buildCounterVolumeSaleInfoListPrice--; | |
1783 } | |
1784 | |
1785 core.int buildCounterVolumeSaleInfoOffersListPrice = 0; | |
1786 buildVolumeSaleInfoOffersListPrice() { | |
1787 var o = new api.VolumeSaleInfoOffersListPrice(); | |
1788 buildCounterVolumeSaleInfoOffersListPrice++; | |
1789 if (buildCounterVolumeSaleInfoOffersListPrice < 3) { | |
1790 o.amountInMicros = 42.0; | |
1791 o.currencyCode = "foo"; | |
1792 } | |
1793 buildCounterVolumeSaleInfoOffersListPrice--; | |
1794 return o; | |
1795 } | |
1796 | |
1797 checkVolumeSaleInfoOffersListPrice(api.VolumeSaleInfoOffersListPrice o) { | |
1798 buildCounterVolumeSaleInfoOffersListPrice++; | |
1799 if (buildCounterVolumeSaleInfoOffersListPrice < 3) { | |
1800 unittest.expect(o.amountInMicros, unittest.equals(42.0)); | |
1801 unittest.expect(o.currencyCode, unittest.equals('foo')); | |
1802 } | |
1803 buildCounterVolumeSaleInfoOffersListPrice--; | |
1804 } | |
1805 | |
1806 core.int buildCounterVolumeSaleInfoOffersRentalDuration = 0; | |
1807 buildVolumeSaleInfoOffersRentalDuration() { | |
1808 var o = new api.VolumeSaleInfoOffersRentalDuration(); | |
1809 buildCounterVolumeSaleInfoOffersRentalDuration++; | |
1810 if (buildCounterVolumeSaleInfoOffersRentalDuration < 3) { | |
1811 o.count = 42.0; | |
1812 o.unit = "foo"; | |
1813 } | |
1814 buildCounterVolumeSaleInfoOffersRentalDuration--; | |
1815 return o; | |
1816 } | |
1817 | |
1818 checkVolumeSaleInfoOffersRentalDuration(api.VolumeSaleInfoOffersRentalDuration o
) { | |
1819 buildCounterVolumeSaleInfoOffersRentalDuration++; | |
1820 if (buildCounterVolumeSaleInfoOffersRentalDuration < 3) { | |
1821 unittest.expect(o.count, unittest.equals(42.0)); | |
1822 unittest.expect(o.unit, unittest.equals('foo')); | |
1823 } | |
1824 buildCounterVolumeSaleInfoOffersRentalDuration--; | |
1825 } | |
1826 | |
1827 core.int buildCounterVolumeSaleInfoOffersRetailPrice = 0; | |
1828 buildVolumeSaleInfoOffersRetailPrice() { | |
1829 var o = new api.VolumeSaleInfoOffersRetailPrice(); | |
1830 buildCounterVolumeSaleInfoOffersRetailPrice++; | |
1831 if (buildCounterVolumeSaleInfoOffersRetailPrice < 3) { | |
1832 o.amountInMicros = 42.0; | |
1833 o.currencyCode = "foo"; | |
1834 } | |
1835 buildCounterVolumeSaleInfoOffersRetailPrice--; | |
1836 return o; | |
1837 } | |
1838 | |
1839 checkVolumeSaleInfoOffersRetailPrice(api.VolumeSaleInfoOffersRetailPrice o) { | |
1840 buildCounterVolumeSaleInfoOffersRetailPrice++; | |
1841 if (buildCounterVolumeSaleInfoOffersRetailPrice < 3) { | |
1842 unittest.expect(o.amountInMicros, unittest.equals(42.0)); | |
1843 unittest.expect(o.currencyCode, unittest.equals('foo')); | |
1844 } | |
1845 buildCounterVolumeSaleInfoOffersRetailPrice--; | |
1846 } | |
1847 | |
1848 core.int buildCounterVolumeSaleInfoOffers = 0; | |
1849 buildVolumeSaleInfoOffers() { | |
1850 var o = new api.VolumeSaleInfoOffers(); | |
1851 buildCounterVolumeSaleInfoOffers++; | |
1852 if (buildCounterVolumeSaleInfoOffers < 3) { | |
1853 o.finskyOfferType = 42; | |
1854 o.listPrice = buildVolumeSaleInfoOffersListPrice(); | |
1855 o.rentalDuration = buildVolumeSaleInfoOffersRentalDuration(); | |
1856 o.retailPrice = buildVolumeSaleInfoOffersRetailPrice(); | |
1857 } | |
1858 buildCounterVolumeSaleInfoOffers--; | |
1859 return o; | |
1860 } | |
1861 | |
1862 checkVolumeSaleInfoOffers(api.VolumeSaleInfoOffers o) { | |
1863 buildCounterVolumeSaleInfoOffers++; | |
1864 if (buildCounterVolumeSaleInfoOffers < 3) { | |
1865 unittest.expect(o.finskyOfferType, unittest.equals(42)); | |
1866 checkVolumeSaleInfoOffersListPrice(o.listPrice); | |
1867 checkVolumeSaleInfoOffersRentalDuration(o.rentalDuration); | |
1868 checkVolumeSaleInfoOffersRetailPrice(o.retailPrice); | |
1869 } | |
1870 buildCounterVolumeSaleInfoOffers--; | |
1871 } | |
1872 | |
1873 buildUnnamed519() { | |
1874 var o = new core.List<api.VolumeSaleInfoOffers>(); | |
1875 o.add(buildVolumeSaleInfoOffers()); | |
1876 o.add(buildVolumeSaleInfoOffers()); | |
1877 return o; | |
1878 } | |
1879 | |
1880 checkUnnamed519(core.List<api.VolumeSaleInfoOffers> o) { | |
1881 unittest.expect(o, unittest.hasLength(2)); | |
1882 checkVolumeSaleInfoOffers(o[0]); | |
1883 checkVolumeSaleInfoOffers(o[1]); | |
1884 } | |
1885 | |
1886 core.int buildCounterVolumeSaleInfoRetailPrice = 0; | |
1887 buildVolumeSaleInfoRetailPrice() { | |
1888 var o = new api.VolumeSaleInfoRetailPrice(); | |
1889 buildCounterVolumeSaleInfoRetailPrice++; | |
1890 if (buildCounterVolumeSaleInfoRetailPrice < 3) { | |
1891 o.amount = 42.0; | |
1892 o.currencyCode = "foo"; | |
1893 } | |
1894 buildCounterVolumeSaleInfoRetailPrice--; | |
1895 return o; | |
1896 } | |
1897 | |
1898 checkVolumeSaleInfoRetailPrice(api.VolumeSaleInfoRetailPrice o) { | |
1899 buildCounterVolumeSaleInfoRetailPrice++; | |
1900 if (buildCounterVolumeSaleInfoRetailPrice < 3) { | |
1901 unittest.expect(o.amount, unittest.equals(42.0)); | |
1902 unittest.expect(o.currencyCode, unittest.equals('foo')); | |
1903 } | |
1904 buildCounterVolumeSaleInfoRetailPrice--; | |
1905 } | |
1906 | |
1907 core.int buildCounterVolumeSaleInfo = 0; | |
1908 buildVolumeSaleInfo() { | |
1909 var o = new api.VolumeSaleInfo(); | |
1910 buildCounterVolumeSaleInfo++; | |
1911 if (buildCounterVolumeSaleInfo < 3) { | |
1912 o.buyLink = "foo"; | |
1913 o.country = "foo"; | |
1914 o.isEbook = true; | |
1915 o.listPrice = buildVolumeSaleInfoListPrice(); | |
1916 o.offers = buildUnnamed519(); | |
1917 o.onSaleDate = core.DateTime.parse("2002-02-27T14:01:02"); | |
1918 o.retailPrice = buildVolumeSaleInfoRetailPrice(); | |
1919 o.saleability = "foo"; | |
1920 } | |
1921 buildCounterVolumeSaleInfo--; | |
1922 return o; | |
1923 } | |
1924 | |
1925 checkVolumeSaleInfo(api.VolumeSaleInfo o) { | |
1926 buildCounterVolumeSaleInfo++; | |
1927 if (buildCounterVolumeSaleInfo < 3) { | |
1928 unittest.expect(o.buyLink, unittest.equals('foo')); | |
1929 unittest.expect(o.country, unittest.equals('foo')); | |
1930 unittest.expect(o.isEbook, unittest.isTrue); | |
1931 checkVolumeSaleInfoListPrice(o.listPrice); | |
1932 checkUnnamed519(o.offers); | |
1933 unittest.expect(o.onSaleDate, unittest.equals(core.DateTime.parse("2002-02-2
7T14:01:02"))); | |
1934 checkVolumeSaleInfoRetailPrice(o.retailPrice); | |
1935 unittest.expect(o.saleability, unittest.equals('foo')); | |
1936 } | |
1937 buildCounterVolumeSaleInfo--; | |
1938 } | |
1939 | |
1940 core.int buildCounterVolumeSearchInfo = 0; | |
1941 buildVolumeSearchInfo() { | |
1942 var o = new api.VolumeSearchInfo(); | |
1943 buildCounterVolumeSearchInfo++; | |
1944 if (buildCounterVolumeSearchInfo < 3) { | |
1945 o.textSnippet = "foo"; | |
1946 } | |
1947 buildCounterVolumeSearchInfo--; | |
1948 return o; | |
1949 } | |
1950 | |
1951 checkVolumeSearchInfo(api.VolumeSearchInfo o) { | |
1952 buildCounterVolumeSearchInfo++; | |
1953 if (buildCounterVolumeSearchInfo < 3) { | |
1954 unittest.expect(o.textSnippet, unittest.equals('foo')); | |
1955 } | |
1956 buildCounterVolumeSearchInfo--; | |
1957 } | |
1958 | |
1959 core.int buildCounterVolumeUserInfoCopy = 0; | |
1960 buildVolumeUserInfoCopy() { | |
1961 var o = new api.VolumeUserInfoCopy(); | |
1962 buildCounterVolumeUserInfoCopy++; | |
1963 if (buildCounterVolumeUserInfoCopy < 3) { | |
1964 o.allowedCharacterCount = 42; | |
1965 o.limitType = "foo"; | |
1966 o.remainingCharacterCount = 42; | |
1967 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
1968 } | |
1969 buildCounterVolumeUserInfoCopy--; | |
1970 return o; | |
1971 } | |
1972 | |
1973 checkVolumeUserInfoCopy(api.VolumeUserInfoCopy o) { | |
1974 buildCounterVolumeUserInfoCopy++; | |
1975 if (buildCounterVolumeUserInfoCopy < 3) { | |
1976 unittest.expect(o.allowedCharacterCount, unittest.equals(42)); | |
1977 unittest.expect(o.limitType, unittest.equals('foo')); | |
1978 unittest.expect(o.remainingCharacterCount, unittest.equals(42)); | |
1979 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
1980 } | |
1981 buildCounterVolumeUserInfoCopy--; | |
1982 } | |
1983 | |
1984 core.int buildCounterVolumeUserInfoRentalPeriod = 0; | |
1985 buildVolumeUserInfoRentalPeriod() { | |
1986 var o = new api.VolumeUserInfoRentalPeriod(); | |
1987 buildCounterVolumeUserInfoRentalPeriod++; | |
1988 if (buildCounterVolumeUserInfoRentalPeriod < 3) { | |
1989 o.endUtcSec = "foo"; | |
1990 o.startUtcSec = "foo"; | |
1991 } | |
1992 buildCounterVolumeUserInfoRentalPeriod--; | |
1993 return o; | |
1994 } | |
1995 | |
1996 checkVolumeUserInfoRentalPeriod(api.VolumeUserInfoRentalPeriod o) { | |
1997 buildCounterVolumeUserInfoRentalPeriod++; | |
1998 if (buildCounterVolumeUserInfoRentalPeriod < 3) { | |
1999 unittest.expect(o.endUtcSec, unittest.equals('foo')); | |
2000 unittest.expect(o.startUtcSec, unittest.equals('foo')); | |
2001 } | |
2002 buildCounterVolumeUserInfoRentalPeriod--; | |
2003 } | |
2004 | |
2005 core.int buildCounterVolumeUserInfoUserUploadedVolumeInfo = 0; | |
2006 buildVolumeUserInfoUserUploadedVolumeInfo() { | |
2007 var o = new api.VolumeUserInfoUserUploadedVolumeInfo(); | |
2008 buildCounterVolumeUserInfoUserUploadedVolumeInfo++; | |
2009 if (buildCounterVolumeUserInfoUserUploadedVolumeInfo < 3) { | |
2010 o.processingState = "foo"; | |
2011 } | |
2012 buildCounterVolumeUserInfoUserUploadedVolumeInfo--; | |
2013 return o; | |
2014 } | |
2015 | |
2016 checkVolumeUserInfoUserUploadedVolumeInfo(api.VolumeUserInfoUserUploadedVolumeIn
fo o) { | |
2017 buildCounterVolumeUserInfoUserUploadedVolumeInfo++; | |
2018 if (buildCounterVolumeUserInfoUserUploadedVolumeInfo < 3) { | |
2019 unittest.expect(o.processingState, unittest.equals('foo')); | |
2020 } | |
2021 buildCounterVolumeUserInfoUserUploadedVolumeInfo--; | |
2022 } | |
2023 | |
2024 core.int buildCounterVolumeUserInfo = 0; | |
2025 buildVolumeUserInfo() { | |
2026 var o = new api.VolumeUserInfo(); | |
2027 buildCounterVolumeUserInfo++; | |
2028 if (buildCounterVolumeUserInfo < 3) { | |
2029 o.copy = buildVolumeUserInfoCopy(); | |
2030 o.isInMyBooks = true; | |
2031 o.isPreordered = true; | |
2032 o.isPurchased = true; | |
2033 o.isUploaded = true; | |
2034 o.readingPosition = buildReadingPosition(); | |
2035 o.rentalPeriod = buildVolumeUserInfoRentalPeriod(); | |
2036 o.rentalState = "foo"; | |
2037 o.review = buildReview(); | |
2038 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
2039 o.userUploadedVolumeInfo = buildVolumeUserInfoUserUploadedVolumeInfo(); | |
2040 } | |
2041 buildCounterVolumeUserInfo--; | |
2042 return o; | |
2043 } | |
2044 | |
2045 checkVolumeUserInfo(api.VolumeUserInfo o) { | |
2046 buildCounterVolumeUserInfo++; | |
2047 if (buildCounterVolumeUserInfo < 3) { | |
2048 checkVolumeUserInfoCopy(o.copy); | |
2049 unittest.expect(o.isInMyBooks, unittest.isTrue); | |
2050 unittest.expect(o.isPreordered, unittest.isTrue); | |
2051 unittest.expect(o.isPurchased, unittest.isTrue); | |
2052 unittest.expect(o.isUploaded, unittest.isTrue); | |
2053 checkReadingPosition(o.readingPosition); | |
2054 checkVolumeUserInfoRentalPeriod(o.rentalPeriod); | |
2055 unittest.expect(o.rentalState, unittest.equals('foo')); | |
2056 checkReview(o.review); | |
2057 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
2058 checkVolumeUserInfoUserUploadedVolumeInfo(o.userUploadedVolumeInfo); | |
2059 } | |
2060 buildCounterVolumeUserInfo--; | |
2061 } | |
2062 | |
2063 buildUnnamed520() { | |
2064 var o = new core.List<core.String>(); | |
2065 o.add("foo"); | |
2066 o.add("foo"); | |
2067 return o; | |
2068 } | |
2069 | |
2070 checkUnnamed520(core.List<core.String> o) { | |
2071 unittest.expect(o, unittest.hasLength(2)); | |
2072 unittest.expect(o[0], unittest.equals('foo')); | |
2073 unittest.expect(o[1], unittest.equals('foo')); | |
2074 } | |
2075 | |
2076 buildUnnamed521() { | |
2077 var o = new core.List<core.String>(); | |
2078 o.add("foo"); | |
2079 o.add("foo"); | |
2080 return o; | |
2081 } | |
2082 | |
2083 checkUnnamed521(core.List<core.String> o) { | |
2084 unittest.expect(o, unittest.hasLength(2)); | |
2085 unittest.expect(o[0], unittest.equals('foo')); | |
2086 unittest.expect(o[1], unittest.equals('foo')); | |
2087 } | |
2088 | |
2089 core.int buildCounterVolumeVolumeInfoDimensions = 0; | |
2090 buildVolumeVolumeInfoDimensions() { | |
2091 var o = new api.VolumeVolumeInfoDimensions(); | |
2092 buildCounterVolumeVolumeInfoDimensions++; | |
2093 if (buildCounterVolumeVolumeInfoDimensions < 3) { | |
2094 o.height = "foo"; | |
2095 o.thickness = "foo"; | |
2096 o.width = "foo"; | |
2097 } | |
2098 buildCounterVolumeVolumeInfoDimensions--; | |
2099 return o; | |
2100 } | |
2101 | |
2102 checkVolumeVolumeInfoDimensions(api.VolumeVolumeInfoDimensions o) { | |
2103 buildCounterVolumeVolumeInfoDimensions++; | |
2104 if (buildCounterVolumeVolumeInfoDimensions < 3) { | |
2105 unittest.expect(o.height, unittest.equals('foo')); | |
2106 unittest.expect(o.thickness, unittest.equals('foo')); | |
2107 unittest.expect(o.width, unittest.equals('foo')); | |
2108 } | |
2109 buildCounterVolumeVolumeInfoDimensions--; | |
2110 } | |
2111 | |
2112 core.int buildCounterVolumeVolumeInfoImageLinks = 0; | |
2113 buildVolumeVolumeInfoImageLinks() { | |
2114 var o = new api.VolumeVolumeInfoImageLinks(); | |
2115 buildCounterVolumeVolumeInfoImageLinks++; | |
2116 if (buildCounterVolumeVolumeInfoImageLinks < 3) { | |
2117 o.extraLarge = "foo"; | |
2118 o.large = "foo"; | |
2119 o.medium = "foo"; | |
2120 o.small = "foo"; | |
2121 o.smallThumbnail = "foo"; | |
2122 o.thumbnail = "foo"; | |
2123 } | |
2124 buildCounterVolumeVolumeInfoImageLinks--; | |
2125 return o; | |
2126 } | |
2127 | |
2128 checkVolumeVolumeInfoImageLinks(api.VolumeVolumeInfoImageLinks o) { | |
2129 buildCounterVolumeVolumeInfoImageLinks++; | |
2130 if (buildCounterVolumeVolumeInfoImageLinks < 3) { | |
2131 unittest.expect(o.extraLarge, unittest.equals('foo')); | |
2132 unittest.expect(o.large, unittest.equals('foo')); | |
2133 unittest.expect(o.medium, unittest.equals('foo')); | |
2134 unittest.expect(o.small, unittest.equals('foo')); | |
2135 unittest.expect(o.smallThumbnail, unittest.equals('foo')); | |
2136 unittest.expect(o.thumbnail, unittest.equals('foo')); | |
2137 } | |
2138 buildCounterVolumeVolumeInfoImageLinks--; | |
2139 } | |
2140 | |
2141 core.int buildCounterVolumeVolumeInfoIndustryIdentifiers = 0; | |
2142 buildVolumeVolumeInfoIndustryIdentifiers() { | |
2143 var o = new api.VolumeVolumeInfoIndustryIdentifiers(); | |
2144 buildCounterVolumeVolumeInfoIndustryIdentifiers++; | |
2145 if (buildCounterVolumeVolumeInfoIndustryIdentifiers < 3) { | |
2146 o.identifier = "foo"; | |
2147 o.type = "foo"; | |
2148 } | |
2149 buildCounterVolumeVolumeInfoIndustryIdentifiers--; | |
2150 return o; | |
2151 } | |
2152 | |
2153 checkVolumeVolumeInfoIndustryIdentifiers(api.VolumeVolumeInfoIndustryIdentifiers
o) { | |
2154 buildCounterVolumeVolumeInfoIndustryIdentifiers++; | |
2155 if (buildCounterVolumeVolumeInfoIndustryIdentifiers < 3) { | |
2156 unittest.expect(o.identifier, unittest.equals('foo')); | |
2157 unittest.expect(o.type, unittest.equals('foo')); | |
2158 } | |
2159 buildCounterVolumeVolumeInfoIndustryIdentifiers--; | |
2160 } | |
2161 | |
2162 buildUnnamed522() { | |
2163 var o = new core.List<api.VolumeVolumeInfoIndustryIdentifiers>(); | |
2164 o.add(buildVolumeVolumeInfoIndustryIdentifiers()); | |
2165 o.add(buildVolumeVolumeInfoIndustryIdentifiers()); | |
2166 return o; | |
2167 } | |
2168 | |
2169 checkUnnamed522(core.List<api.VolumeVolumeInfoIndustryIdentifiers> o) { | |
2170 unittest.expect(o, unittest.hasLength(2)); | |
2171 checkVolumeVolumeInfoIndustryIdentifiers(o[0]); | |
2172 checkVolumeVolumeInfoIndustryIdentifiers(o[1]); | |
2173 } | |
2174 | |
2175 core.int buildCounterVolumeVolumeInfo = 0; | |
2176 buildVolumeVolumeInfo() { | |
2177 var o = new api.VolumeVolumeInfo(); | |
2178 buildCounterVolumeVolumeInfo++; | |
2179 if (buildCounterVolumeVolumeInfo < 3) { | |
2180 o.authors = buildUnnamed520(); | |
2181 o.averageRating = 42.0; | |
2182 o.canonicalVolumeLink = "foo"; | |
2183 o.categories = buildUnnamed521(); | |
2184 o.contentVersion = "foo"; | |
2185 o.description = "foo"; | |
2186 o.dimensions = buildVolumeVolumeInfoDimensions(); | |
2187 o.imageLinks = buildVolumeVolumeInfoImageLinks(); | |
2188 o.industryIdentifiers = buildUnnamed522(); | |
2189 o.infoLink = "foo"; | |
2190 o.language = "foo"; | |
2191 o.mainCategory = "foo"; | |
2192 o.pageCount = 42; | |
2193 o.previewLink = "foo"; | |
2194 o.printType = "foo"; | |
2195 o.printedPageCount = 42; | |
2196 o.publishedDate = "foo"; | |
2197 o.publisher = "foo"; | |
2198 o.ratingsCount = 42; | |
2199 o.readingModes = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
2200 o.subtitle = "foo"; | |
2201 o.title = "foo"; | |
2202 } | |
2203 buildCounterVolumeVolumeInfo--; | |
2204 return o; | |
2205 } | |
2206 | |
2207 checkVolumeVolumeInfo(api.VolumeVolumeInfo o) { | |
2208 buildCounterVolumeVolumeInfo++; | |
2209 if (buildCounterVolumeVolumeInfo < 3) { | |
2210 checkUnnamed520(o.authors); | |
2211 unittest.expect(o.averageRating, unittest.equals(42.0)); | |
2212 unittest.expect(o.canonicalVolumeLink, unittest.equals('foo')); | |
2213 checkUnnamed521(o.categories); | |
2214 unittest.expect(o.contentVersion, unittest.equals('foo')); | |
2215 unittest.expect(o.description, unittest.equals('foo')); | |
2216 checkVolumeVolumeInfoDimensions(o.dimensions); | |
2217 checkVolumeVolumeInfoImageLinks(o.imageLinks); | |
2218 checkUnnamed522(o.industryIdentifiers); | |
2219 unittest.expect(o.infoLink, unittest.equals('foo')); | |
2220 unittest.expect(o.language, unittest.equals('foo')); | |
2221 unittest.expect(o.mainCategory, unittest.equals('foo')); | |
2222 unittest.expect(o.pageCount, unittest.equals(42)); | |
2223 unittest.expect(o.previewLink, unittest.equals('foo')); | |
2224 unittest.expect(o.printType, unittest.equals('foo')); | |
2225 unittest.expect(o.printedPageCount, unittest.equals(42)); | |
2226 unittest.expect(o.publishedDate, unittest.equals('foo')); | |
2227 unittest.expect(o.publisher, unittest.equals('foo')); | |
2228 unittest.expect(o.ratingsCount, unittest.equals(42)); | |
2229 var casted2 = (o.readingModes) as core.Map; unittest.expect(casted2, unittes
t.hasLength(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); u
nittest.expect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2[
"string"], unittest.equals('foo')); | |
2230 unittest.expect(o.subtitle, unittest.equals('foo')); | |
2231 unittest.expect(o.title, unittest.equals('foo')); | |
2232 } | |
2233 buildCounterVolumeVolumeInfo--; | |
2234 } | |
2235 | |
2236 core.int buildCounterVolume = 0; | |
2237 buildVolume() { | |
2238 var o = new api.Volume(); | |
2239 buildCounterVolume++; | |
2240 if (buildCounterVolume < 3) { | |
2241 o.accessInfo = buildVolumeAccessInfo(); | |
2242 o.etag = "foo"; | |
2243 o.id = "foo"; | |
2244 o.kind = "foo"; | |
2245 o.layerInfo = buildVolumeLayerInfo(); | |
2246 o.recommendedInfo = buildVolumeRecommendedInfo(); | |
2247 o.saleInfo = buildVolumeSaleInfo(); | |
2248 o.searchInfo = buildVolumeSearchInfo(); | |
2249 o.selfLink = "foo"; | |
2250 o.userInfo = buildVolumeUserInfo(); | |
2251 o.volumeInfo = buildVolumeVolumeInfo(); | |
2252 } | |
2253 buildCounterVolume--; | |
2254 return o; | |
2255 } | |
2256 | |
2257 checkVolume(api.Volume o) { | |
2258 buildCounterVolume++; | |
2259 if (buildCounterVolume < 3) { | |
2260 checkVolumeAccessInfo(o.accessInfo); | |
2261 unittest.expect(o.etag, unittest.equals('foo')); | |
2262 unittest.expect(o.id, unittest.equals('foo')); | |
2263 unittest.expect(o.kind, unittest.equals('foo')); | |
2264 checkVolumeLayerInfo(o.layerInfo); | |
2265 checkVolumeRecommendedInfo(o.recommendedInfo); | |
2266 checkVolumeSaleInfo(o.saleInfo); | |
2267 checkVolumeSearchInfo(o.searchInfo); | |
2268 unittest.expect(o.selfLink, unittest.equals('foo')); | |
2269 checkVolumeUserInfo(o.userInfo); | |
2270 checkVolumeVolumeInfo(o.volumeInfo); | |
2271 } | |
2272 buildCounterVolume--; | |
2273 } | |
2274 | |
2275 core.int buildCounterVolumeannotationContentRanges = 0; | |
2276 buildVolumeannotationContentRanges() { | |
2277 var o = new api.VolumeannotationContentRanges(); | |
2278 buildCounterVolumeannotationContentRanges++; | |
2279 if (buildCounterVolumeannotationContentRanges < 3) { | |
2280 o.cfiRange = buildBooksAnnotationsRange(); | |
2281 o.contentVersion = "foo"; | |
2282 o.gbImageRange = buildBooksAnnotationsRange(); | |
2283 o.gbTextRange = buildBooksAnnotationsRange(); | |
2284 } | |
2285 buildCounterVolumeannotationContentRanges--; | |
2286 return o; | |
2287 } | |
2288 | |
2289 checkVolumeannotationContentRanges(api.VolumeannotationContentRanges o) { | |
2290 buildCounterVolumeannotationContentRanges++; | |
2291 if (buildCounterVolumeannotationContentRanges < 3) { | |
2292 checkBooksAnnotationsRange(o.cfiRange); | |
2293 unittest.expect(o.contentVersion, unittest.equals('foo')); | |
2294 checkBooksAnnotationsRange(o.gbImageRange); | |
2295 checkBooksAnnotationsRange(o.gbTextRange); | |
2296 } | |
2297 buildCounterVolumeannotationContentRanges--; | |
2298 } | |
2299 | |
2300 buildUnnamed523() { | |
2301 var o = new core.List<core.String>(); | |
2302 o.add("foo"); | |
2303 o.add("foo"); | |
2304 return o; | |
2305 } | |
2306 | |
2307 checkUnnamed523(core.List<core.String> o) { | |
2308 unittest.expect(o, unittest.hasLength(2)); | |
2309 unittest.expect(o[0], unittest.equals('foo')); | |
2310 unittest.expect(o[1], unittest.equals('foo')); | |
2311 } | |
2312 | |
2313 core.int buildCounterVolumeannotation = 0; | |
2314 buildVolumeannotation() { | |
2315 var o = new api.Volumeannotation(); | |
2316 buildCounterVolumeannotation++; | |
2317 if (buildCounterVolumeannotation < 3) { | |
2318 o.annotationDataId = "foo"; | |
2319 o.annotationDataLink = "foo"; | |
2320 o.annotationType = "foo"; | |
2321 o.contentRanges = buildVolumeannotationContentRanges(); | |
2322 o.data = "foo"; | |
2323 o.deleted = true; | |
2324 o.id = "foo"; | |
2325 o.kind = "foo"; | |
2326 o.layerId = "foo"; | |
2327 o.pageIds = buildUnnamed523(); | |
2328 o.selectedText = "foo"; | |
2329 o.selfLink = "foo"; | |
2330 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
2331 o.volumeId = "foo"; | |
2332 } | |
2333 buildCounterVolumeannotation--; | |
2334 return o; | |
2335 } | |
2336 | |
2337 checkVolumeannotation(api.Volumeannotation o) { | |
2338 buildCounterVolumeannotation++; | |
2339 if (buildCounterVolumeannotation < 3) { | |
2340 unittest.expect(o.annotationDataId, unittest.equals('foo')); | |
2341 unittest.expect(o.annotationDataLink, unittest.equals('foo')); | |
2342 unittest.expect(o.annotationType, unittest.equals('foo')); | |
2343 checkVolumeannotationContentRanges(o.contentRanges); | |
2344 unittest.expect(o.data, unittest.equals('foo')); | |
2345 unittest.expect(o.deleted, unittest.isTrue); | |
2346 unittest.expect(o.id, unittest.equals('foo')); | |
2347 unittest.expect(o.kind, unittest.equals('foo')); | |
2348 unittest.expect(o.layerId, unittest.equals('foo')); | |
2349 checkUnnamed523(o.pageIds); | |
2350 unittest.expect(o.selectedText, unittest.equals('foo')); | |
2351 unittest.expect(o.selfLink, unittest.equals('foo')); | |
2352 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
2353 unittest.expect(o.volumeId, unittest.equals('foo')); | |
2354 } | |
2355 buildCounterVolumeannotation--; | |
2356 } | |
2357 | |
2358 buildUnnamed524() { | |
2359 var o = new core.List<api.Volumeannotation>(); | |
2360 o.add(buildVolumeannotation()); | |
2361 o.add(buildVolumeannotation()); | |
2362 return o; | |
2363 } | |
2364 | |
2365 checkUnnamed524(core.List<api.Volumeannotation> o) { | |
2366 unittest.expect(o, unittest.hasLength(2)); | |
2367 checkVolumeannotation(o[0]); | |
2368 checkVolumeannotation(o[1]); | |
2369 } | |
2370 | |
2371 core.int buildCounterVolumeannotations = 0; | |
2372 buildVolumeannotations() { | |
2373 var o = new api.Volumeannotations(); | |
2374 buildCounterVolumeannotations++; | |
2375 if (buildCounterVolumeannotations < 3) { | |
2376 o.items = buildUnnamed524(); | |
2377 o.kind = "foo"; | |
2378 o.nextPageToken = "foo"; | |
2379 o.totalItems = 42; | |
2380 o.version = "foo"; | |
2381 } | |
2382 buildCounterVolumeannotations--; | |
2383 return o; | |
2384 } | |
2385 | |
2386 checkVolumeannotations(api.Volumeannotations o) { | |
2387 buildCounterVolumeannotations++; | |
2388 if (buildCounterVolumeannotations < 3) { | |
2389 checkUnnamed524(o.items); | |
2390 unittest.expect(o.kind, unittest.equals('foo')); | |
2391 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
2392 unittest.expect(o.totalItems, unittest.equals(42)); | |
2393 unittest.expect(o.version, unittest.equals('foo')); | |
2394 } | |
2395 buildCounterVolumeannotations--; | |
2396 } | |
2397 | |
2398 buildUnnamed525() { | |
2399 var o = new core.List<api.Volume>(); | |
2400 o.add(buildVolume()); | |
2401 o.add(buildVolume()); | |
2402 return o; | |
2403 } | |
2404 | |
2405 checkUnnamed525(core.List<api.Volume> o) { | |
2406 unittest.expect(o, unittest.hasLength(2)); | |
2407 checkVolume(o[0]); | |
2408 checkVolume(o[1]); | |
2409 } | |
2410 | |
2411 core.int buildCounterVolumes = 0; | |
2412 buildVolumes() { | |
2413 var o = new api.Volumes(); | |
2414 buildCounterVolumes++; | |
2415 if (buildCounterVolumes < 3) { | |
2416 o.items = buildUnnamed525(); | |
2417 o.kind = "foo"; | |
2418 o.totalItems = 42; | |
2419 } | |
2420 buildCounterVolumes--; | |
2421 return o; | |
2422 } | |
2423 | |
2424 checkVolumes(api.Volumes o) { | |
2425 buildCounterVolumes++; | |
2426 if (buildCounterVolumes < 3) { | |
2427 checkUnnamed525(o.items); | |
2428 unittest.expect(o.kind, unittest.equals('foo')); | |
2429 unittest.expect(o.totalItems, unittest.equals(42)); | |
2430 } | |
2431 buildCounterVolumes--; | |
2432 } | |
2433 | |
2434 buildUnnamed526() { | |
2435 var o = new core.List<core.String>(); | |
2436 o.add("foo"); | |
2437 o.add("foo"); | |
2438 return o; | |
2439 } | |
2440 | |
2441 checkUnnamed526(core.List<core.String> o) { | |
2442 unittest.expect(o, unittest.hasLength(2)); | |
2443 unittest.expect(o[0], unittest.equals('foo')); | |
2444 unittest.expect(o[1], unittest.equals('foo')); | |
2445 } | |
2446 | |
2447 buildUnnamed527() { | |
2448 var o = new core.List<core.String>(); | |
2449 o.add("foo"); | |
2450 o.add("foo"); | |
2451 return o; | |
2452 } | |
2453 | |
2454 checkUnnamed527(core.List<core.String> o) { | |
2455 unittest.expect(o, unittest.hasLength(2)); | |
2456 unittest.expect(o[0], unittest.equals('foo')); | |
2457 unittest.expect(o[1], unittest.equals('foo')); | |
2458 } | |
2459 | |
2460 buildUnnamed528() { | |
2461 var o = new core.List<core.String>(); | |
2462 o.add("foo"); | |
2463 o.add("foo"); | |
2464 return o; | |
2465 } | |
2466 | |
2467 checkUnnamed528(core.List<core.String> o) { | |
2468 unittest.expect(o, unittest.hasLength(2)); | |
2469 unittest.expect(o[0], unittest.equals('foo')); | |
2470 unittest.expect(o[1], unittest.equals('foo')); | |
2471 } | |
2472 | |
2473 buildUnnamed529() { | |
2474 var o = new core.List<core.String>(); | |
2475 o.add("foo"); | |
2476 o.add("foo"); | |
2477 return o; | |
2478 } | |
2479 | |
2480 checkUnnamed529(core.List<core.String> o) { | |
2481 unittest.expect(o, unittest.hasLength(2)); | |
2482 unittest.expect(o[0], unittest.equals('foo')); | |
2483 unittest.expect(o[1], unittest.equals('foo')); | |
2484 } | |
2485 | |
2486 buildUnnamed530() { | |
2487 var o = new core.List<core.String>(); | |
2488 o.add("foo"); | |
2489 o.add("foo"); | |
2490 return o; | |
2491 } | |
2492 | |
2493 checkUnnamed530(core.List<core.String> o) { | |
2494 unittest.expect(o, unittest.hasLength(2)); | |
2495 unittest.expect(o[0], unittest.equals('foo')); | |
2496 unittest.expect(o[1], unittest.equals('foo')); | |
2497 } | |
2498 | |
2499 buildUnnamed531() { | |
2500 var o = new core.List<core.String>(); | |
2501 o.add("foo"); | |
2502 o.add("foo"); | |
2503 return o; | |
2504 } | |
2505 | |
2506 checkUnnamed531(core.List<core.String> o) { | |
2507 unittest.expect(o, unittest.hasLength(2)); | |
2508 unittest.expect(o[0], unittest.equals('foo')); | |
2509 unittest.expect(o[1], unittest.equals('foo')); | |
2510 } | |
2511 | |
2512 buildUnnamed532() { | |
2513 var o = new core.List<core.String>(); | |
2514 o.add("foo"); | |
2515 o.add("foo"); | |
2516 return o; | |
2517 } | |
2518 | |
2519 checkUnnamed532(core.List<core.String> o) { | |
2520 unittest.expect(o, unittest.hasLength(2)); | |
2521 unittest.expect(o[0], unittest.equals('foo')); | |
2522 unittest.expect(o[1], unittest.equals('foo')); | |
2523 } | |
2524 | |
2525 buildUnnamed533() { | |
2526 var o = new core.List<core.String>(); | |
2527 o.add("foo"); | |
2528 o.add("foo"); | |
2529 return o; | |
2530 } | |
2531 | |
2532 checkUnnamed533(core.List<core.String> o) { | |
2533 unittest.expect(o, unittest.hasLength(2)); | |
2534 unittest.expect(o[0], unittest.equals('foo')); | |
2535 unittest.expect(o[1], unittest.equals('foo')); | |
2536 } | |
2537 | |
2538 buildUnnamed534() { | |
2539 var o = new core.List<core.String>(); | |
2540 o.add("foo"); | |
2541 o.add("foo"); | |
2542 return o; | |
2543 } | |
2544 | |
2545 checkUnnamed534(core.List<core.String> o) { | |
2546 unittest.expect(o, unittest.hasLength(2)); | |
2547 unittest.expect(o[0], unittest.equals('foo')); | |
2548 unittest.expect(o[1], unittest.equals('foo')); | |
2549 } | |
2550 | |
2551 buildUnnamed535() { | |
2552 var o = new core.List<core.String>(); | |
2553 o.add("foo"); | |
2554 o.add("foo"); | |
2555 return o; | |
2556 } | |
2557 | |
2558 checkUnnamed535(core.List<core.String> o) { | |
2559 unittest.expect(o, unittest.hasLength(2)); | |
2560 unittest.expect(o[0], unittest.equals('foo')); | |
2561 unittest.expect(o[1], unittest.equals('foo')); | |
2562 } | |
2563 | |
2564 buildUnnamed536() { | |
2565 var o = new core.List<core.String>(); | |
2566 o.add("foo"); | |
2567 o.add("foo"); | |
2568 return o; | |
2569 } | |
2570 | |
2571 checkUnnamed536(core.List<core.String> o) { | |
2572 unittest.expect(o, unittest.hasLength(2)); | |
2573 unittest.expect(o[0], unittest.equals('foo')); | |
2574 unittest.expect(o[1], unittest.equals('foo')); | |
2575 } | |
2576 | |
2577 | |
2578 main() { | |
2579 unittest.group("obj-schema-AnnotationClientVersionRanges", () { | |
2580 unittest.test("to-json--from-json", () { | |
2581 var o = buildAnnotationClientVersionRanges(); | |
2582 var od = new api.AnnotationClientVersionRanges.fromJson(o.toJson()); | |
2583 checkAnnotationClientVersionRanges(od); | |
2584 }); | |
2585 }); | |
2586 | |
2587 | |
2588 unittest.group("obj-schema-AnnotationCurrentVersionRanges", () { | |
2589 unittest.test("to-json--from-json", () { | |
2590 var o = buildAnnotationCurrentVersionRanges(); | |
2591 var od = new api.AnnotationCurrentVersionRanges.fromJson(o.toJson()); | |
2592 checkAnnotationCurrentVersionRanges(od); | |
2593 }); | |
2594 }); | |
2595 | |
2596 | |
2597 unittest.group("obj-schema-AnnotationLayerSummary", () { | |
2598 unittest.test("to-json--from-json", () { | |
2599 var o = buildAnnotationLayerSummary(); | |
2600 var od = new api.AnnotationLayerSummary.fromJson(o.toJson()); | |
2601 checkAnnotationLayerSummary(od); | |
2602 }); | |
2603 }); | |
2604 | |
2605 | |
2606 unittest.group("obj-schema-Annotation", () { | |
2607 unittest.test("to-json--from-json", () { | |
2608 var o = buildAnnotation(); | |
2609 var od = new api.Annotation.fromJson(o.toJson()); | |
2610 checkAnnotation(od); | |
2611 }); | |
2612 }); | |
2613 | |
2614 | |
2615 unittest.group("obj-schema-Annotationdata", () { | |
2616 unittest.test("to-json--from-json", () { | |
2617 var o = buildAnnotationdata(); | |
2618 var od = new api.Annotationdata.fromJson(o.toJson()); | |
2619 checkAnnotationdata(od); | |
2620 }); | |
2621 }); | |
2622 | |
2623 | |
2624 unittest.group("obj-schema-Annotations", () { | |
2625 unittest.test("to-json--from-json", () { | |
2626 var o = buildAnnotations(); | |
2627 var od = new api.Annotations.fromJson(o.toJson()); | |
2628 checkAnnotations(od); | |
2629 }); | |
2630 }); | |
2631 | |
2632 | |
2633 unittest.group("obj-schema-AnnotationsSummaryLayers", () { | |
2634 unittest.test("to-json--from-json", () { | |
2635 var o = buildAnnotationsSummaryLayers(); | |
2636 var od = new api.AnnotationsSummaryLayers.fromJson(o.toJson()); | |
2637 checkAnnotationsSummaryLayers(od); | |
2638 }); | |
2639 }); | |
2640 | |
2641 | |
2642 unittest.group("obj-schema-AnnotationsSummary", () { | |
2643 unittest.test("to-json--from-json", () { | |
2644 var o = buildAnnotationsSummary(); | |
2645 var od = new api.AnnotationsSummary.fromJson(o.toJson()); | |
2646 checkAnnotationsSummary(od); | |
2647 }); | |
2648 }); | |
2649 | |
2650 | |
2651 unittest.group("obj-schema-Annotationsdata", () { | |
2652 unittest.test("to-json--from-json", () { | |
2653 var o = buildAnnotationsdata(); | |
2654 var od = new api.Annotationsdata.fromJson(o.toJson()); | |
2655 checkAnnotationsdata(od); | |
2656 }); | |
2657 }); | |
2658 | |
2659 | |
2660 unittest.group("obj-schema-BooksAnnotationsRange", () { | |
2661 unittest.test("to-json--from-json", () { | |
2662 var o = buildBooksAnnotationsRange(); | |
2663 var od = new api.BooksAnnotationsRange.fromJson(o.toJson()); | |
2664 checkBooksAnnotationsRange(od); | |
2665 }); | |
2666 }); | |
2667 | |
2668 | |
2669 unittest.group("obj-schema-BooksCloudloadingResource", () { | |
2670 unittest.test("to-json--from-json", () { | |
2671 var o = buildBooksCloudloadingResource(); | |
2672 var od = new api.BooksCloudloadingResource.fromJson(o.toJson()); | |
2673 checkBooksCloudloadingResource(od); | |
2674 }); | |
2675 }); | |
2676 | |
2677 | |
2678 unittest.group("obj-schema-BooksVolumesRecommendedRateResponse", () { | |
2679 unittest.test("to-json--from-json", () { | |
2680 var o = buildBooksVolumesRecommendedRateResponse(); | |
2681 var od = new api.BooksVolumesRecommendedRateResponse.fromJson(o.toJson()); | |
2682 checkBooksVolumesRecommendedRateResponse(od); | |
2683 }); | |
2684 }); | |
2685 | |
2686 | |
2687 unittest.group("obj-schema-Bookshelf", () { | |
2688 unittest.test("to-json--from-json", () { | |
2689 var o = buildBookshelf(); | |
2690 var od = new api.Bookshelf.fromJson(o.toJson()); | |
2691 checkBookshelf(od); | |
2692 }); | |
2693 }); | |
2694 | |
2695 | |
2696 unittest.group("obj-schema-Bookshelves", () { | |
2697 unittest.test("to-json--from-json", () { | |
2698 var o = buildBookshelves(); | |
2699 var od = new api.Bookshelves.fromJson(o.toJson()); | |
2700 checkBookshelves(od); | |
2701 }); | |
2702 }); | |
2703 | |
2704 | |
2705 unittest.group("obj-schema-ConcurrentAccessRestriction", () { | |
2706 unittest.test("to-json--from-json", () { | |
2707 var o = buildConcurrentAccessRestriction(); | |
2708 var od = new api.ConcurrentAccessRestriction.fromJson(o.toJson()); | |
2709 checkConcurrentAccessRestriction(od); | |
2710 }); | |
2711 }); | |
2712 | |
2713 | |
2714 unittest.group("obj-schema-DictlayerdataCommon", () { | |
2715 unittest.test("to-json--from-json", () { | |
2716 var o = buildDictlayerdataCommon(); | |
2717 var od = new api.DictlayerdataCommon.fromJson(o.toJson()); | |
2718 checkDictlayerdataCommon(od); | |
2719 }); | |
2720 }); | |
2721 | |
2722 | |
2723 unittest.group("obj-schema-DictlayerdataDictSource", () { | |
2724 unittest.test("to-json--from-json", () { | |
2725 var o = buildDictlayerdataDictSource(); | |
2726 var od = new api.DictlayerdataDictSource.fromJson(o.toJson()); | |
2727 checkDictlayerdataDictSource(od); | |
2728 }); | |
2729 }); | |
2730 | |
2731 | |
2732 unittest.group("obj-schema-DictlayerdataDictWordsDerivativesSource", () { | |
2733 unittest.test("to-json--from-json", () { | |
2734 var o = buildDictlayerdataDictWordsDerivativesSource(); | |
2735 var od = new api.DictlayerdataDictWordsDerivativesSource.fromJson(o.toJson
()); | |
2736 checkDictlayerdataDictWordsDerivativesSource(od); | |
2737 }); | |
2738 }); | |
2739 | |
2740 | |
2741 unittest.group("obj-schema-DictlayerdataDictWordsDerivatives", () { | |
2742 unittest.test("to-json--from-json", () { | |
2743 var o = buildDictlayerdataDictWordsDerivatives(); | |
2744 var od = new api.DictlayerdataDictWordsDerivatives.fromJson(o.toJson()); | |
2745 checkDictlayerdataDictWordsDerivatives(od); | |
2746 }); | |
2747 }); | |
2748 | |
2749 | |
2750 unittest.group("obj-schema-DictlayerdataDictWordsExamplesSource", () { | |
2751 unittest.test("to-json--from-json", () { | |
2752 var o = buildDictlayerdataDictWordsExamplesSource(); | |
2753 var od = new api.DictlayerdataDictWordsExamplesSource.fromJson(o.toJson())
; | |
2754 checkDictlayerdataDictWordsExamplesSource(od); | |
2755 }); | |
2756 }); | |
2757 | |
2758 | |
2759 unittest.group("obj-schema-DictlayerdataDictWordsExamples", () { | |
2760 unittest.test("to-json--from-json", () { | |
2761 var o = buildDictlayerdataDictWordsExamples(); | |
2762 var od = new api.DictlayerdataDictWordsExamples.fromJson(o.toJson()); | |
2763 checkDictlayerdataDictWordsExamples(od); | |
2764 }); | |
2765 }); | |
2766 | |
2767 | |
2768 unittest.group("obj-schema-DictlayerdataDictWordsSensesConjugations", () { | |
2769 unittest.test("to-json--from-json", () { | |
2770 var o = buildDictlayerdataDictWordsSensesConjugations(); | |
2771 var od = new api.DictlayerdataDictWordsSensesConjugations.fromJson(o.toJso
n()); | |
2772 checkDictlayerdataDictWordsSensesConjugations(od); | |
2773 }); | |
2774 }); | |
2775 | |
2776 | |
2777 unittest.group("obj-schema-DictlayerdataDictWordsSensesDefinitionsExamplesSour
ce", () { | |
2778 unittest.test("to-json--from-json", () { | |
2779 var o = buildDictlayerdataDictWordsSensesDefinitionsExamplesSource(); | |
2780 var od = new api.DictlayerdataDictWordsSensesDefinitionsExamplesSource.fro
mJson(o.toJson()); | |
2781 checkDictlayerdataDictWordsSensesDefinitionsExamplesSource(od); | |
2782 }); | |
2783 }); | |
2784 | |
2785 | |
2786 unittest.group("obj-schema-DictlayerdataDictWordsSensesDefinitionsExamples", (
) { | |
2787 unittest.test("to-json--from-json", () { | |
2788 var o = buildDictlayerdataDictWordsSensesDefinitionsExamples(); | |
2789 var od = new api.DictlayerdataDictWordsSensesDefinitionsExamples.fromJson(
o.toJson()); | |
2790 checkDictlayerdataDictWordsSensesDefinitionsExamples(od); | |
2791 }); | |
2792 }); | |
2793 | |
2794 | |
2795 unittest.group("obj-schema-DictlayerdataDictWordsSensesDefinitions", () { | |
2796 unittest.test("to-json--from-json", () { | |
2797 var o = buildDictlayerdataDictWordsSensesDefinitions(); | |
2798 var od = new api.DictlayerdataDictWordsSensesDefinitions.fromJson(o.toJson
()); | |
2799 checkDictlayerdataDictWordsSensesDefinitions(od); | |
2800 }); | |
2801 }); | |
2802 | |
2803 | |
2804 unittest.group("obj-schema-DictlayerdataDictWordsSensesSource", () { | |
2805 unittest.test("to-json--from-json", () { | |
2806 var o = buildDictlayerdataDictWordsSensesSource(); | |
2807 var od = new api.DictlayerdataDictWordsSensesSource.fromJson(o.toJson()); | |
2808 checkDictlayerdataDictWordsSensesSource(od); | |
2809 }); | |
2810 }); | |
2811 | |
2812 | |
2813 unittest.group("obj-schema-DictlayerdataDictWordsSensesSynonymsSource", () { | |
2814 unittest.test("to-json--from-json", () { | |
2815 var o = buildDictlayerdataDictWordsSensesSynonymsSource(); | |
2816 var od = new api.DictlayerdataDictWordsSensesSynonymsSource.fromJson(o.toJ
son()); | |
2817 checkDictlayerdataDictWordsSensesSynonymsSource(od); | |
2818 }); | |
2819 }); | |
2820 | |
2821 | |
2822 unittest.group("obj-schema-DictlayerdataDictWordsSensesSynonyms", () { | |
2823 unittest.test("to-json--from-json", () { | |
2824 var o = buildDictlayerdataDictWordsSensesSynonyms(); | |
2825 var od = new api.DictlayerdataDictWordsSensesSynonyms.fromJson(o.toJson())
; | |
2826 checkDictlayerdataDictWordsSensesSynonyms(od); | |
2827 }); | |
2828 }); | |
2829 | |
2830 | |
2831 unittest.group("obj-schema-DictlayerdataDictWordsSenses", () { | |
2832 unittest.test("to-json--from-json", () { | |
2833 var o = buildDictlayerdataDictWordsSenses(); | |
2834 var od = new api.DictlayerdataDictWordsSenses.fromJson(o.toJson()); | |
2835 checkDictlayerdataDictWordsSenses(od); | |
2836 }); | |
2837 }); | |
2838 | |
2839 | |
2840 unittest.group("obj-schema-DictlayerdataDictWordsSource", () { | |
2841 unittest.test("to-json--from-json", () { | |
2842 var o = buildDictlayerdataDictWordsSource(); | |
2843 var od = new api.DictlayerdataDictWordsSource.fromJson(o.toJson()); | |
2844 checkDictlayerdataDictWordsSource(od); | |
2845 }); | |
2846 }); | |
2847 | |
2848 | |
2849 unittest.group("obj-schema-DictlayerdataDictWords", () { | |
2850 unittest.test("to-json--from-json", () { | |
2851 var o = buildDictlayerdataDictWords(); | |
2852 var od = new api.DictlayerdataDictWords.fromJson(o.toJson()); | |
2853 checkDictlayerdataDictWords(od); | |
2854 }); | |
2855 }); | |
2856 | |
2857 | |
2858 unittest.group("obj-schema-DictlayerdataDict", () { | |
2859 unittest.test("to-json--from-json", () { | |
2860 var o = buildDictlayerdataDict(); | |
2861 var od = new api.DictlayerdataDict.fromJson(o.toJson()); | |
2862 checkDictlayerdataDict(od); | |
2863 }); | |
2864 }); | |
2865 | |
2866 | |
2867 unittest.group("obj-schema-Dictlayerdata", () { | |
2868 unittest.test("to-json--from-json", () { | |
2869 var o = buildDictlayerdata(); | |
2870 var od = new api.Dictlayerdata.fromJson(o.toJson()); | |
2871 checkDictlayerdata(od); | |
2872 }); | |
2873 }); | |
2874 | |
2875 | |
2876 unittest.group("obj-schema-DownloadAccessRestriction", () { | |
2877 unittest.test("to-json--from-json", () { | |
2878 var o = buildDownloadAccessRestriction(); | |
2879 var od = new api.DownloadAccessRestriction.fromJson(o.toJson()); | |
2880 checkDownloadAccessRestriction(od); | |
2881 }); | |
2882 }); | |
2883 | |
2884 | |
2885 unittest.group("obj-schema-DownloadAccesses", () { | |
2886 unittest.test("to-json--from-json", () { | |
2887 var o = buildDownloadAccesses(); | |
2888 var od = new api.DownloadAccesses.fromJson(o.toJson()); | |
2889 checkDownloadAccesses(od); | |
2890 }); | |
2891 }); | |
2892 | |
2893 | |
2894 unittest.group("obj-schema-GeolayerdataCommon", () { | |
2895 unittest.test("to-json--from-json", () { | |
2896 var o = buildGeolayerdataCommon(); | |
2897 var od = new api.GeolayerdataCommon.fromJson(o.toJson()); | |
2898 checkGeolayerdataCommon(od); | |
2899 }); | |
2900 }); | |
2901 | |
2902 | |
2903 unittest.group("obj-schema-GeolayerdataGeoBoundary", () { | |
2904 unittest.test("to-json--from-json", () { | |
2905 var o = buildGeolayerdataGeoBoundary(); | |
2906 var od = new api.GeolayerdataGeoBoundary.fromJson(o.toJson()); | |
2907 checkGeolayerdataGeoBoundary(od); | |
2908 }); | |
2909 }); | |
2910 | |
2911 | |
2912 unittest.group("obj-schema-GeolayerdataGeoViewportHi", () { | |
2913 unittest.test("to-json--from-json", () { | |
2914 var o = buildGeolayerdataGeoViewportHi(); | |
2915 var od = new api.GeolayerdataGeoViewportHi.fromJson(o.toJson()); | |
2916 checkGeolayerdataGeoViewportHi(od); | |
2917 }); | |
2918 }); | |
2919 | |
2920 | |
2921 unittest.group("obj-schema-GeolayerdataGeoViewportLo", () { | |
2922 unittest.test("to-json--from-json", () { | |
2923 var o = buildGeolayerdataGeoViewportLo(); | |
2924 var od = new api.GeolayerdataGeoViewportLo.fromJson(o.toJson()); | |
2925 checkGeolayerdataGeoViewportLo(od); | |
2926 }); | |
2927 }); | |
2928 | |
2929 | |
2930 unittest.group("obj-schema-GeolayerdataGeoViewport", () { | |
2931 unittest.test("to-json--from-json", () { | |
2932 var o = buildGeolayerdataGeoViewport(); | |
2933 var od = new api.GeolayerdataGeoViewport.fromJson(o.toJson()); | |
2934 checkGeolayerdataGeoViewport(od); | |
2935 }); | |
2936 }); | |
2937 | |
2938 | |
2939 unittest.group("obj-schema-GeolayerdataGeo", () { | |
2940 unittest.test("to-json--from-json", () { | |
2941 var o = buildGeolayerdataGeo(); | |
2942 var od = new api.GeolayerdataGeo.fromJson(o.toJson()); | |
2943 checkGeolayerdataGeo(od); | |
2944 }); | |
2945 }); | |
2946 | |
2947 | |
2948 unittest.group("obj-schema-Geolayerdata", () { | |
2949 unittest.test("to-json--from-json", () { | |
2950 var o = buildGeolayerdata(); | |
2951 var od = new api.Geolayerdata.fromJson(o.toJson()); | |
2952 checkGeolayerdata(od); | |
2953 }); | |
2954 }); | |
2955 | |
2956 | |
2957 unittest.group("obj-schema-Layersummaries", () { | |
2958 unittest.test("to-json--from-json", () { | |
2959 var o = buildLayersummaries(); | |
2960 var od = new api.Layersummaries.fromJson(o.toJson()); | |
2961 checkLayersummaries(od); | |
2962 }); | |
2963 }); | |
2964 | |
2965 | |
2966 unittest.group("obj-schema-Layersummary", () { | |
2967 unittest.test("to-json--from-json", () { | |
2968 var o = buildLayersummary(); | |
2969 var od = new api.Layersummary.fromJson(o.toJson()); | |
2970 checkLayersummary(od); | |
2971 }); | |
2972 }); | |
2973 | |
2974 | |
2975 unittest.group("obj-schema-OffersItemsItems", () { | |
2976 unittest.test("to-json--from-json", () { | |
2977 var o = buildOffersItemsItems(); | |
2978 var od = new api.OffersItemsItems.fromJson(o.toJson()); | |
2979 checkOffersItemsItems(od); | |
2980 }); | |
2981 }); | |
2982 | |
2983 | |
2984 unittest.group("obj-schema-OffersItems", () { | |
2985 unittest.test("to-json--from-json", () { | |
2986 var o = buildOffersItems(); | |
2987 var od = new api.OffersItems.fromJson(o.toJson()); | |
2988 checkOffersItems(od); | |
2989 }); | |
2990 }); | |
2991 | |
2992 | |
2993 unittest.group("obj-schema-Offers", () { | |
2994 unittest.test("to-json--from-json", () { | |
2995 var o = buildOffers(); | |
2996 var od = new api.Offers.fromJson(o.toJson()); | |
2997 checkOffers(od); | |
2998 }); | |
2999 }); | |
3000 | |
3001 | |
3002 unittest.group("obj-schema-ReadingPosition", () { | |
3003 unittest.test("to-json--from-json", () { | |
3004 var o = buildReadingPosition(); | |
3005 var od = new api.ReadingPosition.fromJson(o.toJson()); | |
3006 checkReadingPosition(od); | |
3007 }); | |
3008 }); | |
3009 | |
3010 | |
3011 unittest.group("obj-schema-RequestAccess", () { | |
3012 unittest.test("to-json--from-json", () { | |
3013 var o = buildRequestAccess(); | |
3014 var od = new api.RequestAccess.fromJson(o.toJson()); | |
3015 checkRequestAccess(od); | |
3016 }); | |
3017 }); | |
3018 | |
3019 | |
3020 unittest.group("obj-schema-ReviewAuthor", () { | |
3021 unittest.test("to-json--from-json", () { | |
3022 var o = buildReviewAuthor(); | |
3023 var od = new api.ReviewAuthor.fromJson(o.toJson()); | |
3024 checkReviewAuthor(od); | |
3025 }); | |
3026 }); | |
3027 | |
3028 | |
3029 unittest.group("obj-schema-ReviewSource", () { | |
3030 unittest.test("to-json--from-json", () { | |
3031 var o = buildReviewSource(); | |
3032 var od = new api.ReviewSource.fromJson(o.toJson()); | |
3033 checkReviewSource(od); | |
3034 }); | |
3035 }); | |
3036 | |
3037 | |
3038 unittest.group("obj-schema-Review", () { | |
3039 unittest.test("to-json--from-json", () { | |
3040 var o = buildReview(); | |
3041 var od = new api.Review.fromJson(o.toJson()); | |
3042 checkReview(od); | |
3043 }); | |
3044 }); | |
3045 | |
3046 | |
3047 unittest.group("obj-schema-VolumeAccessInfoEpub", () { | |
3048 unittest.test("to-json--from-json", () { | |
3049 var o = buildVolumeAccessInfoEpub(); | |
3050 var od = new api.VolumeAccessInfoEpub.fromJson(o.toJson()); | |
3051 checkVolumeAccessInfoEpub(od); | |
3052 }); | |
3053 }); | |
3054 | |
3055 | |
3056 unittest.group("obj-schema-VolumeAccessInfoPdf", () { | |
3057 unittest.test("to-json--from-json", () { | |
3058 var o = buildVolumeAccessInfoPdf(); | |
3059 var od = new api.VolumeAccessInfoPdf.fromJson(o.toJson()); | |
3060 checkVolumeAccessInfoPdf(od); | |
3061 }); | |
3062 }); | |
3063 | |
3064 | |
3065 unittest.group("obj-schema-VolumeAccessInfo", () { | |
3066 unittest.test("to-json--from-json", () { | |
3067 var o = buildVolumeAccessInfo(); | |
3068 var od = new api.VolumeAccessInfo.fromJson(o.toJson()); | |
3069 checkVolumeAccessInfo(od); | |
3070 }); | |
3071 }); | |
3072 | |
3073 | |
3074 unittest.group("obj-schema-VolumeLayerInfoLayers", () { | |
3075 unittest.test("to-json--from-json", () { | |
3076 var o = buildVolumeLayerInfoLayers(); | |
3077 var od = new api.VolumeLayerInfoLayers.fromJson(o.toJson()); | |
3078 checkVolumeLayerInfoLayers(od); | |
3079 }); | |
3080 }); | |
3081 | |
3082 | |
3083 unittest.group("obj-schema-VolumeLayerInfo", () { | |
3084 unittest.test("to-json--from-json", () { | |
3085 var o = buildVolumeLayerInfo(); | |
3086 var od = new api.VolumeLayerInfo.fromJson(o.toJson()); | |
3087 checkVolumeLayerInfo(od); | |
3088 }); | |
3089 }); | |
3090 | |
3091 | |
3092 unittest.group("obj-schema-VolumeRecommendedInfo", () { | |
3093 unittest.test("to-json--from-json", () { | |
3094 var o = buildVolumeRecommendedInfo(); | |
3095 var od = new api.VolumeRecommendedInfo.fromJson(o.toJson()); | |
3096 checkVolumeRecommendedInfo(od); | |
3097 }); | |
3098 }); | |
3099 | |
3100 | |
3101 unittest.group("obj-schema-VolumeSaleInfoListPrice", () { | |
3102 unittest.test("to-json--from-json", () { | |
3103 var o = buildVolumeSaleInfoListPrice(); | |
3104 var od = new api.VolumeSaleInfoListPrice.fromJson(o.toJson()); | |
3105 checkVolumeSaleInfoListPrice(od); | |
3106 }); | |
3107 }); | |
3108 | |
3109 | |
3110 unittest.group("obj-schema-VolumeSaleInfoOffersListPrice", () { | |
3111 unittest.test("to-json--from-json", () { | |
3112 var o = buildVolumeSaleInfoOffersListPrice(); | |
3113 var od = new api.VolumeSaleInfoOffersListPrice.fromJson(o.toJson()); | |
3114 checkVolumeSaleInfoOffersListPrice(od); | |
3115 }); | |
3116 }); | |
3117 | |
3118 | |
3119 unittest.group("obj-schema-VolumeSaleInfoOffersRentalDuration", () { | |
3120 unittest.test("to-json--from-json", () { | |
3121 var o = buildVolumeSaleInfoOffersRentalDuration(); | |
3122 var od = new api.VolumeSaleInfoOffersRentalDuration.fromJson(o.toJson()); | |
3123 checkVolumeSaleInfoOffersRentalDuration(od); | |
3124 }); | |
3125 }); | |
3126 | |
3127 | |
3128 unittest.group("obj-schema-VolumeSaleInfoOffersRetailPrice", () { | |
3129 unittest.test("to-json--from-json", () { | |
3130 var o = buildVolumeSaleInfoOffersRetailPrice(); | |
3131 var od = new api.VolumeSaleInfoOffersRetailPrice.fromJson(o.toJson()); | |
3132 checkVolumeSaleInfoOffersRetailPrice(od); | |
3133 }); | |
3134 }); | |
3135 | |
3136 | |
3137 unittest.group("obj-schema-VolumeSaleInfoOffers", () { | |
3138 unittest.test("to-json--from-json", () { | |
3139 var o = buildVolumeSaleInfoOffers(); | |
3140 var od = new api.VolumeSaleInfoOffers.fromJson(o.toJson()); | |
3141 checkVolumeSaleInfoOffers(od); | |
3142 }); | |
3143 }); | |
3144 | |
3145 | |
3146 unittest.group("obj-schema-VolumeSaleInfoRetailPrice", () { | |
3147 unittest.test("to-json--from-json", () { | |
3148 var o = buildVolumeSaleInfoRetailPrice(); | |
3149 var od = new api.VolumeSaleInfoRetailPrice.fromJson(o.toJson()); | |
3150 checkVolumeSaleInfoRetailPrice(od); | |
3151 }); | |
3152 }); | |
3153 | |
3154 | |
3155 unittest.group("obj-schema-VolumeSaleInfo", () { | |
3156 unittest.test("to-json--from-json", () { | |
3157 var o = buildVolumeSaleInfo(); | |
3158 var od = new api.VolumeSaleInfo.fromJson(o.toJson()); | |
3159 checkVolumeSaleInfo(od); | |
3160 }); | |
3161 }); | |
3162 | |
3163 | |
3164 unittest.group("obj-schema-VolumeSearchInfo", () { | |
3165 unittest.test("to-json--from-json", () { | |
3166 var o = buildVolumeSearchInfo(); | |
3167 var od = new api.VolumeSearchInfo.fromJson(o.toJson()); | |
3168 checkVolumeSearchInfo(od); | |
3169 }); | |
3170 }); | |
3171 | |
3172 | |
3173 unittest.group("obj-schema-VolumeUserInfoCopy", () { | |
3174 unittest.test("to-json--from-json", () { | |
3175 var o = buildVolumeUserInfoCopy(); | |
3176 var od = new api.VolumeUserInfoCopy.fromJson(o.toJson()); | |
3177 checkVolumeUserInfoCopy(od); | |
3178 }); | |
3179 }); | |
3180 | |
3181 | |
3182 unittest.group("obj-schema-VolumeUserInfoRentalPeriod", () { | |
3183 unittest.test("to-json--from-json", () { | |
3184 var o = buildVolumeUserInfoRentalPeriod(); | |
3185 var od = new api.VolumeUserInfoRentalPeriod.fromJson(o.toJson()); | |
3186 checkVolumeUserInfoRentalPeriod(od); | |
3187 }); | |
3188 }); | |
3189 | |
3190 | |
3191 unittest.group("obj-schema-VolumeUserInfoUserUploadedVolumeInfo", () { | |
3192 unittest.test("to-json--from-json", () { | |
3193 var o = buildVolumeUserInfoUserUploadedVolumeInfo(); | |
3194 var od = new api.VolumeUserInfoUserUploadedVolumeInfo.fromJson(o.toJson())
; | |
3195 checkVolumeUserInfoUserUploadedVolumeInfo(od); | |
3196 }); | |
3197 }); | |
3198 | |
3199 | |
3200 unittest.group("obj-schema-VolumeUserInfo", () { | |
3201 unittest.test("to-json--from-json", () { | |
3202 var o = buildVolumeUserInfo(); | |
3203 var od = new api.VolumeUserInfo.fromJson(o.toJson()); | |
3204 checkVolumeUserInfo(od); | |
3205 }); | |
3206 }); | |
3207 | |
3208 | |
3209 unittest.group("obj-schema-VolumeVolumeInfoDimensions", () { | |
3210 unittest.test("to-json--from-json", () { | |
3211 var o = buildVolumeVolumeInfoDimensions(); | |
3212 var od = new api.VolumeVolumeInfoDimensions.fromJson(o.toJson()); | |
3213 checkVolumeVolumeInfoDimensions(od); | |
3214 }); | |
3215 }); | |
3216 | |
3217 | |
3218 unittest.group("obj-schema-VolumeVolumeInfoImageLinks", () { | |
3219 unittest.test("to-json--from-json", () { | |
3220 var o = buildVolumeVolumeInfoImageLinks(); | |
3221 var od = new api.VolumeVolumeInfoImageLinks.fromJson(o.toJson()); | |
3222 checkVolumeVolumeInfoImageLinks(od); | |
3223 }); | |
3224 }); | |
3225 | |
3226 | |
3227 unittest.group("obj-schema-VolumeVolumeInfoIndustryIdentifiers", () { | |
3228 unittest.test("to-json--from-json", () { | |
3229 var o = buildVolumeVolumeInfoIndustryIdentifiers(); | |
3230 var od = new api.VolumeVolumeInfoIndustryIdentifiers.fromJson(o.toJson()); | |
3231 checkVolumeVolumeInfoIndustryIdentifiers(od); | |
3232 }); | |
3233 }); | |
3234 | |
3235 | |
3236 unittest.group("obj-schema-VolumeVolumeInfo", () { | |
3237 unittest.test("to-json--from-json", () { | |
3238 var o = buildVolumeVolumeInfo(); | |
3239 var od = new api.VolumeVolumeInfo.fromJson(o.toJson()); | |
3240 checkVolumeVolumeInfo(od); | |
3241 }); | |
3242 }); | |
3243 | |
3244 | |
3245 unittest.group("obj-schema-Volume", () { | |
3246 unittest.test("to-json--from-json", () { | |
3247 var o = buildVolume(); | |
3248 var od = new api.Volume.fromJson(o.toJson()); | |
3249 checkVolume(od); | |
3250 }); | |
3251 }); | |
3252 | |
3253 | |
3254 unittest.group("obj-schema-VolumeannotationContentRanges", () { | |
3255 unittest.test("to-json--from-json", () { | |
3256 var o = buildVolumeannotationContentRanges(); | |
3257 var od = new api.VolumeannotationContentRanges.fromJson(o.toJson()); | |
3258 checkVolumeannotationContentRanges(od); | |
3259 }); | |
3260 }); | |
3261 | |
3262 | |
3263 unittest.group("obj-schema-Volumeannotation", () { | |
3264 unittest.test("to-json--from-json", () { | |
3265 var o = buildVolumeannotation(); | |
3266 var od = new api.Volumeannotation.fromJson(o.toJson()); | |
3267 checkVolumeannotation(od); | |
3268 }); | |
3269 }); | |
3270 | |
3271 | |
3272 unittest.group("obj-schema-Volumeannotations", () { | |
3273 unittest.test("to-json--from-json", () { | |
3274 var o = buildVolumeannotations(); | |
3275 var od = new api.Volumeannotations.fromJson(o.toJson()); | |
3276 checkVolumeannotations(od); | |
3277 }); | |
3278 }); | |
3279 | |
3280 | |
3281 unittest.group("obj-schema-Volumes", () { | |
3282 unittest.test("to-json--from-json", () { | |
3283 var o = buildVolumes(); | |
3284 var od = new api.Volumes.fromJson(o.toJson()); | |
3285 checkVolumes(od); | |
3286 }); | |
3287 }); | |
3288 | |
3289 | |
3290 unittest.group("resource-BookshelvesResourceApi", () { | |
3291 unittest.test("method--get", () { | |
3292 | |
3293 var mock = new common_test.HttpServerMock(); | |
3294 api.BookshelvesResourceApi res = new api.BooksApi(mock).bookshelves; | |
3295 var arg_userId = "foo"; | |
3296 var arg_shelf = "foo"; | |
3297 var arg_source = "foo"; | |
3298 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3299 var path = (req.url).path; | |
3300 var pathOffset = 0; | |
3301 var index; | |
3302 var subPart; | |
3303 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3304 pathOffset += 10; | |
3305 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("users/")); | |
3306 pathOffset += 6; | |
3307 index = path.indexOf("/bookshelves/", pathOffset); | |
3308 unittest.expect(index >= 0, unittest.isTrue); | |
3309 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3310 pathOffset = index; | |
3311 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
3312 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bookshelves/")); | |
3313 pathOffset += 13; | |
3314 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3315 pathOffset = path.length; | |
3316 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
3317 | |
3318 var query = (req.url).query; | |
3319 var queryOffset = 0; | |
3320 var queryMap = {}; | |
3321 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3322 parseBool(n) { | |
3323 if (n == "true") return true; | |
3324 if (n == "false") return false; | |
3325 if (n == null) return null; | |
3326 throw new core.ArgumentError("Invalid boolean: $n"); | |
3327 } | |
3328 if (query.length > 0) { | |
3329 for (var part in query.split("&")) { | |
3330 var keyvalue = part.split("="); | |
3331 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3332 } | |
3333 } | |
3334 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3335 | |
3336 | |
3337 var h = { | |
3338 "content-type" : "application/json; charset=utf-8", | |
3339 }; | |
3340 var resp = convert.JSON.encode(buildBookshelf()); | |
3341 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3342 }), true); | |
3343 res.get(arg_userId, arg_shelf, source: arg_source).then(unittest.expectAsy
nc(((api.Bookshelf response) { | |
3344 checkBookshelf(response); | |
3345 }))); | |
3346 }); | |
3347 | |
3348 unittest.test("method--list", () { | |
3349 | |
3350 var mock = new common_test.HttpServerMock(); | |
3351 api.BookshelvesResourceApi res = new api.BooksApi(mock).bookshelves; | |
3352 var arg_userId = "foo"; | |
3353 var arg_source = "foo"; | |
3354 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3355 var path = (req.url).path; | |
3356 var pathOffset = 0; | |
3357 var index; | |
3358 var subPart; | |
3359 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3360 pathOffset += 10; | |
3361 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("users/")); | |
3362 pathOffset += 6; | |
3363 index = path.indexOf("/bookshelves", pathOffset); | |
3364 unittest.expect(index >= 0, unittest.isTrue); | |
3365 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3366 pathOffset = index; | |
3367 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
3368 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/bookshelves")); | |
3369 pathOffset += 12; | |
3370 | |
3371 var query = (req.url).query; | |
3372 var queryOffset = 0; | |
3373 var queryMap = {}; | |
3374 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3375 parseBool(n) { | |
3376 if (n == "true") return true; | |
3377 if (n == "false") return false; | |
3378 if (n == null) return null; | |
3379 throw new core.ArgumentError("Invalid boolean: $n"); | |
3380 } | |
3381 if (query.length > 0) { | |
3382 for (var part in query.split("&")) { | |
3383 var keyvalue = part.split("="); | |
3384 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3385 } | |
3386 } | |
3387 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3388 | |
3389 | |
3390 var h = { | |
3391 "content-type" : "application/json; charset=utf-8", | |
3392 }; | |
3393 var resp = convert.JSON.encode(buildBookshelves()); | |
3394 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3395 }), true); | |
3396 res.list(arg_userId, source: arg_source).then(unittest.expectAsync(((api.B
ookshelves response) { | |
3397 checkBookshelves(response); | |
3398 }))); | |
3399 }); | |
3400 | |
3401 }); | |
3402 | |
3403 | |
3404 unittest.group("resource-BookshelvesVolumesResourceApi", () { | |
3405 unittest.test("method--list", () { | |
3406 | |
3407 var mock = new common_test.HttpServerMock(); | |
3408 api.BookshelvesVolumesResourceApi res = new api.BooksApi(mock).bookshelves
.volumes; | |
3409 var arg_userId = "foo"; | |
3410 var arg_shelf = "foo"; | |
3411 var arg_maxResults = 42; | |
3412 var arg_showPreorders = true; | |
3413 var arg_source = "foo"; | |
3414 var arg_startIndex = 42; | |
3415 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3416 var path = (req.url).path; | |
3417 var pathOffset = 0; | |
3418 var index; | |
3419 var subPart; | |
3420 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3421 pathOffset += 10; | |
3422 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("users/")); | |
3423 pathOffset += 6; | |
3424 index = path.indexOf("/bookshelves/", pathOffset); | |
3425 unittest.expect(index >= 0, unittest.isTrue); | |
3426 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3427 pathOffset = index; | |
3428 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
3429 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bookshelves/")); | |
3430 pathOffset += 13; | |
3431 index = path.indexOf("/volumes", pathOffset); | |
3432 unittest.expect(index >= 0, unittest.isTrue); | |
3433 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3434 pathOffset = index; | |
3435 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
3436 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/volumes")); | |
3437 pathOffset += 8; | |
3438 | |
3439 var query = (req.url).query; | |
3440 var queryOffset = 0; | |
3441 var queryMap = {}; | |
3442 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3443 parseBool(n) { | |
3444 if (n == "true") return true; | |
3445 if (n == "false") return false; | |
3446 if (n == null) return null; | |
3447 throw new core.ArgumentError("Invalid boolean: $n"); | |
3448 } | |
3449 if (query.length > 0) { | |
3450 for (var part in query.split("&")) { | |
3451 var keyvalue = part.split("="); | |
3452 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3453 } | |
3454 } | |
3455 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
3456 unittest.expect(queryMap["showPreorders"].first, unittest.equals("$arg_s
howPreorders")); | |
3457 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3458 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | |
3459 | |
3460 | |
3461 var h = { | |
3462 "content-type" : "application/json; charset=utf-8", | |
3463 }; | |
3464 var resp = convert.JSON.encode(buildVolumes()); | |
3465 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3466 }), true); | |
3467 res.list(arg_userId, arg_shelf, maxResults: arg_maxResults, showPreorders:
arg_showPreorders, source: arg_source, startIndex: arg_startIndex).then(unittes
t.expectAsync(((api.Volumes response) { | |
3468 checkVolumes(response); | |
3469 }))); | |
3470 }); | |
3471 | |
3472 }); | |
3473 | |
3474 | |
3475 unittest.group("resource-CloudloadingResourceApi", () { | |
3476 unittest.test("method--addBook", () { | |
3477 | |
3478 var mock = new common_test.HttpServerMock(); | |
3479 api.CloudloadingResourceApi res = new api.BooksApi(mock).cloudloading; | |
3480 var arg_driveDocumentId = "foo"; | |
3481 var arg_mimeType = "foo"; | |
3482 var arg_name = "foo"; | |
3483 var arg_uploadClientToken = "foo"; | |
3484 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3485 var path = (req.url).path; | |
3486 var pathOffset = 0; | |
3487 var index; | |
3488 var subPart; | |
3489 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3490 pathOffset += 10; | |
3491 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("cloudloading/addBook")); | |
3492 pathOffset += 20; | |
3493 | |
3494 var query = (req.url).query; | |
3495 var queryOffset = 0; | |
3496 var queryMap = {}; | |
3497 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3498 parseBool(n) { | |
3499 if (n == "true") return true; | |
3500 if (n == "false") return false; | |
3501 if (n == null) return null; | |
3502 throw new core.ArgumentError("Invalid boolean: $n"); | |
3503 } | |
3504 if (query.length > 0) { | |
3505 for (var part in query.split("&")) { | |
3506 var keyvalue = part.split("="); | |
3507 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3508 } | |
3509 } | |
3510 unittest.expect(queryMap["drive_document_id"].first, unittest.equals(arg
_driveDocumentId)); | |
3511 unittest.expect(queryMap["mime_type"].first, unittest.equals(arg_mimeTyp
e)); | |
3512 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); | |
3513 unittest.expect(queryMap["upload_client_token"].first, unittest.equals(a
rg_uploadClientToken)); | |
3514 | |
3515 | |
3516 var h = { | |
3517 "content-type" : "application/json; charset=utf-8", | |
3518 }; | |
3519 var resp = convert.JSON.encode(buildBooksCloudloadingResource()); | |
3520 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3521 }), true); | |
3522 res.addBook(driveDocumentId: arg_driveDocumentId, mimeType: arg_mimeType,
name: arg_name, uploadClientToken: arg_uploadClientToken).then(unittest.expectAs
ync(((api.BooksCloudloadingResource response) { | |
3523 checkBooksCloudloadingResource(response); | |
3524 }))); | |
3525 }); | |
3526 | |
3527 unittest.test("method--deleteBook", () { | |
3528 | |
3529 var mock = new common_test.HttpServerMock(); | |
3530 api.CloudloadingResourceApi res = new api.BooksApi(mock).cloudloading; | |
3531 var arg_volumeId = "foo"; | |
3532 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3533 var path = (req.url).path; | |
3534 var pathOffset = 0; | |
3535 var index; | |
3536 var subPart; | |
3537 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3538 pathOffset += 10; | |
3539 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("cloudloading/deleteBook")); | |
3540 pathOffset += 23; | |
3541 | |
3542 var query = (req.url).query; | |
3543 var queryOffset = 0; | |
3544 var queryMap = {}; | |
3545 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3546 parseBool(n) { | |
3547 if (n == "true") return true; | |
3548 if (n == "false") return false; | |
3549 if (n == null) return null; | |
3550 throw new core.ArgumentError("Invalid boolean: $n"); | |
3551 } | |
3552 if (query.length > 0) { | |
3553 for (var part in query.split("&")) { | |
3554 var keyvalue = part.split("="); | |
3555 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3556 } | |
3557 } | |
3558 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
3559 | |
3560 | |
3561 var h = { | |
3562 "content-type" : "application/json; charset=utf-8", | |
3563 }; | |
3564 var resp = ""; | |
3565 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3566 }), true); | |
3567 res.deleteBook(arg_volumeId).then(unittest.expectAsync((_) {})); | |
3568 }); | |
3569 | |
3570 unittest.test("method--updateBook", () { | |
3571 | |
3572 var mock = new common_test.HttpServerMock(); | |
3573 api.CloudloadingResourceApi res = new api.BooksApi(mock).cloudloading; | |
3574 var arg_request = buildBooksCloudloadingResource(); | |
3575 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3576 var obj = new api.BooksCloudloadingResource.fromJson(json); | |
3577 checkBooksCloudloadingResource(obj); | |
3578 | |
3579 var path = (req.url).path; | |
3580 var pathOffset = 0; | |
3581 var index; | |
3582 var subPart; | |
3583 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3584 pathOffset += 10; | |
3585 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("cloudloading/updateBook")); | |
3586 pathOffset += 23; | |
3587 | |
3588 var query = (req.url).query; | |
3589 var queryOffset = 0; | |
3590 var queryMap = {}; | |
3591 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3592 parseBool(n) { | |
3593 if (n == "true") return true; | |
3594 if (n == "false") return false; | |
3595 if (n == null) return null; | |
3596 throw new core.ArgumentError("Invalid boolean: $n"); | |
3597 } | |
3598 if (query.length > 0) { | |
3599 for (var part in query.split("&")) { | |
3600 var keyvalue = part.split("="); | |
3601 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3602 } | |
3603 } | |
3604 | |
3605 | |
3606 var h = { | |
3607 "content-type" : "application/json; charset=utf-8", | |
3608 }; | |
3609 var resp = convert.JSON.encode(buildBooksCloudloadingResource()); | |
3610 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3611 }), true); | |
3612 res.updateBook(arg_request).then(unittest.expectAsync(((api.BooksCloudload
ingResource response) { | |
3613 checkBooksCloudloadingResource(response); | |
3614 }))); | |
3615 }); | |
3616 | |
3617 }); | |
3618 | |
3619 | |
3620 unittest.group("resource-LayersResourceApi", () { | |
3621 unittest.test("method--get", () { | |
3622 | |
3623 var mock = new common_test.HttpServerMock(); | |
3624 api.LayersResourceApi res = new api.BooksApi(mock).layers; | |
3625 var arg_volumeId = "foo"; | |
3626 var arg_summaryId = "foo"; | |
3627 var arg_contentVersion = "foo"; | |
3628 var arg_source = "foo"; | |
3629 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3630 var path = (req.url).path; | |
3631 var pathOffset = 0; | |
3632 var index; | |
3633 var subPart; | |
3634 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3635 pathOffset += 10; | |
3636 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
3637 pathOffset += 8; | |
3638 index = path.indexOf("/layersummary/", pathOffset); | |
3639 unittest.expect(index >= 0, unittest.isTrue); | |
3640 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3641 pathOffset = index; | |
3642 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
3643 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/layersummary/")); | |
3644 pathOffset += 14; | |
3645 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3646 pathOffset = path.length; | |
3647 unittest.expect(subPart, unittest.equals("$arg_summaryId")); | |
3648 | |
3649 var query = (req.url).query; | |
3650 var queryOffset = 0; | |
3651 var queryMap = {}; | |
3652 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3653 parseBool(n) { | |
3654 if (n == "true") return true; | |
3655 if (n == "false") return false; | |
3656 if (n == null) return null; | |
3657 throw new core.ArgumentError("Invalid boolean: $n"); | |
3658 } | |
3659 if (query.length > 0) { | |
3660 for (var part in query.split("&")) { | |
3661 var keyvalue = part.split("="); | |
3662 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3663 } | |
3664 } | |
3665 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
3666 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3667 | |
3668 | |
3669 var h = { | |
3670 "content-type" : "application/json; charset=utf-8", | |
3671 }; | |
3672 var resp = convert.JSON.encode(buildLayersummary()); | |
3673 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3674 }), true); | |
3675 res.get(arg_volumeId, arg_summaryId, contentVersion: arg_contentVersion, s
ource: arg_source).then(unittest.expectAsync(((api.Layersummary response) { | |
3676 checkLayersummary(response); | |
3677 }))); | |
3678 }); | |
3679 | |
3680 unittest.test("method--list", () { | |
3681 | |
3682 var mock = new common_test.HttpServerMock(); | |
3683 api.LayersResourceApi res = new api.BooksApi(mock).layers; | |
3684 var arg_volumeId = "foo"; | |
3685 var arg_contentVersion = "foo"; | |
3686 var arg_maxResults = 42; | |
3687 var arg_pageToken = "foo"; | |
3688 var arg_source = "foo"; | |
3689 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3690 var path = (req.url).path; | |
3691 var pathOffset = 0; | |
3692 var index; | |
3693 var subPart; | |
3694 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3695 pathOffset += 10; | |
3696 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
3697 pathOffset += 8; | |
3698 index = path.indexOf("/layersummary", pathOffset); | |
3699 unittest.expect(index >= 0, unittest.isTrue); | |
3700 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3701 pathOffset = index; | |
3702 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
3703 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/layersummary")); | |
3704 pathOffset += 13; | |
3705 | |
3706 var query = (req.url).query; | |
3707 var queryOffset = 0; | |
3708 var queryMap = {}; | |
3709 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3710 parseBool(n) { | |
3711 if (n == "true") return true; | |
3712 if (n == "false") return false; | |
3713 if (n == null) return null; | |
3714 throw new core.ArgumentError("Invalid boolean: $n"); | |
3715 } | |
3716 if (query.length > 0) { | |
3717 for (var part in query.split("&")) { | |
3718 var keyvalue = part.split("="); | |
3719 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3720 } | |
3721 } | |
3722 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
3723 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
3724 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
3725 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3726 | |
3727 | |
3728 var h = { | |
3729 "content-type" : "application/json; charset=utf-8", | |
3730 }; | |
3731 var resp = convert.JSON.encode(buildLayersummaries()); | |
3732 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3733 }), true); | |
3734 res.list(arg_volumeId, contentVersion: arg_contentVersion, maxResults: arg
_maxResults, pageToken: arg_pageToken, source: arg_source).then(unittest.expectA
sync(((api.Layersummaries response) { | |
3735 checkLayersummaries(response); | |
3736 }))); | |
3737 }); | |
3738 | |
3739 }); | |
3740 | |
3741 | |
3742 unittest.group("resource-LayersAnnotationDataResourceApi", () { | |
3743 unittest.test("method--get", () { | |
3744 | |
3745 var mock = new common_test.HttpServerMock(); | |
3746 api.LayersAnnotationDataResourceApi res = new api.BooksApi(mock).layers.an
notationData; | |
3747 var arg_volumeId = "foo"; | |
3748 var arg_layerId = "foo"; | |
3749 var arg_annotationDataId = "foo"; | |
3750 var arg_contentVersion = "foo"; | |
3751 var arg_allowWebDefinitions = true; | |
3752 var arg_h = 42; | |
3753 var arg_locale = "foo"; | |
3754 var arg_scale = 42; | |
3755 var arg_source = "foo"; | |
3756 var arg_w = 42; | |
3757 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3758 var path = (req.url).path; | |
3759 var pathOffset = 0; | |
3760 var index; | |
3761 var subPart; | |
3762 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3763 pathOffset += 10; | |
3764 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
3765 pathOffset += 8; | |
3766 index = path.indexOf("/layers/", pathOffset); | |
3767 unittest.expect(index >= 0, unittest.isTrue); | |
3768 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3769 pathOffset = index; | |
3770 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
3771 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/layers/")); | |
3772 pathOffset += 8; | |
3773 index = path.indexOf("/data/", pathOffset); | |
3774 unittest.expect(index >= 0, unittest.isTrue); | |
3775 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3776 pathOffset = index; | |
3777 unittest.expect(subPart, unittest.equals("$arg_layerId")); | |
3778 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/data/")); | |
3779 pathOffset += 6; | |
3780 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3781 pathOffset = path.length; | |
3782 unittest.expect(subPart, unittest.equals("$arg_annotationDataId")); | |
3783 | |
3784 var query = (req.url).query; | |
3785 var queryOffset = 0; | |
3786 var queryMap = {}; | |
3787 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3788 parseBool(n) { | |
3789 if (n == "true") return true; | |
3790 if (n == "false") return false; | |
3791 if (n == null) return null; | |
3792 throw new core.ArgumentError("Invalid boolean: $n"); | |
3793 } | |
3794 if (query.length > 0) { | |
3795 for (var part in query.split("&")) { | |
3796 var keyvalue = part.split("="); | |
3797 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3798 } | |
3799 } | |
3800 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
3801 unittest.expect(queryMap["allowWebDefinitions"].first, unittest.equals("
$arg_allowWebDefinitions")); | |
3802 unittest.expect(core.int.parse(queryMap["h"].first), unittest.equals(arg
_h)); | |
3803 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
3804 unittest.expect(core.int.parse(queryMap["scale"].first), unittest.equals
(arg_scale)); | |
3805 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3806 unittest.expect(core.int.parse(queryMap["w"].first), unittest.equals(arg
_w)); | |
3807 | |
3808 | |
3809 var h = { | |
3810 "content-type" : "application/json; charset=utf-8", | |
3811 }; | |
3812 var resp = convert.JSON.encode(buildAnnotationdata()); | |
3813 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3814 }), true); | |
3815 res.get(arg_volumeId, arg_layerId, arg_annotationDataId, arg_contentVersio
n, allowWebDefinitions: arg_allowWebDefinitions, h: arg_h, locale: arg_locale, s
cale: arg_scale, source: arg_source, w: arg_w).then(unittest.expectAsync(((api.A
nnotationdata response) { | |
3816 checkAnnotationdata(response); | |
3817 }))); | |
3818 }); | |
3819 | |
3820 unittest.test("method--list", () { | |
3821 | |
3822 var mock = new common_test.HttpServerMock(); | |
3823 api.LayersAnnotationDataResourceApi res = new api.BooksApi(mock).layers.an
notationData; | |
3824 var arg_volumeId = "foo"; | |
3825 var arg_layerId = "foo"; | |
3826 var arg_contentVersion = "foo"; | |
3827 var arg_annotationDataId = buildUnnamed526(); | |
3828 var arg_h = 42; | |
3829 var arg_locale = "foo"; | |
3830 var arg_maxResults = 42; | |
3831 var arg_pageToken = "foo"; | |
3832 var arg_scale = 42; | |
3833 var arg_source = "foo"; | |
3834 var arg_updatedMax = "foo"; | |
3835 var arg_updatedMin = "foo"; | |
3836 var arg_w = 42; | |
3837 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3838 var path = (req.url).path; | |
3839 var pathOffset = 0; | |
3840 var index; | |
3841 var subPart; | |
3842 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3843 pathOffset += 10; | |
3844 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
3845 pathOffset += 8; | |
3846 index = path.indexOf("/layers/", pathOffset); | |
3847 unittest.expect(index >= 0, unittest.isTrue); | |
3848 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3849 pathOffset = index; | |
3850 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
3851 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/layers/")); | |
3852 pathOffset += 8; | |
3853 index = path.indexOf("/data", pathOffset); | |
3854 unittest.expect(index >= 0, unittest.isTrue); | |
3855 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3856 pathOffset = index; | |
3857 unittest.expect(subPart, unittest.equals("$arg_layerId")); | |
3858 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/data")); | |
3859 pathOffset += 5; | |
3860 | |
3861 var query = (req.url).query; | |
3862 var queryOffset = 0; | |
3863 var queryMap = {}; | |
3864 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3865 parseBool(n) { | |
3866 if (n == "true") return true; | |
3867 if (n == "false") return false; | |
3868 if (n == null) return null; | |
3869 throw new core.ArgumentError("Invalid boolean: $n"); | |
3870 } | |
3871 if (query.length > 0) { | |
3872 for (var part in query.split("&")) { | |
3873 var keyvalue = part.split("="); | |
3874 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3875 } | |
3876 } | |
3877 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
3878 unittest.expect(queryMap["annotationDataId"], unittest.equals(arg_annota
tionDataId)); | |
3879 unittest.expect(core.int.parse(queryMap["h"].first), unittest.equals(arg
_h)); | |
3880 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
3881 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
3882 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
3883 unittest.expect(core.int.parse(queryMap["scale"].first), unittest.equals
(arg_scale)); | |
3884 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3885 unittest.expect(queryMap["updatedMax"].first, unittest.equals(arg_update
dMax)); | |
3886 unittest.expect(queryMap["updatedMin"].first, unittest.equals(arg_update
dMin)); | |
3887 unittest.expect(core.int.parse(queryMap["w"].first), unittest.equals(arg
_w)); | |
3888 | |
3889 | |
3890 var h = { | |
3891 "content-type" : "application/json; charset=utf-8", | |
3892 }; | |
3893 var resp = convert.JSON.encode(buildAnnotationsdata()); | |
3894 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3895 }), true); | |
3896 res.list(arg_volumeId, arg_layerId, arg_contentVersion, annotationDataId:
arg_annotationDataId, h: arg_h, locale: arg_locale, maxResults: arg_maxResults,
pageToken: arg_pageToken, scale: arg_scale, source: arg_source, updatedMax: arg_
updatedMax, updatedMin: arg_updatedMin, w: arg_w).then(unittest.expectAsync(((ap
i.Annotationsdata response) { | |
3897 checkAnnotationsdata(response); | |
3898 }))); | |
3899 }); | |
3900 | |
3901 }); | |
3902 | |
3903 | |
3904 unittest.group("resource-LayersVolumeAnnotationsResourceApi", () { | |
3905 unittest.test("method--get", () { | |
3906 | |
3907 var mock = new common_test.HttpServerMock(); | |
3908 api.LayersVolumeAnnotationsResourceApi res = new api.BooksApi(mock).layers
.volumeAnnotations; | |
3909 var arg_volumeId = "foo"; | |
3910 var arg_layerId = "foo"; | |
3911 var arg_annotationId = "foo"; | |
3912 var arg_locale = "foo"; | |
3913 var arg_source = "foo"; | |
3914 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3915 var path = (req.url).path; | |
3916 var pathOffset = 0; | |
3917 var index; | |
3918 var subPart; | |
3919 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3920 pathOffset += 10; | |
3921 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
3922 pathOffset += 8; | |
3923 index = path.indexOf("/layers/", pathOffset); | |
3924 unittest.expect(index >= 0, unittest.isTrue); | |
3925 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3926 pathOffset = index; | |
3927 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
3928 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/layers/")); | |
3929 pathOffset += 8; | |
3930 index = path.indexOf("/annotations/", pathOffset); | |
3931 unittest.expect(index >= 0, unittest.isTrue); | |
3932 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3933 pathOffset = index; | |
3934 unittest.expect(subPart, unittest.equals("$arg_layerId")); | |
3935 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/annotations/")); | |
3936 pathOffset += 13; | |
3937 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3938 pathOffset = path.length; | |
3939 unittest.expect(subPart, unittest.equals("$arg_annotationId")); | |
3940 | |
3941 var query = (req.url).query; | |
3942 var queryOffset = 0; | |
3943 var queryMap = {}; | |
3944 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3945 parseBool(n) { | |
3946 if (n == "true") return true; | |
3947 if (n == "false") return false; | |
3948 if (n == null) return null; | |
3949 throw new core.ArgumentError("Invalid boolean: $n"); | |
3950 } | |
3951 if (query.length > 0) { | |
3952 for (var part in query.split("&")) { | |
3953 var keyvalue = part.split("="); | |
3954 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3955 } | |
3956 } | |
3957 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
3958 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
3959 | |
3960 | |
3961 var h = { | |
3962 "content-type" : "application/json; charset=utf-8", | |
3963 }; | |
3964 var resp = convert.JSON.encode(buildVolumeannotation()); | |
3965 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3966 }), true); | |
3967 res.get(arg_volumeId, arg_layerId, arg_annotationId, locale: arg_locale, s
ource: arg_source).then(unittest.expectAsync(((api.Volumeannotation response) { | |
3968 checkVolumeannotation(response); | |
3969 }))); | |
3970 }); | |
3971 | |
3972 unittest.test("method--list", () { | |
3973 | |
3974 var mock = new common_test.HttpServerMock(); | |
3975 api.LayersVolumeAnnotationsResourceApi res = new api.BooksApi(mock).layers
.volumeAnnotations; | |
3976 var arg_volumeId = "foo"; | |
3977 var arg_layerId = "foo"; | |
3978 var arg_contentVersion = "foo"; | |
3979 var arg_endOffset = "foo"; | |
3980 var arg_endPosition = "foo"; | |
3981 var arg_locale = "foo"; | |
3982 var arg_maxResults = 42; | |
3983 var arg_pageToken = "foo"; | |
3984 var arg_showDeleted = true; | |
3985 var arg_source = "foo"; | |
3986 var arg_startOffset = "foo"; | |
3987 var arg_startPosition = "foo"; | |
3988 var arg_updatedMax = "foo"; | |
3989 var arg_updatedMin = "foo"; | |
3990 var arg_volumeAnnotationsVersion = "foo"; | |
3991 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3992 var path = (req.url).path; | |
3993 var pathOffset = 0; | |
3994 var index; | |
3995 var subPart; | |
3996 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
3997 pathOffset += 10; | |
3998 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
3999 pathOffset += 8; | |
4000 index = path.indexOf("/layers/", pathOffset); | |
4001 unittest.expect(index >= 0, unittest.isTrue); | |
4002 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4003 pathOffset = index; | |
4004 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
4005 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/layers/")); | |
4006 pathOffset += 8; | |
4007 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4008 pathOffset = path.length; | |
4009 unittest.expect(subPart, unittest.equals("$arg_layerId")); | |
4010 | |
4011 var query = (req.url).query; | |
4012 var queryOffset = 0; | |
4013 var queryMap = {}; | |
4014 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4015 parseBool(n) { | |
4016 if (n == "true") return true; | |
4017 if (n == "false") return false; | |
4018 if (n == null) return null; | |
4019 throw new core.ArgumentError("Invalid boolean: $n"); | |
4020 } | |
4021 if (query.length > 0) { | |
4022 for (var part in query.split("&")) { | |
4023 var keyvalue = part.split("="); | |
4024 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4025 } | |
4026 } | |
4027 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
4028 unittest.expect(queryMap["endOffset"].first, unittest.equals(arg_endOffs
et)); | |
4029 unittest.expect(queryMap["endPosition"].first, unittest.equals(arg_endPo
sition)); | |
4030 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
4031 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
4032 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
4033 unittest.expect(queryMap["showDeleted"].first, unittest.equals("$arg_sho
wDeleted")); | |
4034 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4035 unittest.expect(queryMap["startOffset"].first, unittest.equals(arg_start
Offset)); | |
4036 unittest.expect(queryMap["startPosition"].first, unittest.equals(arg_sta
rtPosition)); | |
4037 unittest.expect(queryMap["updatedMax"].first, unittest.equals(arg_update
dMax)); | |
4038 unittest.expect(queryMap["updatedMin"].first, unittest.equals(arg_update
dMin)); | |
4039 unittest.expect(queryMap["volumeAnnotationsVersion"].first, unittest.equ
als(arg_volumeAnnotationsVersion)); | |
4040 | |
4041 | |
4042 var h = { | |
4043 "content-type" : "application/json; charset=utf-8", | |
4044 }; | |
4045 var resp = convert.JSON.encode(buildVolumeannotations()); | |
4046 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4047 }), true); | |
4048 res.list(arg_volumeId, arg_layerId, arg_contentVersion, endOffset: arg_end
Offset, endPosition: arg_endPosition, locale: arg_locale, maxResults: arg_maxRes
ults, pageToken: arg_pageToken, showDeleted: arg_showDeleted, source: arg_source
, startOffset: arg_startOffset, startPosition: arg_startPosition, updatedMax: ar
g_updatedMax, updatedMin: arg_updatedMin, volumeAnnotationsVersion: arg_volumeAn
notationsVersion).then(unittest.expectAsync(((api.Volumeannotations response) { | |
4049 checkVolumeannotations(response); | |
4050 }))); | |
4051 }); | |
4052 | |
4053 }); | |
4054 | |
4055 | |
4056 unittest.group("resource-MyconfigResourceApi", () { | |
4057 unittest.test("method--releaseDownloadAccess", () { | |
4058 | |
4059 var mock = new common_test.HttpServerMock(); | |
4060 api.MyconfigResourceApi res = new api.BooksApi(mock).myconfig; | |
4061 var arg_volumeIds = buildUnnamed527(); | |
4062 var arg_cpksver = "foo"; | |
4063 var arg_locale = "foo"; | |
4064 var arg_source = "foo"; | |
4065 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4066 var path = (req.url).path; | |
4067 var pathOffset = 0; | |
4068 var index; | |
4069 var subPart; | |
4070 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4071 pathOffset += 10; | |
4072 unittest.expect(path.substring(pathOffset, pathOffset + 30), unittest.eq
uals("myconfig/releaseDownloadAccess")); | |
4073 pathOffset += 30; | |
4074 | |
4075 var query = (req.url).query; | |
4076 var queryOffset = 0; | |
4077 var queryMap = {}; | |
4078 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4079 parseBool(n) { | |
4080 if (n == "true") return true; | |
4081 if (n == "false") return false; | |
4082 if (n == null) return null; | |
4083 throw new core.ArgumentError("Invalid boolean: $n"); | |
4084 } | |
4085 if (query.length > 0) { | |
4086 for (var part in query.split("&")) { | |
4087 var keyvalue = part.split("="); | |
4088 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4089 } | |
4090 } | |
4091 unittest.expect(queryMap["volumeIds"], unittest.equals(arg_volumeIds)); | |
4092 unittest.expect(queryMap["cpksver"].first, unittest.equals(arg_cpksver))
; | |
4093 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
4094 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4095 | |
4096 | |
4097 var h = { | |
4098 "content-type" : "application/json; charset=utf-8", | |
4099 }; | |
4100 var resp = convert.JSON.encode(buildDownloadAccesses()); | |
4101 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4102 }), true); | |
4103 res.releaseDownloadAccess(arg_volumeIds, arg_cpksver, locale: arg_locale,
source: arg_source).then(unittest.expectAsync(((api.DownloadAccesses response) { | |
4104 checkDownloadAccesses(response); | |
4105 }))); | |
4106 }); | |
4107 | |
4108 unittest.test("method--requestAccess", () { | |
4109 | |
4110 var mock = new common_test.HttpServerMock(); | |
4111 api.MyconfigResourceApi res = new api.BooksApi(mock).myconfig; | |
4112 var arg_source = "foo"; | |
4113 var arg_volumeId = "foo"; | |
4114 var arg_nonce = "foo"; | |
4115 var arg_cpksver = "foo"; | |
4116 var arg_licenseTypes = "foo"; | |
4117 var arg_locale = "foo"; | |
4118 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4119 var path = (req.url).path; | |
4120 var pathOffset = 0; | |
4121 var index; | |
4122 var subPart; | |
4123 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4124 pathOffset += 10; | |
4125 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("myconfig/requestAccess")); | |
4126 pathOffset += 22; | |
4127 | |
4128 var query = (req.url).query; | |
4129 var queryOffset = 0; | |
4130 var queryMap = {}; | |
4131 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4132 parseBool(n) { | |
4133 if (n == "true") return true; | |
4134 if (n == "false") return false; | |
4135 if (n == null) return null; | |
4136 throw new core.ArgumentError("Invalid boolean: $n"); | |
4137 } | |
4138 if (query.length > 0) { | |
4139 for (var part in query.split("&")) { | |
4140 var keyvalue = part.split("="); | |
4141 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4142 } | |
4143 } | |
4144 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4145 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
4146 unittest.expect(queryMap["nonce"].first, unittest.equals(arg_nonce)); | |
4147 unittest.expect(queryMap["cpksver"].first, unittest.equals(arg_cpksver))
; | |
4148 unittest.expect(queryMap["licenseTypes"].first, unittest.equals(arg_lice
nseTypes)); | |
4149 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
4150 | |
4151 | |
4152 var h = { | |
4153 "content-type" : "application/json; charset=utf-8", | |
4154 }; | |
4155 var resp = convert.JSON.encode(buildRequestAccess()); | |
4156 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4157 }), true); | |
4158 res.requestAccess(arg_source, arg_volumeId, arg_nonce, arg_cpksver, licens
eTypes: arg_licenseTypes, locale: arg_locale).then(unittest.expectAsync(((api.Re
questAccess response) { | |
4159 checkRequestAccess(response); | |
4160 }))); | |
4161 }); | |
4162 | |
4163 unittest.test("method--syncVolumeLicenses", () { | |
4164 | |
4165 var mock = new common_test.HttpServerMock(); | |
4166 api.MyconfigResourceApi res = new api.BooksApi(mock).myconfig; | |
4167 var arg_source = "foo"; | |
4168 var arg_nonce = "foo"; | |
4169 var arg_cpksver = "foo"; | |
4170 var arg_features = buildUnnamed528(); | |
4171 var arg_locale = "foo"; | |
4172 var arg_showPreorders = true; | |
4173 var arg_volumeIds = buildUnnamed529(); | |
4174 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4175 var path = (req.url).path; | |
4176 var pathOffset = 0; | |
4177 var index; | |
4178 var subPart; | |
4179 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4180 pathOffset += 10; | |
4181 unittest.expect(path.substring(pathOffset, pathOffset + 27), unittest.eq
uals("myconfig/syncVolumeLicenses")); | |
4182 pathOffset += 27; | |
4183 | |
4184 var query = (req.url).query; | |
4185 var queryOffset = 0; | |
4186 var queryMap = {}; | |
4187 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4188 parseBool(n) { | |
4189 if (n == "true") return true; | |
4190 if (n == "false") return false; | |
4191 if (n == null) return null; | |
4192 throw new core.ArgumentError("Invalid boolean: $n"); | |
4193 } | |
4194 if (query.length > 0) { | |
4195 for (var part in query.split("&")) { | |
4196 var keyvalue = part.split("="); | |
4197 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4198 } | |
4199 } | |
4200 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4201 unittest.expect(queryMap["nonce"].first, unittest.equals(arg_nonce)); | |
4202 unittest.expect(queryMap["cpksver"].first, unittest.equals(arg_cpksver))
; | |
4203 unittest.expect(queryMap["features"], unittest.equals(arg_features)); | |
4204 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
4205 unittest.expect(queryMap["showPreorders"].first, unittest.equals("$arg_s
howPreorders")); | |
4206 unittest.expect(queryMap["volumeIds"], unittest.equals(arg_volumeIds)); | |
4207 | |
4208 | |
4209 var h = { | |
4210 "content-type" : "application/json; charset=utf-8", | |
4211 }; | |
4212 var resp = convert.JSON.encode(buildVolumes()); | |
4213 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4214 }), true); | |
4215 res.syncVolumeLicenses(arg_source, arg_nonce, arg_cpksver, features: arg_f
eatures, locale: arg_locale, showPreorders: arg_showPreorders, volumeIds: arg_vo
lumeIds).then(unittest.expectAsync(((api.Volumes response) { | |
4216 checkVolumes(response); | |
4217 }))); | |
4218 }); | |
4219 | |
4220 }); | |
4221 | |
4222 | |
4223 unittest.group("resource-MylibraryAnnotationsResourceApi", () { | |
4224 unittest.test("method--delete", () { | |
4225 | |
4226 var mock = new common_test.HttpServerMock(); | |
4227 api.MylibraryAnnotationsResourceApi res = new api.BooksApi(mock).mylibrary
.annotations; | |
4228 var arg_annotationId = "foo"; | |
4229 var arg_source = "foo"; | |
4230 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4231 var path = (req.url).path; | |
4232 var pathOffset = 0; | |
4233 var index; | |
4234 var subPart; | |
4235 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4236 pathOffset += 10; | |
4237 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/annotations/")); | |
4238 pathOffset += 22; | |
4239 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4240 pathOffset = path.length; | |
4241 unittest.expect(subPart, unittest.equals("$arg_annotationId")); | |
4242 | |
4243 var query = (req.url).query; | |
4244 var queryOffset = 0; | |
4245 var queryMap = {}; | |
4246 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4247 parseBool(n) { | |
4248 if (n == "true") return true; | |
4249 if (n == "false") return false; | |
4250 if (n == null) return null; | |
4251 throw new core.ArgumentError("Invalid boolean: $n"); | |
4252 } | |
4253 if (query.length > 0) { | |
4254 for (var part in query.split("&")) { | |
4255 var keyvalue = part.split("="); | |
4256 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4257 } | |
4258 } | |
4259 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4260 | |
4261 | |
4262 var h = { | |
4263 "content-type" : "application/json; charset=utf-8", | |
4264 }; | |
4265 var resp = ""; | |
4266 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4267 }), true); | |
4268 res.delete(arg_annotationId, source: arg_source).then(unittest.expectAsync
((_) {})); | |
4269 }); | |
4270 | |
4271 unittest.test("method--get", () { | |
4272 | |
4273 var mock = new common_test.HttpServerMock(); | |
4274 api.MylibraryAnnotationsResourceApi res = new api.BooksApi(mock).mylibrary
.annotations; | |
4275 var arg_annotationId = "foo"; | |
4276 var arg_source = "foo"; | |
4277 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4278 var path = (req.url).path; | |
4279 var pathOffset = 0; | |
4280 var index; | |
4281 var subPart; | |
4282 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4283 pathOffset += 10; | |
4284 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/annotations/")); | |
4285 pathOffset += 22; | |
4286 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4287 pathOffset = path.length; | |
4288 unittest.expect(subPart, unittest.equals("$arg_annotationId")); | |
4289 | |
4290 var query = (req.url).query; | |
4291 var queryOffset = 0; | |
4292 var queryMap = {}; | |
4293 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4294 parseBool(n) { | |
4295 if (n == "true") return true; | |
4296 if (n == "false") return false; | |
4297 if (n == null) return null; | |
4298 throw new core.ArgumentError("Invalid boolean: $n"); | |
4299 } | |
4300 if (query.length > 0) { | |
4301 for (var part in query.split("&")) { | |
4302 var keyvalue = part.split("="); | |
4303 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4304 } | |
4305 } | |
4306 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4307 | |
4308 | |
4309 var h = { | |
4310 "content-type" : "application/json; charset=utf-8", | |
4311 }; | |
4312 var resp = convert.JSON.encode(buildAnnotation()); | |
4313 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4314 }), true); | |
4315 res.get(arg_annotationId, source: arg_source).then(unittest.expectAsync(((
api.Annotation response) { | |
4316 checkAnnotation(response); | |
4317 }))); | |
4318 }); | |
4319 | |
4320 unittest.test("method--insert", () { | |
4321 | |
4322 var mock = new common_test.HttpServerMock(); | |
4323 api.MylibraryAnnotationsResourceApi res = new api.BooksApi(mock).mylibrary
.annotations; | |
4324 var arg_request = buildAnnotation(); | |
4325 var arg_showOnlySummaryInResponse = true; | |
4326 var arg_source = "foo"; | |
4327 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4328 var obj = new api.Annotation.fromJson(json); | |
4329 checkAnnotation(obj); | |
4330 | |
4331 var path = (req.url).path; | |
4332 var pathOffset = 0; | |
4333 var index; | |
4334 var subPart; | |
4335 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4336 pathOffset += 10; | |
4337 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("mylibrary/annotations")); | |
4338 pathOffset += 21; | |
4339 | |
4340 var query = (req.url).query; | |
4341 var queryOffset = 0; | |
4342 var queryMap = {}; | |
4343 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4344 parseBool(n) { | |
4345 if (n == "true") return true; | |
4346 if (n == "false") return false; | |
4347 if (n == null) return null; | |
4348 throw new core.ArgumentError("Invalid boolean: $n"); | |
4349 } | |
4350 if (query.length > 0) { | |
4351 for (var part in query.split("&")) { | |
4352 var keyvalue = part.split("="); | |
4353 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4354 } | |
4355 } | |
4356 unittest.expect(queryMap["showOnlySummaryInResponse"].first, unittest.eq
uals("$arg_showOnlySummaryInResponse")); | |
4357 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4358 | |
4359 | |
4360 var h = { | |
4361 "content-type" : "application/json; charset=utf-8", | |
4362 }; | |
4363 var resp = convert.JSON.encode(buildAnnotation()); | |
4364 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4365 }), true); | |
4366 res.insert(arg_request, showOnlySummaryInResponse: arg_showOnlySummaryInRe
sponse, source: arg_source).then(unittest.expectAsync(((api.Annotation response)
{ | |
4367 checkAnnotation(response); | |
4368 }))); | |
4369 }); | |
4370 | |
4371 unittest.test("method--list", () { | |
4372 | |
4373 var mock = new common_test.HttpServerMock(); | |
4374 api.MylibraryAnnotationsResourceApi res = new api.BooksApi(mock).mylibrary
.annotations; | |
4375 var arg_contentVersion = "foo"; | |
4376 var arg_layerId = "foo"; | |
4377 var arg_layerIds = buildUnnamed530(); | |
4378 var arg_maxResults = 42; | |
4379 var arg_pageIds = buildUnnamed531(); | |
4380 var arg_pageToken = "foo"; | |
4381 var arg_showDeleted = true; | |
4382 var arg_source = "foo"; | |
4383 var arg_updatedMax = "foo"; | |
4384 var arg_updatedMin = "foo"; | |
4385 var arg_volumeId = "foo"; | |
4386 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4387 var path = (req.url).path; | |
4388 var pathOffset = 0; | |
4389 var index; | |
4390 var subPart; | |
4391 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4392 pathOffset += 10; | |
4393 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("mylibrary/annotations")); | |
4394 pathOffset += 21; | |
4395 | |
4396 var query = (req.url).query; | |
4397 var queryOffset = 0; | |
4398 var queryMap = {}; | |
4399 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4400 parseBool(n) { | |
4401 if (n == "true") return true; | |
4402 if (n == "false") return false; | |
4403 if (n == null) return null; | |
4404 throw new core.ArgumentError("Invalid boolean: $n"); | |
4405 } | |
4406 if (query.length > 0) { | |
4407 for (var part in query.split("&")) { | |
4408 var keyvalue = part.split("="); | |
4409 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4410 } | |
4411 } | |
4412 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
4413 unittest.expect(queryMap["layerId"].first, unittest.equals(arg_layerId))
; | |
4414 unittest.expect(queryMap["layerIds"], unittest.equals(arg_layerIds)); | |
4415 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
4416 unittest.expect(queryMap["pageIds"], unittest.equals(arg_pageIds)); | |
4417 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
4418 unittest.expect(queryMap["showDeleted"].first, unittest.equals("$arg_sho
wDeleted")); | |
4419 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4420 unittest.expect(queryMap["updatedMax"].first, unittest.equals(arg_update
dMax)); | |
4421 unittest.expect(queryMap["updatedMin"].first, unittest.equals(arg_update
dMin)); | |
4422 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
4423 | |
4424 | |
4425 var h = { | |
4426 "content-type" : "application/json; charset=utf-8", | |
4427 }; | |
4428 var resp = convert.JSON.encode(buildAnnotations()); | |
4429 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4430 }), true); | |
4431 res.list(contentVersion: arg_contentVersion, layerId: arg_layerId, layerId
s: arg_layerIds, maxResults: arg_maxResults, pageIds: arg_pageIds, pageToken: ar
g_pageToken, showDeleted: arg_showDeleted, source: arg_source, updatedMax: arg_u
pdatedMax, updatedMin: arg_updatedMin, volumeId: arg_volumeId).then(unittest.exp
ectAsync(((api.Annotations response) { | |
4432 checkAnnotations(response); | |
4433 }))); | |
4434 }); | |
4435 | |
4436 unittest.test("method--summary", () { | |
4437 | |
4438 var mock = new common_test.HttpServerMock(); | |
4439 api.MylibraryAnnotationsResourceApi res = new api.BooksApi(mock).mylibrary
.annotations; | |
4440 var arg_layerIds = buildUnnamed532(); | |
4441 var arg_volumeId = "foo"; | |
4442 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4443 var path = (req.url).path; | |
4444 var pathOffset = 0; | |
4445 var index; | |
4446 var subPart; | |
4447 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4448 pathOffset += 10; | |
4449 unittest.expect(path.substring(pathOffset, pathOffset + 29), unittest.eq
uals("mylibrary/annotations/summary")); | |
4450 pathOffset += 29; | |
4451 | |
4452 var query = (req.url).query; | |
4453 var queryOffset = 0; | |
4454 var queryMap = {}; | |
4455 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4456 parseBool(n) { | |
4457 if (n == "true") return true; | |
4458 if (n == "false") return false; | |
4459 if (n == null) return null; | |
4460 throw new core.ArgumentError("Invalid boolean: $n"); | |
4461 } | |
4462 if (query.length > 0) { | |
4463 for (var part in query.split("&")) { | |
4464 var keyvalue = part.split("="); | |
4465 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4466 } | |
4467 } | |
4468 unittest.expect(queryMap["layerIds"], unittest.equals(arg_layerIds)); | |
4469 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
4470 | |
4471 | |
4472 var h = { | |
4473 "content-type" : "application/json; charset=utf-8", | |
4474 }; | |
4475 var resp = convert.JSON.encode(buildAnnotationsSummary()); | |
4476 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4477 }), true); | |
4478 res.summary(arg_layerIds, arg_volumeId).then(unittest.expectAsync(((api.An
notationsSummary response) { | |
4479 checkAnnotationsSummary(response); | |
4480 }))); | |
4481 }); | |
4482 | |
4483 unittest.test("method--update", () { | |
4484 | |
4485 var mock = new common_test.HttpServerMock(); | |
4486 api.MylibraryAnnotationsResourceApi res = new api.BooksApi(mock).mylibrary
.annotations; | |
4487 var arg_request = buildAnnotation(); | |
4488 var arg_annotationId = "foo"; | |
4489 var arg_source = "foo"; | |
4490 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4491 var obj = new api.Annotation.fromJson(json); | |
4492 checkAnnotation(obj); | |
4493 | |
4494 var path = (req.url).path; | |
4495 var pathOffset = 0; | |
4496 var index; | |
4497 var subPart; | |
4498 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4499 pathOffset += 10; | |
4500 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/annotations/")); | |
4501 pathOffset += 22; | |
4502 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4503 pathOffset = path.length; | |
4504 unittest.expect(subPart, unittest.equals("$arg_annotationId")); | |
4505 | |
4506 var query = (req.url).query; | |
4507 var queryOffset = 0; | |
4508 var queryMap = {}; | |
4509 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4510 parseBool(n) { | |
4511 if (n == "true") return true; | |
4512 if (n == "false") return false; | |
4513 if (n == null) return null; | |
4514 throw new core.ArgumentError("Invalid boolean: $n"); | |
4515 } | |
4516 if (query.length > 0) { | |
4517 for (var part in query.split("&")) { | |
4518 var keyvalue = part.split("="); | |
4519 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4520 } | |
4521 } | |
4522 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4523 | |
4524 | |
4525 var h = { | |
4526 "content-type" : "application/json; charset=utf-8", | |
4527 }; | |
4528 var resp = convert.JSON.encode(buildAnnotation()); | |
4529 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4530 }), true); | |
4531 res.update(arg_request, arg_annotationId, source: arg_source).then(unittes
t.expectAsync(((api.Annotation response) { | |
4532 checkAnnotation(response); | |
4533 }))); | |
4534 }); | |
4535 | |
4536 }); | |
4537 | |
4538 | |
4539 unittest.group("resource-MylibraryBookshelvesResourceApi", () { | |
4540 unittest.test("method--addVolume", () { | |
4541 | |
4542 var mock = new common_test.HttpServerMock(); | |
4543 api.MylibraryBookshelvesResourceApi res = new api.BooksApi(mock).mylibrary
.bookshelves; | |
4544 var arg_shelf = "foo"; | |
4545 var arg_volumeId = "foo"; | |
4546 var arg_source = "foo"; | |
4547 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4548 var path = (req.url).path; | |
4549 var pathOffset = 0; | |
4550 var index; | |
4551 var subPart; | |
4552 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4553 pathOffset += 10; | |
4554 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/bookshelves/")); | |
4555 pathOffset += 22; | |
4556 index = path.indexOf("/addVolume", pathOffset); | |
4557 unittest.expect(index >= 0, unittest.isTrue); | |
4558 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4559 pathOffset = index; | |
4560 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
4561 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/addVolume")); | |
4562 pathOffset += 10; | |
4563 | |
4564 var query = (req.url).query; | |
4565 var queryOffset = 0; | |
4566 var queryMap = {}; | |
4567 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4568 parseBool(n) { | |
4569 if (n == "true") return true; | |
4570 if (n == "false") return false; | |
4571 if (n == null) return null; | |
4572 throw new core.ArgumentError("Invalid boolean: $n"); | |
4573 } | |
4574 if (query.length > 0) { | |
4575 for (var part in query.split("&")) { | |
4576 var keyvalue = part.split("="); | |
4577 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4578 } | |
4579 } | |
4580 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
4581 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4582 | |
4583 | |
4584 var h = { | |
4585 "content-type" : "application/json; charset=utf-8", | |
4586 }; | |
4587 var resp = ""; | |
4588 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4589 }), true); | |
4590 res.addVolume(arg_shelf, arg_volumeId, source: arg_source).then(unittest.e
xpectAsync((_) {})); | |
4591 }); | |
4592 | |
4593 unittest.test("method--clearVolumes", () { | |
4594 | |
4595 var mock = new common_test.HttpServerMock(); | |
4596 api.MylibraryBookshelvesResourceApi res = new api.BooksApi(mock).mylibrary
.bookshelves; | |
4597 var arg_shelf = "foo"; | |
4598 var arg_source = "foo"; | |
4599 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4600 var path = (req.url).path; | |
4601 var pathOffset = 0; | |
4602 var index; | |
4603 var subPart; | |
4604 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4605 pathOffset += 10; | |
4606 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/bookshelves/")); | |
4607 pathOffset += 22; | |
4608 index = path.indexOf("/clearVolumes", pathOffset); | |
4609 unittest.expect(index >= 0, unittest.isTrue); | |
4610 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4611 pathOffset = index; | |
4612 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
4613 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/clearVolumes")); | |
4614 pathOffset += 13; | |
4615 | |
4616 var query = (req.url).query; | |
4617 var queryOffset = 0; | |
4618 var queryMap = {}; | |
4619 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4620 parseBool(n) { | |
4621 if (n == "true") return true; | |
4622 if (n == "false") return false; | |
4623 if (n == null) return null; | |
4624 throw new core.ArgumentError("Invalid boolean: $n"); | |
4625 } | |
4626 if (query.length > 0) { | |
4627 for (var part in query.split("&")) { | |
4628 var keyvalue = part.split("="); | |
4629 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4630 } | |
4631 } | |
4632 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4633 | |
4634 | |
4635 var h = { | |
4636 "content-type" : "application/json; charset=utf-8", | |
4637 }; | |
4638 var resp = ""; | |
4639 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4640 }), true); | |
4641 res.clearVolumes(arg_shelf, source: arg_source).then(unittest.expectAsync(
(_) {})); | |
4642 }); | |
4643 | |
4644 unittest.test("method--get", () { | |
4645 | |
4646 var mock = new common_test.HttpServerMock(); | |
4647 api.MylibraryBookshelvesResourceApi res = new api.BooksApi(mock).mylibrary
.bookshelves; | |
4648 var arg_shelf = "foo"; | |
4649 var arg_source = "foo"; | |
4650 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4651 var path = (req.url).path; | |
4652 var pathOffset = 0; | |
4653 var index; | |
4654 var subPart; | |
4655 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4656 pathOffset += 10; | |
4657 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/bookshelves/")); | |
4658 pathOffset += 22; | |
4659 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4660 pathOffset = path.length; | |
4661 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
4662 | |
4663 var query = (req.url).query; | |
4664 var queryOffset = 0; | |
4665 var queryMap = {}; | |
4666 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4667 parseBool(n) { | |
4668 if (n == "true") return true; | |
4669 if (n == "false") return false; | |
4670 if (n == null) return null; | |
4671 throw new core.ArgumentError("Invalid boolean: $n"); | |
4672 } | |
4673 if (query.length > 0) { | |
4674 for (var part in query.split("&")) { | |
4675 var keyvalue = part.split("="); | |
4676 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4677 } | |
4678 } | |
4679 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4680 | |
4681 | |
4682 var h = { | |
4683 "content-type" : "application/json; charset=utf-8", | |
4684 }; | |
4685 var resp = convert.JSON.encode(buildBookshelf()); | |
4686 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4687 }), true); | |
4688 res.get(arg_shelf, source: arg_source).then(unittest.expectAsync(((api.Boo
kshelf response) { | |
4689 checkBookshelf(response); | |
4690 }))); | |
4691 }); | |
4692 | |
4693 unittest.test("method--list", () { | |
4694 | |
4695 var mock = new common_test.HttpServerMock(); | |
4696 api.MylibraryBookshelvesResourceApi res = new api.BooksApi(mock).mylibrary
.bookshelves; | |
4697 var arg_source = "foo"; | |
4698 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4699 var path = (req.url).path; | |
4700 var pathOffset = 0; | |
4701 var index; | |
4702 var subPart; | |
4703 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4704 pathOffset += 10; | |
4705 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("mylibrary/bookshelves")); | |
4706 pathOffset += 21; | |
4707 | |
4708 var query = (req.url).query; | |
4709 var queryOffset = 0; | |
4710 var queryMap = {}; | |
4711 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4712 parseBool(n) { | |
4713 if (n == "true") return true; | |
4714 if (n == "false") return false; | |
4715 if (n == null) return null; | |
4716 throw new core.ArgumentError("Invalid boolean: $n"); | |
4717 } | |
4718 if (query.length > 0) { | |
4719 for (var part in query.split("&")) { | |
4720 var keyvalue = part.split("="); | |
4721 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4722 } | |
4723 } | |
4724 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4725 | |
4726 | |
4727 var h = { | |
4728 "content-type" : "application/json; charset=utf-8", | |
4729 }; | |
4730 var resp = convert.JSON.encode(buildBookshelves()); | |
4731 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4732 }), true); | |
4733 res.list(source: arg_source).then(unittest.expectAsync(((api.Bookshelves r
esponse) { | |
4734 checkBookshelves(response); | |
4735 }))); | |
4736 }); | |
4737 | |
4738 unittest.test("method--moveVolume", () { | |
4739 | |
4740 var mock = new common_test.HttpServerMock(); | |
4741 api.MylibraryBookshelvesResourceApi res = new api.BooksApi(mock).mylibrary
.bookshelves; | |
4742 var arg_shelf = "foo"; | |
4743 var arg_volumeId = "foo"; | |
4744 var arg_volumePosition = 42; | |
4745 var arg_source = "foo"; | |
4746 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4747 var path = (req.url).path; | |
4748 var pathOffset = 0; | |
4749 var index; | |
4750 var subPart; | |
4751 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4752 pathOffset += 10; | |
4753 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/bookshelves/")); | |
4754 pathOffset += 22; | |
4755 index = path.indexOf("/moveVolume", pathOffset); | |
4756 unittest.expect(index >= 0, unittest.isTrue); | |
4757 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4758 pathOffset = index; | |
4759 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
4760 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/moveVolume")); | |
4761 pathOffset += 11; | |
4762 | |
4763 var query = (req.url).query; | |
4764 var queryOffset = 0; | |
4765 var queryMap = {}; | |
4766 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4767 parseBool(n) { | |
4768 if (n == "true") return true; | |
4769 if (n == "false") return false; | |
4770 if (n == null) return null; | |
4771 throw new core.ArgumentError("Invalid boolean: $n"); | |
4772 } | |
4773 if (query.length > 0) { | |
4774 for (var part in query.split("&")) { | |
4775 var keyvalue = part.split("="); | |
4776 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4777 } | |
4778 } | |
4779 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
4780 unittest.expect(core.int.parse(queryMap["volumePosition"].first), unitte
st.equals(arg_volumePosition)); | |
4781 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4782 | |
4783 | |
4784 var h = { | |
4785 "content-type" : "application/json; charset=utf-8", | |
4786 }; | |
4787 var resp = ""; | |
4788 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4789 }), true); | |
4790 res.moveVolume(arg_shelf, arg_volumeId, arg_volumePosition, source: arg_so
urce).then(unittest.expectAsync((_) {})); | |
4791 }); | |
4792 | |
4793 unittest.test("method--removeVolume", () { | |
4794 | |
4795 var mock = new common_test.HttpServerMock(); | |
4796 api.MylibraryBookshelvesResourceApi res = new api.BooksApi(mock).mylibrary
.bookshelves; | |
4797 var arg_shelf = "foo"; | |
4798 var arg_volumeId = "foo"; | |
4799 var arg_source = "foo"; | |
4800 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4801 var path = (req.url).path; | |
4802 var pathOffset = 0; | |
4803 var index; | |
4804 var subPart; | |
4805 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4806 pathOffset += 10; | |
4807 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/bookshelves/")); | |
4808 pathOffset += 22; | |
4809 index = path.indexOf("/removeVolume", pathOffset); | |
4810 unittest.expect(index >= 0, unittest.isTrue); | |
4811 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4812 pathOffset = index; | |
4813 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
4814 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/removeVolume")); | |
4815 pathOffset += 13; | |
4816 | |
4817 var query = (req.url).query; | |
4818 var queryOffset = 0; | |
4819 var queryMap = {}; | |
4820 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4821 parseBool(n) { | |
4822 if (n == "true") return true; | |
4823 if (n == "false") return false; | |
4824 if (n == null) return null; | |
4825 throw new core.ArgumentError("Invalid boolean: $n"); | |
4826 } | |
4827 if (query.length > 0) { | |
4828 for (var part in query.split("&")) { | |
4829 var keyvalue = part.split("="); | |
4830 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4831 } | |
4832 } | |
4833 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
4834 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4835 | |
4836 | |
4837 var h = { | |
4838 "content-type" : "application/json; charset=utf-8", | |
4839 }; | |
4840 var resp = ""; | |
4841 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4842 }), true); | |
4843 res.removeVolume(arg_shelf, arg_volumeId, source: arg_source).then(unittes
t.expectAsync((_) {})); | |
4844 }); | |
4845 | |
4846 }); | |
4847 | |
4848 | |
4849 unittest.group("resource-MylibraryBookshelvesVolumesResourceApi", () { | |
4850 unittest.test("method--list", () { | |
4851 | |
4852 var mock = new common_test.HttpServerMock(); | |
4853 api.MylibraryBookshelvesVolumesResourceApi res = new api.BooksApi(mock).my
library.bookshelves.volumes; | |
4854 var arg_shelf = "foo"; | |
4855 var arg_country = "foo"; | |
4856 var arg_maxResults = 42; | |
4857 var arg_projection = "foo"; | |
4858 var arg_q = "foo"; | |
4859 var arg_showPreorders = true; | |
4860 var arg_source = "foo"; | |
4861 var arg_startIndex = 42; | |
4862 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4863 var path = (req.url).path; | |
4864 var pathOffset = 0; | |
4865 var index; | |
4866 var subPart; | |
4867 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4868 pathOffset += 10; | |
4869 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("mylibrary/bookshelves/")); | |
4870 pathOffset += 22; | |
4871 index = path.indexOf("/volumes", pathOffset); | |
4872 unittest.expect(index >= 0, unittest.isTrue); | |
4873 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4874 pathOffset = index; | |
4875 unittest.expect(subPart, unittest.equals("$arg_shelf")); | |
4876 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/volumes")); | |
4877 pathOffset += 8; | |
4878 | |
4879 var query = (req.url).query; | |
4880 var queryOffset = 0; | |
4881 var queryMap = {}; | |
4882 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4883 parseBool(n) { | |
4884 if (n == "true") return true; | |
4885 if (n == "false") return false; | |
4886 if (n == null) return null; | |
4887 throw new core.ArgumentError("Invalid boolean: $n"); | |
4888 } | |
4889 if (query.length > 0) { | |
4890 for (var part in query.split("&")) { | |
4891 var keyvalue = part.split("="); | |
4892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4893 } | |
4894 } | |
4895 unittest.expect(queryMap["country"].first, unittest.equals(arg_country))
; | |
4896 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
4897 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | |
4898 unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); | |
4899 unittest.expect(queryMap["showPreorders"].first, unittest.equals("$arg_s
howPreorders")); | |
4900 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4901 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | |
4902 | |
4903 | |
4904 var h = { | |
4905 "content-type" : "application/json; charset=utf-8", | |
4906 }; | |
4907 var resp = convert.JSON.encode(buildVolumes()); | |
4908 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4909 }), true); | |
4910 res.list(arg_shelf, country: arg_country, maxResults: arg_maxResults, proj
ection: arg_projection, q: arg_q, showPreorders: arg_showPreorders, source: arg_
source, startIndex: arg_startIndex).then(unittest.expectAsync(((api.Volumes resp
onse) { | |
4911 checkVolumes(response); | |
4912 }))); | |
4913 }); | |
4914 | |
4915 }); | |
4916 | |
4917 | |
4918 unittest.group("resource-MylibraryReadingpositionsResourceApi", () { | |
4919 unittest.test("method--get", () { | |
4920 | |
4921 var mock = new common_test.HttpServerMock(); | |
4922 api.MylibraryReadingpositionsResourceApi res = new api.BooksApi(mock).myli
brary.readingpositions; | |
4923 var arg_volumeId = "foo"; | |
4924 var arg_contentVersion = "foo"; | |
4925 var arg_source = "foo"; | |
4926 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4927 var path = (req.url).path; | |
4928 var pathOffset = 0; | |
4929 var index; | |
4930 var subPart; | |
4931 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4932 pathOffset += 10; | |
4933 unittest.expect(path.substring(pathOffset, pathOffset + 27), unittest.eq
uals("mylibrary/readingpositions/")); | |
4934 pathOffset += 27; | |
4935 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4936 pathOffset = path.length; | |
4937 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
4938 | |
4939 var query = (req.url).query; | |
4940 var queryOffset = 0; | |
4941 var queryMap = {}; | |
4942 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4943 parseBool(n) { | |
4944 if (n == "true") return true; | |
4945 if (n == "false") return false; | |
4946 if (n == null) return null; | |
4947 throw new core.ArgumentError("Invalid boolean: $n"); | |
4948 } | |
4949 if (query.length > 0) { | |
4950 for (var part in query.split("&")) { | |
4951 var keyvalue = part.split("="); | |
4952 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4953 } | |
4954 } | |
4955 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
4956 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
4957 | |
4958 | |
4959 var h = { | |
4960 "content-type" : "application/json; charset=utf-8", | |
4961 }; | |
4962 var resp = convert.JSON.encode(buildReadingPosition()); | |
4963 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4964 }), true); | |
4965 res.get(arg_volumeId, contentVersion: arg_contentVersion, source: arg_sour
ce).then(unittest.expectAsync(((api.ReadingPosition response) { | |
4966 checkReadingPosition(response); | |
4967 }))); | |
4968 }); | |
4969 | |
4970 unittest.test("method--setPosition", () { | |
4971 | |
4972 var mock = new common_test.HttpServerMock(); | |
4973 api.MylibraryReadingpositionsResourceApi res = new api.BooksApi(mock).myli
brary.readingpositions; | |
4974 var arg_volumeId = "foo"; | |
4975 var arg_timestamp = "foo"; | |
4976 var arg_position = "foo"; | |
4977 var arg_action = "foo"; | |
4978 var arg_contentVersion = "foo"; | |
4979 var arg_deviceCookie = "foo"; | |
4980 var arg_source = "foo"; | |
4981 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4982 var path = (req.url).path; | |
4983 var pathOffset = 0; | |
4984 var index; | |
4985 var subPart; | |
4986 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
4987 pathOffset += 10; | |
4988 unittest.expect(path.substring(pathOffset, pathOffset + 27), unittest.eq
uals("mylibrary/readingpositions/")); | |
4989 pathOffset += 27; | |
4990 index = path.indexOf("/setPosition", pathOffset); | |
4991 unittest.expect(index >= 0, unittest.isTrue); | |
4992 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4993 pathOffset = index; | |
4994 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
4995 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/setPosition")); | |
4996 pathOffset += 12; | |
4997 | |
4998 var query = (req.url).query; | |
4999 var queryOffset = 0; | |
5000 var queryMap = {}; | |
5001 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5002 parseBool(n) { | |
5003 if (n == "true") return true; | |
5004 if (n == "false") return false; | |
5005 if (n == null) return null; | |
5006 throw new core.ArgumentError("Invalid boolean: $n"); | |
5007 } | |
5008 if (query.length > 0) { | |
5009 for (var part in query.split("&")) { | |
5010 var keyvalue = part.split("="); | |
5011 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5012 } | |
5013 } | |
5014 unittest.expect(queryMap["timestamp"].first, unittest.equals(arg_timesta
mp)); | |
5015 unittest.expect(queryMap["position"].first, unittest.equals(arg_position
)); | |
5016 unittest.expect(queryMap["action"].first, unittest.equals(arg_action)); | |
5017 unittest.expect(queryMap["contentVersion"].first, unittest.equals(arg_co
ntentVersion)); | |
5018 unittest.expect(queryMap["deviceCookie"].first, unittest.equals(arg_devi
ceCookie)); | |
5019 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5020 | |
5021 | |
5022 var h = { | |
5023 "content-type" : "application/json; charset=utf-8", | |
5024 }; | |
5025 var resp = ""; | |
5026 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5027 }), true); | |
5028 res.setPosition(arg_volumeId, arg_timestamp, arg_position, action: arg_act
ion, contentVersion: arg_contentVersion, deviceCookie: arg_deviceCookie, source:
arg_source).then(unittest.expectAsync((_) {})); | |
5029 }); | |
5030 | |
5031 }); | |
5032 | |
5033 | |
5034 unittest.group("resource-PromoofferResourceApi", () { | |
5035 unittest.test("method--accept", () { | |
5036 | |
5037 var mock = new common_test.HttpServerMock(); | |
5038 api.PromoofferResourceApi res = new api.BooksApi(mock).promooffer; | |
5039 var arg_androidId = "foo"; | |
5040 var arg_device = "foo"; | |
5041 var arg_manufacturer = "foo"; | |
5042 var arg_model = "foo"; | |
5043 var arg_offerId = "foo"; | |
5044 var arg_product = "foo"; | |
5045 var arg_serial = "foo"; | |
5046 var arg_volumeId = "foo"; | |
5047 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5048 var path = (req.url).path; | |
5049 var pathOffset = 0; | |
5050 var index; | |
5051 var subPart; | |
5052 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5053 pathOffset += 10; | |
5054 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("promooffer/accept")); | |
5055 pathOffset += 17; | |
5056 | |
5057 var query = (req.url).query; | |
5058 var queryOffset = 0; | |
5059 var queryMap = {}; | |
5060 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5061 parseBool(n) { | |
5062 if (n == "true") return true; | |
5063 if (n == "false") return false; | |
5064 if (n == null) return null; | |
5065 throw new core.ArgumentError("Invalid boolean: $n"); | |
5066 } | |
5067 if (query.length > 0) { | |
5068 for (var part in query.split("&")) { | |
5069 var keyvalue = part.split("="); | |
5070 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5071 } | |
5072 } | |
5073 unittest.expect(queryMap["androidId"].first, unittest.equals(arg_android
Id)); | |
5074 unittest.expect(queryMap["device"].first, unittest.equals(arg_device)); | |
5075 unittest.expect(queryMap["manufacturer"].first, unittest.equals(arg_manu
facturer)); | |
5076 unittest.expect(queryMap["model"].first, unittest.equals(arg_model)); | |
5077 unittest.expect(queryMap["offerId"].first, unittest.equals(arg_offerId))
; | |
5078 unittest.expect(queryMap["product"].first, unittest.equals(arg_product))
; | |
5079 unittest.expect(queryMap["serial"].first, unittest.equals(arg_serial)); | |
5080 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
5081 | |
5082 | |
5083 var h = { | |
5084 "content-type" : "application/json; charset=utf-8", | |
5085 }; | |
5086 var resp = ""; | |
5087 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5088 }), true); | |
5089 res.accept(androidId: arg_androidId, device: arg_device, manufacturer: arg
_manufacturer, model: arg_model, offerId: arg_offerId, product: arg_product, ser
ial: arg_serial, volumeId: arg_volumeId).then(unittest.expectAsync((_) {})); | |
5090 }); | |
5091 | |
5092 unittest.test("method--dismiss", () { | |
5093 | |
5094 var mock = new common_test.HttpServerMock(); | |
5095 api.PromoofferResourceApi res = new api.BooksApi(mock).promooffer; | |
5096 var arg_androidId = "foo"; | |
5097 var arg_device = "foo"; | |
5098 var arg_manufacturer = "foo"; | |
5099 var arg_model = "foo"; | |
5100 var arg_offerId = "foo"; | |
5101 var arg_product = "foo"; | |
5102 var arg_serial = "foo"; | |
5103 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5104 var path = (req.url).path; | |
5105 var pathOffset = 0; | |
5106 var index; | |
5107 var subPart; | |
5108 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5109 pathOffset += 10; | |
5110 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("promooffer/dismiss")); | |
5111 pathOffset += 18; | |
5112 | |
5113 var query = (req.url).query; | |
5114 var queryOffset = 0; | |
5115 var queryMap = {}; | |
5116 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5117 parseBool(n) { | |
5118 if (n == "true") return true; | |
5119 if (n == "false") return false; | |
5120 if (n == null) return null; | |
5121 throw new core.ArgumentError("Invalid boolean: $n"); | |
5122 } | |
5123 if (query.length > 0) { | |
5124 for (var part in query.split("&")) { | |
5125 var keyvalue = part.split("="); | |
5126 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5127 } | |
5128 } | |
5129 unittest.expect(queryMap["androidId"].first, unittest.equals(arg_android
Id)); | |
5130 unittest.expect(queryMap["device"].first, unittest.equals(arg_device)); | |
5131 unittest.expect(queryMap["manufacturer"].first, unittest.equals(arg_manu
facturer)); | |
5132 unittest.expect(queryMap["model"].first, unittest.equals(arg_model)); | |
5133 unittest.expect(queryMap["offerId"].first, unittest.equals(arg_offerId))
; | |
5134 unittest.expect(queryMap["product"].first, unittest.equals(arg_product))
; | |
5135 unittest.expect(queryMap["serial"].first, unittest.equals(arg_serial)); | |
5136 | |
5137 | |
5138 var h = { | |
5139 "content-type" : "application/json; charset=utf-8", | |
5140 }; | |
5141 var resp = ""; | |
5142 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5143 }), true); | |
5144 res.dismiss(androidId: arg_androidId, device: arg_device, manufacturer: ar
g_manufacturer, model: arg_model, offerId: arg_offerId, product: arg_product, se
rial: arg_serial).then(unittest.expectAsync((_) {})); | |
5145 }); | |
5146 | |
5147 unittest.test("method--get", () { | |
5148 | |
5149 var mock = new common_test.HttpServerMock(); | |
5150 api.PromoofferResourceApi res = new api.BooksApi(mock).promooffer; | |
5151 var arg_androidId = "foo"; | |
5152 var arg_device = "foo"; | |
5153 var arg_manufacturer = "foo"; | |
5154 var arg_model = "foo"; | |
5155 var arg_product = "foo"; | |
5156 var arg_serial = "foo"; | |
5157 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5158 var path = (req.url).path; | |
5159 var pathOffset = 0; | |
5160 var index; | |
5161 var subPart; | |
5162 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5163 pathOffset += 10; | |
5164 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("promooffer/get")); | |
5165 pathOffset += 14; | |
5166 | |
5167 var query = (req.url).query; | |
5168 var queryOffset = 0; | |
5169 var queryMap = {}; | |
5170 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5171 parseBool(n) { | |
5172 if (n == "true") return true; | |
5173 if (n == "false") return false; | |
5174 if (n == null) return null; | |
5175 throw new core.ArgumentError("Invalid boolean: $n"); | |
5176 } | |
5177 if (query.length > 0) { | |
5178 for (var part in query.split("&")) { | |
5179 var keyvalue = part.split("="); | |
5180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5181 } | |
5182 } | |
5183 unittest.expect(queryMap["androidId"].first, unittest.equals(arg_android
Id)); | |
5184 unittest.expect(queryMap["device"].first, unittest.equals(arg_device)); | |
5185 unittest.expect(queryMap["manufacturer"].first, unittest.equals(arg_manu
facturer)); | |
5186 unittest.expect(queryMap["model"].first, unittest.equals(arg_model)); | |
5187 unittest.expect(queryMap["product"].first, unittest.equals(arg_product))
; | |
5188 unittest.expect(queryMap["serial"].first, unittest.equals(arg_serial)); | |
5189 | |
5190 | |
5191 var h = { | |
5192 "content-type" : "application/json; charset=utf-8", | |
5193 }; | |
5194 var resp = convert.JSON.encode(buildOffers()); | |
5195 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5196 }), true); | |
5197 res.get(androidId: arg_androidId, device: arg_device, manufacturer: arg_ma
nufacturer, model: arg_model, product: arg_product, serial: arg_serial).then(uni
ttest.expectAsync(((api.Offers response) { | |
5198 checkOffers(response); | |
5199 }))); | |
5200 }); | |
5201 | |
5202 }); | |
5203 | |
5204 | |
5205 unittest.group("resource-VolumesResourceApi", () { | |
5206 unittest.test("method--get", () { | |
5207 | |
5208 var mock = new common_test.HttpServerMock(); | |
5209 api.VolumesResourceApi res = new api.BooksApi(mock).volumes; | |
5210 var arg_volumeId = "foo"; | |
5211 var arg_country = "foo"; | |
5212 var arg_partner = "foo"; | |
5213 var arg_projection = "foo"; | |
5214 var arg_source = "foo"; | |
5215 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5216 var path = (req.url).path; | |
5217 var pathOffset = 0; | |
5218 var index; | |
5219 var subPart; | |
5220 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5221 pathOffset += 10; | |
5222 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
5223 pathOffset += 8; | |
5224 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
5225 pathOffset = path.length; | |
5226 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
5227 | |
5228 var query = (req.url).query; | |
5229 var queryOffset = 0; | |
5230 var queryMap = {}; | |
5231 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5232 parseBool(n) { | |
5233 if (n == "true") return true; | |
5234 if (n == "false") return false; | |
5235 if (n == null) return null; | |
5236 throw new core.ArgumentError("Invalid boolean: $n"); | |
5237 } | |
5238 if (query.length > 0) { | |
5239 for (var part in query.split("&")) { | |
5240 var keyvalue = part.split("="); | |
5241 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5242 } | |
5243 } | |
5244 unittest.expect(queryMap["country"].first, unittest.equals(arg_country))
; | |
5245 unittest.expect(queryMap["partner"].first, unittest.equals(arg_partner))
; | |
5246 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | |
5247 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5248 | |
5249 | |
5250 var h = { | |
5251 "content-type" : "application/json; charset=utf-8", | |
5252 }; | |
5253 var resp = convert.JSON.encode(buildVolume()); | |
5254 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5255 }), true); | |
5256 res.get(arg_volumeId, country: arg_country, partner: arg_partner, projecti
on: arg_projection, source: arg_source).then(unittest.expectAsync(((api.Volume r
esponse) { | |
5257 checkVolume(response); | |
5258 }))); | |
5259 }); | |
5260 | |
5261 unittest.test("method--list", () { | |
5262 | |
5263 var mock = new common_test.HttpServerMock(); | |
5264 api.VolumesResourceApi res = new api.BooksApi(mock).volumes; | |
5265 var arg_q = "foo"; | |
5266 var arg_download = "foo"; | |
5267 var arg_filter = "foo"; | |
5268 var arg_langRestrict = "foo"; | |
5269 var arg_libraryRestrict = "foo"; | |
5270 var arg_maxResults = 42; | |
5271 var arg_orderBy = "foo"; | |
5272 var arg_partner = "foo"; | |
5273 var arg_printType = "foo"; | |
5274 var arg_projection = "foo"; | |
5275 var arg_showPreorders = true; | |
5276 var arg_source = "foo"; | |
5277 var arg_startIndex = 42; | |
5278 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5279 var path = (req.url).path; | |
5280 var pathOffset = 0; | |
5281 var index; | |
5282 var subPart; | |
5283 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5284 pathOffset += 10; | |
5285 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("volumes")); | |
5286 pathOffset += 7; | |
5287 | |
5288 var query = (req.url).query; | |
5289 var queryOffset = 0; | |
5290 var queryMap = {}; | |
5291 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5292 parseBool(n) { | |
5293 if (n == "true") return true; | |
5294 if (n == "false") return false; | |
5295 if (n == null) return null; | |
5296 throw new core.ArgumentError("Invalid boolean: $n"); | |
5297 } | |
5298 if (query.length > 0) { | |
5299 for (var part in query.split("&")) { | |
5300 var keyvalue = part.split("="); | |
5301 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5302 } | |
5303 } | |
5304 unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); | |
5305 unittest.expect(queryMap["download"].first, unittest.equals(arg_download
)); | |
5306 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
5307 unittest.expect(queryMap["langRestrict"].first, unittest.equals(arg_lang
Restrict)); | |
5308 unittest.expect(queryMap["libraryRestrict"].first, unittest.equals(arg_l
ibraryRestrict)); | |
5309 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
5310 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | |
5311 unittest.expect(queryMap["partner"].first, unittest.equals(arg_partner))
; | |
5312 unittest.expect(queryMap["printType"].first, unittest.equals(arg_printTy
pe)); | |
5313 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | |
5314 unittest.expect(queryMap["showPreorders"].first, unittest.equals("$arg_s
howPreorders")); | |
5315 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5316 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | |
5317 | |
5318 | |
5319 var h = { | |
5320 "content-type" : "application/json; charset=utf-8", | |
5321 }; | |
5322 var resp = convert.JSON.encode(buildVolumes()); | |
5323 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5324 }), true); | |
5325 res.list(arg_q, download: arg_download, filter: arg_filter, langRestrict:
arg_langRestrict, libraryRestrict: arg_libraryRestrict, maxResults: arg_maxResul
ts, orderBy: arg_orderBy, partner: arg_partner, printType: arg_printType, projec
tion: arg_projection, showPreorders: arg_showPreorders, source: arg_source, star
tIndex: arg_startIndex).then(unittest.expectAsync(((api.Volumes response) { | |
5326 checkVolumes(response); | |
5327 }))); | |
5328 }); | |
5329 | |
5330 }); | |
5331 | |
5332 | |
5333 unittest.group("resource-VolumesAssociatedResourceApi", () { | |
5334 unittest.test("method--list", () { | |
5335 | |
5336 var mock = new common_test.HttpServerMock(); | |
5337 api.VolumesAssociatedResourceApi res = new api.BooksApi(mock).volumes.asso
ciated; | |
5338 var arg_volumeId = "foo"; | |
5339 var arg_association = "foo"; | |
5340 var arg_locale = "foo"; | |
5341 var arg_source = "foo"; | |
5342 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5343 var path = (req.url).path; | |
5344 var pathOffset = 0; | |
5345 var index; | |
5346 var subPart; | |
5347 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5348 pathOffset += 10; | |
5349 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("volumes/")); | |
5350 pathOffset += 8; | |
5351 index = path.indexOf("/associated", pathOffset); | |
5352 unittest.expect(index >= 0, unittest.isTrue); | |
5353 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
5354 pathOffset = index; | |
5355 unittest.expect(subPart, unittest.equals("$arg_volumeId")); | |
5356 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/associated")); | |
5357 pathOffset += 11; | |
5358 | |
5359 var query = (req.url).query; | |
5360 var queryOffset = 0; | |
5361 var queryMap = {}; | |
5362 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5363 parseBool(n) { | |
5364 if (n == "true") return true; | |
5365 if (n == "false") return false; | |
5366 if (n == null) return null; | |
5367 throw new core.ArgumentError("Invalid boolean: $n"); | |
5368 } | |
5369 if (query.length > 0) { | |
5370 for (var part in query.split("&")) { | |
5371 var keyvalue = part.split("="); | |
5372 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5373 } | |
5374 } | |
5375 unittest.expect(queryMap["association"].first, unittest.equals(arg_assoc
iation)); | |
5376 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
5377 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5378 | |
5379 | |
5380 var h = { | |
5381 "content-type" : "application/json; charset=utf-8", | |
5382 }; | |
5383 var resp = convert.JSON.encode(buildVolumes()); | |
5384 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5385 }), true); | |
5386 res.list(arg_volumeId, association: arg_association, locale: arg_locale, s
ource: arg_source).then(unittest.expectAsync(((api.Volumes response) { | |
5387 checkVolumes(response); | |
5388 }))); | |
5389 }); | |
5390 | |
5391 }); | |
5392 | |
5393 | |
5394 unittest.group("resource-VolumesMybooksResourceApi", () { | |
5395 unittest.test("method--list", () { | |
5396 | |
5397 var mock = new common_test.HttpServerMock(); | |
5398 api.VolumesMybooksResourceApi res = new api.BooksApi(mock).volumes.mybooks
; | |
5399 var arg_acquireMethod = buildUnnamed533(); | |
5400 var arg_locale = "foo"; | |
5401 var arg_maxResults = 42; | |
5402 var arg_processingState = buildUnnamed534(); | |
5403 var arg_source = "foo"; | |
5404 var arg_startIndex = 42; | |
5405 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5406 var path = (req.url).path; | |
5407 var pathOffset = 0; | |
5408 var index; | |
5409 var subPart; | |
5410 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5411 pathOffset += 10; | |
5412 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("volumes/mybooks")); | |
5413 pathOffset += 15; | |
5414 | |
5415 var query = (req.url).query; | |
5416 var queryOffset = 0; | |
5417 var queryMap = {}; | |
5418 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5419 parseBool(n) { | |
5420 if (n == "true") return true; | |
5421 if (n == "false") return false; | |
5422 if (n == null) return null; | |
5423 throw new core.ArgumentError("Invalid boolean: $n"); | |
5424 } | |
5425 if (query.length > 0) { | |
5426 for (var part in query.split("&")) { | |
5427 var keyvalue = part.split("="); | |
5428 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5429 } | |
5430 } | |
5431 unittest.expect(queryMap["acquireMethod"], unittest.equals(arg_acquireMe
thod)); | |
5432 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
5433 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
5434 unittest.expect(queryMap["processingState"], unittest.equals(arg_process
ingState)); | |
5435 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5436 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | |
5437 | |
5438 | |
5439 var h = { | |
5440 "content-type" : "application/json; charset=utf-8", | |
5441 }; | |
5442 var resp = convert.JSON.encode(buildVolumes()); | |
5443 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5444 }), true); | |
5445 res.list(acquireMethod: arg_acquireMethod, locale: arg_locale, maxResults:
arg_maxResults, processingState: arg_processingState, source: arg_source, start
Index: arg_startIndex).then(unittest.expectAsync(((api.Volumes response) { | |
5446 checkVolumes(response); | |
5447 }))); | |
5448 }); | |
5449 | |
5450 }); | |
5451 | |
5452 | |
5453 unittest.group("resource-VolumesRecommendedResourceApi", () { | |
5454 unittest.test("method--list", () { | |
5455 | |
5456 var mock = new common_test.HttpServerMock(); | |
5457 api.VolumesRecommendedResourceApi res = new api.BooksApi(mock).volumes.rec
ommended; | |
5458 var arg_locale = "foo"; | |
5459 var arg_source = "foo"; | |
5460 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5461 var path = (req.url).path; | |
5462 var pathOffset = 0; | |
5463 var index; | |
5464 var subPart; | |
5465 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5466 pathOffset += 10; | |
5467 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("volumes/recommended")); | |
5468 pathOffset += 19; | |
5469 | |
5470 var query = (req.url).query; | |
5471 var queryOffset = 0; | |
5472 var queryMap = {}; | |
5473 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5474 parseBool(n) { | |
5475 if (n == "true") return true; | |
5476 if (n == "false") return false; | |
5477 if (n == null) return null; | |
5478 throw new core.ArgumentError("Invalid boolean: $n"); | |
5479 } | |
5480 if (query.length > 0) { | |
5481 for (var part in query.split("&")) { | |
5482 var keyvalue = part.split("="); | |
5483 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5484 } | |
5485 } | |
5486 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
5487 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5488 | |
5489 | |
5490 var h = { | |
5491 "content-type" : "application/json; charset=utf-8", | |
5492 }; | |
5493 var resp = convert.JSON.encode(buildVolumes()); | |
5494 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5495 }), true); | |
5496 res.list(locale: arg_locale, source: arg_source).then(unittest.expectAsync
(((api.Volumes response) { | |
5497 checkVolumes(response); | |
5498 }))); | |
5499 }); | |
5500 | |
5501 unittest.test("method--rate", () { | |
5502 | |
5503 var mock = new common_test.HttpServerMock(); | |
5504 api.VolumesRecommendedResourceApi res = new api.BooksApi(mock).volumes.rec
ommended; | |
5505 var arg_rating = "foo"; | |
5506 var arg_volumeId = "foo"; | |
5507 var arg_locale = "foo"; | |
5508 var arg_source = "foo"; | |
5509 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5510 var path = (req.url).path; | |
5511 var pathOffset = 0; | |
5512 var index; | |
5513 var subPart; | |
5514 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5515 pathOffset += 10; | |
5516 unittest.expect(path.substring(pathOffset, pathOffset + 24), unittest.eq
uals("volumes/recommended/rate")); | |
5517 pathOffset += 24; | |
5518 | |
5519 var query = (req.url).query; | |
5520 var queryOffset = 0; | |
5521 var queryMap = {}; | |
5522 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5523 parseBool(n) { | |
5524 if (n == "true") return true; | |
5525 if (n == "false") return false; | |
5526 if (n == null) return null; | |
5527 throw new core.ArgumentError("Invalid boolean: $n"); | |
5528 } | |
5529 if (query.length > 0) { | |
5530 for (var part in query.split("&")) { | |
5531 var keyvalue = part.split("="); | |
5532 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5533 } | |
5534 } | |
5535 unittest.expect(queryMap["rating"].first, unittest.equals(arg_rating)); | |
5536 unittest.expect(queryMap["volumeId"].first, unittest.equals(arg_volumeId
)); | |
5537 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
5538 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5539 | |
5540 | |
5541 var h = { | |
5542 "content-type" : "application/json; charset=utf-8", | |
5543 }; | |
5544 var resp = convert.JSON.encode(buildBooksVolumesRecommendedRateResponse(
)); | |
5545 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5546 }), true); | |
5547 res.rate(arg_rating, arg_volumeId, locale: arg_locale, source: arg_source)
.then(unittest.expectAsync(((api.BooksVolumesRecommendedRateResponse response) { | |
5548 checkBooksVolumesRecommendedRateResponse(response); | |
5549 }))); | |
5550 }); | |
5551 | |
5552 }); | |
5553 | |
5554 | |
5555 unittest.group("resource-VolumesUseruploadedResourceApi", () { | |
5556 unittest.test("method--list", () { | |
5557 | |
5558 var mock = new common_test.HttpServerMock(); | |
5559 api.VolumesUseruploadedResourceApi res = new api.BooksApi(mock).volumes.us
eruploaded; | |
5560 var arg_locale = "foo"; | |
5561 var arg_maxResults = 42; | |
5562 var arg_processingState = buildUnnamed535(); | |
5563 var arg_source = "foo"; | |
5564 var arg_startIndex = 42; | |
5565 var arg_volumeId = buildUnnamed536(); | |
5566 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
5567 var path = (req.url).path; | |
5568 var pathOffset = 0; | |
5569 var index; | |
5570 var subPart; | |
5571 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/books/v1/")); | |
5572 pathOffset += 10; | |
5573 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("volumes/useruploaded")); | |
5574 pathOffset += 20; | |
5575 | |
5576 var query = (req.url).query; | |
5577 var queryOffset = 0; | |
5578 var queryMap = {}; | |
5579 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
5580 parseBool(n) { | |
5581 if (n == "true") return true; | |
5582 if (n == "false") return false; | |
5583 if (n == null) return null; | |
5584 throw new core.ArgumentError("Invalid boolean: $n"); | |
5585 } | |
5586 if (query.length > 0) { | |
5587 for (var part in query.split("&")) { | |
5588 var keyvalue = part.split("="); | |
5589 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
5590 } | |
5591 } | |
5592 unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); | |
5593 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
5594 unittest.expect(queryMap["processingState"], unittest.equals(arg_process
ingState)); | |
5595 unittest.expect(queryMap["source"].first, unittest.equals(arg_source)); | |
5596 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | |
5597 unittest.expect(queryMap["volumeId"], unittest.equals(arg_volumeId)); | |
5598 | |
5599 | |
5600 var h = { | |
5601 "content-type" : "application/json; charset=utf-8", | |
5602 }; | |
5603 var resp = convert.JSON.encode(buildVolumes()); | |
5604 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
5605 }), true); | |
5606 res.list(locale: arg_locale, maxResults: arg_maxResults, processingState:
arg_processingState, source: arg_source, startIndex: arg_startIndex, volumeId: a
rg_volumeId).then(unittest.expectAsync(((api.Volumes response) { | |
5607 checkVolumes(response); | |
5608 }))); | |
5609 }); | |
5610 | |
5611 }); | |
5612 | |
5613 | |
5614 } | |
5615 | |
OLD | NEW |