OLD | NEW |
1 library googleapis.blogger.v3.test; | 1 library googleapis.blogger.v3.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
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 | 11 |
15 import 'package:googleapis/blogger/v3.dart' as api; | 12 import 'package:googleapis/blogger/v3.dart' as api; |
16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
18 | 53 |
19 core.int buildCounterBlogLocale = 0; | 54 core.int buildCounterBlogLocale = 0; |
20 buildBlogLocale() { | 55 buildBlogLocale() { |
21 var o = new api.BlogLocale(); | 56 var o = new api.BlogLocale(); |
22 buildCounterBlogLocale++; | 57 buildCounterBlogLocale++; |
23 if (buildCounterBlogLocale < 3) { | 58 if (buildCounterBlogLocale < 3) { |
24 o.country = "foo"; | 59 o.country = "foo"; |
25 o.language = "foo"; | 60 o.language = "foo"; |
26 o.variant = "foo"; | 61 o.variant = "foo"; |
27 } | 62 } |
(...skipping 25 matching lines...) Expand all Loading... |
53 | 88 |
54 checkBlogPages(api.BlogPages o) { | 89 checkBlogPages(api.BlogPages o) { |
55 buildCounterBlogPages++; | 90 buildCounterBlogPages++; |
56 if (buildCounterBlogPages < 3) { | 91 if (buildCounterBlogPages < 3) { |
57 unittest.expect(o.selfLink, unittest.equals('foo')); | 92 unittest.expect(o.selfLink, unittest.equals('foo')); |
58 unittest.expect(o.totalItems, unittest.equals(42)); | 93 unittest.expect(o.totalItems, unittest.equals(42)); |
59 } | 94 } |
60 buildCounterBlogPages--; | 95 buildCounterBlogPages--; |
61 } | 96 } |
62 | 97 |
63 buildUnnamed1026() { | 98 buildUnnamed309() { |
64 var o = new core.List<api.Post>(); | 99 var o = new core.List<api.Post>(); |
65 o.add(buildPost()); | 100 o.add(buildPost()); |
66 o.add(buildPost()); | 101 o.add(buildPost()); |
67 return o; | 102 return o; |
68 } | 103 } |
69 | 104 |
70 checkUnnamed1026(core.List<api.Post> o) { | 105 checkUnnamed309(core.List<api.Post> o) { |
71 unittest.expect(o, unittest.hasLength(2)); | 106 unittest.expect(o, unittest.hasLength(2)); |
72 checkPost(o[0]); | 107 checkPost(o[0]); |
73 checkPost(o[1]); | 108 checkPost(o[1]); |
74 } | 109 } |
75 | 110 |
76 core.int buildCounterBlogPosts = 0; | 111 core.int buildCounterBlogPosts = 0; |
77 buildBlogPosts() { | 112 buildBlogPosts() { |
78 var o = new api.BlogPosts(); | 113 var o = new api.BlogPosts(); |
79 buildCounterBlogPosts++; | 114 buildCounterBlogPosts++; |
80 if (buildCounterBlogPosts < 3) { | 115 if (buildCounterBlogPosts < 3) { |
81 o.items = buildUnnamed1026(); | 116 o.items = buildUnnamed309(); |
82 o.selfLink = "foo"; | 117 o.selfLink = "foo"; |
83 o.totalItems = 42; | 118 o.totalItems = 42; |
84 } | 119 } |
85 buildCounterBlogPosts--; | 120 buildCounterBlogPosts--; |
86 return o; | 121 return o; |
87 } | 122 } |
88 | 123 |
89 checkBlogPosts(api.BlogPosts o) { | 124 checkBlogPosts(api.BlogPosts o) { |
90 buildCounterBlogPosts++; | 125 buildCounterBlogPosts++; |
91 if (buildCounterBlogPosts < 3) { | 126 if (buildCounterBlogPosts < 3) { |
92 checkUnnamed1026(o.items); | 127 checkUnnamed309(o.items); |
93 unittest.expect(o.selfLink, unittest.equals('foo')); | 128 unittest.expect(o.selfLink, unittest.equals('foo')); |
94 unittest.expect(o.totalItems, unittest.equals(42)); | 129 unittest.expect(o.totalItems, unittest.equals(42)); |
95 } | 130 } |
96 buildCounterBlogPosts--; | 131 buildCounterBlogPosts--; |
97 } | 132 } |
98 | 133 |
99 core.int buildCounterBlog = 0; | 134 core.int buildCounterBlog = 0; |
100 buildBlog() { | 135 buildBlog() { |
101 var o = new api.Blog(); | 136 var o = new api.Blog(); |
102 buildCounterBlog++; | 137 buildCounterBlog++; |
(...skipping 29 matching lines...) Expand all Loading... |
132 checkBlogPosts(o.posts); | 167 checkBlogPosts(o.posts); |
133 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 168 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); |
134 unittest.expect(o.selfLink, unittest.equals('foo')); | 169 unittest.expect(o.selfLink, unittest.equals('foo')); |
135 unittest.expect(o.status, unittest.equals('foo')); | 170 unittest.expect(o.status, unittest.equals('foo')); |
136 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 171 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
137 unittest.expect(o.url, unittest.equals('foo')); | 172 unittest.expect(o.url, unittest.equals('foo')); |
138 } | 173 } |
139 buildCounterBlog--; | 174 buildCounterBlog--; |
140 } | 175 } |
141 | 176 |
142 buildUnnamed1027() { | 177 buildUnnamed310() { |
143 var o = new core.List<api.BlogUserInfo>(); | 178 var o = new core.List<api.BlogUserInfo>(); |
144 o.add(buildBlogUserInfo()); | 179 o.add(buildBlogUserInfo()); |
145 o.add(buildBlogUserInfo()); | 180 o.add(buildBlogUserInfo()); |
146 return o; | 181 return o; |
147 } | 182 } |
148 | 183 |
149 checkUnnamed1027(core.List<api.BlogUserInfo> o) { | 184 checkUnnamed310(core.List<api.BlogUserInfo> o) { |
150 unittest.expect(o, unittest.hasLength(2)); | 185 unittest.expect(o, unittest.hasLength(2)); |
151 checkBlogUserInfo(o[0]); | 186 checkBlogUserInfo(o[0]); |
152 checkBlogUserInfo(o[1]); | 187 checkBlogUserInfo(o[1]); |
153 } | 188 } |
154 | 189 |
155 buildUnnamed1028() { | 190 buildUnnamed311() { |
156 var o = new core.List<api.Blog>(); | 191 var o = new core.List<api.Blog>(); |
157 o.add(buildBlog()); | 192 o.add(buildBlog()); |
158 o.add(buildBlog()); | 193 o.add(buildBlog()); |
159 return o; | 194 return o; |
160 } | 195 } |
161 | 196 |
162 checkUnnamed1028(core.List<api.Blog> o) { | 197 checkUnnamed311(core.List<api.Blog> o) { |
163 unittest.expect(o, unittest.hasLength(2)); | 198 unittest.expect(o, unittest.hasLength(2)); |
164 checkBlog(o[0]); | 199 checkBlog(o[0]); |
165 checkBlog(o[1]); | 200 checkBlog(o[1]); |
166 } | 201 } |
167 | 202 |
168 core.int buildCounterBlogList = 0; | 203 core.int buildCounterBlogList = 0; |
169 buildBlogList() { | 204 buildBlogList() { |
170 var o = new api.BlogList(); | 205 var o = new api.BlogList(); |
171 buildCounterBlogList++; | 206 buildCounterBlogList++; |
172 if (buildCounterBlogList < 3) { | 207 if (buildCounterBlogList < 3) { |
173 o.blogUserInfos = buildUnnamed1027(); | 208 o.blogUserInfos = buildUnnamed310(); |
174 o.items = buildUnnamed1028(); | 209 o.items = buildUnnamed311(); |
175 o.kind = "foo"; | 210 o.kind = "foo"; |
176 } | 211 } |
177 buildCounterBlogList--; | 212 buildCounterBlogList--; |
178 return o; | 213 return o; |
179 } | 214 } |
180 | 215 |
181 checkBlogList(api.BlogList o) { | 216 checkBlogList(api.BlogList o) { |
182 buildCounterBlogList++; | 217 buildCounterBlogList++; |
183 if (buildCounterBlogList < 3) { | 218 if (buildCounterBlogList < 3) { |
184 checkUnnamed1027(o.blogUserInfos); | 219 checkUnnamed310(o.blogUserInfos); |
185 checkUnnamed1028(o.items); | 220 checkUnnamed311(o.items); |
186 unittest.expect(o.kind, unittest.equals('foo')); | 221 unittest.expect(o.kind, unittest.equals('foo')); |
187 } | 222 } |
188 buildCounterBlogList--; | 223 buildCounterBlogList--; |
189 } | 224 } |
190 | 225 |
191 core.int buildCounterBlogPerUserInfo = 0; | 226 core.int buildCounterBlogPerUserInfo = 0; |
192 buildBlogPerUserInfo() { | 227 buildBlogPerUserInfo() { |
193 var o = new api.BlogPerUserInfo(); | 228 var o = new api.BlogPerUserInfo(); |
194 buildCounterBlogPerUserInfo++; | 229 buildCounterBlogPerUserInfo++; |
195 if (buildCounterBlogPerUserInfo < 3) { | 230 if (buildCounterBlogPerUserInfo < 3) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 unittest.expect(o.kind, unittest.equals('foo')); | 408 unittest.expect(o.kind, unittest.equals('foo')); |
374 checkCommentPost(o.post); | 409 checkCommentPost(o.post); |
375 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 410 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); |
376 unittest.expect(o.selfLink, unittest.equals('foo')); | 411 unittest.expect(o.selfLink, unittest.equals('foo')); |
377 unittest.expect(o.status, unittest.equals('foo')); | 412 unittest.expect(o.status, unittest.equals('foo')); |
378 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 413 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
379 } | 414 } |
380 buildCounterComment--; | 415 buildCounterComment--; |
381 } | 416 } |
382 | 417 |
383 buildUnnamed1029() { | 418 buildUnnamed312() { |
384 var o = new core.List<api.Comment>(); | 419 var o = new core.List<api.Comment>(); |
385 o.add(buildComment()); | 420 o.add(buildComment()); |
386 o.add(buildComment()); | 421 o.add(buildComment()); |
387 return o; | 422 return o; |
388 } | 423 } |
389 | 424 |
390 checkUnnamed1029(core.List<api.Comment> o) { | 425 checkUnnamed312(core.List<api.Comment> o) { |
391 unittest.expect(o, unittest.hasLength(2)); | 426 unittest.expect(o, unittest.hasLength(2)); |
392 checkComment(o[0]); | 427 checkComment(o[0]); |
393 checkComment(o[1]); | 428 checkComment(o[1]); |
394 } | 429 } |
395 | 430 |
396 core.int buildCounterCommentList = 0; | 431 core.int buildCounterCommentList = 0; |
397 buildCommentList() { | 432 buildCommentList() { |
398 var o = new api.CommentList(); | 433 var o = new api.CommentList(); |
399 buildCounterCommentList++; | 434 buildCounterCommentList++; |
400 if (buildCounterCommentList < 3) { | 435 if (buildCounterCommentList < 3) { |
401 o.items = buildUnnamed1029(); | 436 o.items = buildUnnamed312(); |
402 o.kind = "foo"; | 437 o.kind = "foo"; |
403 o.nextPageToken = "foo"; | 438 o.nextPageToken = "foo"; |
404 o.prevPageToken = "foo"; | 439 o.prevPageToken = "foo"; |
405 } | 440 } |
406 buildCounterCommentList--; | 441 buildCounterCommentList--; |
407 return o; | 442 return o; |
408 } | 443 } |
409 | 444 |
410 checkCommentList(api.CommentList o) { | 445 checkCommentList(api.CommentList o) { |
411 buildCounterCommentList++; | 446 buildCounterCommentList++; |
412 if (buildCounterCommentList < 3) { | 447 if (buildCounterCommentList < 3) { |
413 checkUnnamed1029(o.items); | 448 checkUnnamed312(o.items); |
414 unittest.expect(o.kind, unittest.equals('foo')); | 449 unittest.expect(o.kind, unittest.equals('foo')); |
415 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 450 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
416 unittest.expect(o.prevPageToken, unittest.equals('foo')); | 451 unittest.expect(o.prevPageToken, unittest.equals('foo')); |
417 } | 452 } |
418 buildCounterCommentList--; | 453 buildCounterCommentList--; |
419 } | 454 } |
420 | 455 |
421 core.int buildCounterPageAuthorImage = 0; | 456 core.int buildCounterPageAuthorImage = 0; |
422 buildPageAuthorImage() { | 457 buildPageAuthorImage() { |
423 var o = new api.PageAuthorImage(); | 458 var o = new api.PageAuthorImage(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 550 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); |
516 unittest.expect(o.selfLink, unittest.equals('foo')); | 551 unittest.expect(o.selfLink, unittest.equals('foo')); |
517 unittest.expect(o.status, unittest.equals('foo')); | 552 unittest.expect(o.status, unittest.equals('foo')); |
518 unittest.expect(o.title, unittest.equals('foo')); | 553 unittest.expect(o.title, unittest.equals('foo')); |
519 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 554 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
520 unittest.expect(o.url, unittest.equals('foo')); | 555 unittest.expect(o.url, unittest.equals('foo')); |
521 } | 556 } |
522 buildCounterPage--; | 557 buildCounterPage--; |
523 } | 558 } |
524 | 559 |
525 buildUnnamed1030() { | 560 buildUnnamed313() { |
526 var o = new core.List<api.Page>(); | 561 var o = new core.List<api.Page>(); |
527 o.add(buildPage()); | 562 o.add(buildPage()); |
528 o.add(buildPage()); | 563 o.add(buildPage()); |
529 return o; | 564 return o; |
530 } | 565 } |
531 | 566 |
532 checkUnnamed1030(core.List<api.Page> o) { | 567 checkUnnamed313(core.List<api.Page> o) { |
533 unittest.expect(o, unittest.hasLength(2)); | 568 unittest.expect(o, unittest.hasLength(2)); |
534 checkPage(o[0]); | 569 checkPage(o[0]); |
535 checkPage(o[1]); | 570 checkPage(o[1]); |
536 } | 571 } |
537 | 572 |
538 core.int buildCounterPageList = 0; | 573 core.int buildCounterPageList = 0; |
539 buildPageList() { | 574 buildPageList() { |
540 var o = new api.PageList(); | 575 var o = new api.PageList(); |
541 buildCounterPageList++; | 576 buildCounterPageList++; |
542 if (buildCounterPageList < 3) { | 577 if (buildCounterPageList < 3) { |
543 o.items = buildUnnamed1030(); | 578 o.items = buildUnnamed313(); |
544 o.kind = "foo"; | 579 o.kind = "foo"; |
545 o.nextPageToken = "foo"; | 580 o.nextPageToken = "foo"; |
546 } | 581 } |
547 buildCounterPageList--; | 582 buildCounterPageList--; |
548 return o; | 583 return o; |
549 } | 584 } |
550 | 585 |
551 checkPageList(api.PageList o) { | 586 checkPageList(api.PageList o) { |
552 buildCounterPageList++; | 587 buildCounterPageList++; |
553 if (buildCounterPageList < 3) { | 588 if (buildCounterPageList < 3) { |
554 checkUnnamed1030(o.items); | 589 checkUnnamed313(o.items); |
555 unittest.expect(o.kind, unittest.equals('foo')); | 590 unittest.expect(o.kind, unittest.equals('foo')); |
556 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 591 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
557 } | 592 } |
558 buildCounterPageList--; | 593 buildCounterPageList--; |
559 } | 594 } |
560 | 595 |
561 core.int buildCounterPageviewsCounts = 0; | 596 core.int buildCounterPageviewsCounts = 0; |
562 buildPageviewsCounts() { | 597 buildPageviewsCounts() { |
563 var o = new api.PageviewsCounts(); | 598 var o = new api.PageviewsCounts(); |
564 buildCounterPageviewsCounts++; | 599 buildCounterPageviewsCounts++; |
565 if (buildCounterPageviewsCounts < 3) { | 600 if (buildCounterPageviewsCounts < 3) { |
566 o.count = "foo"; | 601 o.count = "foo"; |
567 o.timeRange = "foo"; | 602 o.timeRange = "foo"; |
568 } | 603 } |
569 buildCounterPageviewsCounts--; | 604 buildCounterPageviewsCounts--; |
570 return o; | 605 return o; |
571 } | 606 } |
572 | 607 |
573 checkPageviewsCounts(api.PageviewsCounts o) { | 608 checkPageviewsCounts(api.PageviewsCounts o) { |
574 buildCounterPageviewsCounts++; | 609 buildCounterPageviewsCounts++; |
575 if (buildCounterPageviewsCounts < 3) { | 610 if (buildCounterPageviewsCounts < 3) { |
576 unittest.expect(o.count, unittest.equals('foo')); | 611 unittest.expect(o.count, unittest.equals('foo')); |
577 unittest.expect(o.timeRange, unittest.equals('foo')); | 612 unittest.expect(o.timeRange, unittest.equals('foo')); |
578 } | 613 } |
579 buildCounterPageviewsCounts--; | 614 buildCounterPageviewsCounts--; |
580 } | 615 } |
581 | 616 |
582 buildUnnamed1031() { | 617 buildUnnamed314() { |
583 var o = new core.List<api.PageviewsCounts>(); | 618 var o = new core.List<api.PageviewsCounts>(); |
584 o.add(buildPageviewsCounts()); | 619 o.add(buildPageviewsCounts()); |
585 o.add(buildPageviewsCounts()); | 620 o.add(buildPageviewsCounts()); |
586 return o; | 621 return o; |
587 } | 622 } |
588 | 623 |
589 checkUnnamed1031(core.List<api.PageviewsCounts> o) { | 624 checkUnnamed314(core.List<api.PageviewsCounts> o) { |
590 unittest.expect(o, unittest.hasLength(2)); | 625 unittest.expect(o, unittest.hasLength(2)); |
591 checkPageviewsCounts(o[0]); | 626 checkPageviewsCounts(o[0]); |
592 checkPageviewsCounts(o[1]); | 627 checkPageviewsCounts(o[1]); |
593 } | 628 } |
594 | 629 |
595 core.int buildCounterPageviews = 0; | 630 core.int buildCounterPageviews = 0; |
596 buildPageviews() { | 631 buildPageviews() { |
597 var o = new api.Pageviews(); | 632 var o = new api.Pageviews(); |
598 buildCounterPageviews++; | 633 buildCounterPageviews++; |
599 if (buildCounterPageviews < 3) { | 634 if (buildCounterPageviews < 3) { |
600 o.blogId = "foo"; | 635 o.blogId = "foo"; |
601 o.counts = buildUnnamed1031(); | 636 o.counts = buildUnnamed314(); |
602 o.kind = "foo"; | 637 o.kind = "foo"; |
603 } | 638 } |
604 buildCounterPageviews--; | 639 buildCounterPageviews--; |
605 return o; | 640 return o; |
606 } | 641 } |
607 | 642 |
608 checkPageviews(api.Pageviews o) { | 643 checkPageviews(api.Pageviews o) { |
609 buildCounterPageviews++; | 644 buildCounterPageviews++; |
610 if (buildCounterPageviews < 3) { | 645 if (buildCounterPageviews < 3) { |
611 unittest.expect(o.blogId, unittest.equals('foo')); | 646 unittest.expect(o.blogId, unittest.equals('foo')); |
612 checkUnnamed1031(o.counts); | 647 checkUnnamed314(o.counts); |
613 unittest.expect(o.kind, unittest.equals('foo')); | 648 unittest.expect(o.kind, unittest.equals('foo')); |
614 } | 649 } |
615 buildCounterPageviews--; | 650 buildCounterPageviews--; |
616 } | 651 } |
617 | 652 |
618 core.int buildCounterPostAuthorImage = 0; | 653 core.int buildCounterPostAuthorImage = 0; |
619 buildPostAuthorImage() { | 654 buildPostAuthorImage() { |
620 var o = new api.PostAuthorImage(); | 655 var o = new api.PostAuthorImage(); |
621 buildCounterPostAuthorImage++; | 656 buildCounterPostAuthorImage++; |
622 if (buildCounterPostAuthorImage < 3) { | 657 if (buildCounterPostAuthorImage < 3) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 } | 725 } |
691 | 726 |
692 checkPostImages(api.PostImages o) { | 727 checkPostImages(api.PostImages o) { |
693 buildCounterPostImages++; | 728 buildCounterPostImages++; |
694 if (buildCounterPostImages < 3) { | 729 if (buildCounterPostImages < 3) { |
695 unittest.expect(o.url, unittest.equals('foo')); | 730 unittest.expect(o.url, unittest.equals('foo')); |
696 } | 731 } |
697 buildCounterPostImages--; | 732 buildCounterPostImages--; |
698 } | 733 } |
699 | 734 |
700 buildUnnamed1032() { | 735 buildUnnamed315() { |
701 var o = new core.List<api.PostImages>(); | 736 var o = new core.List<api.PostImages>(); |
702 o.add(buildPostImages()); | 737 o.add(buildPostImages()); |
703 o.add(buildPostImages()); | 738 o.add(buildPostImages()); |
704 return o; | 739 return o; |
705 } | 740 } |
706 | 741 |
707 checkUnnamed1032(core.List<api.PostImages> o) { | 742 checkUnnamed315(core.List<api.PostImages> o) { |
708 unittest.expect(o, unittest.hasLength(2)); | 743 unittest.expect(o, unittest.hasLength(2)); |
709 checkPostImages(o[0]); | 744 checkPostImages(o[0]); |
710 checkPostImages(o[1]); | 745 checkPostImages(o[1]); |
711 } | 746 } |
712 | 747 |
713 buildUnnamed1033() { | 748 buildUnnamed316() { |
714 var o = new core.List<core.String>(); | 749 var o = new core.List<core.String>(); |
715 o.add("foo"); | 750 o.add("foo"); |
716 o.add("foo"); | 751 o.add("foo"); |
717 return o; | 752 return o; |
718 } | 753 } |
719 | 754 |
720 checkUnnamed1033(core.List<core.String> o) { | 755 checkUnnamed316(core.List<core.String> o) { |
721 unittest.expect(o, unittest.hasLength(2)); | 756 unittest.expect(o, unittest.hasLength(2)); |
722 unittest.expect(o[0], unittest.equals('foo')); | 757 unittest.expect(o[0], unittest.equals('foo')); |
723 unittest.expect(o[1], unittest.equals('foo')); | 758 unittest.expect(o[1], unittest.equals('foo')); |
724 } | 759 } |
725 | 760 |
726 core.int buildCounterPostLocation = 0; | 761 core.int buildCounterPostLocation = 0; |
727 buildPostLocation() { | 762 buildPostLocation() { |
728 var o = new api.PostLocation(); | 763 var o = new api.PostLocation(); |
729 buildCounterPostLocation++; | 764 buildCounterPostLocation++; |
730 if (buildCounterPostLocation < 3) { | 765 if (buildCounterPostLocation < 3) { |
(...skipping 10 matching lines...) Expand all Loading... |
741 buildCounterPostLocation++; | 776 buildCounterPostLocation++; |
742 if (buildCounterPostLocation < 3) { | 777 if (buildCounterPostLocation < 3) { |
743 unittest.expect(o.lat, unittest.equals(42.0)); | 778 unittest.expect(o.lat, unittest.equals(42.0)); |
744 unittest.expect(o.lng, unittest.equals(42.0)); | 779 unittest.expect(o.lng, unittest.equals(42.0)); |
745 unittest.expect(o.name, unittest.equals('foo')); | 780 unittest.expect(o.name, unittest.equals('foo')); |
746 unittest.expect(o.span, unittest.equals('foo')); | 781 unittest.expect(o.span, unittest.equals('foo')); |
747 } | 782 } |
748 buildCounterPostLocation--; | 783 buildCounterPostLocation--; |
749 } | 784 } |
750 | 785 |
751 buildUnnamed1034() { | 786 buildUnnamed317() { |
752 var o = new core.List<api.Comment>(); | 787 var o = new core.List<api.Comment>(); |
753 o.add(buildComment()); | 788 o.add(buildComment()); |
754 o.add(buildComment()); | 789 o.add(buildComment()); |
755 return o; | 790 return o; |
756 } | 791 } |
757 | 792 |
758 checkUnnamed1034(core.List<api.Comment> o) { | 793 checkUnnamed317(core.List<api.Comment> o) { |
759 unittest.expect(o, unittest.hasLength(2)); | 794 unittest.expect(o, unittest.hasLength(2)); |
760 checkComment(o[0]); | 795 checkComment(o[0]); |
761 checkComment(o[1]); | 796 checkComment(o[1]); |
762 } | 797 } |
763 | 798 |
764 core.int buildCounterPostReplies = 0; | 799 core.int buildCounterPostReplies = 0; |
765 buildPostReplies() { | 800 buildPostReplies() { |
766 var o = new api.PostReplies(); | 801 var o = new api.PostReplies(); |
767 buildCounterPostReplies++; | 802 buildCounterPostReplies++; |
768 if (buildCounterPostReplies < 3) { | 803 if (buildCounterPostReplies < 3) { |
769 o.items = buildUnnamed1034(); | 804 o.items = buildUnnamed317(); |
770 o.selfLink = "foo"; | 805 o.selfLink = "foo"; |
771 o.totalItems = "foo"; | 806 o.totalItems = "foo"; |
772 } | 807 } |
773 buildCounterPostReplies--; | 808 buildCounterPostReplies--; |
774 return o; | 809 return o; |
775 } | 810 } |
776 | 811 |
777 checkPostReplies(api.PostReplies o) { | 812 checkPostReplies(api.PostReplies o) { |
778 buildCounterPostReplies++; | 813 buildCounterPostReplies++; |
779 if (buildCounterPostReplies < 3) { | 814 if (buildCounterPostReplies < 3) { |
780 checkUnnamed1034(o.items); | 815 checkUnnamed317(o.items); |
781 unittest.expect(o.selfLink, unittest.equals('foo')); | 816 unittest.expect(o.selfLink, unittest.equals('foo')); |
782 unittest.expect(o.totalItems, unittest.equals('foo')); | 817 unittest.expect(o.totalItems, unittest.equals('foo')); |
783 } | 818 } |
784 buildCounterPostReplies--; | 819 buildCounterPostReplies--; |
785 } | 820 } |
786 | 821 |
787 core.int buildCounterPost = 0; | 822 core.int buildCounterPost = 0; |
788 buildPost() { | 823 buildPost() { |
789 var o = new api.Post(); | 824 var o = new api.Post(); |
790 buildCounterPost++; | 825 buildCounterPost++; |
791 if (buildCounterPost < 3) { | 826 if (buildCounterPost < 3) { |
792 o.author = buildPostAuthor(); | 827 o.author = buildPostAuthor(); |
793 o.blog = buildPostBlog(); | 828 o.blog = buildPostBlog(); |
794 o.content = "foo"; | 829 o.content = "foo"; |
795 o.customMetaData = "foo"; | 830 o.customMetaData = "foo"; |
796 o.etag = "foo"; | 831 o.etag = "foo"; |
797 o.id = "foo"; | 832 o.id = "foo"; |
798 o.images = buildUnnamed1032(); | 833 o.images = buildUnnamed315(); |
799 o.kind = "foo"; | 834 o.kind = "foo"; |
800 o.labels = buildUnnamed1033(); | 835 o.labels = buildUnnamed316(); |
801 o.location = buildPostLocation(); | 836 o.location = buildPostLocation(); |
802 o.published = core.DateTime.parse("2002-02-27T14:01:02"); | 837 o.published = core.DateTime.parse("2002-02-27T14:01:02"); |
803 o.readerComments = "foo"; | 838 o.readerComments = "foo"; |
804 o.replies = buildPostReplies(); | 839 o.replies = buildPostReplies(); |
805 o.selfLink = "foo"; | 840 o.selfLink = "foo"; |
806 o.status = "foo"; | 841 o.status = "foo"; |
807 o.title = "foo"; | 842 o.title = "foo"; |
808 o.titleLink = "foo"; | 843 o.titleLink = "foo"; |
809 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | 844 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
810 o.url = "foo"; | 845 o.url = "foo"; |
811 } | 846 } |
812 buildCounterPost--; | 847 buildCounterPost--; |
813 return o; | 848 return o; |
814 } | 849 } |
815 | 850 |
816 checkPost(api.Post o) { | 851 checkPost(api.Post o) { |
817 buildCounterPost++; | 852 buildCounterPost++; |
818 if (buildCounterPost < 3) { | 853 if (buildCounterPost < 3) { |
819 checkPostAuthor(o.author); | 854 checkPostAuthor(o.author); |
820 checkPostBlog(o.blog); | 855 checkPostBlog(o.blog); |
821 unittest.expect(o.content, unittest.equals('foo')); | 856 unittest.expect(o.content, unittest.equals('foo')); |
822 unittest.expect(o.customMetaData, unittest.equals('foo')); | 857 unittest.expect(o.customMetaData, unittest.equals('foo')); |
823 unittest.expect(o.etag, unittest.equals('foo')); | 858 unittest.expect(o.etag, unittest.equals('foo')); |
824 unittest.expect(o.id, unittest.equals('foo')); | 859 unittest.expect(o.id, unittest.equals('foo')); |
825 checkUnnamed1032(o.images); | 860 checkUnnamed315(o.images); |
826 unittest.expect(o.kind, unittest.equals('foo')); | 861 unittest.expect(o.kind, unittest.equals('foo')); |
827 checkUnnamed1033(o.labels); | 862 checkUnnamed316(o.labels); |
828 checkPostLocation(o.location); | 863 checkPostLocation(o.location); |
829 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 864 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); |
830 unittest.expect(o.readerComments, unittest.equals('foo')); | 865 unittest.expect(o.readerComments, unittest.equals('foo')); |
831 checkPostReplies(o.replies); | 866 checkPostReplies(o.replies); |
832 unittest.expect(o.selfLink, unittest.equals('foo')); | 867 unittest.expect(o.selfLink, unittest.equals('foo')); |
833 unittest.expect(o.status, unittest.equals('foo')); | 868 unittest.expect(o.status, unittest.equals('foo')); |
834 unittest.expect(o.title, unittest.equals('foo')); | 869 unittest.expect(o.title, unittest.equals('foo')); |
835 unittest.expect(o.titleLink, unittest.equals('foo')); | 870 unittest.expect(o.titleLink, unittest.equals('foo')); |
836 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 871 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
837 unittest.expect(o.url, unittest.equals('foo')); | 872 unittest.expect(o.url, unittest.equals('foo')); |
838 } | 873 } |
839 buildCounterPost--; | 874 buildCounterPost--; |
840 } | 875 } |
841 | 876 |
842 buildUnnamed1035() { | 877 buildUnnamed318() { |
843 var o = new core.List<api.Post>(); | 878 var o = new core.List<api.Post>(); |
844 o.add(buildPost()); | 879 o.add(buildPost()); |
845 o.add(buildPost()); | 880 o.add(buildPost()); |
846 return o; | 881 return o; |
847 } | 882 } |
848 | 883 |
849 checkUnnamed1035(core.List<api.Post> o) { | 884 checkUnnamed318(core.List<api.Post> o) { |
850 unittest.expect(o, unittest.hasLength(2)); | 885 unittest.expect(o, unittest.hasLength(2)); |
851 checkPost(o[0]); | 886 checkPost(o[0]); |
852 checkPost(o[1]); | 887 checkPost(o[1]); |
853 } | 888 } |
854 | 889 |
855 core.int buildCounterPostList = 0; | 890 core.int buildCounterPostList = 0; |
856 buildPostList() { | 891 buildPostList() { |
857 var o = new api.PostList(); | 892 var o = new api.PostList(); |
858 buildCounterPostList++; | 893 buildCounterPostList++; |
859 if (buildCounterPostList < 3) { | 894 if (buildCounterPostList < 3) { |
860 o.items = buildUnnamed1035(); | 895 o.items = buildUnnamed318(); |
861 o.kind = "foo"; | 896 o.kind = "foo"; |
862 o.nextPageToken = "foo"; | 897 o.nextPageToken = "foo"; |
863 } | 898 } |
864 buildCounterPostList--; | 899 buildCounterPostList--; |
865 return o; | 900 return o; |
866 } | 901 } |
867 | 902 |
868 checkPostList(api.PostList o) { | 903 checkPostList(api.PostList o) { |
869 buildCounterPostList++; | 904 buildCounterPostList++; |
870 if (buildCounterPostList < 3) { | 905 if (buildCounterPostList < 3) { |
871 checkUnnamed1035(o.items); | 906 checkUnnamed318(o.items); |
872 unittest.expect(o.kind, unittest.equals('foo')); | 907 unittest.expect(o.kind, unittest.equals('foo')); |
873 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 908 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
874 } | 909 } |
875 buildCounterPostList--; | 910 buildCounterPostList--; |
876 } | 911 } |
877 | 912 |
878 core.int buildCounterPostPerUserInfo = 0; | 913 core.int buildCounterPostPerUserInfo = 0; |
879 buildPostPerUserInfo() { | 914 buildPostPerUserInfo() { |
880 var o = new api.PostPerUserInfo(); | 915 var o = new api.PostPerUserInfo(); |
881 buildCounterPostPerUserInfo++; | 916 buildCounterPostPerUserInfo++; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 checkPostUserInfo(api.PostUserInfo o) { | 953 checkPostUserInfo(api.PostUserInfo o) { |
919 buildCounterPostUserInfo++; | 954 buildCounterPostUserInfo++; |
920 if (buildCounterPostUserInfo < 3) { | 955 if (buildCounterPostUserInfo < 3) { |
921 unittest.expect(o.kind, unittest.equals('foo')); | 956 unittest.expect(o.kind, unittest.equals('foo')); |
922 checkPost(o.post); | 957 checkPost(o.post); |
923 checkPostPerUserInfo(o.postUserInfo); | 958 checkPostPerUserInfo(o.postUserInfo); |
924 } | 959 } |
925 buildCounterPostUserInfo--; | 960 buildCounterPostUserInfo--; |
926 } | 961 } |
927 | 962 |
928 buildUnnamed1036() { | 963 buildUnnamed319() { |
929 var o = new core.List<api.PostUserInfo>(); | 964 var o = new core.List<api.PostUserInfo>(); |
930 o.add(buildPostUserInfo()); | 965 o.add(buildPostUserInfo()); |
931 o.add(buildPostUserInfo()); | 966 o.add(buildPostUserInfo()); |
932 return o; | 967 return o; |
933 } | 968 } |
934 | 969 |
935 checkUnnamed1036(core.List<api.PostUserInfo> o) { | 970 checkUnnamed319(core.List<api.PostUserInfo> o) { |
936 unittest.expect(o, unittest.hasLength(2)); | 971 unittest.expect(o, unittest.hasLength(2)); |
937 checkPostUserInfo(o[0]); | 972 checkPostUserInfo(o[0]); |
938 checkPostUserInfo(o[1]); | 973 checkPostUserInfo(o[1]); |
939 } | 974 } |
940 | 975 |
941 core.int buildCounterPostUserInfosList = 0; | 976 core.int buildCounterPostUserInfosList = 0; |
942 buildPostUserInfosList() { | 977 buildPostUserInfosList() { |
943 var o = new api.PostUserInfosList(); | 978 var o = new api.PostUserInfosList(); |
944 buildCounterPostUserInfosList++; | 979 buildCounterPostUserInfosList++; |
945 if (buildCounterPostUserInfosList < 3) { | 980 if (buildCounterPostUserInfosList < 3) { |
946 o.items = buildUnnamed1036(); | 981 o.items = buildUnnamed319(); |
947 o.kind = "foo"; | 982 o.kind = "foo"; |
948 o.nextPageToken = "foo"; | 983 o.nextPageToken = "foo"; |
949 } | 984 } |
950 buildCounterPostUserInfosList--; | 985 buildCounterPostUserInfosList--; |
951 return o; | 986 return o; |
952 } | 987 } |
953 | 988 |
954 checkPostUserInfosList(api.PostUserInfosList o) { | 989 checkPostUserInfosList(api.PostUserInfosList o) { |
955 buildCounterPostUserInfosList++; | 990 buildCounterPostUserInfosList++; |
956 if (buildCounterPostUserInfosList < 3) { | 991 if (buildCounterPostUserInfosList < 3) { |
957 checkUnnamed1036(o.items); | 992 checkUnnamed319(o.items); |
958 unittest.expect(o.kind, unittest.equals('foo')); | 993 unittest.expect(o.kind, unittest.equals('foo')); |
959 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 994 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
960 } | 995 } |
961 buildCounterPostUserInfosList--; | 996 buildCounterPostUserInfosList--; |
962 } | 997 } |
963 | 998 |
964 core.int buildCounterUserBlogs = 0; | 999 core.int buildCounterUserBlogs = 0; |
965 buildUserBlogs() { | 1000 buildUserBlogs() { |
966 var o = new api.UserBlogs(); | 1001 var o = new api.UserBlogs(); |
967 buildCounterUserBlogs++; | 1002 buildCounterUserBlogs++; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 unittest.expect(o.displayName, unittest.equals('foo')); | 1066 unittest.expect(o.displayName, unittest.equals('foo')); |
1032 unittest.expect(o.id, unittest.equals('foo')); | 1067 unittest.expect(o.id, unittest.equals('foo')); |
1033 unittest.expect(o.kind, unittest.equals('foo')); | 1068 unittest.expect(o.kind, unittest.equals('foo')); |
1034 checkUserLocale(o.locale); | 1069 checkUserLocale(o.locale); |
1035 unittest.expect(o.selfLink, unittest.equals('foo')); | 1070 unittest.expect(o.selfLink, unittest.equals('foo')); |
1036 unittest.expect(o.url, unittest.equals('foo')); | 1071 unittest.expect(o.url, unittest.equals('foo')); |
1037 } | 1072 } |
1038 buildCounterUser--; | 1073 buildCounterUser--; |
1039 } | 1074 } |
1040 | 1075 |
1041 buildUnnamed1037() { | 1076 buildUnnamed320() { |
1042 var o = new core.List<core.String>(); | 1077 var o = new core.List<core.String>(); |
1043 o.add("foo"); | 1078 o.add("foo"); |
1044 o.add("foo"); | 1079 o.add("foo"); |
1045 return o; | 1080 return o; |
1046 } | 1081 } |
1047 | 1082 |
1048 checkUnnamed1037(core.List<core.String> o) { | 1083 checkUnnamed320(core.List<core.String> o) { |
1049 unittest.expect(o, unittest.hasLength(2)); | 1084 unittest.expect(o, unittest.hasLength(2)); |
1050 unittest.expect(o[0], unittest.equals('foo')); | 1085 unittest.expect(o[0], unittest.equals('foo')); |
1051 unittest.expect(o[1], unittest.equals('foo')); | 1086 unittest.expect(o[1], unittest.equals('foo')); |
1052 } | 1087 } |
1053 | 1088 |
1054 buildUnnamed1038() { | 1089 buildUnnamed321() { |
1055 var o = new core.List<core.String>(); | 1090 var o = new core.List<core.String>(); |
1056 o.add("foo"); | 1091 o.add("foo"); |
1057 o.add("foo"); | 1092 o.add("foo"); |
1058 return o; | 1093 return o; |
1059 } | 1094 } |
1060 | 1095 |
1061 checkUnnamed1038(core.List<core.String> o) { | 1096 checkUnnamed321(core.List<core.String> o) { |
1062 unittest.expect(o, unittest.hasLength(2)); | 1097 unittest.expect(o, unittest.hasLength(2)); |
1063 unittest.expect(o[0], unittest.equals('foo')); | 1098 unittest.expect(o[0], unittest.equals('foo')); |
1064 unittest.expect(o[1], unittest.equals('foo')); | 1099 unittest.expect(o[1], unittest.equals('foo')); |
1065 } | 1100 } |
1066 | 1101 |
1067 buildUnnamed1039() { | 1102 buildUnnamed322() { |
1068 var o = new core.List<core.String>(); | 1103 var o = new core.List<core.String>(); |
1069 o.add("foo"); | 1104 o.add("foo"); |
1070 o.add("foo"); | 1105 o.add("foo"); |
1071 return o; | 1106 return o; |
1072 } | 1107 } |
1073 | 1108 |
1074 checkUnnamed1039(core.List<core.String> o) { | 1109 checkUnnamed322(core.List<core.String> o) { |
1075 unittest.expect(o, unittest.hasLength(2)); | 1110 unittest.expect(o, unittest.hasLength(2)); |
1076 unittest.expect(o[0], unittest.equals('foo')); | 1111 unittest.expect(o[0], unittest.equals('foo')); |
1077 unittest.expect(o[1], unittest.equals('foo')); | 1112 unittest.expect(o[1], unittest.equals('foo')); |
1078 } | 1113 } |
1079 | 1114 |
1080 buildUnnamed1040() { | 1115 buildUnnamed323() { |
1081 var o = new core.List<core.String>(); | 1116 var o = new core.List<core.String>(); |
1082 o.add("foo"); | 1117 o.add("foo"); |
1083 o.add("foo"); | 1118 o.add("foo"); |
1084 return o; | 1119 return o; |
1085 } | 1120 } |
1086 | 1121 |
1087 checkUnnamed1040(core.List<core.String> o) { | 1122 checkUnnamed323(core.List<core.String> o) { |
1088 unittest.expect(o, unittest.hasLength(2)); | 1123 unittest.expect(o, unittest.hasLength(2)); |
1089 unittest.expect(o[0], unittest.equals('foo')); | 1124 unittest.expect(o[0], unittest.equals('foo')); |
1090 unittest.expect(o[1], unittest.equals('foo')); | 1125 unittest.expect(o[1], unittest.equals('foo')); |
1091 } | 1126 } |
1092 | 1127 |
1093 buildUnnamed1041() { | 1128 buildUnnamed324() { |
1094 var o = new core.List<core.String>(); | 1129 var o = new core.List<core.String>(); |
1095 o.add("foo"); | 1130 o.add("foo"); |
1096 o.add("foo"); | 1131 o.add("foo"); |
1097 return o; | 1132 return o; |
1098 } | 1133 } |
1099 | 1134 |
1100 checkUnnamed1041(core.List<core.String> o) { | 1135 checkUnnamed324(core.List<core.String> o) { |
1101 unittest.expect(o, unittest.hasLength(2)); | 1136 unittest.expect(o, unittest.hasLength(2)); |
1102 unittest.expect(o[0], unittest.equals('foo')); | 1137 unittest.expect(o[0], unittest.equals('foo')); |
1103 unittest.expect(o[1], unittest.equals('foo')); | 1138 unittest.expect(o[1], unittest.equals('foo')); |
1104 } | 1139 } |
1105 | 1140 |
1106 buildUnnamed1042() { | 1141 buildUnnamed325() { |
1107 var o = new core.List<core.String>(); | 1142 var o = new core.List<core.String>(); |
1108 o.add("foo"); | 1143 o.add("foo"); |
1109 o.add("foo"); | 1144 o.add("foo"); |
1110 return o; | 1145 return o; |
1111 } | 1146 } |
1112 | 1147 |
1113 checkUnnamed1042(core.List<core.String> o) { | 1148 checkUnnamed325(core.List<core.String> o) { |
1114 unittest.expect(o, unittest.hasLength(2)); | 1149 unittest.expect(o, unittest.hasLength(2)); |
1115 unittest.expect(o[0], unittest.equals('foo')); | 1150 unittest.expect(o[0], unittest.equals('foo')); |
1116 unittest.expect(o[1], unittest.equals('foo')); | 1151 unittest.expect(o[1], unittest.equals('foo')); |
1117 } | 1152 } |
1118 | 1153 |
1119 buildUnnamed1043() { | 1154 buildUnnamed326() { |
1120 var o = new core.List<core.String>(); | 1155 var o = new core.List<core.String>(); |
1121 o.add("foo"); | 1156 o.add("foo"); |
1122 o.add("foo"); | 1157 o.add("foo"); |
1123 return o; | 1158 return o; |
1124 } | 1159 } |
1125 | 1160 |
1126 checkUnnamed1043(core.List<core.String> o) { | 1161 checkUnnamed326(core.List<core.String> o) { |
1127 unittest.expect(o, unittest.hasLength(2)); | 1162 unittest.expect(o, unittest.hasLength(2)); |
1128 unittest.expect(o[0], unittest.equals('foo')); | 1163 unittest.expect(o[0], unittest.equals('foo')); |
1129 unittest.expect(o[1], unittest.equals('foo')); | 1164 unittest.expect(o[1], unittest.equals('foo')); |
1130 } | 1165 } |
1131 | 1166 |
1132 buildUnnamed1044() { | 1167 buildUnnamed327() { |
1133 var o = new core.List<core.String>(); | 1168 var o = new core.List<core.String>(); |
1134 o.add("foo"); | 1169 o.add("foo"); |
1135 o.add("foo"); | 1170 o.add("foo"); |
1136 return o; | 1171 return o; |
1137 } | 1172 } |
1138 | 1173 |
1139 checkUnnamed1044(core.List<core.String> o) { | 1174 checkUnnamed327(core.List<core.String> o) { |
1140 unittest.expect(o, unittest.hasLength(2)); | 1175 unittest.expect(o, unittest.hasLength(2)); |
1141 unittest.expect(o[0], unittest.equals('foo')); | 1176 unittest.expect(o[0], unittest.equals('foo')); |
1142 unittest.expect(o[1], unittest.equals('foo')); | 1177 unittest.expect(o[1], unittest.equals('foo')); |
1143 } | 1178 } |
1144 | 1179 |
1145 | 1180 |
1146 main() { | 1181 main() { |
1147 unittest.group("obj-schema-BlogLocale", () { | 1182 unittest.group("obj-schema-BlogLocale", () { |
1148 unittest.test("to-json--from-json", () { | 1183 unittest.test("to-json--from-json", () { |
1149 var o = buildBlogLocale(); | 1184 var o = buildBlogLocale(); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 var o = buildUser(); | 1490 var o = buildUser(); |
1456 var od = new api.User.fromJson(o.toJson()); | 1491 var od = new api.User.fromJson(o.toJson()); |
1457 checkUser(od); | 1492 checkUser(od); |
1458 }); | 1493 }); |
1459 }); | 1494 }); |
1460 | 1495 |
1461 | 1496 |
1462 unittest.group("resource-BlogUserInfosResourceApi", () { | 1497 unittest.group("resource-BlogUserInfosResourceApi", () { |
1463 unittest.test("method--get", () { | 1498 unittest.test("method--get", () { |
1464 | 1499 |
1465 var mock = new common_test.HttpServerMock(); | 1500 var mock = new HttpServerMock(); |
1466 api.BlogUserInfosResourceApi res = new api.BloggerApi(mock).blogUserInfos; | 1501 api.BlogUserInfosResourceApi res = new api.BloggerApi(mock).blogUserInfos; |
1467 var arg_userId = "foo"; | 1502 var arg_userId = "foo"; |
1468 var arg_blogId = "foo"; | 1503 var arg_blogId = "foo"; |
1469 var arg_maxPosts = 42; | 1504 var arg_maxPosts = 42; |
1470 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1505 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1471 var path = (req.url).path; | 1506 var path = (req.url).path; |
1472 var pathOffset = 0; | 1507 var pathOffset = 0; |
1473 var index; | 1508 var index; |
1474 var subPart; | 1509 var subPart; |
1475 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1510 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 29 matching lines...) Expand all Loading... |
1505 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1540 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1506 } | 1541 } |
1507 } | 1542 } |
1508 unittest.expect(core.int.parse(queryMap["maxPosts"].first), unittest.equ
als(arg_maxPosts)); | 1543 unittest.expect(core.int.parse(queryMap["maxPosts"].first), unittest.equ
als(arg_maxPosts)); |
1509 | 1544 |
1510 | 1545 |
1511 var h = { | 1546 var h = { |
1512 "content-type" : "application/json; charset=utf-8", | 1547 "content-type" : "application/json; charset=utf-8", |
1513 }; | 1548 }; |
1514 var resp = convert.JSON.encode(buildBlogUserInfo()); | 1549 var resp = convert.JSON.encode(buildBlogUserInfo()); |
1515 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1550 return new async.Future.value(stringResponse(200, h, resp)); |
1516 }), true); | 1551 }), true); |
1517 res.get(arg_userId, arg_blogId, maxPosts: arg_maxPosts).then(unittest.expe
ctAsync(((api.BlogUserInfo response) { | 1552 res.get(arg_userId, arg_blogId, maxPosts: arg_maxPosts).then(unittest.expe
ctAsync(((api.BlogUserInfo response) { |
1518 checkBlogUserInfo(response); | 1553 checkBlogUserInfo(response); |
1519 }))); | 1554 }))); |
1520 }); | 1555 }); |
1521 | 1556 |
1522 }); | 1557 }); |
1523 | 1558 |
1524 | 1559 |
1525 unittest.group("resource-BlogsResourceApi", () { | 1560 unittest.group("resource-BlogsResourceApi", () { |
1526 unittest.test("method--get", () { | 1561 unittest.test("method--get", () { |
1527 | 1562 |
1528 var mock = new common_test.HttpServerMock(); | 1563 var mock = new HttpServerMock(); |
1529 api.BlogsResourceApi res = new api.BloggerApi(mock).blogs; | 1564 api.BlogsResourceApi res = new api.BloggerApi(mock).blogs; |
1530 var arg_blogId = "foo"; | 1565 var arg_blogId = "foo"; |
1531 var arg_maxPosts = 42; | 1566 var arg_maxPosts = 42; |
1532 var arg_view = "foo"; | 1567 var arg_view = "foo"; |
1533 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1568 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1534 var path = (req.url).path; | 1569 var path = (req.url).path; |
1535 var pathOffset = 0; | 1570 var pathOffset = 0; |
1536 var index; | 1571 var index; |
1537 var subPart; | 1572 var subPart; |
1538 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 23 matching lines...) Expand all Loading... |
1562 } | 1597 } |
1563 } | 1598 } |
1564 unittest.expect(core.int.parse(queryMap["maxPosts"].first), unittest.equ
als(arg_maxPosts)); | 1599 unittest.expect(core.int.parse(queryMap["maxPosts"].first), unittest.equ
als(arg_maxPosts)); |
1565 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 1600 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
1566 | 1601 |
1567 | 1602 |
1568 var h = { | 1603 var h = { |
1569 "content-type" : "application/json; charset=utf-8", | 1604 "content-type" : "application/json; charset=utf-8", |
1570 }; | 1605 }; |
1571 var resp = convert.JSON.encode(buildBlog()); | 1606 var resp = convert.JSON.encode(buildBlog()); |
1572 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1607 return new async.Future.value(stringResponse(200, h, resp)); |
1573 }), true); | 1608 }), true); |
1574 res.get(arg_blogId, maxPosts: arg_maxPosts, view: arg_view).then(unittest.
expectAsync(((api.Blog response) { | 1609 res.get(arg_blogId, maxPosts: arg_maxPosts, view: arg_view).then(unittest.
expectAsync(((api.Blog response) { |
1575 checkBlog(response); | 1610 checkBlog(response); |
1576 }))); | 1611 }))); |
1577 }); | 1612 }); |
1578 | 1613 |
1579 unittest.test("method--getByUrl", () { | 1614 unittest.test("method--getByUrl", () { |
1580 | 1615 |
1581 var mock = new common_test.HttpServerMock(); | 1616 var mock = new HttpServerMock(); |
1582 api.BlogsResourceApi res = new api.BloggerApi(mock).blogs; | 1617 api.BlogsResourceApi res = new api.BloggerApi(mock).blogs; |
1583 var arg_url = "foo"; | 1618 var arg_url = "foo"; |
1584 var arg_view = "foo"; | 1619 var arg_view = "foo"; |
1585 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1620 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1586 var path = (req.url).path; | 1621 var path = (req.url).path; |
1587 var pathOffset = 0; | 1622 var pathOffset = 0; |
1588 var index; | 1623 var index; |
1589 var subPart; | 1624 var subPart; |
1590 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1625 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1591 pathOffset += 1; | 1626 pathOffset += 1; |
(...skipping 19 matching lines...) Expand all Loading... |
1611 } | 1646 } |
1612 } | 1647 } |
1613 unittest.expect(queryMap["url"].first, unittest.equals(arg_url)); | 1648 unittest.expect(queryMap["url"].first, unittest.equals(arg_url)); |
1614 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 1649 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
1615 | 1650 |
1616 | 1651 |
1617 var h = { | 1652 var h = { |
1618 "content-type" : "application/json; charset=utf-8", | 1653 "content-type" : "application/json; charset=utf-8", |
1619 }; | 1654 }; |
1620 var resp = convert.JSON.encode(buildBlog()); | 1655 var resp = convert.JSON.encode(buildBlog()); |
1621 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1656 return new async.Future.value(stringResponse(200, h, resp)); |
1622 }), true); | 1657 }), true); |
1623 res.getByUrl(arg_url, view: arg_view).then(unittest.expectAsync(((api.Blog
response) { | 1658 res.getByUrl(arg_url, view: arg_view).then(unittest.expectAsync(((api.Blog
response) { |
1624 checkBlog(response); | 1659 checkBlog(response); |
1625 }))); | 1660 }))); |
1626 }); | 1661 }); |
1627 | 1662 |
1628 unittest.test("method--listByUser", () { | 1663 unittest.test("method--listByUser", () { |
1629 | 1664 |
1630 var mock = new common_test.HttpServerMock(); | 1665 var mock = new HttpServerMock(); |
1631 api.BlogsResourceApi res = new api.BloggerApi(mock).blogs; | 1666 api.BlogsResourceApi res = new api.BloggerApi(mock).blogs; |
1632 var arg_userId = "foo"; | 1667 var arg_userId = "foo"; |
1633 var arg_fetchUserInfo = true; | 1668 var arg_fetchUserInfo = true; |
1634 var arg_role = buildUnnamed1037(); | 1669 var arg_role = buildUnnamed320(); |
1635 var arg_status = buildUnnamed1038(); | 1670 var arg_status = buildUnnamed321(); |
1636 var arg_view = "foo"; | 1671 var arg_view = "foo"; |
1637 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1672 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1638 var path = (req.url).path; | 1673 var path = (req.url).path; |
1639 var pathOffset = 0; | 1674 var pathOffset = 0; |
1640 var index; | 1675 var index; |
1641 var subPart; | 1676 var subPart; |
1642 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1677 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1643 pathOffset += 1; | 1678 pathOffset += 1; |
1644 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 1679 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
1645 pathOffset += 11; | 1680 pathOffset += 11; |
(...skipping 26 matching lines...) Expand all Loading... |
1672 unittest.expect(queryMap["fetchUserInfo"].first, unittest.equals("$arg_f
etchUserInfo")); | 1707 unittest.expect(queryMap["fetchUserInfo"].first, unittest.equals("$arg_f
etchUserInfo")); |
1673 unittest.expect(queryMap["role"], unittest.equals(arg_role)); | 1708 unittest.expect(queryMap["role"], unittest.equals(arg_role)); |
1674 unittest.expect(queryMap["status"], unittest.equals(arg_status)); | 1709 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
1675 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 1710 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
1676 | 1711 |
1677 | 1712 |
1678 var h = { | 1713 var h = { |
1679 "content-type" : "application/json; charset=utf-8", | 1714 "content-type" : "application/json; charset=utf-8", |
1680 }; | 1715 }; |
1681 var resp = convert.JSON.encode(buildBlogList()); | 1716 var resp = convert.JSON.encode(buildBlogList()); |
1682 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1717 return new async.Future.value(stringResponse(200, h, resp)); |
1683 }), true); | 1718 }), true); |
1684 res.listByUser(arg_userId, fetchUserInfo: arg_fetchUserInfo, role: arg_rol
e, status: arg_status, view: arg_view).then(unittest.expectAsync(((api.BlogList
response) { | 1719 res.listByUser(arg_userId, fetchUserInfo: arg_fetchUserInfo, role: arg_rol
e, status: arg_status, view: arg_view).then(unittest.expectAsync(((api.BlogList
response) { |
1685 checkBlogList(response); | 1720 checkBlogList(response); |
1686 }))); | 1721 }))); |
1687 }); | 1722 }); |
1688 | 1723 |
1689 }); | 1724 }); |
1690 | 1725 |
1691 | 1726 |
1692 unittest.group("resource-CommentsResourceApi", () { | 1727 unittest.group("resource-CommentsResourceApi", () { |
1693 unittest.test("method--approve", () { | 1728 unittest.test("method--approve", () { |
1694 | 1729 |
1695 var mock = new common_test.HttpServerMock(); | 1730 var mock = new HttpServerMock(); |
1696 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 1731 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
1697 var arg_blogId = "foo"; | 1732 var arg_blogId = "foo"; |
1698 var arg_postId = "foo"; | 1733 var arg_postId = "foo"; |
1699 var arg_commentId = "foo"; | 1734 var arg_commentId = "foo"; |
1700 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1735 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1701 var path = (req.url).path; | 1736 var path = (req.url).path; |
1702 var pathOffset = 0; | 1737 var pathOffset = 0; |
1703 var index; | 1738 var index; |
1704 var subPart; | 1739 var subPart; |
1705 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1740 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 var keyvalue = part.split("="); | 1780 var keyvalue = part.split("="); |
1746 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1781 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1747 } | 1782 } |
1748 } | 1783 } |
1749 | 1784 |
1750 | 1785 |
1751 var h = { | 1786 var h = { |
1752 "content-type" : "application/json; charset=utf-8", | 1787 "content-type" : "application/json; charset=utf-8", |
1753 }; | 1788 }; |
1754 var resp = convert.JSON.encode(buildComment()); | 1789 var resp = convert.JSON.encode(buildComment()); |
1755 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1790 return new async.Future.value(stringResponse(200, h, resp)); |
1756 }), true); | 1791 }), true); |
1757 res.approve(arg_blogId, arg_postId, arg_commentId).then(unittest.expectAsy
nc(((api.Comment response) { | 1792 res.approve(arg_blogId, arg_postId, arg_commentId).then(unittest.expectAsy
nc(((api.Comment response) { |
1758 checkComment(response); | 1793 checkComment(response); |
1759 }))); | 1794 }))); |
1760 }); | 1795 }); |
1761 | 1796 |
1762 unittest.test("method--delete", () { | 1797 unittest.test("method--delete", () { |
1763 | 1798 |
1764 var mock = new common_test.HttpServerMock(); | 1799 var mock = new HttpServerMock(); |
1765 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 1800 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
1766 var arg_blogId = "foo"; | 1801 var arg_blogId = "foo"; |
1767 var arg_postId = "foo"; | 1802 var arg_postId = "foo"; |
1768 var arg_commentId = "foo"; | 1803 var arg_commentId = "foo"; |
1769 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1804 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1770 var path = (req.url).path; | 1805 var path = (req.url).path; |
1771 var pathOffset = 0; | 1806 var pathOffset = 0; |
1772 var index; | 1807 var index; |
1773 var subPart; | 1808 var subPart; |
1774 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1809 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 var keyvalue = part.split("="); | 1845 var keyvalue = part.split("="); |
1811 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1846 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1812 } | 1847 } |
1813 } | 1848 } |
1814 | 1849 |
1815 | 1850 |
1816 var h = { | 1851 var h = { |
1817 "content-type" : "application/json; charset=utf-8", | 1852 "content-type" : "application/json; charset=utf-8", |
1818 }; | 1853 }; |
1819 var resp = ""; | 1854 var resp = ""; |
1820 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1855 return new async.Future.value(stringResponse(200, h, resp)); |
1821 }), true); | 1856 }), true); |
1822 res.delete(arg_blogId, arg_postId, arg_commentId).then(unittest.expectAsyn
c((_) {})); | 1857 res.delete(arg_blogId, arg_postId, arg_commentId).then(unittest.expectAsyn
c((_) {})); |
1823 }); | 1858 }); |
1824 | 1859 |
1825 unittest.test("method--get", () { | 1860 unittest.test("method--get", () { |
1826 | 1861 |
1827 var mock = new common_test.HttpServerMock(); | 1862 var mock = new HttpServerMock(); |
1828 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 1863 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
1829 var arg_blogId = "foo"; | 1864 var arg_blogId = "foo"; |
1830 var arg_postId = "foo"; | 1865 var arg_postId = "foo"; |
1831 var arg_commentId = "foo"; | 1866 var arg_commentId = "foo"; |
1832 var arg_view = "foo"; | 1867 var arg_view = "foo"; |
1833 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1868 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1834 var path = (req.url).path; | 1869 var path = (req.url).path; |
1835 var pathOffset = 0; | 1870 var pathOffset = 0; |
1836 var index; | 1871 var index; |
1837 var subPart; | 1872 var subPart; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1910 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1876 } | 1911 } |
1877 } | 1912 } |
1878 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 1913 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
1879 | 1914 |
1880 | 1915 |
1881 var h = { | 1916 var h = { |
1882 "content-type" : "application/json; charset=utf-8", | 1917 "content-type" : "application/json; charset=utf-8", |
1883 }; | 1918 }; |
1884 var resp = convert.JSON.encode(buildComment()); | 1919 var resp = convert.JSON.encode(buildComment()); |
1885 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1920 return new async.Future.value(stringResponse(200, h, resp)); |
1886 }), true); | 1921 }), true); |
1887 res.get(arg_blogId, arg_postId, arg_commentId, view: arg_view).then(unitte
st.expectAsync(((api.Comment response) { | 1922 res.get(arg_blogId, arg_postId, arg_commentId, view: arg_view).then(unitte
st.expectAsync(((api.Comment response) { |
1888 checkComment(response); | 1923 checkComment(response); |
1889 }))); | 1924 }))); |
1890 }); | 1925 }); |
1891 | 1926 |
1892 unittest.test("method--list", () { | 1927 unittest.test("method--list", () { |
1893 | 1928 |
1894 var mock = new common_test.HttpServerMock(); | 1929 var mock = new HttpServerMock(); |
1895 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 1930 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
1896 var arg_blogId = "foo"; | 1931 var arg_blogId = "foo"; |
1897 var arg_postId = "foo"; | 1932 var arg_postId = "foo"; |
1898 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); | 1933 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); |
1899 var arg_fetchBodies = true; | 1934 var arg_fetchBodies = true; |
1900 var arg_maxResults = 42; | 1935 var arg_maxResults = 42; |
1901 var arg_pageToken = "foo"; | 1936 var arg_pageToken = "foo"; |
1902 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); | 1937 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); |
1903 var arg_status = buildUnnamed1039(); | 1938 var arg_status = buildUnnamed322(); |
1904 var arg_view = "foo"; | 1939 var arg_view = "foo"; |
1905 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1940 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1906 var path = (req.url).path; | 1941 var path = (req.url).path; |
1907 var pathOffset = 0; | 1942 var pathOffset = 0; |
1908 var index; | 1943 var index; |
1909 var subPart; | 1944 var subPart; |
1910 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1945 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1911 pathOffset += 1; | 1946 pathOffset += 1; |
1912 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 1947 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
1913 pathOffset += 11; | 1948 pathOffset += 11; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1985 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1951 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); | 1986 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); |
1952 unittest.expect(queryMap["status"], unittest.equals(arg_status)); | 1987 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
1953 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 1988 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
1954 | 1989 |
1955 | 1990 |
1956 var h = { | 1991 var h = { |
1957 "content-type" : "application/json; charset=utf-8", | 1992 "content-type" : "application/json; charset=utf-8", |
1958 }; | 1993 }; |
1959 var resp = convert.JSON.encode(buildCommentList()); | 1994 var resp = convert.JSON.encode(buildCommentList()); |
1960 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1995 return new async.Future.value(stringResponse(200, h, resp)); |
1961 }), true); | 1996 }), true); |
1962 res.list(arg_blogId, arg_postId, endDate: arg_endDate, fetchBodies: arg_fe
tchBodies, maxResults: arg_maxResults, pageToken: arg_pageToken, startDate: arg_
startDate, status: arg_status, view: arg_view).then(unittest.expectAsync(((api.C
ommentList response) { | 1997 res.list(arg_blogId, arg_postId, endDate: arg_endDate, fetchBodies: arg_fe
tchBodies, maxResults: arg_maxResults, pageToken: arg_pageToken, startDate: arg_
startDate, status: arg_status, view: arg_view).then(unittest.expectAsync(((api.C
ommentList response) { |
1963 checkCommentList(response); | 1998 checkCommentList(response); |
1964 }))); | 1999 }))); |
1965 }); | 2000 }); |
1966 | 2001 |
1967 unittest.test("method--listByBlog", () { | 2002 unittest.test("method--listByBlog", () { |
1968 | 2003 |
1969 var mock = new common_test.HttpServerMock(); | 2004 var mock = new HttpServerMock(); |
1970 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 2005 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
1971 var arg_blogId = "foo"; | 2006 var arg_blogId = "foo"; |
1972 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); | 2007 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); |
1973 var arg_fetchBodies = true; | 2008 var arg_fetchBodies = true; |
1974 var arg_maxResults = 42; | 2009 var arg_maxResults = 42; |
1975 var arg_pageToken = "foo"; | 2010 var arg_pageToken = "foo"; |
1976 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); | 2011 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); |
1977 var arg_status = buildUnnamed1040(); | 2012 var arg_status = buildUnnamed323(); |
1978 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2013 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1979 var path = (req.url).path; | 2014 var path = (req.url).path; |
1980 var pathOffset = 0; | 2015 var pathOffset = 0; |
1981 var index; | 2016 var index; |
1982 var subPart; | 2017 var subPart; |
1983 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2018 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1984 pathOffset += 1; | 2019 pathOffset += 1; |
1985 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 2020 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
1986 pathOffset += 11; | 2021 pathOffset += 11; |
1987 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("blogs/")); | 2022 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("blogs/")); |
(...skipping 27 matching lines...) Expand all Loading... |
2015 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 2050 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
2016 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2051 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2017 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); | 2052 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); |
2018 unittest.expect(queryMap["status"], unittest.equals(arg_status)); | 2053 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
2019 | 2054 |
2020 | 2055 |
2021 var h = { | 2056 var h = { |
2022 "content-type" : "application/json; charset=utf-8", | 2057 "content-type" : "application/json; charset=utf-8", |
2023 }; | 2058 }; |
2024 var resp = convert.JSON.encode(buildCommentList()); | 2059 var resp = convert.JSON.encode(buildCommentList()); |
2025 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2060 return new async.Future.value(stringResponse(200, h, resp)); |
2026 }), true); | 2061 }), true); |
2027 res.listByBlog(arg_blogId, endDate: arg_endDate, fetchBodies: arg_fetchBod
ies, maxResults: arg_maxResults, pageToken: arg_pageToken, startDate: arg_startD
ate, status: arg_status).then(unittest.expectAsync(((api.CommentList response) { | 2062 res.listByBlog(arg_blogId, endDate: arg_endDate, fetchBodies: arg_fetchBod
ies, maxResults: arg_maxResults, pageToken: arg_pageToken, startDate: arg_startD
ate, status: arg_status).then(unittest.expectAsync(((api.CommentList response) { |
2028 checkCommentList(response); | 2063 checkCommentList(response); |
2029 }))); | 2064 }))); |
2030 }); | 2065 }); |
2031 | 2066 |
2032 unittest.test("method--markAsSpam", () { | 2067 unittest.test("method--markAsSpam", () { |
2033 | 2068 |
2034 var mock = new common_test.HttpServerMock(); | 2069 var mock = new HttpServerMock(); |
2035 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 2070 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
2036 var arg_blogId = "foo"; | 2071 var arg_blogId = "foo"; |
2037 var arg_postId = "foo"; | 2072 var arg_postId = "foo"; |
2038 var arg_commentId = "foo"; | 2073 var arg_commentId = "foo"; |
2039 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2074 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2040 var path = (req.url).path; | 2075 var path = (req.url).path; |
2041 var pathOffset = 0; | 2076 var pathOffset = 0; |
2042 var index; | 2077 var index; |
2043 var subPart; | 2078 var subPart; |
2044 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2079 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 var keyvalue = part.split("="); | 2119 var keyvalue = part.split("="); |
2085 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2120 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2086 } | 2121 } |
2087 } | 2122 } |
2088 | 2123 |
2089 | 2124 |
2090 var h = { | 2125 var h = { |
2091 "content-type" : "application/json; charset=utf-8", | 2126 "content-type" : "application/json; charset=utf-8", |
2092 }; | 2127 }; |
2093 var resp = convert.JSON.encode(buildComment()); | 2128 var resp = convert.JSON.encode(buildComment()); |
2094 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2129 return new async.Future.value(stringResponse(200, h, resp)); |
2095 }), true); | 2130 }), true); |
2096 res.markAsSpam(arg_blogId, arg_postId, arg_commentId).then(unittest.expect
Async(((api.Comment response) { | 2131 res.markAsSpam(arg_blogId, arg_postId, arg_commentId).then(unittest.expect
Async(((api.Comment response) { |
2097 checkComment(response); | 2132 checkComment(response); |
2098 }))); | 2133 }))); |
2099 }); | 2134 }); |
2100 | 2135 |
2101 unittest.test("method--removeContent", () { | 2136 unittest.test("method--removeContent", () { |
2102 | 2137 |
2103 var mock = new common_test.HttpServerMock(); | 2138 var mock = new HttpServerMock(); |
2104 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; | 2139 api.CommentsResourceApi res = new api.BloggerApi(mock).comments; |
2105 var arg_blogId = "foo"; | 2140 var arg_blogId = "foo"; |
2106 var arg_postId = "foo"; | 2141 var arg_postId = "foo"; |
2107 var arg_commentId = "foo"; | 2142 var arg_commentId = "foo"; |
2108 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2143 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2109 var path = (req.url).path; | 2144 var path = (req.url).path; |
2110 var pathOffset = 0; | 2145 var pathOffset = 0; |
2111 var index; | 2146 var index; |
2112 var subPart; | 2147 var subPart; |
2113 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2148 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 var keyvalue = part.split("="); | 2188 var keyvalue = part.split("="); |
2154 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2189 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2155 } | 2190 } |
2156 } | 2191 } |
2157 | 2192 |
2158 | 2193 |
2159 var h = { | 2194 var h = { |
2160 "content-type" : "application/json; charset=utf-8", | 2195 "content-type" : "application/json; charset=utf-8", |
2161 }; | 2196 }; |
2162 var resp = convert.JSON.encode(buildComment()); | 2197 var resp = convert.JSON.encode(buildComment()); |
2163 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2198 return new async.Future.value(stringResponse(200, h, resp)); |
2164 }), true); | 2199 }), true); |
2165 res.removeContent(arg_blogId, arg_postId, arg_commentId).then(unittest.exp
ectAsync(((api.Comment response) { | 2200 res.removeContent(arg_blogId, arg_postId, arg_commentId).then(unittest.exp
ectAsync(((api.Comment response) { |
2166 checkComment(response); | 2201 checkComment(response); |
2167 }))); | 2202 }))); |
2168 }); | 2203 }); |
2169 | 2204 |
2170 }); | 2205 }); |
2171 | 2206 |
2172 | 2207 |
2173 unittest.group("resource-PageViewsResourceApi", () { | 2208 unittest.group("resource-PageViewsResourceApi", () { |
2174 unittest.test("method--get", () { | 2209 unittest.test("method--get", () { |
2175 | 2210 |
2176 var mock = new common_test.HttpServerMock(); | 2211 var mock = new HttpServerMock(); |
2177 api.PageViewsResourceApi res = new api.BloggerApi(mock).pageViews; | 2212 api.PageViewsResourceApi res = new api.BloggerApi(mock).pageViews; |
2178 var arg_blogId = "foo"; | 2213 var arg_blogId = "foo"; |
2179 var arg_range = buildUnnamed1041(); | 2214 var arg_range = buildUnnamed324(); |
2180 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2215 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2181 var path = (req.url).path; | 2216 var path = (req.url).path; |
2182 var pathOffset = 0; | 2217 var pathOffset = 0; |
2183 var index; | 2218 var index; |
2184 var subPart; | 2219 var subPart; |
2185 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2220 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2186 pathOffset += 1; | 2221 pathOffset += 1; |
2187 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 2222 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
2188 pathOffset += 11; | 2223 pathOffset += 11; |
2189 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("blogs/")); | 2224 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("blogs/")); |
(...skipping 22 matching lines...) Expand all Loading... |
2212 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2247 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2213 } | 2248 } |
2214 } | 2249 } |
2215 unittest.expect(queryMap["range"], unittest.equals(arg_range)); | 2250 unittest.expect(queryMap["range"], unittest.equals(arg_range)); |
2216 | 2251 |
2217 | 2252 |
2218 var h = { | 2253 var h = { |
2219 "content-type" : "application/json; charset=utf-8", | 2254 "content-type" : "application/json; charset=utf-8", |
2220 }; | 2255 }; |
2221 var resp = convert.JSON.encode(buildPageviews()); | 2256 var resp = convert.JSON.encode(buildPageviews()); |
2222 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2257 return new async.Future.value(stringResponse(200, h, resp)); |
2223 }), true); | 2258 }), true); |
2224 res.get(arg_blogId, range: arg_range).then(unittest.expectAsync(((api.Page
views response) { | 2259 res.get(arg_blogId, range: arg_range).then(unittest.expectAsync(((api.Page
views response) { |
2225 checkPageviews(response); | 2260 checkPageviews(response); |
2226 }))); | 2261 }))); |
2227 }); | 2262 }); |
2228 | 2263 |
2229 }); | 2264 }); |
2230 | 2265 |
2231 | 2266 |
2232 unittest.group("resource-PagesResourceApi", () { | 2267 unittest.group("resource-PagesResourceApi", () { |
2233 unittest.test("method--delete", () { | 2268 unittest.test("method--delete", () { |
2234 | 2269 |
2235 var mock = new common_test.HttpServerMock(); | 2270 var mock = new HttpServerMock(); |
2236 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2271 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2237 var arg_blogId = "foo"; | 2272 var arg_blogId = "foo"; |
2238 var arg_pageId = "foo"; | 2273 var arg_pageId = "foo"; |
2239 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2274 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2240 var path = (req.url).path; | 2275 var path = (req.url).path; |
2241 var pathOffset = 0; | 2276 var pathOffset = 0; |
2242 var index; | 2277 var index; |
2243 var subPart; | 2278 var subPart; |
2244 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2279 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2245 pathOffset += 1; | 2280 pathOffset += 1; |
(...skipping 27 matching lines...) Expand all Loading... |
2273 var keyvalue = part.split("="); | 2308 var keyvalue = part.split("="); |
2274 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2309 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2275 } | 2310 } |
2276 } | 2311 } |
2277 | 2312 |
2278 | 2313 |
2279 var h = { | 2314 var h = { |
2280 "content-type" : "application/json; charset=utf-8", | 2315 "content-type" : "application/json; charset=utf-8", |
2281 }; | 2316 }; |
2282 var resp = ""; | 2317 var resp = ""; |
2283 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2318 return new async.Future.value(stringResponse(200, h, resp)); |
2284 }), true); | 2319 }), true); |
2285 res.delete(arg_blogId, arg_pageId).then(unittest.expectAsync((_) {})); | 2320 res.delete(arg_blogId, arg_pageId).then(unittest.expectAsync((_) {})); |
2286 }); | 2321 }); |
2287 | 2322 |
2288 unittest.test("method--get", () { | 2323 unittest.test("method--get", () { |
2289 | 2324 |
2290 var mock = new common_test.HttpServerMock(); | 2325 var mock = new HttpServerMock(); |
2291 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2326 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2292 var arg_blogId = "foo"; | 2327 var arg_blogId = "foo"; |
2293 var arg_pageId = "foo"; | 2328 var arg_pageId = "foo"; |
2294 var arg_view = "foo"; | 2329 var arg_view = "foo"; |
2295 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2330 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2296 var path = (req.url).path; | 2331 var path = (req.url).path; |
2297 var pathOffset = 0; | 2332 var pathOffset = 0; |
2298 var index; | 2333 var index; |
2299 var subPart; | 2334 var subPart; |
2300 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2335 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 29 matching lines...) Expand all Loading... |
2330 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2365 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2331 } | 2366 } |
2332 } | 2367 } |
2333 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 2368 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
2334 | 2369 |
2335 | 2370 |
2336 var h = { | 2371 var h = { |
2337 "content-type" : "application/json; charset=utf-8", | 2372 "content-type" : "application/json; charset=utf-8", |
2338 }; | 2373 }; |
2339 var resp = convert.JSON.encode(buildPage()); | 2374 var resp = convert.JSON.encode(buildPage()); |
2340 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2375 return new async.Future.value(stringResponse(200, h, resp)); |
2341 }), true); | 2376 }), true); |
2342 res.get(arg_blogId, arg_pageId, view: arg_view).then(unittest.expectAsync(
((api.Page response) { | 2377 res.get(arg_blogId, arg_pageId, view: arg_view).then(unittest.expectAsync(
((api.Page response) { |
2343 checkPage(response); | 2378 checkPage(response); |
2344 }))); | 2379 }))); |
2345 }); | 2380 }); |
2346 | 2381 |
2347 unittest.test("method--insert", () { | 2382 unittest.test("method--insert", () { |
2348 | 2383 |
2349 var mock = new common_test.HttpServerMock(); | 2384 var mock = new HttpServerMock(); |
2350 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2385 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2351 var arg_request = buildPage(); | 2386 var arg_request = buildPage(); |
2352 var arg_blogId = "foo"; | 2387 var arg_blogId = "foo"; |
2353 var arg_isDraft = true; | 2388 var arg_isDraft = true; |
2354 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2389 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2355 var obj = new api.Page.fromJson(json); | 2390 var obj = new api.Page.fromJson(json); |
2356 checkPage(obj); | 2391 checkPage(obj); |
2357 | 2392 |
2358 var path = (req.url).path; | 2393 var path = (req.url).path; |
2359 var pathOffset = 0; | 2394 var pathOffset = 0; |
(...skipping 29 matching lines...) Expand all Loading... |
2389 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2424 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2390 } | 2425 } |
2391 } | 2426 } |
2392 unittest.expect(queryMap["isDraft"].first, unittest.equals("$arg_isDraft
")); | 2427 unittest.expect(queryMap["isDraft"].first, unittest.equals("$arg_isDraft
")); |
2393 | 2428 |
2394 | 2429 |
2395 var h = { | 2430 var h = { |
2396 "content-type" : "application/json; charset=utf-8", | 2431 "content-type" : "application/json; charset=utf-8", |
2397 }; | 2432 }; |
2398 var resp = convert.JSON.encode(buildPage()); | 2433 var resp = convert.JSON.encode(buildPage()); |
2399 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2434 return new async.Future.value(stringResponse(200, h, resp)); |
2400 }), true); | 2435 }), true); |
2401 res.insert(arg_request, arg_blogId, isDraft: arg_isDraft).then(unittest.ex
pectAsync(((api.Page response) { | 2436 res.insert(arg_request, arg_blogId, isDraft: arg_isDraft).then(unittest.ex
pectAsync(((api.Page response) { |
2402 checkPage(response); | 2437 checkPage(response); |
2403 }))); | 2438 }))); |
2404 }); | 2439 }); |
2405 | 2440 |
2406 unittest.test("method--list", () { | 2441 unittest.test("method--list", () { |
2407 | 2442 |
2408 var mock = new common_test.HttpServerMock(); | 2443 var mock = new HttpServerMock(); |
2409 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2444 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2410 var arg_blogId = "foo"; | 2445 var arg_blogId = "foo"; |
2411 var arg_fetchBodies = true; | 2446 var arg_fetchBodies = true; |
2412 var arg_maxResults = 42; | 2447 var arg_maxResults = 42; |
2413 var arg_pageToken = "foo"; | 2448 var arg_pageToken = "foo"; |
2414 var arg_status = buildUnnamed1042(); | 2449 var arg_status = buildUnnamed325(); |
2415 var arg_view = "foo"; | 2450 var arg_view = "foo"; |
2416 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2451 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2417 var path = (req.url).path; | 2452 var path = (req.url).path; |
2418 var pathOffset = 0; | 2453 var pathOffset = 0; |
2419 var index; | 2454 var index; |
2420 var subPart; | 2455 var subPart; |
2421 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2456 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2422 pathOffset += 1; | 2457 pathOffset += 1; |
2423 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 2458 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
2424 pathOffset += 11; | 2459 pathOffset += 11; |
(...skipping 27 matching lines...) Expand all Loading... |
2452 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 2487 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
2453 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2488 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2454 unittest.expect(queryMap["status"], unittest.equals(arg_status)); | 2489 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
2455 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 2490 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
2456 | 2491 |
2457 | 2492 |
2458 var h = { | 2493 var h = { |
2459 "content-type" : "application/json; charset=utf-8", | 2494 "content-type" : "application/json; charset=utf-8", |
2460 }; | 2495 }; |
2461 var resp = convert.JSON.encode(buildPageList()); | 2496 var resp = convert.JSON.encode(buildPageList()); |
2462 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2497 return new async.Future.value(stringResponse(200, h, resp)); |
2463 }), true); | 2498 }), true); |
2464 res.list(arg_blogId, fetchBodies: arg_fetchBodies, maxResults: arg_maxResu
lts, pageToken: arg_pageToken, status: arg_status, view: arg_view).then(unittest
.expectAsync(((api.PageList response) { | 2499 res.list(arg_blogId, fetchBodies: arg_fetchBodies, maxResults: arg_maxResu
lts, pageToken: arg_pageToken, status: arg_status, view: arg_view).then(unittest
.expectAsync(((api.PageList response) { |
2465 checkPageList(response); | 2500 checkPageList(response); |
2466 }))); | 2501 }))); |
2467 }); | 2502 }); |
2468 | 2503 |
2469 unittest.test("method--patch", () { | 2504 unittest.test("method--patch", () { |
2470 | 2505 |
2471 var mock = new common_test.HttpServerMock(); | 2506 var mock = new HttpServerMock(); |
2472 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2507 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2473 var arg_request = buildPage(); | 2508 var arg_request = buildPage(); |
2474 var arg_blogId = "foo"; | 2509 var arg_blogId = "foo"; |
2475 var arg_pageId = "foo"; | 2510 var arg_pageId = "foo"; |
2476 var arg_publish_1 = true; | 2511 var arg_publish_1 = true; |
2477 var arg_revert_1 = true; | 2512 var arg_revert_1 = true; |
2478 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2513 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2479 var obj = new api.Page.fromJson(json); | 2514 var obj = new api.Page.fromJson(json); |
2480 checkPage(obj); | 2515 checkPage(obj); |
2481 | 2516 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2517 } | 2552 } |
2518 } | 2553 } |
2519 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); | 2554 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); |
2520 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); | 2555 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); |
2521 | 2556 |
2522 | 2557 |
2523 var h = { | 2558 var h = { |
2524 "content-type" : "application/json; charset=utf-8", | 2559 "content-type" : "application/json; charset=utf-8", |
2525 }; | 2560 }; |
2526 var resp = convert.JSON.encode(buildPage()); | 2561 var resp = convert.JSON.encode(buildPage()); |
2527 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2562 return new async.Future.value(stringResponse(200, h, resp)); |
2528 }), true); | 2563 }), true); |
2529 res.patch(arg_request, arg_blogId, arg_pageId, publish_1: arg_publish_1, r
evert_1: arg_revert_1).then(unittest.expectAsync(((api.Page response) { | 2564 res.patch(arg_request, arg_blogId, arg_pageId, publish_1: arg_publish_1, r
evert_1: arg_revert_1).then(unittest.expectAsync(((api.Page response) { |
2530 checkPage(response); | 2565 checkPage(response); |
2531 }))); | 2566 }))); |
2532 }); | 2567 }); |
2533 | 2568 |
2534 unittest.test("method--publish", () { | 2569 unittest.test("method--publish", () { |
2535 | 2570 |
2536 var mock = new common_test.HttpServerMock(); | 2571 var mock = new HttpServerMock(); |
2537 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2572 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2538 var arg_blogId = "foo"; | 2573 var arg_blogId = "foo"; |
2539 var arg_pageId = "foo"; | 2574 var arg_pageId = "foo"; |
2540 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2575 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2541 var path = (req.url).path; | 2576 var path = (req.url).path; |
2542 var pathOffset = 0; | 2577 var pathOffset = 0; |
2543 var index; | 2578 var index; |
2544 var subPart; | 2579 var subPart; |
2545 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2580 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2546 pathOffset += 1; | 2581 pathOffset += 1; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2578 var keyvalue = part.split("="); | 2613 var keyvalue = part.split("="); |
2579 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2614 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2580 } | 2615 } |
2581 } | 2616 } |
2582 | 2617 |
2583 | 2618 |
2584 var h = { | 2619 var h = { |
2585 "content-type" : "application/json; charset=utf-8", | 2620 "content-type" : "application/json; charset=utf-8", |
2586 }; | 2621 }; |
2587 var resp = convert.JSON.encode(buildPage()); | 2622 var resp = convert.JSON.encode(buildPage()); |
2588 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2623 return new async.Future.value(stringResponse(200, h, resp)); |
2589 }), true); | 2624 }), true); |
2590 res.publish(arg_blogId, arg_pageId).then(unittest.expectAsync(((api.Page r
esponse) { | 2625 res.publish(arg_blogId, arg_pageId).then(unittest.expectAsync(((api.Page r
esponse) { |
2591 checkPage(response); | 2626 checkPage(response); |
2592 }))); | 2627 }))); |
2593 }); | 2628 }); |
2594 | 2629 |
2595 unittest.test("method--revert", () { | 2630 unittest.test("method--revert", () { |
2596 | 2631 |
2597 var mock = new common_test.HttpServerMock(); | 2632 var mock = new HttpServerMock(); |
2598 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2633 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2599 var arg_blogId = "foo"; | 2634 var arg_blogId = "foo"; |
2600 var arg_pageId = "foo"; | 2635 var arg_pageId = "foo"; |
2601 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2636 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2602 var path = (req.url).path; | 2637 var path = (req.url).path; |
2603 var pathOffset = 0; | 2638 var pathOffset = 0; |
2604 var index; | 2639 var index; |
2605 var subPart; | 2640 var subPart; |
2606 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2641 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2607 pathOffset += 1; | 2642 pathOffset += 1; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 var keyvalue = part.split("="); | 2674 var keyvalue = part.split("="); |
2640 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2675 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2641 } | 2676 } |
2642 } | 2677 } |
2643 | 2678 |
2644 | 2679 |
2645 var h = { | 2680 var h = { |
2646 "content-type" : "application/json; charset=utf-8", | 2681 "content-type" : "application/json; charset=utf-8", |
2647 }; | 2682 }; |
2648 var resp = convert.JSON.encode(buildPage()); | 2683 var resp = convert.JSON.encode(buildPage()); |
2649 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2684 return new async.Future.value(stringResponse(200, h, resp)); |
2650 }), true); | 2685 }), true); |
2651 res.revert(arg_blogId, arg_pageId).then(unittest.expectAsync(((api.Page re
sponse) { | 2686 res.revert(arg_blogId, arg_pageId).then(unittest.expectAsync(((api.Page re
sponse) { |
2652 checkPage(response); | 2687 checkPage(response); |
2653 }))); | 2688 }))); |
2654 }); | 2689 }); |
2655 | 2690 |
2656 unittest.test("method--update", () { | 2691 unittest.test("method--update", () { |
2657 | 2692 |
2658 var mock = new common_test.HttpServerMock(); | 2693 var mock = new HttpServerMock(); |
2659 api.PagesResourceApi res = new api.BloggerApi(mock).pages; | 2694 api.PagesResourceApi res = new api.BloggerApi(mock).pages; |
2660 var arg_request = buildPage(); | 2695 var arg_request = buildPage(); |
2661 var arg_blogId = "foo"; | 2696 var arg_blogId = "foo"; |
2662 var arg_pageId = "foo"; | 2697 var arg_pageId = "foo"; |
2663 var arg_publish_1 = true; | 2698 var arg_publish_1 = true; |
2664 var arg_revert_1 = true; | 2699 var arg_revert_1 = true; |
2665 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2700 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2666 var obj = new api.Page.fromJson(json); | 2701 var obj = new api.Page.fromJson(json); |
2667 checkPage(obj); | 2702 checkPage(obj); |
2668 | 2703 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 } | 2739 } |
2705 } | 2740 } |
2706 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); | 2741 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); |
2707 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); | 2742 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); |
2708 | 2743 |
2709 | 2744 |
2710 var h = { | 2745 var h = { |
2711 "content-type" : "application/json; charset=utf-8", | 2746 "content-type" : "application/json; charset=utf-8", |
2712 }; | 2747 }; |
2713 var resp = convert.JSON.encode(buildPage()); | 2748 var resp = convert.JSON.encode(buildPage()); |
2714 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2749 return new async.Future.value(stringResponse(200, h, resp)); |
2715 }), true); | 2750 }), true); |
2716 res.update(arg_request, arg_blogId, arg_pageId, publish_1: arg_publish_1,
revert_1: arg_revert_1).then(unittest.expectAsync(((api.Page response) { | 2751 res.update(arg_request, arg_blogId, arg_pageId, publish_1: arg_publish_1,
revert_1: arg_revert_1).then(unittest.expectAsync(((api.Page response) { |
2717 checkPage(response); | 2752 checkPage(response); |
2718 }))); | 2753 }))); |
2719 }); | 2754 }); |
2720 | 2755 |
2721 }); | 2756 }); |
2722 | 2757 |
2723 | 2758 |
2724 unittest.group("resource-PostUserInfosResourceApi", () { | 2759 unittest.group("resource-PostUserInfosResourceApi", () { |
2725 unittest.test("method--get", () { | 2760 unittest.test("method--get", () { |
2726 | 2761 |
2727 var mock = new common_test.HttpServerMock(); | 2762 var mock = new HttpServerMock(); |
2728 api.PostUserInfosResourceApi res = new api.BloggerApi(mock).postUserInfos; | 2763 api.PostUserInfosResourceApi res = new api.BloggerApi(mock).postUserInfos; |
2729 var arg_userId = "foo"; | 2764 var arg_userId = "foo"; |
2730 var arg_blogId = "foo"; | 2765 var arg_blogId = "foo"; |
2731 var arg_postId = "foo"; | 2766 var arg_postId = "foo"; |
2732 var arg_maxComments = 42; | 2767 var arg_maxComments = 42; |
2733 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2768 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2734 var path = (req.url).path; | 2769 var path = (req.url).path; |
2735 var pathOffset = 0; | 2770 var pathOffset = 0; |
2736 var index; | 2771 var index; |
2737 var subPart; | 2772 var subPart; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2775 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2810 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2776 } | 2811 } |
2777 } | 2812 } |
2778 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); | 2813 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); |
2779 | 2814 |
2780 | 2815 |
2781 var h = { | 2816 var h = { |
2782 "content-type" : "application/json; charset=utf-8", | 2817 "content-type" : "application/json; charset=utf-8", |
2783 }; | 2818 }; |
2784 var resp = convert.JSON.encode(buildPostUserInfo()); | 2819 var resp = convert.JSON.encode(buildPostUserInfo()); |
2785 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2820 return new async.Future.value(stringResponse(200, h, resp)); |
2786 }), true); | 2821 }), true); |
2787 res.get(arg_userId, arg_blogId, arg_postId, maxComments: arg_maxComments).
then(unittest.expectAsync(((api.PostUserInfo response) { | 2822 res.get(arg_userId, arg_blogId, arg_postId, maxComments: arg_maxComments).
then(unittest.expectAsync(((api.PostUserInfo response) { |
2788 checkPostUserInfo(response); | 2823 checkPostUserInfo(response); |
2789 }))); | 2824 }))); |
2790 }); | 2825 }); |
2791 | 2826 |
2792 unittest.test("method--list", () { | 2827 unittest.test("method--list", () { |
2793 | 2828 |
2794 var mock = new common_test.HttpServerMock(); | 2829 var mock = new HttpServerMock(); |
2795 api.PostUserInfosResourceApi res = new api.BloggerApi(mock).postUserInfos; | 2830 api.PostUserInfosResourceApi res = new api.BloggerApi(mock).postUserInfos; |
2796 var arg_userId = "foo"; | 2831 var arg_userId = "foo"; |
2797 var arg_blogId = "foo"; | 2832 var arg_blogId = "foo"; |
2798 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); | 2833 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); |
2799 var arg_fetchBodies = true; | 2834 var arg_fetchBodies = true; |
2800 var arg_labels = "foo"; | 2835 var arg_labels = "foo"; |
2801 var arg_maxResults = 42; | 2836 var arg_maxResults = 42; |
2802 var arg_orderBy = "foo"; | 2837 var arg_orderBy = "foo"; |
2803 var arg_pageToken = "foo"; | 2838 var arg_pageToken = "foo"; |
2804 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); | 2839 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); |
2805 var arg_status = buildUnnamed1043(); | 2840 var arg_status = buildUnnamed326(); |
2806 var arg_view = "foo"; | 2841 var arg_view = "foo"; |
2807 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2842 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2808 var path = (req.url).path; | 2843 var path = (req.url).path; |
2809 var pathOffset = 0; | 2844 var pathOffset = 0; |
2810 var index; | 2845 var index; |
2811 var subPart; | 2846 var subPart; |
2812 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2847 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2813 pathOffset += 1; | 2848 pathOffset += 1; |
2814 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 2849 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
2815 pathOffset += 11; | 2850 pathOffset += 11; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2854 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2889 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2855 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); | 2890 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); |
2856 unittest.expect(queryMap["status"], unittest.equals(arg_status)); | 2891 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
2857 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 2892 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
2858 | 2893 |
2859 | 2894 |
2860 var h = { | 2895 var h = { |
2861 "content-type" : "application/json; charset=utf-8", | 2896 "content-type" : "application/json; charset=utf-8", |
2862 }; | 2897 }; |
2863 var resp = convert.JSON.encode(buildPostUserInfosList()); | 2898 var resp = convert.JSON.encode(buildPostUserInfosList()); |
2864 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2899 return new async.Future.value(stringResponse(200, h, resp)); |
2865 }), true); | 2900 }), true); |
2866 res.list(arg_userId, arg_blogId, endDate: arg_endDate, fetchBodies: arg_fe
tchBodies, labels: arg_labels, maxResults: arg_maxResults, orderBy: arg_orderBy,
pageToken: arg_pageToken, startDate: arg_startDate, status: arg_status, view: a
rg_view).then(unittest.expectAsync(((api.PostUserInfosList response) { | 2901 res.list(arg_userId, arg_blogId, endDate: arg_endDate, fetchBodies: arg_fe
tchBodies, labels: arg_labels, maxResults: arg_maxResults, orderBy: arg_orderBy,
pageToken: arg_pageToken, startDate: arg_startDate, status: arg_status, view: a
rg_view).then(unittest.expectAsync(((api.PostUserInfosList response) { |
2867 checkPostUserInfosList(response); | 2902 checkPostUserInfosList(response); |
2868 }))); | 2903 }))); |
2869 }); | 2904 }); |
2870 | 2905 |
2871 }); | 2906 }); |
2872 | 2907 |
2873 | 2908 |
2874 unittest.group("resource-PostsResourceApi", () { | 2909 unittest.group("resource-PostsResourceApi", () { |
2875 unittest.test("method--delete", () { | 2910 unittest.test("method--delete", () { |
2876 | 2911 |
2877 var mock = new common_test.HttpServerMock(); | 2912 var mock = new HttpServerMock(); |
2878 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 2913 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
2879 var arg_blogId = "foo"; | 2914 var arg_blogId = "foo"; |
2880 var arg_postId = "foo"; | 2915 var arg_postId = "foo"; |
2881 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2916 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2882 var path = (req.url).path; | 2917 var path = (req.url).path; |
2883 var pathOffset = 0; | 2918 var pathOffset = 0; |
2884 var index; | 2919 var index; |
2885 var subPart; | 2920 var subPart; |
2886 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2921 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2887 pathOffset += 1; | 2922 pathOffset += 1; |
(...skipping 27 matching lines...) Expand all Loading... |
2915 var keyvalue = part.split("="); | 2950 var keyvalue = part.split("="); |
2916 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2951 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2917 } | 2952 } |
2918 } | 2953 } |
2919 | 2954 |
2920 | 2955 |
2921 var h = { | 2956 var h = { |
2922 "content-type" : "application/json; charset=utf-8", | 2957 "content-type" : "application/json; charset=utf-8", |
2923 }; | 2958 }; |
2924 var resp = ""; | 2959 var resp = ""; |
2925 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2960 return new async.Future.value(stringResponse(200, h, resp)); |
2926 }), true); | 2961 }), true); |
2927 res.delete(arg_blogId, arg_postId).then(unittest.expectAsync((_) {})); | 2962 res.delete(arg_blogId, arg_postId).then(unittest.expectAsync((_) {})); |
2928 }); | 2963 }); |
2929 | 2964 |
2930 unittest.test("method--get", () { | 2965 unittest.test("method--get", () { |
2931 | 2966 |
2932 var mock = new common_test.HttpServerMock(); | 2967 var mock = new HttpServerMock(); |
2933 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 2968 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
2934 var arg_blogId = "foo"; | 2969 var arg_blogId = "foo"; |
2935 var arg_postId = "foo"; | 2970 var arg_postId = "foo"; |
2936 var arg_fetchBody = true; | 2971 var arg_fetchBody = true; |
2937 var arg_fetchImages = true; | 2972 var arg_fetchImages = true; |
2938 var arg_maxComments = 42; | 2973 var arg_maxComments = 42; |
2939 var arg_view = "foo"; | 2974 var arg_view = "foo"; |
2940 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2975 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2941 var path = (req.url).path; | 2976 var path = (req.url).path; |
2942 var pathOffset = 0; | 2977 var pathOffset = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 unittest.expect(queryMap["fetchBody"].first, unittest.equals("$arg_fetch
Body")); | 3013 unittest.expect(queryMap["fetchBody"].first, unittest.equals("$arg_fetch
Body")); |
2979 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); | 3014 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); |
2980 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); | 3015 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); |
2981 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 3016 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
2982 | 3017 |
2983 | 3018 |
2984 var h = { | 3019 var h = { |
2985 "content-type" : "application/json; charset=utf-8", | 3020 "content-type" : "application/json; charset=utf-8", |
2986 }; | 3021 }; |
2987 var resp = convert.JSON.encode(buildPost()); | 3022 var resp = convert.JSON.encode(buildPost()); |
2988 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3023 return new async.Future.value(stringResponse(200, h, resp)); |
2989 }), true); | 3024 }), true); |
2990 res.get(arg_blogId, arg_postId, fetchBody: arg_fetchBody, fetchImages: arg
_fetchImages, maxComments: arg_maxComments, view: arg_view).then(unittest.expect
Async(((api.Post response) { | 3025 res.get(arg_blogId, arg_postId, fetchBody: arg_fetchBody, fetchImages: arg
_fetchImages, maxComments: arg_maxComments, view: arg_view).then(unittest.expect
Async(((api.Post response) { |
2991 checkPost(response); | 3026 checkPost(response); |
2992 }))); | 3027 }))); |
2993 }); | 3028 }); |
2994 | 3029 |
2995 unittest.test("method--getByPath", () { | 3030 unittest.test("method--getByPath", () { |
2996 | 3031 |
2997 var mock = new common_test.HttpServerMock(); | 3032 var mock = new HttpServerMock(); |
2998 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3033 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
2999 var arg_blogId = "foo"; | 3034 var arg_blogId = "foo"; |
3000 var arg_path = "foo"; | 3035 var arg_path = "foo"; |
3001 var arg_maxComments = 42; | 3036 var arg_maxComments = 42; |
3002 var arg_view = "foo"; | 3037 var arg_view = "foo"; |
3003 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3038 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3004 var path = (req.url).path; | 3039 var path = (req.url).path; |
3005 var pathOffset = 0; | 3040 var pathOffset = 0; |
3006 var index; | 3041 var index; |
3007 var subPart; | 3042 var subPart; |
(...skipping 29 matching lines...) Expand all Loading... |
3037 } | 3072 } |
3038 unittest.expect(queryMap["path"].first, unittest.equals(arg_path)); | 3073 unittest.expect(queryMap["path"].first, unittest.equals(arg_path)); |
3039 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); | 3074 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); |
3040 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 3075 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
3041 | 3076 |
3042 | 3077 |
3043 var h = { | 3078 var h = { |
3044 "content-type" : "application/json; charset=utf-8", | 3079 "content-type" : "application/json; charset=utf-8", |
3045 }; | 3080 }; |
3046 var resp = convert.JSON.encode(buildPost()); | 3081 var resp = convert.JSON.encode(buildPost()); |
3047 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3082 return new async.Future.value(stringResponse(200, h, resp)); |
3048 }), true); | 3083 }), true); |
3049 res.getByPath(arg_blogId, arg_path, maxComments: arg_maxComments, view: ar
g_view).then(unittest.expectAsync(((api.Post response) { | 3084 res.getByPath(arg_blogId, arg_path, maxComments: arg_maxComments, view: ar
g_view).then(unittest.expectAsync(((api.Post response) { |
3050 checkPost(response); | 3085 checkPost(response); |
3051 }))); | 3086 }))); |
3052 }); | 3087 }); |
3053 | 3088 |
3054 unittest.test("method--insert", () { | 3089 unittest.test("method--insert", () { |
3055 | 3090 |
3056 var mock = new common_test.HttpServerMock(); | 3091 var mock = new HttpServerMock(); |
3057 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3092 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3058 var arg_request = buildPost(); | 3093 var arg_request = buildPost(); |
3059 var arg_blogId = "foo"; | 3094 var arg_blogId = "foo"; |
3060 var arg_fetchBody = true; | 3095 var arg_fetchBody = true; |
3061 var arg_fetchImages = true; | 3096 var arg_fetchImages = true; |
3062 var arg_isDraft = true; | 3097 var arg_isDraft = true; |
3063 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3098 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3064 var obj = new api.Post.fromJson(json); | 3099 var obj = new api.Post.fromJson(json); |
3065 checkPost(obj); | 3100 checkPost(obj); |
3066 | 3101 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3100 } | 3135 } |
3101 unittest.expect(queryMap["fetchBody"].first, unittest.equals("$arg_fetch
Body")); | 3136 unittest.expect(queryMap["fetchBody"].first, unittest.equals("$arg_fetch
Body")); |
3102 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); | 3137 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); |
3103 unittest.expect(queryMap["isDraft"].first, unittest.equals("$arg_isDraft
")); | 3138 unittest.expect(queryMap["isDraft"].first, unittest.equals("$arg_isDraft
")); |
3104 | 3139 |
3105 | 3140 |
3106 var h = { | 3141 var h = { |
3107 "content-type" : "application/json; charset=utf-8", | 3142 "content-type" : "application/json; charset=utf-8", |
3108 }; | 3143 }; |
3109 var resp = convert.JSON.encode(buildPost()); | 3144 var resp = convert.JSON.encode(buildPost()); |
3110 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3145 return new async.Future.value(stringResponse(200, h, resp)); |
3111 }), true); | 3146 }), true); |
3112 res.insert(arg_request, arg_blogId, fetchBody: arg_fetchBody, fetchImages:
arg_fetchImages, isDraft: arg_isDraft).then(unittest.expectAsync(((api.Post res
ponse) { | 3147 res.insert(arg_request, arg_blogId, fetchBody: arg_fetchBody, fetchImages:
arg_fetchImages, isDraft: arg_isDraft).then(unittest.expectAsync(((api.Post res
ponse) { |
3113 checkPost(response); | 3148 checkPost(response); |
3114 }))); | 3149 }))); |
3115 }); | 3150 }); |
3116 | 3151 |
3117 unittest.test("method--list", () { | 3152 unittest.test("method--list", () { |
3118 | 3153 |
3119 var mock = new common_test.HttpServerMock(); | 3154 var mock = new HttpServerMock(); |
3120 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3155 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3121 var arg_blogId = "foo"; | 3156 var arg_blogId = "foo"; |
3122 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); | 3157 var arg_endDate = core.DateTime.parse("2002-02-27T14:01:02"); |
3123 var arg_fetchBodies = true; | 3158 var arg_fetchBodies = true; |
3124 var arg_fetchImages = true; | 3159 var arg_fetchImages = true; |
3125 var arg_labels = "foo"; | 3160 var arg_labels = "foo"; |
3126 var arg_maxResults = 42; | 3161 var arg_maxResults = 42; |
3127 var arg_orderBy = "foo"; | 3162 var arg_orderBy = "foo"; |
3128 var arg_pageToken = "foo"; | 3163 var arg_pageToken = "foo"; |
3129 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); | 3164 var arg_startDate = core.DateTime.parse("2002-02-27T14:01:02"); |
3130 var arg_status = buildUnnamed1044(); | 3165 var arg_status = buildUnnamed327(); |
3131 var arg_view = "foo"; | 3166 var arg_view = "foo"; |
3132 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3167 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3133 var path = (req.url).path; | 3168 var path = (req.url).path; |
3134 var pathOffset = 0; | 3169 var pathOffset = 0; |
3135 var index; | 3170 var index; |
3136 var subPart; | 3171 var subPart; |
3137 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3172 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
3138 pathOffset += 1; | 3173 pathOffset += 1; |
3139 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 3174 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
3140 pathOffset += 11; | 3175 pathOffset += 11; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 3208 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
3174 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); | 3209 unittest.expect(core.DateTime.parse(queryMap["startDate"].first), unitte
st.equals(arg_startDate)); |
3175 unittest.expect(queryMap["status"], unittest.equals(arg_status)); | 3210 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
3176 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); | 3211 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
3177 | 3212 |
3178 | 3213 |
3179 var h = { | 3214 var h = { |
3180 "content-type" : "application/json; charset=utf-8", | 3215 "content-type" : "application/json; charset=utf-8", |
3181 }; | 3216 }; |
3182 var resp = convert.JSON.encode(buildPostList()); | 3217 var resp = convert.JSON.encode(buildPostList()); |
3183 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3218 return new async.Future.value(stringResponse(200, h, resp)); |
3184 }), true); | 3219 }), true); |
3185 res.list(arg_blogId, endDate: arg_endDate, fetchBodies: arg_fetchBodies, f
etchImages: arg_fetchImages, labels: arg_labels, maxResults: arg_maxResults, ord
erBy: arg_orderBy, pageToken: arg_pageToken, startDate: arg_startDate, status: a
rg_status, view: arg_view).then(unittest.expectAsync(((api.PostList response) { | 3220 res.list(arg_blogId, endDate: arg_endDate, fetchBodies: arg_fetchBodies, f
etchImages: arg_fetchImages, labels: arg_labels, maxResults: arg_maxResults, ord
erBy: arg_orderBy, pageToken: arg_pageToken, startDate: arg_startDate, status: a
rg_status, view: arg_view).then(unittest.expectAsync(((api.PostList response) { |
3186 checkPostList(response); | 3221 checkPostList(response); |
3187 }))); | 3222 }))); |
3188 }); | 3223 }); |
3189 | 3224 |
3190 unittest.test("method--patch", () { | 3225 unittest.test("method--patch", () { |
3191 | 3226 |
3192 var mock = new common_test.HttpServerMock(); | 3227 var mock = new HttpServerMock(); |
3193 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3228 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3194 var arg_request = buildPost(); | 3229 var arg_request = buildPost(); |
3195 var arg_blogId = "foo"; | 3230 var arg_blogId = "foo"; |
3196 var arg_postId = "foo"; | 3231 var arg_postId = "foo"; |
3197 var arg_fetchBody = true; | 3232 var arg_fetchBody = true; |
3198 var arg_fetchImages = true; | 3233 var arg_fetchImages = true; |
3199 var arg_maxComments = 42; | 3234 var arg_maxComments = 42; |
3200 var arg_publish_1 = true; | 3235 var arg_publish_1 = true; |
3201 var arg_revert_1 = true; | 3236 var arg_revert_1 = true; |
3202 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3237 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3244 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); | 3279 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); |
3245 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); | 3280 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); |
3246 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); | 3281 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); |
3247 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); | 3282 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); |
3248 | 3283 |
3249 | 3284 |
3250 var h = { | 3285 var h = { |
3251 "content-type" : "application/json; charset=utf-8", | 3286 "content-type" : "application/json; charset=utf-8", |
3252 }; | 3287 }; |
3253 var resp = convert.JSON.encode(buildPost()); | 3288 var resp = convert.JSON.encode(buildPost()); |
3254 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3289 return new async.Future.value(stringResponse(200, h, resp)); |
3255 }), true); | 3290 }), true); |
3256 res.patch(arg_request, arg_blogId, arg_postId, fetchBody: arg_fetchBody, f
etchImages: arg_fetchImages, maxComments: arg_maxComments, publish_1: arg_publis
h_1, revert_1: arg_revert_1).then(unittest.expectAsync(((api.Post response) { | 3291 res.patch(arg_request, arg_blogId, arg_postId, fetchBody: arg_fetchBody, f
etchImages: arg_fetchImages, maxComments: arg_maxComments, publish_1: arg_publis
h_1, revert_1: arg_revert_1).then(unittest.expectAsync(((api.Post response) { |
3257 checkPost(response); | 3292 checkPost(response); |
3258 }))); | 3293 }))); |
3259 }); | 3294 }); |
3260 | 3295 |
3261 unittest.test("method--publish", () { | 3296 unittest.test("method--publish", () { |
3262 | 3297 |
3263 var mock = new common_test.HttpServerMock(); | 3298 var mock = new HttpServerMock(); |
3264 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3299 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3265 var arg_blogId = "foo"; | 3300 var arg_blogId = "foo"; |
3266 var arg_postId = "foo"; | 3301 var arg_postId = "foo"; |
3267 var arg_publishDate = core.DateTime.parse("2002-02-27T14:01:02"); | 3302 var arg_publishDate = core.DateTime.parse("2002-02-27T14:01:02"); |
3268 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3303 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3269 var path = (req.url).path; | 3304 var path = (req.url).path; |
3270 var pathOffset = 0; | 3305 var pathOffset = 0; |
3271 var index; | 3306 var index; |
3272 var subPart; | 3307 var subPart; |
3273 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3308 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3307 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3342 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
3308 } | 3343 } |
3309 } | 3344 } |
3310 unittest.expect(core.DateTime.parse(queryMap["publishDate"].first), unit
test.equals(arg_publishDate)); | 3345 unittest.expect(core.DateTime.parse(queryMap["publishDate"].first), unit
test.equals(arg_publishDate)); |
3311 | 3346 |
3312 | 3347 |
3313 var h = { | 3348 var h = { |
3314 "content-type" : "application/json; charset=utf-8", | 3349 "content-type" : "application/json; charset=utf-8", |
3315 }; | 3350 }; |
3316 var resp = convert.JSON.encode(buildPost()); | 3351 var resp = convert.JSON.encode(buildPost()); |
3317 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3352 return new async.Future.value(stringResponse(200, h, resp)); |
3318 }), true); | 3353 }), true); |
3319 res.publish(arg_blogId, arg_postId, publishDate: arg_publishDate).then(uni
ttest.expectAsync(((api.Post response) { | 3354 res.publish(arg_blogId, arg_postId, publishDate: arg_publishDate).then(uni
ttest.expectAsync(((api.Post response) { |
3320 checkPost(response); | 3355 checkPost(response); |
3321 }))); | 3356 }))); |
3322 }); | 3357 }); |
3323 | 3358 |
3324 unittest.test("method--revert", () { | 3359 unittest.test("method--revert", () { |
3325 | 3360 |
3326 var mock = new common_test.HttpServerMock(); | 3361 var mock = new HttpServerMock(); |
3327 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3362 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3328 var arg_blogId = "foo"; | 3363 var arg_blogId = "foo"; |
3329 var arg_postId = "foo"; | 3364 var arg_postId = "foo"; |
3330 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3365 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3331 var path = (req.url).path; | 3366 var path = (req.url).path; |
3332 var pathOffset = 0; | 3367 var pathOffset = 0; |
3333 var index; | 3368 var index; |
3334 var subPart; | 3369 var subPart; |
3335 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3370 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
3336 pathOffset += 1; | 3371 pathOffset += 1; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3368 var keyvalue = part.split("="); | 3403 var keyvalue = part.split("="); |
3369 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3404 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
3370 } | 3405 } |
3371 } | 3406 } |
3372 | 3407 |
3373 | 3408 |
3374 var h = { | 3409 var h = { |
3375 "content-type" : "application/json; charset=utf-8", | 3410 "content-type" : "application/json; charset=utf-8", |
3376 }; | 3411 }; |
3377 var resp = convert.JSON.encode(buildPost()); | 3412 var resp = convert.JSON.encode(buildPost()); |
3378 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3413 return new async.Future.value(stringResponse(200, h, resp)); |
3379 }), true); | 3414 }), true); |
3380 res.revert(arg_blogId, arg_postId).then(unittest.expectAsync(((api.Post re
sponse) { | 3415 res.revert(arg_blogId, arg_postId).then(unittest.expectAsync(((api.Post re
sponse) { |
3381 checkPost(response); | 3416 checkPost(response); |
3382 }))); | 3417 }))); |
3383 }); | 3418 }); |
3384 | 3419 |
3385 unittest.test("method--search", () { | 3420 unittest.test("method--search", () { |
3386 | 3421 |
3387 var mock = new common_test.HttpServerMock(); | 3422 var mock = new HttpServerMock(); |
3388 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3423 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3389 var arg_blogId = "foo"; | 3424 var arg_blogId = "foo"; |
3390 var arg_q = "foo"; | 3425 var arg_q = "foo"; |
3391 var arg_fetchBodies = true; | 3426 var arg_fetchBodies = true; |
3392 var arg_orderBy = "foo"; | 3427 var arg_orderBy = "foo"; |
3393 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3428 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3394 var path = (req.url).path; | 3429 var path = (req.url).path; |
3395 var pathOffset = 0; | 3430 var pathOffset = 0; |
3396 var index; | 3431 var index; |
3397 var subPart; | 3432 var subPart; |
(...skipping 29 matching lines...) Expand all Loading... |
3427 } | 3462 } |
3428 unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); | 3463 unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); |
3429 unittest.expect(queryMap["fetchBodies"].first, unittest.equals("$arg_fet
chBodies")); | 3464 unittest.expect(queryMap["fetchBodies"].first, unittest.equals("$arg_fet
chBodies")); |
3430 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | 3465 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; |
3431 | 3466 |
3432 | 3467 |
3433 var h = { | 3468 var h = { |
3434 "content-type" : "application/json; charset=utf-8", | 3469 "content-type" : "application/json; charset=utf-8", |
3435 }; | 3470 }; |
3436 var resp = convert.JSON.encode(buildPostList()); | 3471 var resp = convert.JSON.encode(buildPostList()); |
3437 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3472 return new async.Future.value(stringResponse(200, h, resp)); |
3438 }), true); | 3473 }), true); |
3439 res.search(arg_blogId, arg_q, fetchBodies: arg_fetchBodies, orderBy: arg_o
rderBy).then(unittest.expectAsync(((api.PostList response) { | 3474 res.search(arg_blogId, arg_q, fetchBodies: arg_fetchBodies, orderBy: arg_o
rderBy).then(unittest.expectAsync(((api.PostList response) { |
3440 checkPostList(response); | 3475 checkPostList(response); |
3441 }))); | 3476 }))); |
3442 }); | 3477 }); |
3443 | 3478 |
3444 unittest.test("method--update", () { | 3479 unittest.test("method--update", () { |
3445 | 3480 |
3446 var mock = new common_test.HttpServerMock(); | 3481 var mock = new HttpServerMock(); |
3447 api.PostsResourceApi res = new api.BloggerApi(mock).posts; | 3482 api.PostsResourceApi res = new api.BloggerApi(mock).posts; |
3448 var arg_request = buildPost(); | 3483 var arg_request = buildPost(); |
3449 var arg_blogId = "foo"; | 3484 var arg_blogId = "foo"; |
3450 var arg_postId = "foo"; | 3485 var arg_postId = "foo"; |
3451 var arg_fetchBody = true; | 3486 var arg_fetchBody = true; |
3452 var arg_fetchImages = true; | 3487 var arg_fetchImages = true; |
3453 var arg_maxComments = 42; | 3488 var arg_maxComments = 42; |
3454 var arg_publish_1 = true; | 3489 var arg_publish_1 = true; |
3455 var arg_revert_1 = true; | 3490 var arg_revert_1 = true; |
3456 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3491 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3498 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); | 3533 unittest.expect(queryMap["fetchImages"].first, unittest.equals("$arg_fet
chImages")); |
3499 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); | 3534 unittest.expect(core.int.parse(queryMap["maxComments"].first), unittest.
equals(arg_maxComments)); |
3500 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); | 3535 unittest.expect(queryMap["publish"].first, unittest.equals("$arg_publish
_1")); |
3501 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); | 3536 unittest.expect(queryMap["revert"].first, unittest.equals("$arg_revert_1
")); |
3502 | 3537 |
3503 | 3538 |
3504 var h = { | 3539 var h = { |
3505 "content-type" : "application/json; charset=utf-8", | 3540 "content-type" : "application/json; charset=utf-8", |
3506 }; | 3541 }; |
3507 var resp = convert.JSON.encode(buildPost()); | 3542 var resp = convert.JSON.encode(buildPost()); |
3508 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3543 return new async.Future.value(stringResponse(200, h, resp)); |
3509 }), true); | 3544 }), true); |
3510 res.update(arg_request, arg_blogId, arg_postId, fetchBody: arg_fetchBody,
fetchImages: arg_fetchImages, maxComments: arg_maxComments, publish_1: arg_publi
sh_1, revert_1: arg_revert_1).then(unittest.expectAsync(((api.Post response) { | 3545 res.update(arg_request, arg_blogId, arg_postId, fetchBody: arg_fetchBody,
fetchImages: arg_fetchImages, maxComments: arg_maxComments, publish_1: arg_publi
sh_1, revert_1: arg_revert_1).then(unittest.expectAsync(((api.Post response) { |
3511 checkPost(response); | 3546 checkPost(response); |
3512 }))); | 3547 }))); |
3513 }); | 3548 }); |
3514 | 3549 |
3515 }); | 3550 }); |
3516 | 3551 |
3517 | 3552 |
3518 unittest.group("resource-UsersResourceApi", () { | 3553 unittest.group("resource-UsersResourceApi", () { |
3519 unittest.test("method--get", () { | 3554 unittest.test("method--get", () { |
3520 | 3555 |
3521 var mock = new common_test.HttpServerMock(); | 3556 var mock = new HttpServerMock(); |
3522 api.UsersResourceApi res = new api.BloggerApi(mock).users; | 3557 api.UsersResourceApi res = new api.BloggerApi(mock).users; |
3523 var arg_userId = "foo"; | 3558 var arg_userId = "foo"; |
3524 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3559 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
3525 var path = (req.url).path; | 3560 var path = (req.url).path; |
3526 var pathOffset = 0; | 3561 var pathOffset = 0; |
3527 var index; | 3562 var index; |
3528 var subPart; | 3563 var subPart; |
3529 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3564 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
3530 pathOffset += 1; | 3565 pathOffset += 1; |
3531 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); | 3566 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("blogger/v3/")); |
(...skipping 19 matching lines...) Expand all Loading... |
3551 var keyvalue = part.split("="); | 3586 var keyvalue = part.split("="); |
3552 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3587 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
3553 } | 3588 } |
3554 } | 3589 } |
3555 | 3590 |
3556 | 3591 |
3557 var h = { | 3592 var h = { |
3558 "content-type" : "application/json; charset=utf-8", | 3593 "content-type" : "application/json; charset=utf-8", |
3559 }; | 3594 }; |
3560 var resp = convert.JSON.encode(buildUser()); | 3595 var resp = convert.JSON.encode(buildUser()); |
3561 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3596 return new async.Future.value(stringResponse(200, h, resp)); |
3562 }), true); | 3597 }), true); |
3563 res.get(arg_userId).then(unittest.expectAsync(((api.User response) { | 3598 res.get(arg_userId).then(unittest.expectAsync(((api.User response) { |
3564 checkUser(response); | 3599 checkUser(response); |
3565 }))); | 3600 }))); |
3566 }); | 3601 }); |
3567 | 3602 |
3568 }); | 3603 }); |
3569 | 3604 |
3570 | 3605 |
3571 } | 3606 } |
3572 | 3607 |
OLD | NEW |