| OLD | NEW |
| 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 Loading... |
| 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 buildUnnamed1560() { | 54 buildUnnamed1587() { |
| 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 checkUnnamed1560(core.List<api.Image> o) { | 61 checkUnnamed1587(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 buildUnnamed1561() { | 67 buildUnnamed1588() { |
| 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 checkUnnamed1561(core.List<api.FeatureDescription> o) { | 74 checkUnnamed1588(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 buildUnnamed1562() { | 80 buildUnnamed1589() { |
| 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 checkUnnamed1562(core.List<core.String> o) { | 87 checkUnnamed1589(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 buildUnnamed1563() { | 93 buildUnnamed1590() { |
| 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 checkUnnamed1563(core.List<api.ProductDetail> o) { | 100 checkUnnamed1590(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 buildUnnamed1564() { | 106 buildUnnamed1591() { |
| 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 checkUnnamed1564(core.List<core.String> o) { | 113 checkUnnamed1591(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 buildUnnamed1565() { | 119 buildUnnamed1592() { |
| 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 checkUnnamed1565(core.List<core.String> o) { | 126 checkUnnamed1592(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 = buildUnnamed1560(); | 137 o.additionalImageLink = buildUnnamed1587(); |
| 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 = buildUnnamed1561(); | 145 o.featureDescription = buildUnnamed1588(); |
| 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 = buildUnnamed1562(); | 149 o.gtin = buildUnnamed1589(); |
| 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 = buildUnnamed1563(); | 155 o.productDetail = buildUnnamed1590(); |
| 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 = buildUnnamed1564(); | 159 o.productType = buildUnnamed1591(); |
| 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 = buildUnnamed1565(); | 168 o.videoLink = buildUnnamed1592(); |
| 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 checkUnnamed1560(o.additionalImageLink); | 177 checkUnnamed1587(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 checkUnnamed1561(o.featureDescription); | 185 checkUnnamed1588(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 checkUnnamed1562(o.gtin); | 189 checkUnnamed1589(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 checkUnnamed1563(o.productDetail); | 195 checkUnnamed1590(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 checkUnnamed1564(o.productType); | 199 checkUnnamed1591(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 checkUnnamed1565(o.videoLink); | 208 checkUnnamed1592(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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (buildCounterIssue < 3) { | 335 if (buildCounterIssue < 3) { |
| 336 unittest.expect(o.attribute, unittest.equals('foo')); | 336 unittest.expect(o.attribute, unittest.equals('foo')); |
| 337 unittest.expect(o.description, unittest.equals('foo')); | 337 unittest.expect(o.description, unittest.equals('foo')); |
| 338 unittest.expect(o.severity, unittest.equals('foo')); | 338 unittest.expect(o.severity, unittest.equals('foo')); |
| 339 unittest.expect(o.timestamp, unittest.equals('foo')); | 339 unittest.expect(o.timestamp, unittest.equals('foo')); |
| 340 unittest.expect(o.type, unittest.equals('foo')); | 340 unittest.expect(o.type, unittest.equals('foo')); |
| 341 } | 341 } |
| 342 buildCounterIssue--; | 342 buildCounterIssue--; |
| 343 } | 343 } |
| 344 | 344 |
| 345 buildUnnamed1566() { | 345 buildUnnamed1593() { |
| 346 var o = new core.List<api.Product>(); | 346 var o = new core.List<api.Product>(); |
| 347 o.add(buildProduct()); | 347 o.add(buildProduct()); |
| 348 o.add(buildProduct()); | 348 o.add(buildProduct()); |
| 349 return o; | 349 return o; |
| 350 } | 350 } |
| 351 | 351 |
| 352 checkUnnamed1566(core.List<api.Product> o) { | 352 checkUnnamed1593(core.List<api.Product> o) { |
| 353 unittest.expect(o, unittest.hasLength(2)); | 353 unittest.expect(o, unittest.hasLength(2)); |
| 354 checkProduct(o[0]); | 354 checkProduct(o[0]); |
| 355 checkProduct(o[1]); | 355 checkProduct(o[1]); |
| 356 } | 356 } |
| 357 | 357 |
| 358 core.int buildCounterListProductsResponse = 0; | 358 core.int buildCounterListProductsResponse = 0; |
| 359 buildListProductsResponse() { | 359 buildListProductsResponse() { |
| 360 var o = new api.ListProductsResponse(); | 360 var o = new api.ListProductsResponse(); |
| 361 buildCounterListProductsResponse++; | 361 buildCounterListProductsResponse++; |
| 362 if (buildCounterListProductsResponse < 3) { | 362 if (buildCounterListProductsResponse < 3) { |
| 363 o.nextPageToken = "foo"; | 363 o.nextPageToken = "foo"; |
| 364 o.products = buildUnnamed1566(); | 364 o.products = buildUnnamed1593(); |
| 365 } | 365 } |
| 366 buildCounterListProductsResponse--; | 366 buildCounterListProductsResponse--; |
| 367 return o; | 367 return o; |
| 368 } | 368 } |
| 369 | 369 |
| 370 checkListProductsResponse(api.ListProductsResponse o) { | 370 checkListProductsResponse(api.ListProductsResponse o) { |
| 371 buildCounterListProductsResponse++; | 371 buildCounterListProductsResponse++; |
| 372 if (buildCounterListProductsResponse < 3) { | 372 if (buildCounterListProductsResponse < 3) { |
| 373 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 373 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 374 checkUnnamed1566(o.products); | 374 checkUnnamed1593(o.products); |
| 375 } | 375 } |
| 376 buildCounterListProductsResponse--; | 376 buildCounterListProductsResponse--; |
| 377 } | 377 } |
| 378 | 378 |
| 379 core.int buildCounterPrice = 0; | 379 core.int buildCounterPrice = 0; |
| 380 buildPrice() { | 380 buildPrice() { |
| 381 var o = new api.Price(); | 381 var o = new api.Price(); |
| 382 buildCounterPrice++; | 382 buildCounterPrice++; |
| 383 if (buildCounterPrice < 3) { | 383 if (buildCounterPrice < 3) { |
| 384 o.amount = "foo"; | 384 o.amount = "foo"; |
| 385 o.currency = "foo"; | 385 o.currency = "foo"; |
| 386 } | 386 } |
| 387 buildCounterPrice--; | 387 buildCounterPrice--; |
| 388 return o; | 388 return o; |
| 389 } | 389 } |
| 390 | 390 |
| 391 checkPrice(api.Price o) { | 391 checkPrice(api.Price o) { |
| 392 buildCounterPrice++; | 392 buildCounterPrice++; |
| 393 if (buildCounterPrice < 3) { | 393 if (buildCounterPrice < 3) { |
| 394 unittest.expect(o.amount, unittest.equals('foo')); | 394 unittest.expect(o.amount, unittest.equals('foo')); |
| 395 unittest.expect(o.currency, unittest.equals('foo')); | 395 unittest.expect(o.currency, unittest.equals('foo')); |
| 396 } | 396 } |
| 397 buildCounterPrice--; | 397 buildCounterPrice--; |
| 398 } | 398 } |
| 399 | 399 |
| 400 buildUnnamed1567() { | 400 buildUnnamed1594() { |
| 401 var o = new core.List<api.Issue>(); | 401 var o = new core.List<api.Issue>(); |
| 402 o.add(buildIssue()); | 402 o.add(buildIssue()); |
| 403 o.add(buildIssue()); | 403 o.add(buildIssue()); |
| 404 return o; | 404 return o; |
| 405 } | 405 } |
| 406 | 406 |
| 407 checkUnnamed1567(core.List<api.Issue> o) { | 407 checkUnnamed1594(core.List<api.Issue> o) { |
| 408 unittest.expect(o, unittest.hasLength(2)); | 408 unittest.expect(o, unittest.hasLength(2)); |
| 409 checkIssue(o[0]); | 409 checkIssue(o[0]); |
| 410 checkIssue(o[1]); | 410 checkIssue(o[1]); |
| 411 } | 411 } |
| 412 | 412 |
| 413 buildUnnamed1568() { | 413 buildUnnamed1595() { |
| 414 var o = new core.List<core.String>(); | 414 var o = new core.List<core.String>(); |
| 415 o.add("foo"); | 415 o.add("foo"); |
| 416 o.add("foo"); | 416 o.add("foo"); |
| 417 return o; | 417 return o; |
| 418 } | 418 } |
| 419 | 419 |
| 420 checkUnnamed1568(core.List<core.String> o) { | 420 checkUnnamed1595(core.List<core.String> o) { |
| 421 unittest.expect(o, unittest.hasLength(2)); | 421 unittest.expect(o, unittest.hasLength(2)); |
| 422 unittest.expect(o[0], unittest.equals('foo')); | 422 unittest.expect(o[0], unittest.equals('foo')); |
| 423 unittest.expect(o[1], unittest.equals('foo')); | 423 unittest.expect(o[1], unittest.equals('foo')); |
| 424 } | 424 } |
| 425 | 425 |
| 426 core.int buildCounterProduct = 0; | 426 core.int buildCounterProduct = 0; |
| 427 buildProduct() { | 427 buildProduct() { |
| 428 var o = new api.Product(); | 428 var o = new api.Product(); |
| 429 buildCounterProduct++; | 429 buildCounterProduct++; |
| 430 if (buildCounterProduct < 3) { | 430 if (buildCounterProduct < 3) { |
| 431 o.contentLanguage = "foo"; | 431 o.contentLanguage = "foo"; |
| 432 o.finalAttributes = buildAttributes(); | 432 o.finalAttributes = buildAttributes(); |
| 433 o.issues = buildUnnamed1567(); | 433 o.issues = buildUnnamed1594(); |
| 434 o.manuallyDeletedAttributes = buildUnnamed1568(); | 434 o.manuallyDeletedAttributes = buildUnnamed1595(); |
| 435 o.manuallyProvidedAttributes = buildAttributes(); | 435 o.manuallyProvidedAttributes = buildAttributes(); |
| 436 o.name = "foo"; | 436 o.name = "foo"; |
| 437 o.parent = "foo"; | 437 o.parent = "foo"; |
| 438 o.productId = "foo"; | 438 o.productId = "foo"; |
| 439 o.targetCountry = "foo"; | 439 o.targetCountry = "foo"; |
| 440 o.uploadedAttributes = buildAttributes(); | 440 o.uploadedAttributes = buildAttributes(); |
| 441 } | 441 } |
| 442 buildCounterProduct--; | 442 buildCounterProduct--; |
| 443 return o; | 443 return o; |
| 444 } | 444 } |
| 445 | 445 |
| 446 checkProduct(api.Product o) { | 446 checkProduct(api.Product o) { |
| 447 buildCounterProduct++; | 447 buildCounterProduct++; |
| 448 if (buildCounterProduct < 3) { | 448 if (buildCounterProduct < 3) { |
| 449 unittest.expect(o.contentLanguage, unittest.equals('foo')); | 449 unittest.expect(o.contentLanguage, unittest.equals('foo')); |
| 450 checkAttributes(o.finalAttributes); | 450 checkAttributes(o.finalAttributes); |
| 451 checkUnnamed1567(o.issues); | 451 checkUnnamed1594(o.issues); |
| 452 checkUnnamed1568(o.manuallyDeletedAttributes); | 452 checkUnnamed1595(o.manuallyDeletedAttributes); |
| 453 checkAttributes(o.manuallyProvidedAttributes); | 453 checkAttributes(o.manuallyProvidedAttributes); |
| 454 unittest.expect(o.name, unittest.equals('foo')); | 454 unittest.expect(o.name, unittest.equals('foo')); |
| 455 unittest.expect(o.parent, unittest.equals('foo')); | 455 unittest.expect(o.parent, unittest.equals('foo')); |
| 456 unittest.expect(o.productId, unittest.equals('foo')); | 456 unittest.expect(o.productId, unittest.equals('foo')); |
| 457 unittest.expect(o.targetCountry, unittest.equals('foo')); | 457 unittest.expect(o.targetCountry, unittest.equals('foo')); |
| 458 checkAttributes(o.uploadedAttributes); | 458 checkAttributes(o.uploadedAttributes); |
| 459 } | 459 } |
| 460 buildCounterProduct--; | 460 buildCounterProduct--; |
| 461 } | 461 } |
| 462 | 462 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 res.get(arg_parent, arg_name).then(unittest.expectAsync1(((api.Product res
ponse) { | 675 res.get(arg_parent, arg_name).then(unittest.expectAsync1(((api.Product res
ponse) { |
| 676 checkProduct(response); | 676 checkProduct(response); |
| 677 }))); | 677 }))); |
| 678 }); | 678 }); |
| 679 | 679 |
| 680 unittest.test("method--list", () { | 680 unittest.test("method--list", () { |
| 681 | 681 |
| 682 var mock = new HttpServerMock(); | 682 var mock = new HttpServerMock(); |
| 683 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; | 683 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; |
| 684 var arg_parent = "foo"; | 684 var arg_parent = "foo"; |
| 685 var arg_pageSize = 42; |
| 685 var arg_pageToken = "foo"; | 686 var arg_pageToken = "foo"; |
| 686 var arg_pageSize = 42; | |
| 687 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 687 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 688 var path = (req.url).path; | 688 var path = (req.url).path; |
| 689 var pathOffset = 0; | 689 var pathOffset = 0; |
| 690 var index; | 690 var index; |
| 691 var subPart; | 691 var subPart; |
| 692 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 692 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 693 pathOffset += 1; | 693 pathOffset += 1; |
| 694 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 694 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 695 pathOffset += 3; | 695 pathOffset += 3; |
| 696 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 696 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 697 | 697 |
| 698 var query = (req.url).query; | 698 var query = (req.url).query; |
| 699 var queryOffset = 0; | 699 var queryOffset = 0; |
| 700 var queryMap = {}; | 700 var queryMap = {}; |
| 701 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 701 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 702 parseBool(n) { | 702 parseBool(n) { |
| 703 if (n == "true") return true; | 703 if (n == "true") return true; |
| 704 if (n == "false") return false; | 704 if (n == "false") return false; |
| 705 if (n == null) return null; | 705 if (n == null) return null; |
| 706 throw new core.ArgumentError("Invalid boolean: $n"); | 706 throw new core.ArgumentError("Invalid boolean: $n"); |
| 707 } | 707 } |
| 708 if (query.length > 0) { | 708 if (query.length > 0) { |
| 709 for (var part in query.split("&")) { | 709 for (var part in query.split("&")) { |
| 710 var keyvalue = part.split("="); | 710 var keyvalue = part.split("="); |
| 711 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 711 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 712 } | 712 } |
| 713 } | 713 } |
| 714 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 714 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 715 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 715 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
| 716 | 716 |
| 717 | 717 |
| 718 var h = { | 718 var h = { |
| 719 "content-type" : "application/json; charset=utf-8", | 719 "content-type" : "application/json; charset=utf-8", |
| 720 }; | 720 }; |
| 721 var resp = convert.JSON.encode(buildListProductsResponse()); | 721 var resp = convert.JSON.encode(buildListProductsResponse()); |
| 722 return new async.Future.value(stringResponse(200, h, resp)); | 722 return new async.Future.value(stringResponse(200, h, resp)); |
| 723 }), true); | 723 }), true); |
| 724 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListProductsResponse response) { | 724 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListProductsResponse response) { |
| 725 checkListProductsResponse(response); | 725 checkListProductsResponse(response); |
| 726 }))); | 726 }))); |
| 727 }); | 727 }); |
| 728 | 728 |
| 729 unittest.test("method--update", () { | 729 unittest.test("method--update", () { |
| 730 | 730 |
| 731 var mock = new HttpServerMock(); | 731 var mock = new HttpServerMock(); |
| 732 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; | 732 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; |
| 733 var arg_request = buildProduct(); | 733 var arg_request = buildProduct(); |
| 734 var arg_parent = "foo"; | 734 var arg_parent = "foo"; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1((
(api.Product response) { | 774 res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1((
(api.Product response) { |
| 775 checkProduct(response); | 775 checkProduct(response); |
| 776 }))); | 776 }))); |
| 777 }); | 777 }); |
| 778 | 778 |
| 779 }); | 779 }); |
| 780 | 780 |
| 781 | 781 |
| 782 } | 782 } |
| 783 | 783 |
| OLD | NEW |