| 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 buildUnnamed1468() { | 54 buildUnnamed1560() { |
| 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 checkUnnamed1468(core.List<api.Image> o) { | 61 checkUnnamed1560(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 buildUnnamed1469() { | 67 buildUnnamed1561() { |
| 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 checkUnnamed1469(core.List<api.FeatureDescription> o) { | 74 checkUnnamed1561(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 buildUnnamed1470() { | 80 buildUnnamed1562() { |
| 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 checkUnnamed1470(core.List<core.String> o) { | 87 checkUnnamed1562(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 buildUnnamed1471() { | 93 buildUnnamed1563() { |
| 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 checkUnnamed1471(core.List<api.ProductDetail> o) { | 100 checkUnnamed1563(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 buildUnnamed1472() { | 106 buildUnnamed1564() { |
| 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 checkUnnamed1472(core.List<core.String> o) { | 113 checkUnnamed1564(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 buildUnnamed1473() { | 119 buildUnnamed1565() { |
| 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 checkUnnamed1473(core.List<core.String> o) { | 126 checkUnnamed1565(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 = buildUnnamed1468(); | 137 o.additionalImageLink = buildUnnamed1560(); |
| 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 = buildUnnamed1469(); | 145 o.featureDescription = buildUnnamed1561(); |
| 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 = buildUnnamed1470(); | 149 o.gtin = buildUnnamed1562(); |
| 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 = buildUnnamed1471(); | 155 o.productDetail = buildUnnamed1563(); |
| 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 = buildUnnamed1472(); | 159 o.productType = buildUnnamed1564(); |
| 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 = buildUnnamed1473(); | 168 o.videoLink = buildUnnamed1565(); |
| 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 checkUnnamed1468(o.additionalImageLink); | 177 checkUnnamed1560(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 checkUnnamed1469(o.featureDescription); | 185 checkUnnamed1561(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 checkUnnamed1470(o.gtin); | 189 checkUnnamed1562(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 checkUnnamed1471(o.productDetail); | 195 checkUnnamed1563(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 checkUnnamed1472(o.productType); | 199 checkUnnamed1564(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 checkUnnamed1473(o.videoLink); | 208 checkUnnamed1565(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 26 matching lines...) Expand all Loading... |
| 245 | 245 |
| 246 checkCount(api.Count o) { | 246 checkCount(api.Count o) { |
| 247 buildCounterCount++; | 247 buildCounterCount++; |
| 248 if (buildCounterCount < 3) { | 248 if (buildCounterCount < 3) { |
| 249 unittest.expect(o.unit, unittest.equals('foo')); | 249 unittest.expect(o.unit, unittest.equals('foo')); |
| 250 unittest.expect(o.value, unittest.equals('foo')); | 250 unittest.expect(o.value, unittest.equals('foo')); |
| 251 } | 251 } |
| 252 buildCounterCount--; | 252 buildCounterCount--; |
| 253 } | 253 } |
| 254 | 254 |
| 255 core.int buildCounterEmpty = 0; |
| 256 buildEmpty() { |
| 257 var o = new api.Empty(); |
| 258 buildCounterEmpty++; |
| 259 if (buildCounterEmpty < 3) { |
| 260 } |
| 261 buildCounterEmpty--; |
| 262 return o; |
| 263 } |
| 264 |
| 265 checkEmpty(api.Empty o) { |
| 266 buildCounterEmpty++; |
| 267 if (buildCounterEmpty < 3) { |
| 268 } |
| 269 buildCounterEmpty--; |
| 270 } |
| 271 |
| 255 core.int buildCounterFeatureDescription = 0; | 272 core.int buildCounterFeatureDescription = 0; |
| 256 buildFeatureDescription() { | 273 buildFeatureDescription() { |
| 257 var o = new api.FeatureDescription(); | 274 var o = new api.FeatureDescription(); |
| 258 buildCounterFeatureDescription++; | 275 buildCounterFeatureDescription++; |
| 259 if (buildCounterFeatureDescription < 3) { | 276 if (buildCounterFeatureDescription < 3) { |
| 260 o.headline = "foo"; | 277 o.headline = "foo"; |
| 261 o.image = buildImage(); | 278 o.image = buildImage(); |
| 262 o.text = "foo"; | 279 o.text = "foo"; |
| 263 } | 280 } |
| 264 buildCounterFeatureDescription--; | 281 buildCounterFeatureDescription--; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 if (buildCounterIssue < 3) { | 335 if (buildCounterIssue < 3) { |
| 319 unittest.expect(o.attribute, unittest.equals('foo')); | 336 unittest.expect(o.attribute, unittest.equals('foo')); |
| 320 unittest.expect(o.description, unittest.equals('foo')); | 337 unittest.expect(o.description, unittest.equals('foo')); |
| 321 unittest.expect(o.severity, unittest.equals('foo')); | 338 unittest.expect(o.severity, unittest.equals('foo')); |
| 322 unittest.expect(o.timestamp, unittest.equals('foo')); | 339 unittest.expect(o.timestamp, unittest.equals('foo')); |
| 323 unittest.expect(o.type, unittest.equals('foo')); | 340 unittest.expect(o.type, unittest.equals('foo')); |
| 324 } | 341 } |
| 325 buildCounterIssue--; | 342 buildCounterIssue--; |
| 326 } | 343 } |
| 327 | 344 |
| 328 buildUnnamed1474() { | 345 buildUnnamed1566() { |
| 329 var o = new core.List<api.Product>(); | 346 var o = new core.List<api.Product>(); |
| 330 o.add(buildProduct()); | 347 o.add(buildProduct()); |
| 331 o.add(buildProduct()); | 348 o.add(buildProduct()); |
| 332 return o; | 349 return o; |
| 333 } | 350 } |
| 334 | 351 |
| 335 checkUnnamed1474(core.List<api.Product> o) { | 352 checkUnnamed1566(core.List<api.Product> o) { |
| 336 unittest.expect(o, unittest.hasLength(2)); | 353 unittest.expect(o, unittest.hasLength(2)); |
| 337 checkProduct(o[0]); | 354 checkProduct(o[0]); |
| 338 checkProduct(o[1]); | 355 checkProduct(o[1]); |
| 339 } | 356 } |
| 340 | 357 |
| 341 core.int buildCounterListProductsResponse = 0; | 358 core.int buildCounterListProductsResponse = 0; |
| 342 buildListProductsResponse() { | 359 buildListProductsResponse() { |
| 343 var o = new api.ListProductsResponse(); | 360 var o = new api.ListProductsResponse(); |
| 344 buildCounterListProductsResponse++; | 361 buildCounterListProductsResponse++; |
| 345 if (buildCounterListProductsResponse < 3) { | 362 if (buildCounterListProductsResponse < 3) { |
| 346 o.nextPageToken = "foo"; | 363 o.nextPageToken = "foo"; |
| 347 o.products = buildUnnamed1474(); | 364 o.products = buildUnnamed1566(); |
| 348 } | 365 } |
| 349 buildCounterListProductsResponse--; | 366 buildCounterListProductsResponse--; |
| 350 return o; | 367 return o; |
| 351 } | 368 } |
| 352 | 369 |
| 353 checkListProductsResponse(api.ListProductsResponse o) { | 370 checkListProductsResponse(api.ListProductsResponse o) { |
| 354 buildCounterListProductsResponse++; | 371 buildCounterListProductsResponse++; |
| 355 if (buildCounterListProductsResponse < 3) { | 372 if (buildCounterListProductsResponse < 3) { |
| 356 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 373 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 357 checkUnnamed1474(o.products); | 374 checkUnnamed1566(o.products); |
| 358 } | 375 } |
| 359 buildCounterListProductsResponse--; | 376 buildCounterListProductsResponse--; |
| 360 } | 377 } |
| 361 | 378 |
| 362 core.int buildCounterPrice = 0; | 379 core.int buildCounterPrice = 0; |
| 363 buildPrice() { | 380 buildPrice() { |
| 364 var o = new api.Price(); | 381 var o = new api.Price(); |
| 365 buildCounterPrice++; | 382 buildCounterPrice++; |
| 366 if (buildCounterPrice < 3) { | 383 if (buildCounterPrice < 3) { |
| 367 o.amount = "foo"; | 384 o.amount = "foo"; |
| 368 o.currency = "foo"; | 385 o.currency = "foo"; |
| 369 } | 386 } |
| 370 buildCounterPrice--; | 387 buildCounterPrice--; |
| 371 return o; | 388 return o; |
| 372 } | 389 } |
| 373 | 390 |
| 374 checkPrice(api.Price o) { | 391 checkPrice(api.Price o) { |
| 375 buildCounterPrice++; | 392 buildCounterPrice++; |
| 376 if (buildCounterPrice < 3) { | 393 if (buildCounterPrice < 3) { |
| 377 unittest.expect(o.amount, unittest.equals('foo')); | 394 unittest.expect(o.amount, unittest.equals('foo')); |
| 378 unittest.expect(o.currency, unittest.equals('foo')); | 395 unittest.expect(o.currency, unittest.equals('foo')); |
| 379 } | 396 } |
| 380 buildCounterPrice--; | 397 buildCounterPrice--; |
| 381 } | 398 } |
| 382 | 399 |
| 383 buildUnnamed1475() { | 400 buildUnnamed1567() { |
| 384 var o = new core.List<api.Issue>(); | 401 var o = new core.List<api.Issue>(); |
| 385 o.add(buildIssue()); | 402 o.add(buildIssue()); |
| 386 o.add(buildIssue()); | 403 o.add(buildIssue()); |
| 387 return o; | 404 return o; |
| 388 } | 405 } |
| 389 | 406 |
| 390 checkUnnamed1475(core.List<api.Issue> o) { | 407 checkUnnamed1567(core.List<api.Issue> o) { |
| 391 unittest.expect(o, unittest.hasLength(2)); | 408 unittest.expect(o, unittest.hasLength(2)); |
| 392 checkIssue(o[0]); | 409 checkIssue(o[0]); |
| 393 checkIssue(o[1]); | 410 checkIssue(o[1]); |
| 394 } | 411 } |
| 395 | 412 |
| 396 buildUnnamed1476() { | 413 buildUnnamed1568() { |
| 397 var o = new core.List<core.String>(); | 414 var o = new core.List<core.String>(); |
| 398 o.add("foo"); | 415 o.add("foo"); |
| 399 o.add("foo"); | 416 o.add("foo"); |
| 400 return o; | 417 return o; |
| 401 } | 418 } |
| 402 | 419 |
| 403 checkUnnamed1476(core.List<core.String> o) { | 420 checkUnnamed1568(core.List<core.String> o) { |
| 404 unittest.expect(o, unittest.hasLength(2)); | 421 unittest.expect(o, unittest.hasLength(2)); |
| 405 unittest.expect(o[0], unittest.equals('foo')); | 422 unittest.expect(o[0], unittest.equals('foo')); |
| 406 unittest.expect(o[1], unittest.equals('foo')); | 423 unittest.expect(o[1], unittest.equals('foo')); |
| 407 } | 424 } |
| 408 | 425 |
| 409 core.int buildCounterProduct = 0; | 426 core.int buildCounterProduct = 0; |
| 410 buildProduct() { | 427 buildProduct() { |
| 411 var o = new api.Product(); | 428 var o = new api.Product(); |
| 412 buildCounterProduct++; | 429 buildCounterProduct++; |
| 413 if (buildCounterProduct < 3) { | 430 if (buildCounterProduct < 3) { |
| 414 o.contentLanguage = "foo"; | 431 o.contentLanguage = "foo"; |
| 415 o.finalAttributes = buildAttributes(); | 432 o.finalAttributes = buildAttributes(); |
| 416 o.issues = buildUnnamed1475(); | 433 o.issues = buildUnnamed1567(); |
| 417 o.manuallyDeletedAttributes = buildUnnamed1476(); | 434 o.manuallyDeletedAttributes = buildUnnamed1568(); |
| 418 o.manuallyProvidedAttributes = buildAttributes(); | 435 o.manuallyProvidedAttributes = buildAttributes(); |
| 419 o.name = "foo"; | 436 o.name = "foo"; |
| 420 o.parent = "foo"; | 437 o.parent = "foo"; |
| 421 o.productId = "foo"; | 438 o.productId = "foo"; |
| 422 o.targetCountry = "foo"; | 439 o.targetCountry = "foo"; |
| 423 o.uploadedAttributes = buildAttributes(); | 440 o.uploadedAttributes = buildAttributes(); |
| 424 } | 441 } |
| 425 buildCounterProduct--; | 442 buildCounterProduct--; |
| 426 return o; | 443 return o; |
| 427 } | 444 } |
| 428 | 445 |
| 429 checkProduct(api.Product o) { | 446 checkProduct(api.Product o) { |
| 430 buildCounterProduct++; | 447 buildCounterProduct++; |
| 431 if (buildCounterProduct < 3) { | 448 if (buildCounterProduct < 3) { |
| 432 unittest.expect(o.contentLanguage, unittest.equals('foo')); | 449 unittest.expect(o.contentLanguage, unittest.equals('foo')); |
| 433 checkAttributes(o.finalAttributes); | 450 checkAttributes(o.finalAttributes); |
| 434 checkUnnamed1475(o.issues); | 451 checkUnnamed1567(o.issues); |
| 435 checkUnnamed1476(o.manuallyDeletedAttributes); | 452 checkUnnamed1568(o.manuallyDeletedAttributes); |
| 436 checkAttributes(o.manuallyProvidedAttributes); | 453 checkAttributes(o.manuallyProvidedAttributes); |
| 437 unittest.expect(o.name, unittest.equals('foo')); | 454 unittest.expect(o.name, unittest.equals('foo')); |
| 438 unittest.expect(o.parent, unittest.equals('foo')); | 455 unittest.expect(o.parent, unittest.equals('foo')); |
| 439 unittest.expect(o.productId, unittest.equals('foo')); | 456 unittest.expect(o.productId, unittest.equals('foo')); |
| 440 unittest.expect(o.targetCountry, unittest.equals('foo')); | 457 unittest.expect(o.targetCountry, unittest.equals('foo')); |
| 441 checkAttributes(o.uploadedAttributes); | 458 checkAttributes(o.uploadedAttributes); |
| 442 } | 459 } |
| 443 buildCounterProduct--; | 460 buildCounterProduct--; |
| 444 } | 461 } |
| 445 | 462 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 505 |
| 489 unittest.group("obj-schema-Count", () { | 506 unittest.group("obj-schema-Count", () { |
| 490 unittest.test("to-json--from-json", () { | 507 unittest.test("to-json--from-json", () { |
| 491 var o = buildCount(); | 508 var o = buildCount(); |
| 492 var od = new api.Count.fromJson(o.toJson()); | 509 var od = new api.Count.fromJson(o.toJson()); |
| 493 checkCount(od); | 510 checkCount(od); |
| 494 }); | 511 }); |
| 495 }); | 512 }); |
| 496 | 513 |
| 497 | 514 |
| 515 unittest.group("obj-schema-Empty", () { |
| 516 unittest.test("to-json--from-json", () { |
| 517 var o = buildEmpty(); |
| 518 var od = new api.Empty.fromJson(o.toJson()); |
| 519 checkEmpty(od); |
| 520 }); |
| 521 }); |
| 522 |
| 523 |
| 498 unittest.group("obj-schema-FeatureDescription", () { | 524 unittest.group("obj-schema-FeatureDescription", () { |
| 499 unittest.test("to-json--from-json", () { | 525 unittest.test("to-json--from-json", () { |
| 500 var o = buildFeatureDescription(); | 526 var o = buildFeatureDescription(); |
| 501 var od = new api.FeatureDescription.fromJson(o.toJson()); | 527 var od = new api.FeatureDescription.fromJson(o.toJson()); |
| 502 checkFeatureDescription(od); | 528 checkFeatureDescription(od); |
| 503 }); | 529 }); |
| 504 }); | 530 }); |
| 505 | 531 |
| 506 | 532 |
| 507 unittest.group("obj-schema-Image", () { | 533 unittest.group("obj-schema-Image", () { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 unittest.group("obj-schema-ProductDetail", () { | 578 unittest.group("obj-schema-ProductDetail", () { |
| 553 unittest.test("to-json--from-json", () { | 579 unittest.test("to-json--from-json", () { |
| 554 var o = buildProductDetail(); | 580 var o = buildProductDetail(); |
| 555 var od = new api.ProductDetail.fromJson(o.toJson()); | 581 var od = new api.ProductDetail.fromJson(o.toJson()); |
| 556 checkProductDetail(od); | 582 checkProductDetail(od); |
| 557 }); | 583 }); |
| 558 }); | 584 }); |
| 559 | 585 |
| 560 | 586 |
| 561 unittest.group("resource-AccountsProductsResourceApi", () { | 587 unittest.group("resource-AccountsProductsResourceApi", () { |
| 588 unittest.test("method--delete", () { |
| 589 |
| 590 var mock = new HttpServerMock(); |
| 591 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; |
| 592 var arg_parent = "foo"; |
| 593 var arg_name = "foo"; |
| 594 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 595 var path = (req.url).path; |
| 596 var pathOffset = 0; |
| 597 var index; |
| 598 var subPart; |
| 599 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 600 pathOffset += 1; |
| 601 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 602 pathOffset += 3; |
| 603 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 604 |
| 605 var query = (req.url).query; |
| 606 var queryOffset = 0; |
| 607 var queryMap = {}; |
| 608 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 609 parseBool(n) { |
| 610 if (n == "true") return true; |
| 611 if (n == "false") return false; |
| 612 if (n == null) return null; |
| 613 throw new core.ArgumentError("Invalid boolean: $n"); |
| 614 } |
| 615 if (query.length > 0) { |
| 616 for (var part in query.split("&")) { |
| 617 var keyvalue = part.split("="); |
| 618 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 619 } |
| 620 } |
| 621 |
| 622 |
| 623 var h = { |
| 624 "content-type" : "application/json; charset=utf-8", |
| 625 }; |
| 626 var resp = convert.JSON.encode(buildEmpty()); |
| 627 return new async.Future.value(stringResponse(200, h, resp)); |
| 628 }), true); |
| 629 res.delete(arg_parent, arg_name).then(unittest.expectAsync1(((api.Empty re
sponse) { |
| 630 checkEmpty(response); |
| 631 }))); |
| 632 }); |
| 633 |
| 562 unittest.test("method--get", () { | 634 unittest.test("method--get", () { |
| 563 | 635 |
| 564 var mock = new HttpServerMock(); | 636 var mock = new HttpServerMock(); |
| 565 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; | 637 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; |
| 566 var arg_parent = "foo"; | 638 var arg_parent = "foo"; |
| 567 var arg_name = "foo"; | 639 var arg_name = "foo"; |
| 568 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 640 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 569 var path = (req.url).path; | 641 var path = (req.url).path; |
| 570 var pathOffset = 0; | 642 var pathOffset = 0; |
| 571 var index; | 643 var index; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 "content-type" : "application/json; charset=utf-8", | 719 "content-type" : "application/json; charset=utf-8", |
| 648 }; | 720 }; |
| 649 var resp = convert.JSON.encode(buildListProductsResponse()); | 721 var resp = convert.JSON.encode(buildListProductsResponse()); |
| 650 return new async.Future.value(stringResponse(200, h, resp)); | 722 return new async.Future.value(stringResponse(200, h, resp)); |
| 651 }), true); | 723 }), true); |
| 652 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListProductsResponse response) { | 724 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListProductsResponse response) { |
| 653 checkListProductsResponse(response); | 725 checkListProductsResponse(response); |
| 654 }))); | 726 }))); |
| 655 }); | 727 }); |
| 656 | 728 |
| 729 unittest.test("method--update", () { |
| 730 |
| 731 var mock = new HttpServerMock(); |
| 732 api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accou
nts.products; |
| 733 var arg_request = buildProduct(); |
| 734 var arg_parent = "foo"; |
| 735 var arg_name = "foo"; |
| 736 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 737 var obj = new api.Product.fromJson(json); |
| 738 checkProduct(obj); |
| 739 |
| 740 var path = (req.url).path; |
| 741 var pathOffset = 0; |
| 742 var index; |
| 743 var subPart; |
| 744 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 745 pathOffset += 1; |
| 746 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 747 pathOffset += 3; |
| 748 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 749 |
| 750 var query = (req.url).query; |
| 751 var queryOffset = 0; |
| 752 var queryMap = {}; |
| 753 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 754 parseBool(n) { |
| 755 if (n == "true") return true; |
| 756 if (n == "false") return false; |
| 757 if (n == null) return null; |
| 758 throw new core.ArgumentError("Invalid boolean: $n"); |
| 759 } |
| 760 if (query.length > 0) { |
| 761 for (var part in query.split("&")) { |
| 762 var keyvalue = part.split("="); |
| 763 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 764 } |
| 765 } |
| 766 |
| 767 |
| 768 var h = { |
| 769 "content-type" : "application/json; charset=utf-8", |
| 770 }; |
| 771 var resp = convert.JSON.encode(buildProduct()); |
| 772 return new async.Future.value(stringResponse(200, h, resp)); |
| 773 }), true); |
| 774 res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1((
(api.Product response) { |
| 775 checkProduct(response); |
| 776 }))); |
| 777 }); |
| 778 |
| 657 }); | 779 }); |
| 658 | 780 |
| 659 | 781 |
| 660 } | 782 } |
| 661 | 783 |
| OLD | NEW |