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

Side by Side Diff: generated/googleapis/test/manufacturers/v1_test.dart

Issue 3003493002: Api-Roll 53: 2017-08-21 (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 library googleapis.manufacturers.v1.test; 1 library googleapis.manufacturers.v1.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:test/test.dart' as unittest; 10 import 'package:test/test.dart' as unittest;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 http.StreamedResponse stringResponse( 48 http.StreamedResponse stringResponse(
49 core.int status, core.Map<core.String, core.String> headers, core.String bod y) { 49 core.int status, core.Map<core.String, core.String> headers, core.String bod y) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 51 return new http.StreamedResponse(stream, status, headers: headers);
52 } 52 }
53 53
54 buildUnnamed1587() { 54 buildUnnamed1604() {
55 var o = new core.List<api.Image>(); 55 var o = new core.List<api.Image>();
56 o.add(buildImage()); 56 o.add(buildImage());
57 o.add(buildImage()); 57 o.add(buildImage());
58 return o; 58 return o;
59 } 59 }
60 60
61 checkUnnamed1587(core.List<api.Image> o) { 61 checkUnnamed1604(core.List<api.Image> o) {
62 unittest.expect(o, unittest.hasLength(2)); 62 unittest.expect(o, unittest.hasLength(2));
63 checkImage(o[0]); 63 checkImage(o[0]);
64 checkImage(o[1]); 64 checkImage(o[1]);
65 } 65 }
66 66
67 buildUnnamed1588() { 67 buildUnnamed1605() {
68 var o = new core.List<api.FeatureDescription>(); 68 var o = new core.List<api.FeatureDescription>();
69 o.add(buildFeatureDescription()); 69 o.add(buildFeatureDescription());
70 o.add(buildFeatureDescription()); 70 o.add(buildFeatureDescription());
71 return o; 71 return o;
72 } 72 }
73 73
74 checkUnnamed1588(core.List<api.FeatureDescription> o) { 74 checkUnnamed1605(core.List<api.FeatureDescription> o) {
75 unittest.expect(o, unittest.hasLength(2)); 75 unittest.expect(o, unittest.hasLength(2));
76 checkFeatureDescription(o[0]); 76 checkFeatureDescription(o[0]);
77 checkFeatureDescription(o[1]); 77 checkFeatureDescription(o[1]);
78 } 78 }
79 79
80 buildUnnamed1589() { 80 buildUnnamed1606() {
81 var o = new core.List<core.String>(); 81 var o = new core.List<core.String>();
82 o.add("foo"); 82 o.add("foo");
83 o.add("foo"); 83 o.add("foo");
84 return o; 84 return o;
85 } 85 }
86 86
87 checkUnnamed1589(core.List<core.String> o) { 87 checkUnnamed1606(core.List<core.String> o) {
88 unittest.expect(o, unittest.hasLength(2)); 88 unittest.expect(o, unittest.hasLength(2));
89 unittest.expect(o[0], unittest.equals('foo')); 89 unittest.expect(o[0], unittest.equals('foo'));
90 unittest.expect(o[1], unittest.equals('foo')); 90 unittest.expect(o[1], unittest.equals('foo'));
91 } 91 }
92 92
93 buildUnnamed1590() { 93 buildUnnamed1607() {
94 var o = new core.List<api.ProductDetail>(); 94 var o = new core.List<api.ProductDetail>();
95 o.add(buildProductDetail()); 95 o.add(buildProductDetail());
96 o.add(buildProductDetail()); 96 o.add(buildProductDetail());
97 return o; 97 return o;
98 } 98 }
99 99
100 checkUnnamed1590(core.List<api.ProductDetail> o) { 100 checkUnnamed1607(core.List<api.ProductDetail> o) {
101 unittest.expect(o, unittest.hasLength(2)); 101 unittest.expect(o, unittest.hasLength(2));
102 checkProductDetail(o[0]); 102 checkProductDetail(o[0]);
103 checkProductDetail(o[1]); 103 checkProductDetail(o[1]);
104 } 104 }
105 105
106 buildUnnamed1591() { 106 buildUnnamed1608() {
107 var o = new core.List<core.String>(); 107 var o = new core.List<core.String>();
108 o.add("foo"); 108 o.add("foo");
109 o.add("foo"); 109 o.add("foo");
110 return o; 110 return o;
111 } 111 }
112 112
113 checkUnnamed1591(core.List<core.String> o) { 113 checkUnnamed1608(core.List<core.String> o) {
114 unittest.expect(o, unittest.hasLength(2)); 114 unittest.expect(o, unittest.hasLength(2));
115 unittest.expect(o[0], unittest.equals('foo')); 115 unittest.expect(o[0], unittest.equals('foo'));
116 unittest.expect(o[1], unittest.equals('foo')); 116 unittest.expect(o[1], unittest.equals('foo'));
117 } 117 }
118 118
119 buildUnnamed1592() { 119 buildUnnamed1609() {
120 var o = new core.List<core.String>(); 120 var o = new core.List<core.String>();
121 o.add("foo"); 121 o.add("foo");
122 o.add("foo"); 122 o.add("foo");
123 return o; 123 return o;
124 } 124 }
125 125
126 checkUnnamed1592(core.List<core.String> o) { 126 checkUnnamed1609(core.List<core.String> o) {
127 unittest.expect(o, unittest.hasLength(2)); 127 unittest.expect(o, unittest.hasLength(2));
128 unittest.expect(o[0], unittest.equals('foo')); 128 unittest.expect(o[0], unittest.equals('foo'));
129 unittest.expect(o[1], unittest.equals('foo')); 129 unittest.expect(o[1], unittest.equals('foo'));
130 } 130 }
131 131
132 core.int buildCounterAttributes = 0; 132 core.int buildCounterAttributes = 0;
133 buildAttributes() { 133 buildAttributes() {
134 var o = new api.Attributes(); 134 var o = new api.Attributes();
135 buildCounterAttributes++; 135 buildCounterAttributes++;
136 if (buildCounterAttributes < 3) { 136 if (buildCounterAttributes < 3) {
137 o.additionalImageLink = buildUnnamed1587(); 137 o.additionalImageLink = buildUnnamed1604();
138 o.ageGroup = "foo"; 138 o.ageGroup = "foo";
139 o.brand = "foo"; 139 o.brand = "foo";
140 o.capacity = buildCapacity(); 140 o.capacity = buildCapacity();
141 o.color = "foo"; 141 o.color = "foo";
142 o.count = buildCount(); 142 o.count = buildCount();
143 o.description = "foo"; 143 o.description = "foo";
144 o.disclosureDate = "foo"; 144 o.disclosureDate = "foo";
145 o.featureDescription = buildUnnamed1588(); 145 o.featureDescription = buildUnnamed1605();
146 o.flavor = "foo"; 146 o.flavor = "foo";
147 o.format = "foo"; 147 o.format = "foo";
148 o.gender = "foo"; 148 o.gender = "foo";
149 o.gtin = buildUnnamed1589(); 149 o.gtin = buildUnnamed1606();
150 o.imageLink = buildImage(); 150 o.imageLink = buildImage();
151 o.itemGroupId = "foo"; 151 o.itemGroupId = "foo";
152 o.material = "foo"; 152 o.material = "foo";
153 o.mpn = "foo"; 153 o.mpn = "foo";
154 o.pattern = "foo"; 154 o.pattern = "foo";
155 o.productDetail = buildUnnamed1590(); 155 o.productDetail = buildUnnamed1607();
156 o.productLine = "foo"; 156 o.productLine = "foo";
157 o.productName = "foo"; 157 o.productName = "foo";
158 o.productPageUrl = "foo"; 158 o.productPageUrl = "foo";
159 o.productType = buildUnnamed1591(); 159 o.productType = buildUnnamed1608();
160 o.releaseDate = "foo"; 160 o.releaseDate = "foo";
161 o.scent = "foo"; 161 o.scent = "foo";
162 o.size = "foo"; 162 o.size = "foo";
163 o.sizeSystem = "foo"; 163 o.sizeSystem = "foo";
164 o.sizeType = "foo"; 164 o.sizeType = "foo";
165 o.suggestedRetailPrice = buildPrice(); 165 o.suggestedRetailPrice = buildPrice();
166 o.targetAccountId = "foo";
166 o.theme = "foo"; 167 o.theme = "foo";
167 o.title = "foo"; 168 o.title = "foo";
168 o.videoLink = buildUnnamed1592(); 169 o.videoLink = buildUnnamed1609();
169 } 170 }
170 buildCounterAttributes--; 171 buildCounterAttributes--;
171 return o; 172 return o;
172 } 173 }
173 174
174 checkAttributes(api.Attributes o) { 175 checkAttributes(api.Attributes o) {
175 buildCounterAttributes++; 176 buildCounterAttributes++;
176 if (buildCounterAttributes < 3) { 177 if (buildCounterAttributes < 3) {
177 checkUnnamed1587(o.additionalImageLink); 178 checkUnnamed1604(o.additionalImageLink);
178 unittest.expect(o.ageGroup, unittest.equals('foo')); 179 unittest.expect(o.ageGroup, unittest.equals('foo'));
179 unittest.expect(o.brand, unittest.equals('foo')); 180 unittest.expect(o.brand, unittest.equals('foo'));
180 checkCapacity(o.capacity); 181 checkCapacity(o.capacity);
181 unittest.expect(o.color, unittest.equals('foo')); 182 unittest.expect(o.color, unittest.equals('foo'));
182 checkCount(o.count); 183 checkCount(o.count);
183 unittest.expect(o.description, unittest.equals('foo')); 184 unittest.expect(o.description, unittest.equals('foo'));
184 unittest.expect(o.disclosureDate, unittest.equals('foo')); 185 unittest.expect(o.disclosureDate, unittest.equals('foo'));
185 checkUnnamed1588(o.featureDescription); 186 checkUnnamed1605(o.featureDescription);
186 unittest.expect(o.flavor, unittest.equals('foo')); 187 unittest.expect(o.flavor, unittest.equals('foo'));
187 unittest.expect(o.format, unittest.equals('foo')); 188 unittest.expect(o.format, unittest.equals('foo'));
188 unittest.expect(o.gender, unittest.equals('foo')); 189 unittest.expect(o.gender, unittest.equals('foo'));
189 checkUnnamed1589(o.gtin); 190 checkUnnamed1606(o.gtin);
190 checkImage(o.imageLink); 191 checkImage(o.imageLink);
191 unittest.expect(o.itemGroupId, unittest.equals('foo')); 192 unittest.expect(o.itemGroupId, unittest.equals('foo'));
192 unittest.expect(o.material, unittest.equals('foo')); 193 unittest.expect(o.material, unittest.equals('foo'));
193 unittest.expect(o.mpn, unittest.equals('foo')); 194 unittest.expect(o.mpn, unittest.equals('foo'));
194 unittest.expect(o.pattern, unittest.equals('foo')); 195 unittest.expect(o.pattern, unittest.equals('foo'));
195 checkUnnamed1590(o.productDetail); 196 checkUnnamed1607(o.productDetail);
196 unittest.expect(o.productLine, unittest.equals('foo')); 197 unittest.expect(o.productLine, unittest.equals('foo'));
197 unittest.expect(o.productName, unittest.equals('foo')); 198 unittest.expect(o.productName, unittest.equals('foo'));
198 unittest.expect(o.productPageUrl, unittest.equals('foo')); 199 unittest.expect(o.productPageUrl, unittest.equals('foo'));
199 checkUnnamed1591(o.productType); 200 checkUnnamed1608(o.productType);
200 unittest.expect(o.releaseDate, unittest.equals('foo')); 201 unittest.expect(o.releaseDate, unittest.equals('foo'));
201 unittest.expect(o.scent, unittest.equals('foo')); 202 unittest.expect(o.scent, unittest.equals('foo'));
202 unittest.expect(o.size, unittest.equals('foo')); 203 unittest.expect(o.size, unittest.equals('foo'));
203 unittest.expect(o.sizeSystem, unittest.equals('foo')); 204 unittest.expect(o.sizeSystem, unittest.equals('foo'));
204 unittest.expect(o.sizeType, unittest.equals('foo')); 205 unittest.expect(o.sizeType, unittest.equals('foo'));
205 checkPrice(o.suggestedRetailPrice); 206 checkPrice(o.suggestedRetailPrice);
207 unittest.expect(o.targetAccountId, unittest.equals('foo'));
206 unittest.expect(o.theme, unittest.equals('foo')); 208 unittest.expect(o.theme, unittest.equals('foo'));
207 unittest.expect(o.title, unittest.equals('foo')); 209 unittest.expect(o.title, unittest.equals('foo'));
208 checkUnnamed1592(o.videoLink); 210 checkUnnamed1609(o.videoLink);
209 } 211 }
210 buildCounterAttributes--; 212 buildCounterAttributes--;
211 } 213 }
212 214
213 core.int buildCounterCapacity = 0; 215 core.int buildCounterCapacity = 0;
214 buildCapacity() { 216 buildCapacity() {
215 var o = new api.Capacity(); 217 var o = new api.Capacity();
216 buildCounterCapacity++; 218 buildCounterCapacity++;
217 if (buildCounterCapacity < 3) { 219 if (buildCounterCapacity < 3) {
218 o.unit = "foo"; 220 o.unit = "foo";
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (buildCounterIssue < 3) { 337 if (buildCounterIssue < 3) {
336 unittest.expect(o.attribute, unittest.equals('foo')); 338 unittest.expect(o.attribute, unittest.equals('foo'));
337 unittest.expect(o.description, unittest.equals('foo')); 339 unittest.expect(o.description, unittest.equals('foo'));
338 unittest.expect(o.severity, unittest.equals('foo')); 340 unittest.expect(o.severity, unittest.equals('foo'));
339 unittest.expect(o.timestamp, unittest.equals('foo')); 341 unittest.expect(o.timestamp, unittest.equals('foo'));
340 unittest.expect(o.type, unittest.equals('foo')); 342 unittest.expect(o.type, unittest.equals('foo'));
341 } 343 }
342 buildCounterIssue--; 344 buildCounterIssue--;
343 } 345 }
344 346
345 buildUnnamed1593() { 347 buildUnnamed1610() {
346 var o = new core.List<api.Product>(); 348 var o = new core.List<api.Product>();
347 o.add(buildProduct()); 349 o.add(buildProduct());
348 o.add(buildProduct()); 350 o.add(buildProduct());
349 return o; 351 return o;
350 } 352 }
351 353
352 checkUnnamed1593(core.List<api.Product> o) { 354 checkUnnamed1610(core.List<api.Product> o) {
353 unittest.expect(o, unittest.hasLength(2)); 355 unittest.expect(o, unittest.hasLength(2));
354 checkProduct(o[0]); 356 checkProduct(o[0]);
355 checkProduct(o[1]); 357 checkProduct(o[1]);
356 } 358 }
357 359
358 core.int buildCounterListProductsResponse = 0; 360 core.int buildCounterListProductsResponse = 0;
359 buildListProductsResponse() { 361 buildListProductsResponse() {
360 var o = new api.ListProductsResponse(); 362 var o = new api.ListProductsResponse();
361 buildCounterListProductsResponse++; 363 buildCounterListProductsResponse++;
362 if (buildCounterListProductsResponse < 3) { 364 if (buildCounterListProductsResponse < 3) {
363 o.nextPageToken = "foo"; 365 o.nextPageToken = "foo";
364 o.products = buildUnnamed1593(); 366 o.products = buildUnnamed1610();
365 } 367 }
366 buildCounterListProductsResponse--; 368 buildCounterListProductsResponse--;
367 return o; 369 return o;
368 } 370 }
369 371
370 checkListProductsResponse(api.ListProductsResponse o) { 372 checkListProductsResponse(api.ListProductsResponse o) {
371 buildCounterListProductsResponse++; 373 buildCounterListProductsResponse++;
372 if (buildCounterListProductsResponse < 3) { 374 if (buildCounterListProductsResponse < 3) {
373 unittest.expect(o.nextPageToken, unittest.equals('foo')); 375 unittest.expect(o.nextPageToken, unittest.equals('foo'));
374 checkUnnamed1593(o.products); 376 checkUnnamed1610(o.products);
375 } 377 }
376 buildCounterListProductsResponse--; 378 buildCounterListProductsResponse--;
377 } 379 }
378 380
379 core.int buildCounterPrice = 0; 381 core.int buildCounterPrice = 0;
380 buildPrice() { 382 buildPrice() {
381 var o = new api.Price(); 383 var o = new api.Price();
382 buildCounterPrice++; 384 buildCounterPrice++;
383 if (buildCounterPrice < 3) { 385 if (buildCounterPrice < 3) {
384 o.amount = "foo"; 386 o.amount = "foo";
385 o.currency = "foo"; 387 o.currency = "foo";
386 } 388 }
387 buildCounterPrice--; 389 buildCounterPrice--;
388 return o; 390 return o;
389 } 391 }
390 392
391 checkPrice(api.Price o) { 393 checkPrice(api.Price o) {
392 buildCounterPrice++; 394 buildCounterPrice++;
393 if (buildCounterPrice < 3) { 395 if (buildCounterPrice < 3) {
394 unittest.expect(o.amount, unittest.equals('foo')); 396 unittest.expect(o.amount, unittest.equals('foo'));
395 unittest.expect(o.currency, unittest.equals('foo')); 397 unittest.expect(o.currency, unittest.equals('foo'));
396 } 398 }
397 buildCounterPrice--; 399 buildCounterPrice--;
398 } 400 }
399 401
400 buildUnnamed1594() { 402 buildUnnamed1611() {
401 var o = new core.List<api.Issue>(); 403 var o = new core.List<api.Issue>();
402 o.add(buildIssue()); 404 o.add(buildIssue());
403 o.add(buildIssue()); 405 o.add(buildIssue());
404 return o; 406 return o;
405 } 407 }
406 408
407 checkUnnamed1594(core.List<api.Issue> o) { 409 checkUnnamed1611(core.List<api.Issue> o) {
408 unittest.expect(o, unittest.hasLength(2)); 410 unittest.expect(o, unittest.hasLength(2));
409 checkIssue(o[0]); 411 checkIssue(o[0]);
410 checkIssue(o[1]); 412 checkIssue(o[1]);
411 } 413 }
412 414
413 buildUnnamed1595() { 415 buildUnnamed1612() {
414 var o = new core.List<core.String>(); 416 var o = new core.List<core.String>();
415 o.add("foo"); 417 o.add("foo");
416 o.add("foo"); 418 o.add("foo");
417 return o; 419 return o;
418 } 420 }
419 421
420 checkUnnamed1595(core.List<core.String> o) { 422 checkUnnamed1612(core.List<core.String> o) {
421 unittest.expect(o, unittest.hasLength(2)); 423 unittest.expect(o, unittest.hasLength(2));
422 unittest.expect(o[0], unittest.equals('foo')); 424 unittest.expect(o[0], unittest.equals('foo'));
423 unittest.expect(o[1], unittest.equals('foo')); 425 unittest.expect(o[1], unittest.equals('foo'));
424 } 426 }
425 427
426 core.int buildCounterProduct = 0; 428 core.int buildCounterProduct = 0;
427 buildProduct() { 429 buildProduct() {
428 var o = new api.Product(); 430 var o = new api.Product();
429 buildCounterProduct++; 431 buildCounterProduct++;
430 if (buildCounterProduct < 3) { 432 if (buildCounterProduct < 3) {
431 o.contentLanguage = "foo"; 433 o.contentLanguage = "foo";
432 o.finalAttributes = buildAttributes(); 434 o.finalAttributes = buildAttributes();
433 o.issues = buildUnnamed1594(); 435 o.issues = buildUnnamed1611();
434 o.manuallyDeletedAttributes = buildUnnamed1595(); 436 o.manuallyDeletedAttributes = buildUnnamed1612();
435 o.manuallyProvidedAttributes = buildAttributes(); 437 o.manuallyProvidedAttributes = buildAttributes();
436 o.name = "foo"; 438 o.name = "foo";
437 o.parent = "foo"; 439 o.parent = "foo";
438 o.productId = "foo"; 440 o.productId = "foo";
439 o.targetCountry = "foo"; 441 o.targetCountry = "foo";
440 o.uploadedAttributes = buildAttributes(); 442 o.uploadedAttributes = buildAttributes();
441 } 443 }
442 buildCounterProduct--; 444 buildCounterProduct--;
443 return o; 445 return o;
444 } 446 }
445 447
446 checkProduct(api.Product o) { 448 checkProduct(api.Product o) {
447 buildCounterProduct++; 449 buildCounterProduct++;
448 if (buildCounterProduct < 3) { 450 if (buildCounterProduct < 3) {
449 unittest.expect(o.contentLanguage, unittest.equals('foo')); 451 unittest.expect(o.contentLanguage, unittest.equals('foo'));
450 checkAttributes(o.finalAttributes); 452 checkAttributes(o.finalAttributes);
451 checkUnnamed1594(o.issues); 453 checkUnnamed1611(o.issues);
452 checkUnnamed1595(o.manuallyDeletedAttributes); 454 checkUnnamed1612(o.manuallyDeletedAttributes);
453 checkAttributes(o.manuallyProvidedAttributes); 455 checkAttributes(o.manuallyProvidedAttributes);
454 unittest.expect(o.name, unittest.equals('foo')); 456 unittest.expect(o.name, unittest.equals('foo'));
455 unittest.expect(o.parent, unittest.equals('foo')); 457 unittest.expect(o.parent, unittest.equals('foo'));
456 unittest.expect(o.productId, unittest.equals('foo')); 458 unittest.expect(o.productId, unittest.equals('foo'));
457 unittest.expect(o.targetCountry, unittest.equals('foo')); 459 unittest.expect(o.targetCountry, unittest.equals('foo'));
458 checkAttributes(o.uploadedAttributes); 460 checkAttributes(o.uploadedAttributes);
459 } 461 }
460 buildCounterProduct--; 462 buildCounterProduct--;
461 } 463 }
462 464
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 res.get(arg_parent, arg_name).then(unittest.expectAsync1(((api.Product res ponse) { 677 res.get(arg_parent, arg_name).then(unittest.expectAsync1(((api.Product res ponse) {
676 checkProduct(response); 678 checkProduct(response);
677 }))); 679 })));
678 }); 680 });
679 681
680 unittest.test("method--list", () { 682 unittest.test("method--list", () {
681 683
682 var mock = new HttpServerMock(); 684 var mock = new HttpServerMock();
683 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products; 685 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products;
684 var arg_parent = "foo"; 686 var arg_parent = "foo";
687 var arg_pageToken = "foo";
685 var arg_pageSize = 42; 688 var arg_pageSize = 42;
686 var arg_pageToken = "foo";
687 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 689 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
688 var path = (req.url).path; 690 var path = (req.url).path;
689 var pathOffset = 0; 691 var pathOffset = 0;
690 var index; 692 var index;
691 var subPart; 693 var subPart;
692 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 694 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
693 pathOffset += 1; 695 pathOffset += 1;
694 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 696 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
695 pathOffset += 3; 697 pathOffset += 3;
696 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 698 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
697 699
698 var query = (req.url).query; 700 var query = (req.url).query;
699 var queryOffset = 0; 701 var queryOffset = 0;
700 var queryMap = {}; 702 var queryMap = {};
701 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 703 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
702 parseBool(n) { 704 parseBool(n) {
703 if (n == "true") return true; 705 if (n == "true") return true;
704 if (n == "false") return false; 706 if (n == "false") return false;
705 if (n == null) return null; 707 if (n == null) return null;
706 throw new core.ArgumentError("Invalid boolean: $n"); 708 throw new core.ArgumentError("Invalid boolean: $n");
707 } 709 }
708 if (query.length > 0) { 710 if (query.length > 0) {
709 for (var part in query.split("&")) { 711 for (var part in query.split("&")) {
710 var keyvalue = part.split("="); 712 var keyvalue = part.split("=");
711 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 713 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
712 } 714 }
713 } 715 }
716 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
714 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 717 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
715 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
716 718
717 719
718 var h = { 720 var h = {
719 "content-type" : "application/json; charset=utf-8", 721 "content-type" : "application/json; charset=utf-8",
720 }; 722 };
721 var resp = convert.JSON.encode(buildListProductsResponse()); 723 var resp = convert.JSON.encode(buildListProductsResponse());
722 return new async.Future.value(stringResponse(200, h, resp)); 724 return new async.Future.value(stringResponse(200, h, resp));
723 }), true); 725 }), true);
724 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync1(((api.ListProductsResponse response) { 726 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the n(unittest.expectAsync1(((api.ListProductsResponse response) {
725 checkListProductsResponse(response); 727 checkListProductsResponse(response);
726 }))); 728 })));
727 }); 729 });
728 730
729 unittest.test("method--update", () { 731 unittest.test("method--update", () {
730 732
731 var mock = new HttpServerMock(); 733 var mock = new HttpServerMock();
732 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products; 734 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products;
733 var arg_request = buildProduct(); 735 var arg_request = buildProduct();
734 var arg_parent = "foo"; 736 var arg_parent = "foo";
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1(( (api.Product response) { 776 res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1(( (api.Product response) {
775 checkProduct(response); 777 checkProduct(response);
776 }))); 778 })));
777 }); 779 });
778 780
779 }); 781 });
780 782
781 783
782 } 784 }
783 785
OLDNEW
« no previous file with comments | « generated/googleapis/test/logging/v2_test.dart ('k') | generated/googleapis/test/mirror/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698