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

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

Issue 2936613002: Api-Roll 50: 2017-06-12 (Closed)
Patch Set: Created 3 years, 6 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:unittest/unittest.dart' as unittest; 10 import 'package:test/test.dart' as unittest;
11 11
12 import 'package:googleapis/manufacturers/v1.dart' as api; 12 import 'package:googleapis/manufacturers/v1.dart' as api;
13 13
14 class HttpServerMock extends http.BaseClient { 14 class HttpServerMock extends http.BaseClient {
15 core.Function _callback; 15 core.Function _callback;
16 core.bool _expectJson; 16 core.bool _expectJson;
17 17
18 void register(core.Function callback, core.bool expectJson) { 18 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback; 19 _callback = callback;
20 _expectJson = expectJson; 20 _expectJson = expectJson;
(...skipping 18 matching lines...) Expand all
39 } else { 39 } else {
40 return stream.toBytes().then((data) { 40 return stream.toBytes().then((data) {
41 return _callback(request, data); 41 return _callback(request, data);
42 }); 42 });
43 } 43 }
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 http.StreamedResponse stringResponse( 48 http.StreamedResponse stringResponse(
49 core.int status, core.Map headers, core.String body) { 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 buildUnnamed1461() { 54 buildUnnamed1468() {
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 checkUnnamed1461(core.List<api.Image> o) { 61 checkUnnamed1468(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 buildUnnamed1462() { 67 buildUnnamed1469() {
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 checkUnnamed1462(core.List<api.FeatureDescription> o) { 74 checkUnnamed1469(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 buildUnnamed1463() { 80 buildUnnamed1470() {
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 checkUnnamed1463(core.List<core.String> o) { 87 checkUnnamed1470(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 buildUnnamed1464() { 93 buildUnnamed1471() {
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 checkUnnamed1464(core.List<api.ProductDetail> o) { 100 checkUnnamed1471(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 buildUnnamed1465() { 106 buildUnnamed1472() {
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 checkUnnamed1465(core.List<core.String> o) { 113 checkUnnamed1472(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 buildUnnamed1466() { 119 buildUnnamed1473() {
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 checkUnnamed1466(core.List<core.String> o) { 126 checkUnnamed1473(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 = buildUnnamed1461(); 137 o.additionalImageLink = buildUnnamed1468();
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 = buildUnnamed1462(); 145 o.featureDescription = buildUnnamed1469();
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 = buildUnnamed1463(); 149 o.gtin = buildUnnamed1470();
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 = buildUnnamed1464(); 155 o.productDetail = buildUnnamed1471();
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 = buildUnnamed1465(); 159 o.productType = buildUnnamed1472();
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.theme = "foo"; 166 o.theme = "foo";
167 o.title = "foo"; 167 o.title = "foo";
168 o.videoLink = buildUnnamed1466(); 168 o.videoLink = buildUnnamed1473();
169 } 169 }
170 buildCounterAttributes--; 170 buildCounterAttributes--;
171 return o; 171 return o;
172 } 172 }
173 173
174 checkAttributes(api.Attributes o) { 174 checkAttributes(api.Attributes o) {
175 buildCounterAttributes++; 175 buildCounterAttributes++;
176 if (buildCounterAttributes < 3) { 176 if (buildCounterAttributes < 3) {
177 checkUnnamed1461(o.additionalImageLink); 177 checkUnnamed1468(o.additionalImageLink);
178 unittest.expect(o.ageGroup, unittest.equals('foo')); 178 unittest.expect(o.ageGroup, unittest.equals('foo'));
179 unittest.expect(o.brand, unittest.equals('foo')); 179 unittest.expect(o.brand, unittest.equals('foo'));
180 checkCapacity(o.capacity); 180 checkCapacity(o.capacity);
181 unittest.expect(o.color, unittest.equals('foo')); 181 unittest.expect(o.color, unittest.equals('foo'));
182 checkCount(o.count); 182 checkCount(o.count);
183 unittest.expect(o.description, unittest.equals('foo')); 183 unittest.expect(o.description, unittest.equals('foo'));
184 unittest.expect(o.disclosureDate, unittest.equals('foo')); 184 unittest.expect(o.disclosureDate, unittest.equals('foo'));
185 checkUnnamed1462(o.featureDescription); 185 checkUnnamed1469(o.featureDescription);
186 unittest.expect(o.flavor, unittest.equals('foo')); 186 unittest.expect(o.flavor, unittest.equals('foo'));
187 unittest.expect(o.format, unittest.equals('foo')); 187 unittest.expect(o.format, unittest.equals('foo'));
188 unittest.expect(o.gender, unittest.equals('foo')); 188 unittest.expect(o.gender, unittest.equals('foo'));
189 checkUnnamed1463(o.gtin); 189 checkUnnamed1470(o.gtin);
190 checkImage(o.imageLink); 190 checkImage(o.imageLink);
191 unittest.expect(o.itemGroupId, unittest.equals('foo')); 191 unittest.expect(o.itemGroupId, unittest.equals('foo'));
192 unittest.expect(o.material, unittest.equals('foo')); 192 unittest.expect(o.material, unittest.equals('foo'));
193 unittest.expect(o.mpn, unittest.equals('foo')); 193 unittest.expect(o.mpn, unittest.equals('foo'));
194 unittest.expect(o.pattern, unittest.equals('foo')); 194 unittest.expect(o.pattern, unittest.equals('foo'));
195 checkUnnamed1464(o.productDetail); 195 checkUnnamed1471(o.productDetail);
196 unittest.expect(o.productLine, unittest.equals('foo')); 196 unittest.expect(o.productLine, unittest.equals('foo'));
197 unittest.expect(o.productName, unittest.equals('foo')); 197 unittest.expect(o.productName, unittest.equals('foo'));
198 unittest.expect(o.productPageUrl, unittest.equals('foo')); 198 unittest.expect(o.productPageUrl, unittest.equals('foo'));
199 checkUnnamed1465(o.productType); 199 checkUnnamed1472(o.productType);
200 unittest.expect(o.releaseDate, unittest.equals('foo')); 200 unittest.expect(o.releaseDate, unittest.equals('foo'));
201 unittest.expect(o.scent, unittest.equals('foo')); 201 unittest.expect(o.scent, unittest.equals('foo'));
202 unittest.expect(o.size, unittest.equals('foo')); 202 unittest.expect(o.size, unittest.equals('foo'));
203 unittest.expect(o.sizeSystem, unittest.equals('foo')); 203 unittest.expect(o.sizeSystem, unittest.equals('foo'));
204 unittest.expect(o.sizeType, unittest.equals('foo')); 204 unittest.expect(o.sizeType, unittest.equals('foo'));
205 checkPrice(o.suggestedRetailPrice); 205 checkPrice(o.suggestedRetailPrice);
206 unittest.expect(o.theme, unittest.equals('foo')); 206 unittest.expect(o.theme, unittest.equals('foo'));
207 unittest.expect(o.title, unittest.equals('foo')); 207 unittest.expect(o.title, unittest.equals('foo'));
208 checkUnnamed1466(o.videoLink); 208 checkUnnamed1473(o.videoLink);
209 } 209 }
210 buildCounterAttributes--; 210 buildCounterAttributes--;
211 } 211 }
212 212
213 core.int buildCounterCapacity = 0; 213 core.int buildCounterCapacity = 0;
214 buildCapacity() { 214 buildCapacity() {
215 var o = new api.Capacity(); 215 var o = new api.Capacity();
216 buildCounterCapacity++; 216 buildCounterCapacity++;
217 if (buildCounterCapacity < 3) { 217 if (buildCounterCapacity < 3) {
218 o.unit = "foo"; 218 o.unit = "foo";
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (buildCounterIssue < 3) { 318 if (buildCounterIssue < 3) {
319 unittest.expect(o.attribute, unittest.equals('foo')); 319 unittest.expect(o.attribute, unittest.equals('foo'));
320 unittest.expect(o.description, unittest.equals('foo')); 320 unittest.expect(o.description, unittest.equals('foo'));
321 unittest.expect(o.severity, unittest.equals('foo')); 321 unittest.expect(o.severity, unittest.equals('foo'));
322 unittest.expect(o.timestamp, unittest.equals('foo')); 322 unittest.expect(o.timestamp, unittest.equals('foo'));
323 unittest.expect(o.type, unittest.equals('foo')); 323 unittest.expect(o.type, unittest.equals('foo'));
324 } 324 }
325 buildCounterIssue--; 325 buildCounterIssue--;
326 } 326 }
327 327
328 buildUnnamed1467() { 328 buildUnnamed1474() {
329 var o = new core.List<api.Product>(); 329 var o = new core.List<api.Product>();
330 o.add(buildProduct()); 330 o.add(buildProduct());
331 o.add(buildProduct()); 331 o.add(buildProduct());
332 return o; 332 return o;
333 } 333 }
334 334
335 checkUnnamed1467(core.List<api.Product> o) { 335 checkUnnamed1474(core.List<api.Product> o) {
336 unittest.expect(o, unittest.hasLength(2)); 336 unittest.expect(o, unittest.hasLength(2));
337 checkProduct(o[0]); 337 checkProduct(o[0]);
338 checkProduct(o[1]); 338 checkProduct(o[1]);
339 } 339 }
340 340
341 core.int buildCounterListProductsResponse = 0; 341 core.int buildCounterListProductsResponse = 0;
342 buildListProductsResponse() { 342 buildListProductsResponse() {
343 var o = new api.ListProductsResponse(); 343 var o = new api.ListProductsResponse();
344 buildCounterListProductsResponse++; 344 buildCounterListProductsResponse++;
345 if (buildCounterListProductsResponse < 3) { 345 if (buildCounterListProductsResponse < 3) {
346 o.nextPageToken = "foo"; 346 o.nextPageToken = "foo";
347 o.products = buildUnnamed1467(); 347 o.products = buildUnnamed1474();
348 } 348 }
349 buildCounterListProductsResponse--; 349 buildCounterListProductsResponse--;
350 return o; 350 return o;
351 } 351 }
352 352
353 checkListProductsResponse(api.ListProductsResponse o) { 353 checkListProductsResponse(api.ListProductsResponse o) {
354 buildCounterListProductsResponse++; 354 buildCounterListProductsResponse++;
355 if (buildCounterListProductsResponse < 3) { 355 if (buildCounterListProductsResponse < 3) {
356 unittest.expect(o.nextPageToken, unittest.equals('foo')); 356 unittest.expect(o.nextPageToken, unittest.equals('foo'));
357 checkUnnamed1467(o.products); 357 checkUnnamed1474(o.products);
358 } 358 }
359 buildCounterListProductsResponse--; 359 buildCounterListProductsResponse--;
360 } 360 }
361 361
362 core.int buildCounterPrice = 0; 362 core.int buildCounterPrice = 0;
363 buildPrice() { 363 buildPrice() {
364 var o = new api.Price(); 364 var o = new api.Price();
365 buildCounterPrice++; 365 buildCounterPrice++;
366 if (buildCounterPrice < 3) { 366 if (buildCounterPrice < 3) {
367 o.amount = "foo"; 367 o.amount = "foo";
368 o.currency = "foo"; 368 o.currency = "foo";
369 } 369 }
370 buildCounterPrice--; 370 buildCounterPrice--;
371 return o; 371 return o;
372 } 372 }
373 373
374 checkPrice(api.Price o) { 374 checkPrice(api.Price o) {
375 buildCounterPrice++; 375 buildCounterPrice++;
376 if (buildCounterPrice < 3) { 376 if (buildCounterPrice < 3) {
377 unittest.expect(o.amount, unittest.equals('foo')); 377 unittest.expect(o.amount, unittest.equals('foo'));
378 unittest.expect(o.currency, unittest.equals('foo')); 378 unittest.expect(o.currency, unittest.equals('foo'));
379 } 379 }
380 buildCounterPrice--; 380 buildCounterPrice--;
381 } 381 }
382 382
383 buildUnnamed1468() { 383 buildUnnamed1475() {
384 var o = new core.List<api.Issue>(); 384 var o = new core.List<api.Issue>();
385 o.add(buildIssue()); 385 o.add(buildIssue());
386 o.add(buildIssue()); 386 o.add(buildIssue());
387 return o; 387 return o;
388 } 388 }
389 389
390 checkUnnamed1468(core.List<api.Issue> o) { 390 checkUnnamed1475(core.List<api.Issue> o) {
391 unittest.expect(o, unittest.hasLength(2)); 391 unittest.expect(o, unittest.hasLength(2));
392 checkIssue(o[0]); 392 checkIssue(o[0]);
393 checkIssue(o[1]); 393 checkIssue(o[1]);
394 } 394 }
395 395
396 buildUnnamed1469() { 396 buildUnnamed1476() {
397 var o = new core.List<core.String>(); 397 var o = new core.List<core.String>();
398 o.add("foo"); 398 o.add("foo");
399 o.add("foo"); 399 o.add("foo");
400 return o; 400 return o;
401 } 401 }
402 402
403 checkUnnamed1469(core.List<core.String> o) { 403 checkUnnamed1476(core.List<core.String> o) {
404 unittest.expect(o, unittest.hasLength(2)); 404 unittest.expect(o, unittest.hasLength(2));
405 unittest.expect(o[0], unittest.equals('foo')); 405 unittest.expect(o[0], unittest.equals('foo'));
406 unittest.expect(o[1], unittest.equals('foo')); 406 unittest.expect(o[1], unittest.equals('foo'));
407 } 407 }
408 408
409 core.int buildCounterProduct = 0; 409 core.int buildCounterProduct = 0;
410 buildProduct() { 410 buildProduct() {
411 var o = new api.Product(); 411 var o = new api.Product();
412 buildCounterProduct++; 412 buildCounterProduct++;
413 if (buildCounterProduct < 3) { 413 if (buildCounterProduct < 3) {
414 o.contentLanguage = "foo"; 414 o.contentLanguage = "foo";
415 o.finalAttributes = buildAttributes(); 415 o.finalAttributes = buildAttributes();
416 o.issues = buildUnnamed1468(); 416 o.issues = buildUnnamed1475();
417 o.manuallyDeletedAttributes = buildUnnamed1469(); 417 o.manuallyDeletedAttributes = buildUnnamed1476();
418 o.manuallyProvidedAttributes = buildAttributes(); 418 o.manuallyProvidedAttributes = buildAttributes();
419 o.name = "foo"; 419 o.name = "foo";
420 o.parent = "foo"; 420 o.parent = "foo";
421 o.productId = "foo"; 421 o.productId = "foo";
422 o.targetCountry = "foo"; 422 o.targetCountry = "foo";
423 o.uploadedAttributes = buildAttributes(); 423 o.uploadedAttributes = buildAttributes();
424 } 424 }
425 buildCounterProduct--; 425 buildCounterProduct--;
426 return o; 426 return o;
427 } 427 }
428 428
429 checkProduct(api.Product o) { 429 checkProduct(api.Product o) {
430 buildCounterProduct++; 430 buildCounterProduct++;
431 if (buildCounterProduct < 3) { 431 if (buildCounterProduct < 3) {
432 unittest.expect(o.contentLanguage, unittest.equals('foo')); 432 unittest.expect(o.contentLanguage, unittest.equals('foo'));
433 checkAttributes(o.finalAttributes); 433 checkAttributes(o.finalAttributes);
434 checkUnnamed1468(o.issues); 434 checkUnnamed1475(o.issues);
435 checkUnnamed1469(o.manuallyDeletedAttributes); 435 checkUnnamed1476(o.manuallyDeletedAttributes);
436 checkAttributes(o.manuallyProvidedAttributes); 436 checkAttributes(o.manuallyProvidedAttributes);
437 unittest.expect(o.name, unittest.equals('foo')); 437 unittest.expect(o.name, unittest.equals('foo'));
438 unittest.expect(o.parent, unittest.equals('foo')); 438 unittest.expect(o.parent, unittest.equals('foo'));
439 unittest.expect(o.productId, unittest.equals('foo')); 439 unittest.expect(o.productId, unittest.equals('foo'));
440 unittest.expect(o.targetCountry, unittest.equals('foo')); 440 unittest.expect(o.targetCountry, unittest.equals('foo'));
441 checkAttributes(o.uploadedAttributes); 441 checkAttributes(o.uploadedAttributes);
442 } 442 }
443 buildCounterProduct--; 443 buildCounterProduct--;
444 } 444 }
445 445
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 }); 558 });
559 559
560 560
561 unittest.group("resource-AccountsProductsResourceApi", () { 561 unittest.group("resource-AccountsProductsResourceApi", () {
562 unittest.test("method--get", () { 562 unittest.test("method--get", () {
563 563
564 var mock = new HttpServerMock(); 564 var mock = new HttpServerMock();
565 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products; 565 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products;
566 var arg_parent = "foo"; 566 var arg_parent = "foo";
567 var arg_name = "foo"; 567 var arg_name = "foo";
568 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 568 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
569 var path = (req.url).path; 569 var path = (req.url).path;
570 var pathOffset = 0; 570 var pathOffset = 0;
571 var index; 571 var index;
572 var subPart; 572 var subPart;
573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
574 pathOffset += 1; 574 pathOffset += 1;
575 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 575 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
576 pathOffset += 3; 576 pathOffset += 3;
577 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 577 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
578 578
(...skipping 14 matching lines...) Expand all
593 } 593 }
594 } 594 }
595 595
596 596
597 var h = { 597 var h = {
598 "content-type" : "application/json; charset=utf-8", 598 "content-type" : "application/json; charset=utf-8",
599 }; 599 };
600 var resp = convert.JSON.encode(buildProduct()); 600 var resp = convert.JSON.encode(buildProduct());
601 return new async.Future.value(stringResponse(200, h, resp)); 601 return new async.Future.value(stringResponse(200, h, resp));
602 }), true); 602 }), true);
603 res.get(arg_parent, arg_name).then(unittest.expectAsync(((api.Product resp onse) { 603 res.get(arg_parent, arg_name).then(unittest.expectAsync1(((api.Product res ponse) {
604 checkProduct(response); 604 checkProduct(response);
605 }))); 605 })));
606 }); 606 });
607 607
608 unittest.test("method--list", () { 608 unittest.test("method--list", () {
609 609
610 var mock = new HttpServerMock(); 610 var mock = new HttpServerMock();
611 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products; 611 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou nts.products;
612 var arg_parent = "foo"; 612 var arg_parent = "foo";
613 var arg_pageToken = "foo"; 613 var arg_pageToken = "foo";
614 var arg_pageSize = 42; 614 var arg_pageSize = 42;
615 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 615 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
616 var path = (req.url).path; 616 var path = (req.url).path;
617 var pathOffset = 0; 617 var pathOffset = 0;
618 var index; 618 var index;
619 var subPart; 619 var subPart;
620 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 620 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
621 pathOffset += 1; 621 pathOffset += 1;
622 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 622 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
623 pathOffset += 3; 623 pathOffset += 3;
624 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 624 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
625 625
(...skipping 16 matching lines...) Expand all
642 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 642 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
643 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 643 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
644 644
645 645
646 var h = { 646 var h = {
647 "content-type" : "application/json; charset=utf-8", 647 "content-type" : "application/json; charset=utf-8",
648 }; 648 };
649 var resp = convert.JSON.encode(buildListProductsResponse()); 649 var resp = convert.JSON.encode(buildListProductsResponse());
650 return new async.Future.value(stringResponse(200, h, resp)); 650 return new async.Future.value(stringResponse(200, h, resp));
651 }), true); 651 }), true);
652 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the n(unittest.expectAsync(((api.ListProductsResponse response) { 652 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the n(unittest.expectAsync1(((api.ListProductsResponse response) {
653 checkListProductsResponse(response); 653 checkListProductsResponse(response);
654 }))); 654 })));
655 }); 655 });
656 656
657 }); 657 });
658 658
659 659
660 } 660 }
661 661
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