| OLD | NEW |
| (Empty) |
| 1 library googleapis.adexchangebuyer.v1_3.test; | |
| 2 | |
| 3 import "dart:core" as core; | |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | |
| 6 import "dart:convert" as convert; | |
| 7 | |
| 8 import 'package:http/http.dart' as http; | |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:unittest/unittest.dart' as unittest; | |
| 11 import 'package:googleapis/common/common.dart' as common; | |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
| 13 import '../common/common_internal_test.dart' as common_test; | |
| 14 | |
| 15 import 'package:googleapis/adexchangebuyer/v1_3.dart' as api; | |
| 16 | |
| 17 | |
| 18 | |
| 19 core.int buildCounterAccountBidderLocation = 0; | |
| 20 buildAccountBidderLocation() { | |
| 21 var o = new api.AccountBidderLocation(); | |
| 22 buildCounterAccountBidderLocation++; | |
| 23 if (buildCounterAccountBidderLocation < 3) { | |
| 24 o.maximumQps = 42; | |
| 25 o.region = "foo"; | |
| 26 o.url = "foo"; | |
| 27 } | |
| 28 buildCounterAccountBidderLocation--; | |
| 29 return o; | |
| 30 } | |
| 31 | |
| 32 checkAccountBidderLocation(api.AccountBidderLocation o) { | |
| 33 buildCounterAccountBidderLocation++; | |
| 34 if (buildCounterAccountBidderLocation < 3) { | |
| 35 unittest.expect(o.maximumQps, unittest.equals(42)); | |
| 36 unittest.expect(o.region, unittest.equals('foo')); | |
| 37 unittest.expect(o.url, unittest.equals('foo')); | |
| 38 } | |
| 39 buildCounterAccountBidderLocation--; | |
| 40 } | |
| 41 | |
| 42 buildUnnamed537() { | |
| 43 var o = new core.List<api.AccountBidderLocation>(); | |
| 44 o.add(buildAccountBidderLocation()); | |
| 45 o.add(buildAccountBidderLocation()); | |
| 46 return o; | |
| 47 } | |
| 48 | |
| 49 checkUnnamed537(core.List<api.AccountBidderLocation> o) { | |
| 50 unittest.expect(o, unittest.hasLength(2)); | |
| 51 checkAccountBidderLocation(o[0]); | |
| 52 checkAccountBidderLocation(o[1]); | |
| 53 } | |
| 54 | |
| 55 core.int buildCounterAccount = 0; | |
| 56 buildAccount() { | |
| 57 var o = new api.Account(); | |
| 58 buildCounterAccount++; | |
| 59 if (buildCounterAccount < 3) { | |
| 60 o.bidderLocation = buildUnnamed537(); | |
| 61 o.cookieMatchingNid = "foo"; | |
| 62 o.cookieMatchingUrl = "foo"; | |
| 63 o.id = 42; | |
| 64 o.kind = "foo"; | |
| 65 o.maximumTotalQps = 42; | |
| 66 } | |
| 67 buildCounterAccount--; | |
| 68 return o; | |
| 69 } | |
| 70 | |
| 71 checkAccount(api.Account o) { | |
| 72 buildCounterAccount++; | |
| 73 if (buildCounterAccount < 3) { | |
| 74 checkUnnamed537(o.bidderLocation); | |
| 75 unittest.expect(o.cookieMatchingNid, unittest.equals('foo')); | |
| 76 unittest.expect(o.cookieMatchingUrl, unittest.equals('foo')); | |
| 77 unittest.expect(o.id, unittest.equals(42)); | |
| 78 unittest.expect(o.kind, unittest.equals('foo')); | |
| 79 unittest.expect(o.maximumTotalQps, unittest.equals(42)); | |
| 80 } | |
| 81 buildCounterAccount--; | |
| 82 } | |
| 83 | |
| 84 buildUnnamed538() { | |
| 85 var o = new core.List<api.Account>(); | |
| 86 o.add(buildAccount()); | |
| 87 o.add(buildAccount()); | |
| 88 return o; | |
| 89 } | |
| 90 | |
| 91 checkUnnamed538(core.List<api.Account> o) { | |
| 92 unittest.expect(o, unittest.hasLength(2)); | |
| 93 checkAccount(o[0]); | |
| 94 checkAccount(o[1]); | |
| 95 } | |
| 96 | |
| 97 core.int buildCounterAccountsList = 0; | |
| 98 buildAccountsList() { | |
| 99 var o = new api.AccountsList(); | |
| 100 buildCounterAccountsList++; | |
| 101 if (buildCounterAccountsList < 3) { | |
| 102 o.items = buildUnnamed538(); | |
| 103 o.kind = "foo"; | |
| 104 } | |
| 105 buildCounterAccountsList--; | |
| 106 return o; | |
| 107 } | |
| 108 | |
| 109 checkAccountsList(api.AccountsList o) { | |
| 110 buildCounterAccountsList++; | |
| 111 if (buildCounterAccountsList < 3) { | |
| 112 checkUnnamed538(o.items); | |
| 113 unittest.expect(o.kind, unittest.equals('foo')); | |
| 114 } | |
| 115 buildCounterAccountsList--; | |
| 116 } | |
| 117 | |
| 118 buildUnnamed539() { | |
| 119 var o = new core.List<core.String>(); | |
| 120 o.add("foo"); | |
| 121 o.add("foo"); | |
| 122 return o; | |
| 123 } | |
| 124 | |
| 125 checkUnnamed539(core.List<core.String> o) { | |
| 126 unittest.expect(o, unittest.hasLength(2)); | |
| 127 unittest.expect(o[0], unittest.equals('foo')); | |
| 128 unittest.expect(o[1], unittest.equals('foo')); | |
| 129 } | |
| 130 | |
| 131 core.int buildCounterBillingInfo = 0; | |
| 132 buildBillingInfo() { | |
| 133 var o = new api.BillingInfo(); | |
| 134 buildCounterBillingInfo++; | |
| 135 if (buildCounterBillingInfo < 3) { | |
| 136 o.accountId = 42; | |
| 137 o.accountName = "foo"; | |
| 138 o.billingId = buildUnnamed539(); | |
| 139 o.kind = "foo"; | |
| 140 } | |
| 141 buildCounterBillingInfo--; | |
| 142 return o; | |
| 143 } | |
| 144 | |
| 145 checkBillingInfo(api.BillingInfo o) { | |
| 146 buildCounterBillingInfo++; | |
| 147 if (buildCounterBillingInfo < 3) { | |
| 148 unittest.expect(o.accountId, unittest.equals(42)); | |
| 149 unittest.expect(o.accountName, unittest.equals('foo')); | |
| 150 checkUnnamed539(o.billingId); | |
| 151 unittest.expect(o.kind, unittest.equals('foo')); | |
| 152 } | |
| 153 buildCounterBillingInfo--; | |
| 154 } | |
| 155 | |
| 156 buildUnnamed540() { | |
| 157 var o = new core.List<api.BillingInfo>(); | |
| 158 o.add(buildBillingInfo()); | |
| 159 o.add(buildBillingInfo()); | |
| 160 return o; | |
| 161 } | |
| 162 | |
| 163 checkUnnamed540(core.List<api.BillingInfo> o) { | |
| 164 unittest.expect(o, unittest.hasLength(2)); | |
| 165 checkBillingInfo(o[0]); | |
| 166 checkBillingInfo(o[1]); | |
| 167 } | |
| 168 | |
| 169 core.int buildCounterBillingInfoList = 0; | |
| 170 buildBillingInfoList() { | |
| 171 var o = new api.BillingInfoList(); | |
| 172 buildCounterBillingInfoList++; | |
| 173 if (buildCounterBillingInfoList < 3) { | |
| 174 o.items = buildUnnamed540(); | |
| 175 o.kind = "foo"; | |
| 176 } | |
| 177 buildCounterBillingInfoList--; | |
| 178 return o; | |
| 179 } | |
| 180 | |
| 181 checkBillingInfoList(api.BillingInfoList o) { | |
| 182 buildCounterBillingInfoList++; | |
| 183 if (buildCounterBillingInfoList < 3) { | |
| 184 checkUnnamed540(o.items); | |
| 185 unittest.expect(o.kind, unittest.equals('foo')); | |
| 186 } | |
| 187 buildCounterBillingInfoList--; | |
| 188 } | |
| 189 | |
| 190 buildUnnamed541() { | |
| 191 var o = new core.List<core.String>(); | |
| 192 o.add("foo"); | |
| 193 o.add("foo"); | |
| 194 return o; | |
| 195 } | |
| 196 | |
| 197 checkUnnamed541(core.List<core.String> o) { | |
| 198 unittest.expect(o, unittest.hasLength(2)); | |
| 199 unittest.expect(o[0], unittest.equals('foo')); | |
| 200 unittest.expect(o[1], unittest.equals('foo')); | |
| 201 } | |
| 202 | |
| 203 buildUnnamed542() { | |
| 204 var o = new core.List<core.int>(); | |
| 205 o.add(42); | |
| 206 o.add(42); | |
| 207 return o; | |
| 208 } | |
| 209 | |
| 210 checkUnnamed542(core.List<core.int> o) { | |
| 211 unittest.expect(o, unittest.hasLength(2)); | |
| 212 unittest.expect(o[0], unittest.equals(42)); | |
| 213 unittest.expect(o[1], unittest.equals(42)); | |
| 214 } | |
| 215 | |
| 216 buildUnnamed543() { | |
| 217 var o = new core.List<core.String>(); | |
| 218 o.add("foo"); | |
| 219 o.add("foo"); | |
| 220 return o; | |
| 221 } | |
| 222 | |
| 223 checkUnnamed543(core.List<core.String> o) { | |
| 224 unittest.expect(o, unittest.hasLength(2)); | |
| 225 unittest.expect(o[0], unittest.equals('foo')); | |
| 226 unittest.expect(o[1], unittest.equals('foo')); | |
| 227 } | |
| 228 | |
| 229 buildUnnamed544() { | |
| 230 var o = new core.List<core.String>(); | |
| 231 o.add("foo"); | |
| 232 o.add("foo"); | |
| 233 return o; | |
| 234 } | |
| 235 | |
| 236 checkUnnamed544(core.List<core.String> o) { | |
| 237 unittest.expect(o, unittest.hasLength(2)); | |
| 238 unittest.expect(o[0], unittest.equals('foo')); | |
| 239 unittest.expect(o[1], unittest.equals('foo')); | |
| 240 } | |
| 241 | |
| 242 core.int buildCounterCreativeCorrections = 0; | |
| 243 buildCreativeCorrections() { | |
| 244 var o = new api.CreativeCorrections(); | |
| 245 buildCounterCreativeCorrections++; | |
| 246 if (buildCounterCreativeCorrections < 3) { | |
| 247 o.details = buildUnnamed544(); | |
| 248 o.reason = "foo"; | |
| 249 } | |
| 250 buildCounterCreativeCorrections--; | |
| 251 return o; | |
| 252 } | |
| 253 | |
| 254 checkCreativeCorrections(api.CreativeCorrections o) { | |
| 255 buildCounterCreativeCorrections++; | |
| 256 if (buildCounterCreativeCorrections < 3) { | |
| 257 checkUnnamed544(o.details); | |
| 258 unittest.expect(o.reason, unittest.equals('foo')); | |
| 259 } | |
| 260 buildCounterCreativeCorrections--; | |
| 261 } | |
| 262 | |
| 263 buildUnnamed545() { | |
| 264 var o = new core.List<api.CreativeCorrections>(); | |
| 265 o.add(buildCreativeCorrections()); | |
| 266 o.add(buildCreativeCorrections()); | |
| 267 return o; | |
| 268 } | |
| 269 | |
| 270 checkUnnamed545(core.List<api.CreativeCorrections> o) { | |
| 271 unittest.expect(o, unittest.hasLength(2)); | |
| 272 checkCreativeCorrections(o[0]); | |
| 273 checkCreativeCorrections(o[1]); | |
| 274 } | |
| 275 | |
| 276 buildUnnamed546() { | |
| 277 var o = new core.List<core.String>(); | |
| 278 o.add("foo"); | |
| 279 o.add("foo"); | |
| 280 return o; | |
| 281 } | |
| 282 | |
| 283 checkUnnamed546(core.List<core.String> o) { | |
| 284 unittest.expect(o, unittest.hasLength(2)); | |
| 285 unittest.expect(o[0], unittest.equals('foo')); | |
| 286 unittest.expect(o[1], unittest.equals('foo')); | |
| 287 } | |
| 288 | |
| 289 core.int buildCounterCreativeDisapprovalReasons = 0; | |
| 290 buildCreativeDisapprovalReasons() { | |
| 291 var o = new api.CreativeDisapprovalReasons(); | |
| 292 buildCounterCreativeDisapprovalReasons++; | |
| 293 if (buildCounterCreativeDisapprovalReasons < 3) { | |
| 294 o.details = buildUnnamed546(); | |
| 295 o.reason = "foo"; | |
| 296 } | |
| 297 buildCounterCreativeDisapprovalReasons--; | |
| 298 return o; | |
| 299 } | |
| 300 | |
| 301 checkCreativeDisapprovalReasons(api.CreativeDisapprovalReasons o) { | |
| 302 buildCounterCreativeDisapprovalReasons++; | |
| 303 if (buildCounterCreativeDisapprovalReasons < 3) { | |
| 304 checkUnnamed546(o.details); | |
| 305 unittest.expect(o.reason, unittest.equals('foo')); | |
| 306 } | |
| 307 buildCounterCreativeDisapprovalReasons--; | |
| 308 } | |
| 309 | |
| 310 buildUnnamed547() { | |
| 311 var o = new core.List<api.CreativeDisapprovalReasons>(); | |
| 312 o.add(buildCreativeDisapprovalReasons()); | |
| 313 o.add(buildCreativeDisapprovalReasons()); | |
| 314 return o; | |
| 315 } | |
| 316 | |
| 317 checkUnnamed547(core.List<api.CreativeDisapprovalReasons> o) { | |
| 318 unittest.expect(o, unittest.hasLength(2)); | |
| 319 checkCreativeDisapprovalReasons(o[0]); | |
| 320 checkCreativeDisapprovalReasons(o[1]); | |
| 321 } | |
| 322 | |
| 323 core.int buildCounterCreativeFilteringReasonsReasons = 0; | |
| 324 buildCreativeFilteringReasonsReasons() { | |
| 325 var o = new api.CreativeFilteringReasonsReasons(); | |
| 326 buildCounterCreativeFilteringReasonsReasons++; | |
| 327 if (buildCounterCreativeFilteringReasonsReasons < 3) { | |
| 328 o.filteringCount = "foo"; | |
| 329 o.filteringStatus = 42; | |
| 330 } | |
| 331 buildCounterCreativeFilteringReasonsReasons--; | |
| 332 return o; | |
| 333 } | |
| 334 | |
| 335 checkCreativeFilteringReasonsReasons(api.CreativeFilteringReasonsReasons o) { | |
| 336 buildCounterCreativeFilteringReasonsReasons++; | |
| 337 if (buildCounterCreativeFilteringReasonsReasons < 3) { | |
| 338 unittest.expect(o.filteringCount, unittest.equals('foo')); | |
| 339 unittest.expect(o.filteringStatus, unittest.equals(42)); | |
| 340 } | |
| 341 buildCounterCreativeFilteringReasonsReasons--; | |
| 342 } | |
| 343 | |
| 344 buildUnnamed548() { | |
| 345 var o = new core.List<api.CreativeFilteringReasonsReasons>(); | |
| 346 o.add(buildCreativeFilteringReasonsReasons()); | |
| 347 o.add(buildCreativeFilteringReasonsReasons()); | |
| 348 return o; | |
| 349 } | |
| 350 | |
| 351 checkUnnamed548(core.List<api.CreativeFilteringReasonsReasons> o) { | |
| 352 unittest.expect(o, unittest.hasLength(2)); | |
| 353 checkCreativeFilteringReasonsReasons(o[0]); | |
| 354 checkCreativeFilteringReasonsReasons(o[1]); | |
| 355 } | |
| 356 | |
| 357 core.int buildCounterCreativeFilteringReasons = 0; | |
| 358 buildCreativeFilteringReasons() { | |
| 359 var o = new api.CreativeFilteringReasons(); | |
| 360 buildCounterCreativeFilteringReasons++; | |
| 361 if (buildCounterCreativeFilteringReasons < 3) { | |
| 362 o.date = "foo"; | |
| 363 o.reasons = buildUnnamed548(); | |
| 364 } | |
| 365 buildCounterCreativeFilteringReasons--; | |
| 366 return o; | |
| 367 } | |
| 368 | |
| 369 checkCreativeFilteringReasons(api.CreativeFilteringReasons o) { | |
| 370 buildCounterCreativeFilteringReasons++; | |
| 371 if (buildCounterCreativeFilteringReasons < 3) { | |
| 372 unittest.expect(o.date, unittest.equals('foo')); | |
| 373 checkUnnamed548(o.reasons); | |
| 374 } | |
| 375 buildCounterCreativeFilteringReasons--; | |
| 376 } | |
| 377 | |
| 378 buildUnnamed549() { | |
| 379 var o = new core.List<core.int>(); | |
| 380 o.add(42); | |
| 381 o.add(42); | |
| 382 return o; | |
| 383 } | |
| 384 | |
| 385 checkUnnamed549(core.List<core.int> o) { | |
| 386 unittest.expect(o, unittest.hasLength(2)); | |
| 387 unittest.expect(o[0], unittest.equals(42)); | |
| 388 unittest.expect(o[1], unittest.equals(42)); | |
| 389 } | |
| 390 | |
| 391 buildUnnamed550() { | |
| 392 var o = new core.List<core.int>(); | |
| 393 o.add(42); | |
| 394 o.add(42); | |
| 395 return o; | |
| 396 } | |
| 397 | |
| 398 checkUnnamed550(core.List<core.int> o) { | |
| 399 unittest.expect(o, unittest.hasLength(2)); | |
| 400 unittest.expect(o[0], unittest.equals(42)); | |
| 401 unittest.expect(o[1], unittest.equals(42)); | |
| 402 } | |
| 403 | |
| 404 buildUnnamed551() { | |
| 405 var o = new core.List<core.int>(); | |
| 406 o.add(42); | |
| 407 o.add(42); | |
| 408 return o; | |
| 409 } | |
| 410 | |
| 411 checkUnnamed551(core.List<core.int> o) { | |
| 412 unittest.expect(o, unittest.hasLength(2)); | |
| 413 unittest.expect(o[0], unittest.equals(42)); | |
| 414 unittest.expect(o[1], unittest.equals(42)); | |
| 415 } | |
| 416 | |
| 417 buildUnnamed552() { | |
| 418 var o = new core.List<core.int>(); | |
| 419 o.add(42); | |
| 420 o.add(42); | |
| 421 return o; | |
| 422 } | |
| 423 | |
| 424 checkUnnamed552(core.List<core.int> o) { | |
| 425 unittest.expect(o, unittest.hasLength(2)); | |
| 426 unittest.expect(o[0], unittest.equals(42)); | |
| 427 unittest.expect(o[1], unittest.equals(42)); | |
| 428 } | |
| 429 | |
| 430 core.int buildCounterCreative = 0; | |
| 431 buildCreative() { | |
| 432 var o = new api.Creative(); | |
| 433 buildCounterCreative++; | |
| 434 if (buildCounterCreative < 3) { | |
| 435 o.HTMLSnippet = "foo"; | |
| 436 o.accountId = 42; | |
| 437 o.advertiserId = buildUnnamed541(); | |
| 438 o.advertiserName = "foo"; | |
| 439 o.agencyId = "foo"; | |
| 440 o.attribute = buildUnnamed542(); | |
| 441 o.buyerCreativeId = "foo"; | |
| 442 o.clickThroughUrl = buildUnnamed543(); | |
| 443 o.corrections = buildUnnamed545(); | |
| 444 o.disapprovalReasons = buildUnnamed547(); | |
| 445 o.filteringReasons = buildCreativeFilteringReasons(); | |
| 446 o.height = 42; | |
| 447 o.kind = "foo"; | |
| 448 o.productCategories = buildUnnamed549(); | |
| 449 o.restrictedCategories = buildUnnamed550(); | |
| 450 o.sensitiveCategories = buildUnnamed551(); | |
| 451 o.status = "foo"; | |
| 452 o.vendorType = buildUnnamed552(); | |
| 453 o.videoURL = "foo"; | |
| 454 o.width = 42; | |
| 455 } | |
| 456 buildCounterCreative--; | |
| 457 return o; | |
| 458 } | |
| 459 | |
| 460 checkCreative(api.Creative o) { | |
| 461 buildCounterCreative++; | |
| 462 if (buildCounterCreative < 3) { | |
| 463 unittest.expect(o.HTMLSnippet, unittest.equals('foo')); | |
| 464 unittest.expect(o.accountId, unittest.equals(42)); | |
| 465 checkUnnamed541(o.advertiserId); | |
| 466 unittest.expect(o.advertiserName, unittest.equals('foo')); | |
| 467 unittest.expect(o.agencyId, unittest.equals('foo')); | |
| 468 checkUnnamed542(o.attribute); | |
| 469 unittest.expect(o.buyerCreativeId, unittest.equals('foo')); | |
| 470 checkUnnamed543(o.clickThroughUrl); | |
| 471 checkUnnamed545(o.corrections); | |
| 472 checkUnnamed547(o.disapprovalReasons); | |
| 473 checkCreativeFilteringReasons(o.filteringReasons); | |
| 474 unittest.expect(o.height, unittest.equals(42)); | |
| 475 unittest.expect(o.kind, unittest.equals('foo')); | |
| 476 checkUnnamed549(o.productCategories); | |
| 477 checkUnnamed550(o.restrictedCategories); | |
| 478 checkUnnamed551(o.sensitiveCategories); | |
| 479 unittest.expect(o.status, unittest.equals('foo')); | |
| 480 checkUnnamed552(o.vendorType); | |
| 481 unittest.expect(o.videoURL, unittest.equals('foo')); | |
| 482 unittest.expect(o.width, unittest.equals(42)); | |
| 483 } | |
| 484 buildCounterCreative--; | |
| 485 } | |
| 486 | |
| 487 buildUnnamed553() { | |
| 488 var o = new core.List<api.Creative>(); | |
| 489 o.add(buildCreative()); | |
| 490 o.add(buildCreative()); | |
| 491 return o; | |
| 492 } | |
| 493 | |
| 494 checkUnnamed553(core.List<api.Creative> o) { | |
| 495 unittest.expect(o, unittest.hasLength(2)); | |
| 496 checkCreative(o[0]); | |
| 497 checkCreative(o[1]); | |
| 498 } | |
| 499 | |
| 500 core.int buildCounterCreativesList = 0; | |
| 501 buildCreativesList() { | |
| 502 var o = new api.CreativesList(); | |
| 503 buildCounterCreativesList++; | |
| 504 if (buildCounterCreativesList < 3) { | |
| 505 o.items = buildUnnamed553(); | |
| 506 o.kind = "foo"; | |
| 507 o.nextPageToken = "foo"; | |
| 508 } | |
| 509 buildCounterCreativesList--; | |
| 510 return o; | |
| 511 } | |
| 512 | |
| 513 checkCreativesList(api.CreativesList o) { | |
| 514 buildCounterCreativesList++; | |
| 515 if (buildCounterCreativesList < 3) { | |
| 516 checkUnnamed553(o.items); | |
| 517 unittest.expect(o.kind, unittest.equals('foo')); | |
| 518 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
| 519 } | |
| 520 buildCounterCreativesList--; | |
| 521 } | |
| 522 | |
| 523 core.int buildCounterDirectDeal = 0; | |
| 524 buildDirectDeal() { | |
| 525 var o = new api.DirectDeal(); | |
| 526 buildCounterDirectDeal++; | |
| 527 if (buildCounterDirectDeal < 3) { | |
| 528 o.accountId = 42; | |
| 529 o.advertiser = "foo"; | |
| 530 o.currencyCode = "foo"; | |
| 531 o.endTime = "foo"; | |
| 532 o.fixedCpm = "foo"; | |
| 533 o.id = "foo"; | |
| 534 o.kind = "foo"; | |
| 535 o.name = "foo"; | |
| 536 o.privateExchangeMinCpm = "foo"; | |
| 537 o.publisherBlocksOverriden = true; | |
| 538 o.sellerNetwork = "foo"; | |
| 539 o.startTime = "foo"; | |
| 540 } | |
| 541 buildCounterDirectDeal--; | |
| 542 return o; | |
| 543 } | |
| 544 | |
| 545 checkDirectDeal(api.DirectDeal o) { | |
| 546 buildCounterDirectDeal++; | |
| 547 if (buildCounterDirectDeal < 3) { | |
| 548 unittest.expect(o.accountId, unittest.equals(42)); | |
| 549 unittest.expect(o.advertiser, unittest.equals('foo')); | |
| 550 unittest.expect(o.currencyCode, unittest.equals('foo')); | |
| 551 unittest.expect(o.endTime, unittest.equals('foo')); | |
| 552 unittest.expect(o.fixedCpm, unittest.equals('foo')); | |
| 553 unittest.expect(o.id, unittest.equals('foo')); | |
| 554 unittest.expect(o.kind, unittest.equals('foo')); | |
| 555 unittest.expect(o.name, unittest.equals('foo')); | |
| 556 unittest.expect(o.privateExchangeMinCpm, unittest.equals('foo')); | |
| 557 unittest.expect(o.publisherBlocksOverriden, unittest.isTrue); | |
| 558 unittest.expect(o.sellerNetwork, unittest.equals('foo')); | |
| 559 unittest.expect(o.startTime, unittest.equals('foo')); | |
| 560 } | |
| 561 buildCounterDirectDeal--; | |
| 562 } | |
| 563 | |
| 564 buildUnnamed554() { | |
| 565 var o = new core.List<api.DirectDeal>(); | |
| 566 o.add(buildDirectDeal()); | |
| 567 o.add(buildDirectDeal()); | |
| 568 return o; | |
| 569 } | |
| 570 | |
| 571 checkUnnamed554(core.List<api.DirectDeal> o) { | |
| 572 unittest.expect(o, unittest.hasLength(2)); | |
| 573 checkDirectDeal(o[0]); | |
| 574 checkDirectDeal(o[1]); | |
| 575 } | |
| 576 | |
| 577 core.int buildCounterDirectDealsList = 0; | |
| 578 buildDirectDealsList() { | |
| 579 var o = new api.DirectDealsList(); | |
| 580 buildCounterDirectDealsList++; | |
| 581 if (buildCounterDirectDealsList < 3) { | |
| 582 o.directDeals = buildUnnamed554(); | |
| 583 o.kind = "foo"; | |
| 584 } | |
| 585 buildCounterDirectDealsList--; | |
| 586 return o; | |
| 587 } | |
| 588 | |
| 589 checkDirectDealsList(api.DirectDealsList o) { | |
| 590 buildCounterDirectDealsList++; | |
| 591 if (buildCounterDirectDealsList < 3) { | |
| 592 checkUnnamed554(o.directDeals); | |
| 593 unittest.expect(o.kind, unittest.equals('foo')); | |
| 594 } | |
| 595 buildCounterDirectDealsList--; | |
| 596 } | |
| 597 | |
| 598 buildUnnamed555() { | |
| 599 var o = new core.List<core.Object>(); | |
| 600 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 601 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 602 return o; | |
| 603 } | |
| 604 | |
| 605 checkUnnamed555(core.List<core.Object> o) { | |
| 606 unittest.expect(o, unittest.hasLength(2)); | |
| 607 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); | |
| 608 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); | |
| 609 } | |
| 610 | |
| 611 buildUnnamed556() { | |
| 612 var o = new core.List<core.Object>(); | |
| 613 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 614 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 615 return o; | |
| 616 } | |
| 617 | |
| 618 checkUnnamed556(core.List<core.Object> o) { | |
| 619 unittest.expect(o, unittest.hasLength(2)); | |
| 620 var casted3 = (o[0]) as core.Map; unittest.expect(casted3, unittest.hasLength(
3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], u
nittest.equals('foo')); | |
| 621 var casted4 = (o[1]) as core.Map; unittest.expect(casted4, unittest.hasLength(
3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], u
nittest.equals('foo')); | |
| 622 } | |
| 623 | |
| 624 buildUnnamed557() { | |
| 625 var o = new core.List<core.Object>(); | |
| 626 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 627 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 628 return o; | |
| 629 } | |
| 630 | |
| 631 checkUnnamed557(core.List<core.Object> o) { | |
| 632 unittest.expect(o, unittest.hasLength(2)); | |
| 633 var casted5 = (o[0]) as core.Map; unittest.expect(casted5, unittest.hasLength(
3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], u
nittest.equals('foo')); | |
| 634 var casted6 = (o[1]) as core.Map; unittest.expect(casted6, unittest.hasLength(
3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], u
nittest.equals('foo')); | |
| 635 } | |
| 636 | |
| 637 buildUnnamed558() { | |
| 638 var o = new core.List<core.Object>(); | |
| 639 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 640 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | |
| 641 return o; | |
| 642 } | |
| 643 | |
| 644 checkUnnamed558(core.List<core.Object> o) { | |
| 645 unittest.expect(o, unittest.hasLength(2)); | |
| 646 var casted7 = (o[0]) as core.Map; unittest.expect(casted7, unittest.hasLength(
3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"], u
nittest.equals('foo')); | |
| 647 var casted8 = (o[1]) as core.Map; unittest.expect(casted8, unittest.hasLength(
3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"], u
nittest.equals('foo')); | |
| 648 } | |
| 649 | |
| 650 core.int buildCounterPerformanceReport = 0; | |
| 651 buildPerformanceReport() { | |
| 652 var o = new api.PerformanceReport(); | |
| 653 buildCounterPerformanceReport++; | |
| 654 if (buildCounterPerformanceReport < 3) { | |
| 655 o.calloutStatusRate = buildUnnamed555(); | |
| 656 o.cookieMatcherStatusRate = buildUnnamed556(); | |
| 657 o.creativeStatusRate = buildUnnamed557(); | |
| 658 o.hostedMatchStatusRate = buildUnnamed558(); | |
| 659 o.kind = "foo"; | |
| 660 o.latency50thPercentile = 42.0; | |
| 661 o.latency85thPercentile = 42.0; | |
| 662 o.latency95thPercentile = 42.0; | |
| 663 o.noQuotaInRegion = 42.0; | |
| 664 o.outOfQuota = 42.0; | |
| 665 o.pixelMatchRequests = 42.0; | |
| 666 o.pixelMatchResponses = 42.0; | |
| 667 o.quotaConfiguredLimit = 42.0; | |
| 668 o.quotaThrottledLimit = 42.0; | |
| 669 o.region = "foo"; | |
| 670 o.timestamp = "foo"; | |
| 671 } | |
| 672 buildCounterPerformanceReport--; | |
| 673 return o; | |
| 674 } | |
| 675 | |
| 676 checkPerformanceReport(api.PerformanceReport o) { | |
| 677 buildCounterPerformanceReport++; | |
| 678 if (buildCounterPerformanceReport < 3) { | |
| 679 checkUnnamed555(o.calloutStatusRate); | |
| 680 checkUnnamed556(o.cookieMatcherStatusRate); | |
| 681 checkUnnamed557(o.creativeStatusRate); | |
| 682 checkUnnamed558(o.hostedMatchStatusRate); | |
| 683 unittest.expect(o.kind, unittest.equals('foo')); | |
| 684 unittest.expect(o.latency50thPercentile, unittest.equals(42.0)); | |
| 685 unittest.expect(o.latency85thPercentile, unittest.equals(42.0)); | |
| 686 unittest.expect(o.latency95thPercentile, unittest.equals(42.0)); | |
| 687 unittest.expect(o.noQuotaInRegion, unittest.equals(42.0)); | |
| 688 unittest.expect(o.outOfQuota, unittest.equals(42.0)); | |
| 689 unittest.expect(o.pixelMatchRequests, unittest.equals(42.0)); | |
| 690 unittest.expect(o.pixelMatchResponses, unittest.equals(42.0)); | |
| 691 unittest.expect(o.quotaConfiguredLimit, unittest.equals(42.0)); | |
| 692 unittest.expect(o.quotaThrottledLimit, unittest.equals(42.0)); | |
| 693 unittest.expect(o.region, unittest.equals('foo')); | |
| 694 unittest.expect(o.timestamp, unittest.equals('foo')); | |
| 695 } | |
| 696 buildCounterPerformanceReport--; | |
| 697 } | |
| 698 | |
| 699 buildUnnamed559() { | |
| 700 var o = new core.List<api.PerformanceReport>(); | |
| 701 o.add(buildPerformanceReport()); | |
| 702 o.add(buildPerformanceReport()); | |
| 703 return o; | |
| 704 } | |
| 705 | |
| 706 checkUnnamed559(core.List<api.PerformanceReport> o) { | |
| 707 unittest.expect(o, unittest.hasLength(2)); | |
| 708 checkPerformanceReport(o[0]); | |
| 709 checkPerformanceReport(o[1]); | |
| 710 } | |
| 711 | |
| 712 core.int buildCounterPerformanceReportList = 0; | |
| 713 buildPerformanceReportList() { | |
| 714 var o = new api.PerformanceReportList(); | |
| 715 buildCounterPerformanceReportList++; | |
| 716 if (buildCounterPerformanceReportList < 3) { | |
| 717 o.kind = "foo"; | |
| 718 o.performanceReport = buildUnnamed559(); | |
| 719 } | |
| 720 buildCounterPerformanceReportList--; | |
| 721 return o; | |
| 722 } | |
| 723 | |
| 724 checkPerformanceReportList(api.PerformanceReportList o) { | |
| 725 buildCounterPerformanceReportList++; | |
| 726 if (buildCounterPerformanceReportList < 3) { | |
| 727 unittest.expect(o.kind, unittest.equals('foo')); | |
| 728 checkUnnamed559(o.performanceReport); | |
| 729 } | |
| 730 buildCounterPerformanceReportList--; | |
| 731 } | |
| 732 | |
| 733 buildUnnamed560() { | |
| 734 var o = new core.List<core.String>(); | |
| 735 o.add("foo"); | |
| 736 o.add("foo"); | |
| 737 return o; | |
| 738 } | |
| 739 | |
| 740 checkUnnamed560(core.List<core.String> o) { | |
| 741 unittest.expect(o, unittest.hasLength(2)); | |
| 742 unittest.expect(o[0], unittest.equals('foo')); | |
| 743 unittest.expect(o[1], unittest.equals('foo')); | |
| 744 } | |
| 745 | |
| 746 core.int buildCounterPretargetingConfigDimensions = 0; | |
| 747 buildPretargetingConfigDimensions() { | |
| 748 var o = new api.PretargetingConfigDimensions(); | |
| 749 buildCounterPretargetingConfigDimensions++; | |
| 750 if (buildCounterPretargetingConfigDimensions < 3) { | |
| 751 o.height = "foo"; | |
| 752 o.width = "foo"; | |
| 753 } | |
| 754 buildCounterPretargetingConfigDimensions--; | |
| 755 return o; | |
| 756 } | |
| 757 | |
| 758 checkPretargetingConfigDimensions(api.PretargetingConfigDimensions o) { | |
| 759 buildCounterPretargetingConfigDimensions++; | |
| 760 if (buildCounterPretargetingConfigDimensions < 3) { | |
| 761 unittest.expect(o.height, unittest.equals('foo')); | |
| 762 unittest.expect(o.width, unittest.equals('foo')); | |
| 763 } | |
| 764 buildCounterPretargetingConfigDimensions--; | |
| 765 } | |
| 766 | |
| 767 buildUnnamed561() { | |
| 768 var o = new core.List<api.PretargetingConfigDimensions>(); | |
| 769 o.add(buildPretargetingConfigDimensions()); | |
| 770 o.add(buildPretargetingConfigDimensions()); | |
| 771 return o; | |
| 772 } | |
| 773 | |
| 774 checkUnnamed561(core.List<api.PretargetingConfigDimensions> o) { | |
| 775 unittest.expect(o, unittest.hasLength(2)); | |
| 776 checkPretargetingConfigDimensions(o[0]); | |
| 777 checkPretargetingConfigDimensions(o[1]); | |
| 778 } | |
| 779 | |
| 780 buildUnnamed562() { | |
| 781 var o = new core.List<core.String>(); | |
| 782 o.add("foo"); | |
| 783 o.add("foo"); | |
| 784 return o; | |
| 785 } | |
| 786 | |
| 787 checkUnnamed562(core.List<core.String> o) { | |
| 788 unittest.expect(o, unittest.hasLength(2)); | |
| 789 unittest.expect(o[0], unittest.equals('foo')); | |
| 790 unittest.expect(o[1], unittest.equals('foo')); | |
| 791 } | |
| 792 | |
| 793 buildUnnamed563() { | |
| 794 var o = new core.List<core.String>(); | |
| 795 o.add("foo"); | |
| 796 o.add("foo"); | |
| 797 return o; | |
| 798 } | |
| 799 | |
| 800 checkUnnamed563(core.List<core.String> o) { | |
| 801 unittest.expect(o, unittest.hasLength(2)); | |
| 802 unittest.expect(o[0], unittest.equals('foo')); | |
| 803 unittest.expect(o[1], unittest.equals('foo')); | |
| 804 } | |
| 805 | |
| 806 core.int buildCounterPretargetingConfigExcludedPlacements = 0; | |
| 807 buildPretargetingConfigExcludedPlacements() { | |
| 808 var o = new api.PretargetingConfigExcludedPlacements(); | |
| 809 buildCounterPretargetingConfigExcludedPlacements++; | |
| 810 if (buildCounterPretargetingConfigExcludedPlacements < 3) { | |
| 811 o.token = "foo"; | |
| 812 o.type = "foo"; | |
| 813 } | |
| 814 buildCounterPretargetingConfigExcludedPlacements--; | |
| 815 return o; | |
| 816 } | |
| 817 | |
| 818 checkPretargetingConfigExcludedPlacements(api.PretargetingConfigExcludedPlacemen
ts o) { | |
| 819 buildCounterPretargetingConfigExcludedPlacements++; | |
| 820 if (buildCounterPretargetingConfigExcludedPlacements < 3) { | |
| 821 unittest.expect(o.token, unittest.equals('foo')); | |
| 822 unittest.expect(o.type, unittest.equals('foo')); | |
| 823 } | |
| 824 buildCounterPretargetingConfigExcludedPlacements--; | |
| 825 } | |
| 826 | |
| 827 buildUnnamed564() { | |
| 828 var o = new core.List<api.PretargetingConfigExcludedPlacements>(); | |
| 829 o.add(buildPretargetingConfigExcludedPlacements()); | |
| 830 o.add(buildPretargetingConfigExcludedPlacements()); | |
| 831 return o; | |
| 832 } | |
| 833 | |
| 834 checkUnnamed564(core.List<api.PretargetingConfigExcludedPlacements> o) { | |
| 835 unittest.expect(o, unittest.hasLength(2)); | |
| 836 checkPretargetingConfigExcludedPlacements(o[0]); | |
| 837 checkPretargetingConfigExcludedPlacements(o[1]); | |
| 838 } | |
| 839 | |
| 840 buildUnnamed565() { | |
| 841 var o = new core.List<core.String>(); | |
| 842 o.add("foo"); | |
| 843 o.add("foo"); | |
| 844 return o; | |
| 845 } | |
| 846 | |
| 847 checkUnnamed565(core.List<core.String> o) { | |
| 848 unittest.expect(o, unittest.hasLength(2)); | |
| 849 unittest.expect(o[0], unittest.equals('foo')); | |
| 850 unittest.expect(o[1], unittest.equals('foo')); | |
| 851 } | |
| 852 | |
| 853 buildUnnamed566() { | |
| 854 var o = new core.List<core.String>(); | |
| 855 o.add("foo"); | |
| 856 o.add("foo"); | |
| 857 return o; | |
| 858 } | |
| 859 | |
| 860 checkUnnamed566(core.List<core.String> o) { | |
| 861 unittest.expect(o, unittest.hasLength(2)); | |
| 862 unittest.expect(o[0], unittest.equals('foo')); | |
| 863 unittest.expect(o[1], unittest.equals('foo')); | |
| 864 } | |
| 865 | |
| 866 buildUnnamed567() { | |
| 867 var o = new core.List<core.String>(); | |
| 868 o.add("foo"); | |
| 869 o.add("foo"); | |
| 870 return o; | |
| 871 } | |
| 872 | |
| 873 checkUnnamed567(core.List<core.String> o) { | |
| 874 unittest.expect(o, unittest.hasLength(2)); | |
| 875 unittest.expect(o[0], unittest.equals('foo')); | |
| 876 unittest.expect(o[1], unittest.equals('foo')); | |
| 877 } | |
| 878 | |
| 879 buildUnnamed568() { | |
| 880 var o = new core.List<core.String>(); | |
| 881 o.add("foo"); | |
| 882 o.add("foo"); | |
| 883 return o; | |
| 884 } | |
| 885 | |
| 886 checkUnnamed568(core.List<core.String> o) { | |
| 887 unittest.expect(o, unittest.hasLength(2)); | |
| 888 unittest.expect(o[0], unittest.equals('foo')); | |
| 889 unittest.expect(o[1], unittest.equals('foo')); | |
| 890 } | |
| 891 | |
| 892 buildUnnamed569() { | |
| 893 var o = new core.List<core.String>(); | |
| 894 o.add("foo"); | |
| 895 o.add("foo"); | |
| 896 return o; | |
| 897 } | |
| 898 | |
| 899 checkUnnamed569(core.List<core.String> o) { | |
| 900 unittest.expect(o, unittest.hasLength(2)); | |
| 901 unittest.expect(o[0], unittest.equals('foo')); | |
| 902 unittest.expect(o[1], unittest.equals('foo')); | |
| 903 } | |
| 904 | |
| 905 buildUnnamed570() { | |
| 906 var o = new core.List<core.String>(); | |
| 907 o.add("foo"); | |
| 908 o.add("foo"); | |
| 909 return o; | |
| 910 } | |
| 911 | |
| 912 checkUnnamed570(core.List<core.String> o) { | |
| 913 unittest.expect(o, unittest.hasLength(2)); | |
| 914 unittest.expect(o[0], unittest.equals('foo')); | |
| 915 unittest.expect(o[1], unittest.equals('foo')); | |
| 916 } | |
| 917 | |
| 918 buildUnnamed571() { | |
| 919 var o = new core.List<core.String>(); | |
| 920 o.add("foo"); | |
| 921 o.add("foo"); | |
| 922 return o; | |
| 923 } | |
| 924 | |
| 925 checkUnnamed571(core.List<core.String> o) { | |
| 926 unittest.expect(o, unittest.hasLength(2)); | |
| 927 unittest.expect(o[0], unittest.equals('foo')); | |
| 928 unittest.expect(o[1], unittest.equals('foo')); | |
| 929 } | |
| 930 | |
| 931 core.int buildCounterPretargetingConfigPlacements = 0; | |
| 932 buildPretargetingConfigPlacements() { | |
| 933 var o = new api.PretargetingConfigPlacements(); | |
| 934 buildCounterPretargetingConfigPlacements++; | |
| 935 if (buildCounterPretargetingConfigPlacements < 3) { | |
| 936 o.token = "foo"; | |
| 937 o.type = "foo"; | |
| 938 } | |
| 939 buildCounterPretargetingConfigPlacements--; | |
| 940 return o; | |
| 941 } | |
| 942 | |
| 943 checkPretargetingConfigPlacements(api.PretargetingConfigPlacements o) { | |
| 944 buildCounterPretargetingConfigPlacements++; | |
| 945 if (buildCounterPretargetingConfigPlacements < 3) { | |
| 946 unittest.expect(o.token, unittest.equals('foo')); | |
| 947 unittest.expect(o.type, unittest.equals('foo')); | |
| 948 } | |
| 949 buildCounterPretargetingConfigPlacements--; | |
| 950 } | |
| 951 | |
| 952 buildUnnamed572() { | |
| 953 var o = new core.List<api.PretargetingConfigPlacements>(); | |
| 954 o.add(buildPretargetingConfigPlacements()); | |
| 955 o.add(buildPretargetingConfigPlacements()); | |
| 956 return o; | |
| 957 } | |
| 958 | |
| 959 checkUnnamed572(core.List<api.PretargetingConfigPlacements> o) { | |
| 960 unittest.expect(o, unittest.hasLength(2)); | |
| 961 checkPretargetingConfigPlacements(o[0]); | |
| 962 checkPretargetingConfigPlacements(o[1]); | |
| 963 } | |
| 964 | |
| 965 buildUnnamed573() { | |
| 966 var o = new core.List<core.String>(); | |
| 967 o.add("foo"); | |
| 968 o.add("foo"); | |
| 969 return o; | |
| 970 } | |
| 971 | |
| 972 checkUnnamed573(core.List<core.String> o) { | |
| 973 unittest.expect(o, unittest.hasLength(2)); | |
| 974 unittest.expect(o[0], unittest.equals('foo')); | |
| 975 unittest.expect(o[1], unittest.equals('foo')); | |
| 976 } | |
| 977 | |
| 978 buildUnnamed574() { | |
| 979 var o = new core.List<core.String>(); | |
| 980 o.add("foo"); | |
| 981 o.add("foo"); | |
| 982 return o; | |
| 983 } | |
| 984 | |
| 985 checkUnnamed574(core.List<core.String> o) { | |
| 986 unittest.expect(o, unittest.hasLength(2)); | |
| 987 unittest.expect(o[0], unittest.equals('foo')); | |
| 988 unittest.expect(o[1], unittest.equals('foo')); | |
| 989 } | |
| 990 | |
| 991 buildUnnamed575() { | |
| 992 var o = new core.List<core.String>(); | |
| 993 o.add("foo"); | |
| 994 o.add("foo"); | |
| 995 return o; | |
| 996 } | |
| 997 | |
| 998 checkUnnamed575(core.List<core.String> o) { | |
| 999 unittest.expect(o, unittest.hasLength(2)); | |
| 1000 unittest.expect(o[0], unittest.equals('foo')); | |
| 1001 unittest.expect(o[1], unittest.equals('foo')); | |
| 1002 } | |
| 1003 | |
| 1004 buildUnnamed576() { | |
| 1005 var o = new core.List<core.String>(); | |
| 1006 o.add("foo"); | |
| 1007 o.add("foo"); | |
| 1008 return o; | |
| 1009 } | |
| 1010 | |
| 1011 checkUnnamed576(core.List<core.String> o) { | |
| 1012 unittest.expect(o, unittest.hasLength(2)); | |
| 1013 unittest.expect(o[0], unittest.equals('foo')); | |
| 1014 unittest.expect(o[1], unittest.equals('foo')); | |
| 1015 } | |
| 1016 | |
| 1017 buildUnnamed577() { | |
| 1018 var o = new core.List<core.String>(); | |
| 1019 o.add("foo"); | |
| 1020 o.add("foo"); | |
| 1021 return o; | |
| 1022 } | |
| 1023 | |
| 1024 checkUnnamed577(core.List<core.String> o) { | |
| 1025 unittest.expect(o, unittest.hasLength(2)); | |
| 1026 unittest.expect(o[0], unittest.equals('foo')); | |
| 1027 unittest.expect(o[1], unittest.equals('foo')); | |
| 1028 } | |
| 1029 | |
| 1030 core.int buildCounterPretargetingConfig = 0; | |
| 1031 buildPretargetingConfig() { | |
| 1032 var o = new api.PretargetingConfig(); | |
| 1033 buildCounterPretargetingConfig++; | |
| 1034 if (buildCounterPretargetingConfig < 3) { | |
| 1035 o.billingId = "foo"; | |
| 1036 o.configId = "foo"; | |
| 1037 o.configName = "foo"; | |
| 1038 o.creativeType = buildUnnamed560(); | |
| 1039 o.dimensions = buildUnnamed561(); | |
| 1040 o.excludedContentLabels = buildUnnamed562(); | |
| 1041 o.excludedGeoCriteriaIds = buildUnnamed563(); | |
| 1042 o.excludedPlacements = buildUnnamed564(); | |
| 1043 o.excludedUserLists = buildUnnamed565(); | |
| 1044 o.excludedVerticals = buildUnnamed566(); | |
| 1045 o.geoCriteriaIds = buildUnnamed567(); | |
| 1046 o.isActive = true; | |
| 1047 o.kind = "foo"; | |
| 1048 o.languages = buildUnnamed568(); | |
| 1049 o.mobileCarriers = buildUnnamed569(); | |
| 1050 o.mobileDevices = buildUnnamed570(); | |
| 1051 o.mobileOperatingSystemVersions = buildUnnamed571(); | |
| 1052 o.placements = buildUnnamed572(); | |
| 1053 o.platforms = buildUnnamed573(); | |
| 1054 o.supportedCreativeAttributes = buildUnnamed574(); | |
| 1055 o.userLists = buildUnnamed575(); | |
| 1056 o.vendorTypes = buildUnnamed576(); | |
| 1057 o.verticals = buildUnnamed577(); | |
| 1058 } | |
| 1059 buildCounterPretargetingConfig--; | |
| 1060 return o; | |
| 1061 } | |
| 1062 | |
| 1063 checkPretargetingConfig(api.PretargetingConfig o) { | |
| 1064 buildCounterPretargetingConfig++; | |
| 1065 if (buildCounterPretargetingConfig < 3) { | |
| 1066 unittest.expect(o.billingId, unittest.equals('foo')); | |
| 1067 unittest.expect(o.configId, unittest.equals('foo')); | |
| 1068 unittest.expect(o.configName, unittest.equals('foo')); | |
| 1069 checkUnnamed560(o.creativeType); | |
| 1070 checkUnnamed561(o.dimensions); | |
| 1071 checkUnnamed562(o.excludedContentLabels); | |
| 1072 checkUnnamed563(o.excludedGeoCriteriaIds); | |
| 1073 checkUnnamed564(o.excludedPlacements); | |
| 1074 checkUnnamed565(o.excludedUserLists); | |
| 1075 checkUnnamed566(o.excludedVerticals); | |
| 1076 checkUnnamed567(o.geoCriteriaIds); | |
| 1077 unittest.expect(o.isActive, unittest.isTrue); | |
| 1078 unittest.expect(o.kind, unittest.equals('foo')); | |
| 1079 checkUnnamed568(o.languages); | |
| 1080 checkUnnamed569(o.mobileCarriers); | |
| 1081 checkUnnamed570(o.mobileDevices); | |
| 1082 checkUnnamed571(o.mobileOperatingSystemVersions); | |
| 1083 checkUnnamed572(o.placements); | |
| 1084 checkUnnamed573(o.platforms); | |
| 1085 checkUnnamed574(o.supportedCreativeAttributes); | |
| 1086 checkUnnamed575(o.userLists); | |
| 1087 checkUnnamed576(o.vendorTypes); | |
| 1088 checkUnnamed577(o.verticals); | |
| 1089 } | |
| 1090 buildCounterPretargetingConfig--; | |
| 1091 } | |
| 1092 | |
| 1093 buildUnnamed578() { | |
| 1094 var o = new core.List<api.PretargetingConfig>(); | |
| 1095 o.add(buildPretargetingConfig()); | |
| 1096 o.add(buildPretargetingConfig()); | |
| 1097 return o; | |
| 1098 } | |
| 1099 | |
| 1100 checkUnnamed578(core.List<api.PretargetingConfig> o) { | |
| 1101 unittest.expect(o, unittest.hasLength(2)); | |
| 1102 checkPretargetingConfig(o[0]); | |
| 1103 checkPretargetingConfig(o[1]); | |
| 1104 } | |
| 1105 | |
| 1106 core.int buildCounterPretargetingConfigList = 0; | |
| 1107 buildPretargetingConfigList() { | |
| 1108 var o = new api.PretargetingConfigList(); | |
| 1109 buildCounterPretargetingConfigList++; | |
| 1110 if (buildCounterPretargetingConfigList < 3) { | |
| 1111 o.items = buildUnnamed578(); | |
| 1112 o.kind = "foo"; | |
| 1113 } | |
| 1114 buildCounterPretargetingConfigList--; | |
| 1115 return o; | |
| 1116 } | |
| 1117 | |
| 1118 checkPretargetingConfigList(api.PretargetingConfigList o) { | |
| 1119 buildCounterPretargetingConfigList++; | |
| 1120 if (buildCounterPretargetingConfigList < 3) { | |
| 1121 checkUnnamed578(o.items); | |
| 1122 unittest.expect(o.kind, unittest.equals('foo')); | |
| 1123 } | |
| 1124 buildCounterPretargetingConfigList--; | |
| 1125 } | |
| 1126 | |
| 1127 buildUnnamed579() { | |
| 1128 var o = new core.List<core.int>(); | |
| 1129 o.add(42); | |
| 1130 o.add(42); | |
| 1131 return o; | |
| 1132 } | |
| 1133 | |
| 1134 checkUnnamed579(core.List<core.int> o) { | |
| 1135 unittest.expect(o, unittest.hasLength(2)); | |
| 1136 unittest.expect(o[0], unittest.equals(42)); | |
| 1137 unittest.expect(o[1], unittest.equals(42)); | |
| 1138 } | |
| 1139 | |
| 1140 buildUnnamed580() { | |
| 1141 var o = new core.List<core.String>(); | |
| 1142 o.add("foo"); | |
| 1143 o.add("foo"); | |
| 1144 return o; | |
| 1145 } | |
| 1146 | |
| 1147 checkUnnamed580(core.List<core.String> o) { | |
| 1148 unittest.expect(o, unittest.hasLength(2)); | |
| 1149 unittest.expect(o[0], unittest.equals('foo')); | |
| 1150 unittest.expect(o[1], unittest.equals('foo')); | |
| 1151 } | |
| 1152 | |
| 1153 | |
| 1154 main() { | |
| 1155 unittest.group("obj-schema-AccountBidderLocation", () { | |
| 1156 unittest.test("to-json--from-json", () { | |
| 1157 var o = buildAccountBidderLocation(); | |
| 1158 var od = new api.AccountBidderLocation.fromJson(o.toJson()); | |
| 1159 checkAccountBidderLocation(od); | |
| 1160 }); | |
| 1161 }); | |
| 1162 | |
| 1163 | |
| 1164 unittest.group("obj-schema-Account", () { | |
| 1165 unittest.test("to-json--from-json", () { | |
| 1166 var o = buildAccount(); | |
| 1167 var od = new api.Account.fromJson(o.toJson()); | |
| 1168 checkAccount(od); | |
| 1169 }); | |
| 1170 }); | |
| 1171 | |
| 1172 | |
| 1173 unittest.group("obj-schema-AccountsList", () { | |
| 1174 unittest.test("to-json--from-json", () { | |
| 1175 var o = buildAccountsList(); | |
| 1176 var od = new api.AccountsList.fromJson(o.toJson()); | |
| 1177 checkAccountsList(od); | |
| 1178 }); | |
| 1179 }); | |
| 1180 | |
| 1181 | |
| 1182 unittest.group("obj-schema-BillingInfo", () { | |
| 1183 unittest.test("to-json--from-json", () { | |
| 1184 var o = buildBillingInfo(); | |
| 1185 var od = new api.BillingInfo.fromJson(o.toJson()); | |
| 1186 checkBillingInfo(od); | |
| 1187 }); | |
| 1188 }); | |
| 1189 | |
| 1190 | |
| 1191 unittest.group("obj-schema-BillingInfoList", () { | |
| 1192 unittest.test("to-json--from-json", () { | |
| 1193 var o = buildBillingInfoList(); | |
| 1194 var od = new api.BillingInfoList.fromJson(o.toJson()); | |
| 1195 checkBillingInfoList(od); | |
| 1196 }); | |
| 1197 }); | |
| 1198 | |
| 1199 | |
| 1200 unittest.group("obj-schema-CreativeCorrections", () { | |
| 1201 unittest.test("to-json--from-json", () { | |
| 1202 var o = buildCreativeCorrections(); | |
| 1203 var od = new api.CreativeCorrections.fromJson(o.toJson()); | |
| 1204 checkCreativeCorrections(od); | |
| 1205 }); | |
| 1206 }); | |
| 1207 | |
| 1208 | |
| 1209 unittest.group("obj-schema-CreativeDisapprovalReasons", () { | |
| 1210 unittest.test("to-json--from-json", () { | |
| 1211 var o = buildCreativeDisapprovalReasons(); | |
| 1212 var od = new api.CreativeDisapprovalReasons.fromJson(o.toJson()); | |
| 1213 checkCreativeDisapprovalReasons(od); | |
| 1214 }); | |
| 1215 }); | |
| 1216 | |
| 1217 | |
| 1218 unittest.group("obj-schema-CreativeFilteringReasonsReasons", () { | |
| 1219 unittest.test("to-json--from-json", () { | |
| 1220 var o = buildCreativeFilteringReasonsReasons(); | |
| 1221 var od = new api.CreativeFilteringReasonsReasons.fromJson(o.toJson()); | |
| 1222 checkCreativeFilteringReasonsReasons(od); | |
| 1223 }); | |
| 1224 }); | |
| 1225 | |
| 1226 | |
| 1227 unittest.group("obj-schema-CreativeFilteringReasons", () { | |
| 1228 unittest.test("to-json--from-json", () { | |
| 1229 var o = buildCreativeFilteringReasons(); | |
| 1230 var od = new api.CreativeFilteringReasons.fromJson(o.toJson()); | |
| 1231 checkCreativeFilteringReasons(od); | |
| 1232 }); | |
| 1233 }); | |
| 1234 | |
| 1235 | |
| 1236 unittest.group("obj-schema-Creative", () { | |
| 1237 unittest.test("to-json--from-json", () { | |
| 1238 var o = buildCreative(); | |
| 1239 var od = new api.Creative.fromJson(o.toJson()); | |
| 1240 checkCreative(od); | |
| 1241 }); | |
| 1242 }); | |
| 1243 | |
| 1244 | |
| 1245 unittest.group("obj-schema-CreativesList", () { | |
| 1246 unittest.test("to-json--from-json", () { | |
| 1247 var o = buildCreativesList(); | |
| 1248 var od = new api.CreativesList.fromJson(o.toJson()); | |
| 1249 checkCreativesList(od); | |
| 1250 }); | |
| 1251 }); | |
| 1252 | |
| 1253 | |
| 1254 unittest.group("obj-schema-DirectDeal", () { | |
| 1255 unittest.test("to-json--from-json", () { | |
| 1256 var o = buildDirectDeal(); | |
| 1257 var od = new api.DirectDeal.fromJson(o.toJson()); | |
| 1258 checkDirectDeal(od); | |
| 1259 }); | |
| 1260 }); | |
| 1261 | |
| 1262 | |
| 1263 unittest.group("obj-schema-DirectDealsList", () { | |
| 1264 unittest.test("to-json--from-json", () { | |
| 1265 var o = buildDirectDealsList(); | |
| 1266 var od = new api.DirectDealsList.fromJson(o.toJson()); | |
| 1267 checkDirectDealsList(od); | |
| 1268 }); | |
| 1269 }); | |
| 1270 | |
| 1271 | |
| 1272 unittest.group("obj-schema-PerformanceReport", () { | |
| 1273 unittest.test("to-json--from-json", () { | |
| 1274 var o = buildPerformanceReport(); | |
| 1275 var od = new api.PerformanceReport.fromJson(o.toJson()); | |
| 1276 checkPerformanceReport(od); | |
| 1277 }); | |
| 1278 }); | |
| 1279 | |
| 1280 | |
| 1281 unittest.group("obj-schema-PerformanceReportList", () { | |
| 1282 unittest.test("to-json--from-json", () { | |
| 1283 var o = buildPerformanceReportList(); | |
| 1284 var od = new api.PerformanceReportList.fromJson(o.toJson()); | |
| 1285 checkPerformanceReportList(od); | |
| 1286 }); | |
| 1287 }); | |
| 1288 | |
| 1289 | |
| 1290 unittest.group("obj-schema-PretargetingConfigDimensions", () { | |
| 1291 unittest.test("to-json--from-json", () { | |
| 1292 var o = buildPretargetingConfigDimensions(); | |
| 1293 var od = new api.PretargetingConfigDimensions.fromJson(o.toJson()); | |
| 1294 checkPretargetingConfigDimensions(od); | |
| 1295 }); | |
| 1296 }); | |
| 1297 | |
| 1298 | |
| 1299 unittest.group("obj-schema-PretargetingConfigExcludedPlacements", () { | |
| 1300 unittest.test("to-json--from-json", () { | |
| 1301 var o = buildPretargetingConfigExcludedPlacements(); | |
| 1302 var od = new api.PretargetingConfigExcludedPlacements.fromJson(o.toJson())
; | |
| 1303 checkPretargetingConfigExcludedPlacements(od); | |
| 1304 }); | |
| 1305 }); | |
| 1306 | |
| 1307 | |
| 1308 unittest.group("obj-schema-PretargetingConfigPlacements", () { | |
| 1309 unittest.test("to-json--from-json", () { | |
| 1310 var o = buildPretargetingConfigPlacements(); | |
| 1311 var od = new api.PretargetingConfigPlacements.fromJson(o.toJson()); | |
| 1312 checkPretargetingConfigPlacements(od); | |
| 1313 }); | |
| 1314 }); | |
| 1315 | |
| 1316 | |
| 1317 unittest.group("obj-schema-PretargetingConfig", () { | |
| 1318 unittest.test("to-json--from-json", () { | |
| 1319 var o = buildPretargetingConfig(); | |
| 1320 var od = new api.PretargetingConfig.fromJson(o.toJson()); | |
| 1321 checkPretargetingConfig(od); | |
| 1322 }); | |
| 1323 }); | |
| 1324 | |
| 1325 | |
| 1326 unittest.group("obj-schema-PretargetingConfigList", () { | |
| 1327 unittest.test("to-json--from-json", () { | |
| 1328 var o = buildPretargetingConfigList(); | |
| 1329 var od = new api.PretargetingConfigList.fromJson(o.toJson()); | |
| 1330 checkPretargetingConfigList(od); | |
| 1331 }); | |
| 1332 }); | |
| 1333 | |
| 1334 | |
| 1335 unittest.group("resource-AccountsResourceApi", () { | |
| 1336 unittest.test("method--get", () { | |
| 1337 | |
| 1338 var mock = new common_test.HttpServerMock(); | |
| 1339 api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; | |
| 1340 var arg_id = 42; | |
| 1341 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1342 var path = (req.url).path; | |
| 1343 var pathOffset = 0; | |
| 1344 var index; | |
| 1345 var subPart; | |
| 1346 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1347 pathOffset += 22; | |
| 1348 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("accounts/")); | |
| 1349 pathOffset += 9; | |
| 1350 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1351 pathOffset = path.length; | |
| 1352 unittest.expect(subPart, unittest.equals("$arg_id")); | |
| 1353 | |
| 1354 var query = (req.url).query; | |
| 1355 var queryOffset = 0; | |
| 1356 var queryMap = {}; | |
| 1357 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1358 parseBool(n) { | |
| 1359 if (n == "true") return true; | |
| 1360 if (n == "false") return false; | |
| 1361 if (n == null) return null; | |
| 1362 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1363 } | |
| 1364 if (query.length > 0) { | |
| 1365 for (var part in query.split("&")) { | |
| 1366 var keyvalue = part.split("="); | |
| 1367 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1368 } | |
| 1369 } | |
| 1370 | |
| 1371 | |
| 1372 var h = { | |
| 1373 "content-type" : "application/json; charset=utf-8", | |
| 1374 }; | |
| 1375 var resp = convert.JSON.encode(buildAccount()); | |
| 1376 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1377 }), true); | |
| 1378 res.get(arg_id).then(unittest.expectAsync(((api.Account response) { | |
| 1379 checkAccount(response); | |
| 1380 }))); | |
| 1381 }); | |
| 1382 | |
| 1383 unittest.test("method--list", () { | |
| 1384 | |
| 1385 var mock = new common_test.HttpServerMock(); | |
| 1386 api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; | |
| 1387 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1388 var path = (req.url).path; | |
| 1389 var pathOffset = 0; | |
| 1390 var index; | |
| 1391 var subPart; | |
| 1392 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1393 pathOffset += 22; | |
| 1394 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("accounts")); | |
| 1395 pathOffset += 8; | |
| 1396 | |
| 1397 var query = (req.url).query; | |
| 1398 var queryOffset = 0; | |
| 1399 var queryMap = {}; | |
| 1400 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1401 parseBool(n) { | |
| 1402 if (n == "true") return true; | |
| 1403 if (n == "false") return false; | |
| 1404 if (n == null) return null; | |
| 1405 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1406 } | |
| 1407 if (query.length > 0) { | |
| 1408 for (var part in query.split("&")) { | |
| 1409 var keyvalue = part.split("="); | |
| 1410 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1411 } | |
| 1412 } | |
| 1413 | |
| 1414 | |
| 1415 var h = { | |
| 1416 "content-type" : "application/json; charset=utf-8", | |
| 1417 }; | |
| 1418 var resp = convert.JSON.encode(buildAccountsList()); | |
| 1419 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1420 }), true); | |
| 1421 res.list().then(unittest.expectAsync(((api.AccountsList response) { | |
| 1422 checkAccountsList(response); | |
| 1423 }))); | |
| 1424 }); | |
| 1425 | |
| 1426 unittest.test("method--patch", () { | |
| 1427 | |
| 1428 var mock = new common_test.HttpServerMock(); | |
| 1429 api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; | |
| 1430 var arg_request = buildAccount(); | |
| 1431 var arg_id = 42; | |
| 1432 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1433 var obj = new api.Account.fromJson(json); | |
| 1434 checkAccount(obj); | |
| 1435 | |
| 1436 var path = (req.url).path; | |
| 1437 var pathOffset = 0; | |
| 1438 var index; | |
| 1439 var subPart; | |
| 1440 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1441 pathOffset += 22; | |
| 1442 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("accounts/")); | |
| 1443 pathOffset += 9; | |
| 1444 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1445 pathOffset = path.length; | |
| 1446 unittest.expect(subPart, unittest.equals("$arg_id")); | |
| 1447 | |
| 1448 var query = (req.url).query; | |
| 1449 var queryOffset = 0; | |
| 1450 var queryMap = {}; | |
| 1451 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1452 parseBool(n) { | |
| 1453 if (n == "true") return true; | |
| 1454 if (n == "false") return false; | |
| 1455 if (n == null) return null; | |
| 1456 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1457 } | |
| 1458 if (query.length > 0) { | |
| 1459 for (var part in query.split("&")) { | |
| 1460 var keyvalue = part.split("="); | |
| 1461 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1462 } | |
| 1463 } | |
| 1464 | |
| 1465 | |
| 1466 var h = { | |
| 1467 "content-type" : "application/json; charset=utf-8", | |
| 1468 }; | |
| 1469 var resp = convert.JSON.encode(buildAccount()); | |
| 1470 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1471 }), true); | |
| 1472 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.Account res
ponse) { | |
| 1473 checkAccount(response); | |
| 1474 }))); | |
| 1475 }); | |
| 1476 | |
| 1477 unittest.test("method--update", () { | |
| 1478 | |
| 1479 var mock = new common_test.HttpServerMock(); | |
| 1480 api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; | |
| 1481 var arg_request = buildAccount(); | |
| 1482 var arg_id = 42; | |
| 1483 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1484 var obj = new api.Account.fromJson(json); | |
| 1485 checkAccount(obj); | |
| 1486 | |
| 1487 var path = (req.url).path; | |
| 1488 var pathOffset = 0; | |
| 1489 var index; | |
| 1490 var subPart; | |
| 1491 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1492 pathOffset += 22; | |
| 1493 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("accounts/")); | |
| 1494 pathOffset += 9; | |
| 1495 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1496 pathOffset = path.length; | |
| 1497 unittest.expect(subPart, unittest.equals("$arg_id")); | |
| 1498 | |
| 1499 var query = (req.url).query; | |
| 1500 var queryOffset = 0; | |
| 1501 var queryMap = {}; | |
| 1502 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1503 parseBool(n) { | |
| 1504 if (n == "true") return true; | |
| 1505 if (n == "false") return false; | |
| 1506 if (n == null) return null; | |
| 1507 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1508 } | |
| 1509 if (query.length > 0) { | |
| 1510 for (var part in query.split("&")) { | |
| 1511 var keyvalue = part.split("="); | |
| 1512 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1513 } | |
| 1514 } | |
| 1515 | |
| 1516 | |
| 1517 var h = { | |
| 1518 "content-type" : "application/json; charset=utf-8", | |
| 1519 }; | |
| 1520 var resp = convert.JSON.encode(buildAccount()); | |
| 1521 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1522 }), true); | |
| 1523 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Account re
sponse) { | |
| 1524 checkAccount(response); | |
| 1525 }))); | |
| 1526 }); | |
| 1527 | |
| 1528 }); | |
| 1529 | |
| 1530 | |
| 1531 unittest.group("resource-BillingInfoResourceApi", () { | |
| 1532 unittest.test("method--get", () { | |
| 1533 | |
| 1534 var mock = new common_test.HttpServerMock(); | |
| 1535 api.BillingInfoResourceApi res = new api.AdexchangebuyerApi(mock).billingI
nfo; | |
| 1536 var arg_accountId = 42; | |
| 1537 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1538 var path = (req.url).path; | |
| 1539 var pathOffset = 0; | |
| 1540 var index; | |
| 1541 var subPart; | |
| 1542 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1543 pathOffset += 22; | |
| 1544 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("billinginfo/")); | |
| 1545 pathOffset += 12; | |
| 1546 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1547 pathOffset = path.length; | |
| 1548 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 1549 | |
| 1550 var query = (req.url).query; | |
| 1551 var queryOffset = 0; | |
| 1552 var queryMap = {}; | |
| 1553 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1554 parseBool(n) { | |
| 1555 if (n == "true") return true; | |
| 1556 if (n == "false") return false; | |
| 1557 if (n == null) return null; | |
| 1558 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1559 } | |
| 1560 if (query.length > 0) { | |
| 1561 for (var part in query.split("&")) { | |
| 1562 var keyvalue = part.split("="); | |
| 1563 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1564 } | |
| 1565 } | |
| 1566 | |
| 1567 | |
| 1568 var h = { | |
| 1569 "content-type" : "application/json; charset=utf-8", | |
| 1570 }; | |
| 1571 var resp = convert.JSON.encode(buildBillingInfo()); | |
| 1572 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1573 }), true); | |
| 1574 res.get(arg_accountId).then(unittest.expectAsync(((api.BillingInfo respons
e) { | |
| 1575 checkBillingInfo(response); | |
| 1576 }))); | |
| 1577 }); | |
| 1578 | |
| 1579 unittest.test("method--list", () { | |
| 1580 | |
| 1581 var mock = new common_test.HttpServerMock(); | |
| 1582 api.BillingInfoResourceApi res = new api.AdexchangebuyerApi(mock).billingI
nfo; | |
| 1583 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1584 var path = (req.url).path; | |
| 1585 var pathOffset = 0; | |
| 1586 var index; | |
| 1587 var subPart; | |
| 1588 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1589 pathOffset += 22; | |
| 1590 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("billinginfo")); | |
| 1591 pathOffset += 11; | |
| 1592 | |
| 1593 var query = (req.url).query; | |
| 1594 var queryOffset = 0; | |
| 1595 var queryMap = {}; | |
| 1596 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1597 parseBool(n) { | |
| 1598 if (n == "true") return true; | |
| 1599 if (n == "false") return false; | |
| 1600 if (n == null) return null; | |
| 1601 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1602 } | |
| 1603 if (query.length > 0) { | |
| 1604 for (var part in query.split("&")) { | |
| 1605 var keyvalue = part.split("="); | |
| 1606 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1607 } | |
| 1608 } | |
| 1609 | |
| 1610 | |
| 1611 var h = { | |
| 1612 "content-type" : "application/json; charset=utf-8", | |
| 1613 }; | |
| 1614 var resp = convert.JSON.encode(buildBillingInfoList()); | |
| 1615 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1616 }), true); | |
| 1617 res.list().then(unittest.expectAsync(((api.BillingInfoList response) { | |
| 1618 checkBillingInfoList(response); | |
| 1619 }))); | |
| 1620 }); | |
| 1621 | |
| 1622 }); | |
| 1623 | |
| 1624 | |
| 1625 unittest.group("resource-CreativesResourceApi", () { | |
| 1626 unittest.test("method--get", () { | |
| 1627 | |
| 1628 var mock = new common_test.HttpServerMock(); | |
| 1629 api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; | |
| 1630 var arg_accountId = 42; | |
| 1631 var arg_buyerCreativeId = "foo"; | |
| 1632 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1633 var path = (req.url).path; | |
| 1634 var pathOffset = 0; | |
| 1635 var index; | |
| 1636 var subPart; | |
| 1637 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1638 pathOffset += 22; | |
| 1639 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("creatives/")); | |
| 1640 pathOffset += 10; | |
| 1641 index = path.indexOf("/", pathOffset); | |
| 1642 unittest.expect(index >= 0, unittest.isTrue); | |
| 1643 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 1644 pathOffset = index; | |
| 1645 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 1646 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
| 1647 pathOffset += 1; | |
| 1648 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1649 pathOffset = path.length; | |
| 1650 unittest.expect(subPart, unittest.equals("$arg_buyerCreativeId")); | |
| 1651 | |
| 1652 var query = (req.url).query; | |
| 1653 var queryOffset = 0; | |
| 1654 var queryMap = {}; | |
| 1655 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1656 parseBool(n) { | |
| 1657 if (n == "true") return true; | |
| 1658 if (n == "false") return false; | |
| 1659 if (n == null) return null; | |
| 1660 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1661 } | |
| 1662 if (query.length > 0) { | |
| 1663 for (var part in query.split("&")) { | |
| 1664 var keyvalue = part.split("="); | |
| 1665 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1666 } | |
| 1667 } | |
| 1668 | |
| 1669 | |
| 1670 var h = { | |
| 1671 "content-type" : "application/json; charset=utf-8", | |
| 1672 }; | |
| 1673 var resp = convert.JSON.encode(buildCreative()); | |
| 1674 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1675 }), true); | |
| 1676 res.get(arg_accountId, arg_buyerCreativeId).then(unittest.expectAsync(((ap
i.Creative response) { | |
| 1677 checkCreative(response); | |
| 1678 }))); | |
| 1679 }); | |
| 1680 | |
| 1681 unittest.test("method--insert", () { | |
| 1682 | |
| 1683 var mock = new common_test.HttpServerMock(); | |
| 1684 api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; | |
| 1685 var arg_request = buildCreative(); | |
| 1686 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1687 var obj = new api.Creative.fromJson(json); | |
| 1688 checkCreative(obj); | |
| 1689 | |
| 1690 var path = (req.url).path; | |
| 1691 var pathOffset = 0; | |
| 1692 var index; | |
| 1693 var subPart; | |
| 1694 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1695 pathOffset += 22; | |
| 1696 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("creatives")); | |
| 1697 pathOffset += 9; | |
| 1698 | |
| 1699 var query = (req.url).query; | |
| 1700 var queryOffset = 0; | |
| 1701 var queryMap = {}; | |
| 1702 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1703 parseBool(n) { | |
| 1704 if (n == "true") return true; | |
| 1705 if (n == "false") return false; | |
| 1706 if (n == null) return null; | |
| 1707 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1708 } | |
| 1709 if (query.length > 0) { | |
| 1710 for (var part in query.split("&")) { | |
| 1711 var keyvalue = part.split("="); | |
| 1712 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1713 } | |
| 1714 } | |
| 1715 | |
| 1716 | |
| 1717 var h = { | |
| 1718 "content-type" : "application/json; charset=utf-8", | |
| 1719 }; | |
| 1720 var resp = convert.JSON.encode(buildCreative()); | |
| 1721 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1722 }), true); | |
| 1723 res.insert(arg_request).then(unittest.expectAsync(((api.Creative response)
{ | |
| 1724 checkCreative(response); | |
| 1725 }))); | |
| 1726 }); | |
| 1727 | |
| 1728 unittest.test("method--list", () { | |
| 1729 | |
| 1730 var mock = new common_test.HttpServerMock(); | |
| 1731 api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; | |
| 1732 var arg_accountId = buildUnnamed579(); | |
| 1733 var arg_buyerCreativeId = buildUnnamed580(); | |
| 1734 var arg_maxResults = 42; | |
| 1735 var arg_pageToken = "foo"; | |
| 1736 var arg_statusFilter = "foo"; | |
| 1737 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1738 var path = (req.url).path; | |
| 1739 var pathOffset = 0; | |
| 1740 var index; | |
| 1741 var subPart; | |
| 1742 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1743 pathOffset += 22; | |
| 1744 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("creatives")); | |
| 1745 pathOffset += 9; | |
| 1746 | |
| 1747 var query = (req.url).query; | |
| 1748 var queryOffset = 0; | |
| 1749 var queryMap = {}; | |
| 1750 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1751 parseBool(n) { | |
| 1752 if (n == "true") return true; | |
| 1753 if (n == "false") return false; | |
| 1754 if (n == null) return null; | |
| 1755 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1756 } | |
| 1757 if (query.length > 0) { | |
| 1758 for (var part in query.split("&")) { | |
| 1759 var keyvalue = part.split("="); | |
| 1760 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1761 } | |
| 1762 } | |
| 1763 unittest.expect(queryMap["accountId"].map(core.int.parse).toList(), unit
test.equals(arg_accountId)); | |
| 1764 unittest.expect(queryMap["buyerCreativeId"], unittest.equals(arg_buyerCr
eativeId)); | |
| 1765 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 1766 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1767 unittest.expect(queryMap["statusFilter"].first, unittest.equals(arg_stat
usFilter)); | |
| 1768 | |
| 1769 | |
| 1770 var h = { | |
| 1771 "content-type" : "application/json; charset=utf-8", | |
| 1772 }; | |
| 1773 var resp = convert.JSON.encode(buildCreativesList()); | |
| 1774 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1775 }), true); | |
| 1776 res.list(accountId: arg_accountId, buyerCreativeId: arg_buyerCreativeId, m
axResults: arg_maxResults, pageToken: arg_pageToken, statusFilter: arg_statusFil
ter).then(unittest.expectAsync(((api.CreativesList response) { | |
| 1777 checkCreativesList(response); | |
| 1778 }))); | |
| 1779 }); | |
| 1780 | |
| 1781 }); | |
| 1782 | |
| 1783 | |
| 1784 unittest.group("resource-DirectDealsResourceApi", () { | |
| 1785 unittest.test("method--get", () { | |
| 1786 | |
| 1787 var mock = new common_test.HttpServerMock(); | |
| 1788 api.DirectDealsResourceApi res = new api.AdexchangebuyerApi(mock).directDe
als; | |
| 1789 var arg_id = "foo"; | |
| 1790 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1791 var path = (req.url).path; | |
| 1792 var pathOffset = 0; | |
| 1793 var index; | |
| 1794 var subPart; | |
| 1795 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1796 pathOffset += 22; | |
| 1797 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("directdeals/")); | |
| 1798 pathOffset += 12; | |
| 1799 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1800 pathOffset = path.length; | |
| 1801 unittest.expect(subPart, unittest.equals("$arg_id")); | |
| 1802 | |
| 1803 var query = (req.url).query; | |
| 1804 var queryOffset = 0; | |
| 1805 var queryMap = {}; | |
| 1806 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1807 parseBool(n) { | |
| 1808 if (n == "true") return true; | |
| 1809 if (n == "false") return false; | |
| 1810 if (n == null) return null; | |
| 1811 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1812 } | |
| 1813 if (query.length > 0) { | |
| 1814 for (var part in query.split("&")) { | |
| 1815 var keyvalue = part.split("="); | |
| 1816 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1817 } | |
| 1818 } | |
| 1819 | |
| 1820 | |
| 1821 var h = { | |
| 1822 "content-type" : "application/json; charset=utf-8", | |
| 1823 }; | |
| 1824 var resp = convert.JSON.encode(buildDirectDeal()); | |
| 1825 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1826 }), true); | |
| 1827 res.get(arg_id).then(unittest.expectAsync(((api.DirectDeal response) { | |
| 1828 checkDirectDeal(response); | |
| 1829 }))); | |
| 1830 }); | |
| 1831 | |
| 1832 unittest.test("method--list", () { | |
| 1833 | |
| 1834 var mock = new common_test.HttpServerMock(); | |
| 1835 api.DirectDealsResourceApi res = new api.AdexchangebuyerApi(mock).directDe
als; | |
| 1836 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1837 var path = (req.url).path; | |
| 1838 var pathOffset = 0; | |
| 1839 var index; | |
| 1840 var subPart; | |
| 1841 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1842 pathOffset += 22; | |
| 1843 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("directdeals")); | |
| 1844 pathOffset += 11; | |
| 1845 | |
| 1846 var query = (req.url).query; | |
| 1847 var queryOffset = 0; | |
| 1848 var queryMap = {}; | |
| 1849 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1850 parseBool(n) { | |
| 1851 if (n == "true") return true; | |
| 1852 if (n == "false") return false; | |
| 1853 if (n == null) return null; | |
| 1854 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1855 } | |
| 1856 if (query.length > 0) { | |
| 1857 for (var part in query.split("&")) { | |
| 1858 var keyvalue = part.split("="); | |
| 1859 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1860 } | |
| 1861 } | |
| 1862 | |
| 1863 | |
| 1864 var h = { | |
| 1865 "content-type" : "application/json; charset=utf-8", | |
| 1866 }; | |
| 1867 var resp = convert.JSON.encode(buildDirectDealsList()); | |
| 1868 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1869 }), true); | |
| 1870 res.list().then(unittest.expectAsync(((api.DirectDealsList response) { | |
| 1871 checkDirectDealsList(response); | |
| 1872 }))); | |
| 1873 }); | |
| 1874 | |
| 1875 }); | |
| 1876 | |
| 1877 | |
| 1878 unittest.group("resource-PerformanceReportResourceApi", () { | |
| 1879 unittest.test("method--list", () { | |
| 1880 | |
| 1881 var mock = new common_test.HttpServerMock(); | |
| 1882 api.PerformanceReportResourceApi res = new api.AdexchangebuyerApi(mock).pe
rformanceReport; | |
| 1883 var arg_accountId = "foo"; | |
| 1884 var arg_endDateTime = "foo"; | |
| 1885 var arg_startDateTime = "foo"; | |
| 1886 var arg_maxResults = 42; | |
| 1887 var arg_pageToken = "foo"; | |
| 1888 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1889 var path = (req.url).path; | |
| 1890 var pathOffset = 0; | |
| 1891 var index; | |
| 1892 var subPart; | |
| 1893 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1894 pathOffset += 22; | |
| 1895 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("performancereport")); | |
| 1896 pathOffset += 17; | |
| 1897 | |
| 1898 var query = (req.url).query; | |
| 1899 var queryOffset = 0; | |
| 1900 var queryMap = {}; | |
| 1901 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1902 parseBool(n) { | |
| 1903 if (n == "true") return true; | |
| 1904 if (n == "false") return false; | |
| 1905 if (n == null) return null; | |
| 1906 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1907 } | |
| 1908 if (query.length > 0) { | |
| 1909 for (var part in query.split("&")) { | |
| 1910 var keyvalue = part.split("="); | |
| 1911 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1912 } | |
| 1913 } | |
| 1914 unittest.expect(queryMap["accountId"].first, unittest.equals(arg_account
Id)); | |
| 1915 unittest.expect(queryMap["endDateTime"].first, unittest.equals(arg_endDa
teTime)); | |
| 1916 unittest.expect(queryMap["startDateTime"].first, unittest.equals(arg_sta
rtDateTime)); | |
| 1917 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 1918 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1919 | |
| 1920 | |
| 1921 var h = { | |
| 1922 "content-type" : "application/json; charset=utf-8", | |
| 1923 }; | |
| 1924 var resp = convert.JSON.encode(buildPerformanceReportList()); | |
| 1925 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1926 }), true); | |
| 1927 res.list(arg_accountId, arg_endDateTime, arg_startDateTime, maxResults: ar
g_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.Performa
nceReportList response) { | |
| 1928 checkPerformanceReportList(response); | |
| 1929 }))); | |
| 1930 }); | |
| 1931 | |
| 1932 }); | |
| 1933 | |
| 1934 | |
| 1935 unittest.group("resource-PretargetingConfigResourceApi", () { | |
| 1936 unittest.test("method--delete", () { | |
| 1937 | |
| 1938 var mock = new common_test.HttpServerMock(); | |
| 1939 api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).p
retargetingConfig; | |
| 1940 var arg_accountId = "foo"; | |
| 1941 var arg_configId = "foo"; | |
| 1942 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1943 var path = (req.url).path; | |
| 1944 var pathOffset = 0; | |
| 1945 var index; | |
| 1946 var subPart; | |
| 1947 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 1948 pathOffset += 22; | |
| 1949 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("pretargetingconfigs/")); | |
| 1950 pathOffset += 20; | |
| 1951 index = path.indexOf("/", pathOffset); | |
| 1952 unittest.expect(index >= 0, unittest.isTrue); | |
| 1953 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 1954 pathOffset = index; | |
| 1955 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 1956 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
| 1957 pathOffset += 1; | |
| 1958 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 1959 pathOffset = path.length; | |
| 1960 unittest.expect(subPart, unittest.equals("$arg_configId")); | |
| 1961 | |
| 1962 var query = (req.url).query; | |
| 1963 var queryOffset = 0; | |
| 1964 var queryMap = {}; | |
| 1965 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 1966 parseBool(n) { | |
| 1967 if (n == "true") return true; | |
| 1968 if (n == "false") return false; | |
| 1969 if (n == null) return null; | |
| 1970 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 1971 } | |
| 1972 if (query.length > 0) { | |
| 1973 for (var part in query.split("&")) { | |
| 1974 var keyvalue = part.split("="); | |
| 1975 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 1976 } | |
| 1977 } | |
| 1978 | |
| 1979 | |
| 1980 var h = { | |
| 1981 "content-type" : "application/json; charset=utf-8", | |
| 1982 }; | |
| 1983 var resp = ""; | |
| 1984 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 1985 }), true); | |
| 1986 res.delete(arg_accountId, arg_configId).then(unittest.expectAsync((_) {}))
; | |
| 1987 }); | |
| 1988 | |
| 1989 unittest.test("method--get", () { | |
| 1990 | |
| 1991 var mock = new common_test.HttpServerMock(); | |
| 1992 api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).p
retargetingConfig; | |
| 1993 var arg_accountId = "foo"; | |
| 1994 var arg_configId = "foo"; | |
| 1995 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 1996 var path = (req.url).path; | |
| 1997 var pathOffset = 0; | |
| 1998 var index; | |
| 1999 var subPart; | |
| 2000 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 2001 pathOffset += 22; | |
| 2002 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("pretargetingconfigs/")); | |
| 2003 pathOffset += 20; | |
| 2004 index = path.indexOf("/", pathOffset); | |
| 2005 unittest.expect(index >= 0, unittest.isTrue); | |
| 2006 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2007 pathOffset = index; | |
| 2008 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 2009 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
| 2010 pathOffset += 1; | |
| 2011 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2012 pathOffset = path.length; | |
| 2013 unittest.expect(subPart, unittest.equals("$arg_configId")); | |
| 2014 | |
| 2015 var query = (req.url).query; | |
| 2016 var queryOffset = 0; | |
| 2017 var queryMap = {}; | |
| 2018 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2019 parseBool(n) { | |
| 2020 if (n == "true") return true; | |
| 2021 if (n == "false") return false; | |
| 2022 if (n == null) return null; | |
| 2023 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2024 } | |
| 2025 if (query.length > 0) { | |
| 2026 for (var part in query.split("&")) { | |
| 2027 var keyvalue = part.split("="); | |
| 2028 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2029 } | |
| 2030 } | |
| 2031 | |
| 2032 | |
| 2033 var h = { | |
| 2034 "content-type" : "application/json; charset=utf-8", | |
| 2035 }; | |
| 2036 var resp = convert.JSON.encode(buildPretargetingConfig()); | |
| 2037 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2038 }), true); | |
| 2039 res.get(arg_accountId, arg_configId).then(unittest.expectAsync(((api.Preta
rgetingConfig response) { | |
| 2040 checkPretargetingConfig(response); | |
| 2041 }))); | |
| 2042 }); | |
| 2043 | |
| 2044 unittest.test("method--insert", () { | |
| 2045 | |
| 2046 var mock = new common_test.HttpServerMock(); | |
| 2047 api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).p
retargetingConfig; | |
| 2048 var arg_request = buildPretargetingConfig(); | |
| 2049 var arg_accountId = "foo"; | |
| 2050 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2051 var obj = new api.PretargetingConfig.fromJson(json); | |
| 2052 checkPretargetingConfig(obj); | |
| 2053 | |
| 2054 var path = (req.url).path; | |
| 2055 var pathOffset = 0; | |
| 2056 var index; | |
| 2057 var subPart; | |
| 2058 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 2059 pathOffset += 22; | |
| 2060 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("pretargetingconfigs/")); | |
| 2061 pathOffset += 20; | |
| 2062 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2063 pathOffset = path.length; | |
| 2064 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 2065 | |
| 2066 var query = (req.url).query; | |
| 2067 var queryOffset = 0; | |
| 2068 var queryMap = {}; | |
| 2069 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2070 parseBool(n) { | |
| 2071 if (n == "true") return true; | |
| 2072 if (n == "false") return false; | |
| 2073 if (n == null) return null; | |
| 2074 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2075 } | |
| 2076 if (query.length > 0) { | |
| 2077 for (var part in query.split("&")) { | |
| 2078 var keyvalue = part.split("="); | |
| 2079 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2080 } | |
| 2081 } | |
| 2082 | |
| 2083 | |
| 2084 var h = { | |
| 2085 "content-type" : "application/json; charset=utf-8", | |
| 2086 }; | |
| 2087 var resp = convert.JSON.encode(buildPretargetingConfig()); | |
| 2088 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2089 }), true); | |
| 2090 res.insert(arg_request, arg_accountId).then(unittest.expectAsync(((api.Pre
targetingConfig response) { | |
| 2091 checkPretargetingConfig(response); | |
| 2092 }))); | |
| 2093 }); | |
| 2094 | |
| 2095 unittest.test("method--list", () { | |
| 2096 | |
| 2097 var mock = new common_test.HttpServerMock(); | |
| 2098 api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).p
retargetingConfig; | |
| 2099 var arg_accountId = "foo"; | |
| 2100 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2101 var path = (req.url).path; | |
| 2102 var pathOffset = 0; | |
| 2103 var index; | |
| 2104 var subPart; | |
| 2105 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 2106 pathOffset += 22; | |
| 2107 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("pretargetingconfigs/")); | |
| 2108 pathOffset += 20; | |
| 2109 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2110 pathOffset = path.length; | |
| 2111 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 2112 | |
| 2113 var query = (req.url).query; | |
| 2114 var queryOffset = 0; | |
| 2115 var queryMap = {}; | |
| 2116 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2117 parseBool(n) { | |
| 2118 if (n == "true") return true; | |
| 2119 if (n == "false") return false; | |
| 2120 if (n == null) return null; | |
| 2121 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2122 } | |
| 2123 if (query.length > 0) { | |
| 2124 for (var part in query.split("&")) { | |
| 2125 var keyvalue = part.split("="); | |
| 2126 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2127 } | |
| 2128 } | |
| 2129 | |
| 2130 | |
| 2131 var h = { | |
| 2132 "content-type" : "application/json; charset=utf-8", | |
| 2133 }; | |
| 2134 var resp = convert.JSON.encode(buildPretargetingConfigList()); | |
| 2135 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2136 }), true); | |
| 2137 res.list(arg_accountId).then(unittest.expectAsync(((api.PretargetingConfig
List response) { | |
| 2138 checkPretargetingConfigList(response); | |
| 2139 }))); | |
| 2140 }); | |
| 2141 | |
| 2142 unittest.test("method--patch", () { | |
| 2143 | |
| 2144 var mock = new common_test.HttpServerMock(); | |
| 2145 api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).p
retargetingConfig; | |
| 2146 var arg_request = buildPretargetingConfig(); | |
| 2147 var arg_accountId = "foo"; | |
| 2148 var arg_configId = "foo"; | |
| 2149 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2150 var obj = new api.PretargetingConfig.fromJson(json); | |
| 2151 checkPretargetingConfig(obj); | |
| 2152 | |
| 2153 var path = (req.url).path; | |
| 2154 var pathOffset = 0; | |
| 2155 var index; | |
| 2156 var subPart; | |
| 2157 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 2158 pathOffset += 22; | |
| 2159 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("pretargetingconfigs/")); | |
| 2160 pathOffset += 20; | |
| 2161 index = path.indexOf("/", pathOffset); | |
| 2162 unittest.expect(index >= 0, unittest.isTrue); | |
| 2163 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2164 pathOffset = index; | |
| 2165 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 2166 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
| 2167 pathOffset += 1; | |
| 2168 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2169 pathOffset = path.length; | |
| 2170 unittest.expect(subPart, unittest.equals("$arg_configId")); | |
| 2171 | |
| 2172 var query = (req.url).query; | |
| 2173 var queryOffset = 0; | |
| 2174 var queryMap = {}; | |
| 2175 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2176 parseBool(n) { | |
| 2177 if (n == "true") return true; | |
| 2178 if (n == "false") return false; | |
| 2179 if (n == null) return null; | |
| 2180 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2181 } | |
| 2182 if (query.length > 0) { | |
| 2183 for (var part in query.split("&")) { | |
| 2184 var keyvalue = part.split("="); | |
| 2185 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2186 } | |
| 2187 } | |
| 2188 | |
| 2189 | |
| 2190 var h = { | |
| 2191 "content-type" : "application/json; charset=utf-8", | |
| 2192 }; | |
| 2193 var resp = convert.JSON.encode(buildPretargetingConfig()); | |
| 2194 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2195 }), true); | |
| 2196 res.patch(arg_request, arg_accountId, arg_configId).then(unittest.expectAs
ync(((api.PretargetingConfig response) { | |
| 2197 checkPretargetingConfig(response); | |
| 2198 }))); | |
| 2199 }); | |
| 2200 | |
| 2201 unittest.test("method--update", () { | |
| 2202 | |
| 2203 var mock = new common_test.HttpServerMock(); | |
| 2204 api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).p
retargetingConfig; | |
| 2205 var arg_request = buildPretargetingConfig(); | |
| 2206 var arg_accountId = "foo"; | |
| 2207 var arg_configId = "foo"; | |
| 2208 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2209 var obj = new api.PretargetingConfig.fromJson(json); | |
| 2210 checkPretargetingConfig(obj); | |
| 2211 | |
| 2212 var path = (req.url).path; | |
| 2213 var pathOffset = 0; | |
| 2214 var index; | |
| 2215 var subPart; | |
| 2216 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/adexchangebuyer/v1.3/")); | |
| 2217 pathOffset += 22; | |
| 2218 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("pretargetingconfigs/")); | |
| 2219 pathOffset += 20; | |
| 2220 index = path.indexOf("/", pathOffset); | |
| 2221 unittest.expect(index >= 0, unittest.isTrue); | |
| 2222 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2223 pathOffset = index; | |
| 2224 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
| 2225 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
| 2226 pathOffset += 1; | |
| 2227 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2228 pathOffset = path.length; | |
| 2229 unittest.expect(subPart, unittest.equals("$arg_configId")); | |
| 2230 | |
| 2231 var query = (req.url).query; | |
| 2232 var queryOffset = 0; | |
| 2233 var queryMap = {}; | |
| 2234 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2235 parseBool(n) { | |
| 2236 if (n == "true") return true; | |
| 2237 if (n == "false") return false; | |
| 2238 if (n == null) return null; | |
| 2239 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2240 } | |
| 2241 if (query.length > 0) { | |
| 2242 for (var part in query.split("&")) { | |
| 2243 var keyvalue = part.split("="); | |
| 2244 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2245 } | |
| 2246 } | |
| 2247 | |
| 2248 | |
| 2249 var h = { | |
| 2250 "content-type" : "application/json; charset=utf-8", | |
| 2251 }; | |
| 2252 var resp = convert.JSON.encode(buildPretargetingConfig()); | |
| 2253 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2254 }), true); | |
| 2255 res.update(arg_request, arg_accountId, arg_configId).then(unittest.expectA
sync(((api.PretargetingConfig response) { | |
| 2256 checkPretargetingConfig(response); | |
| 2257 }))); | |
| 2258 }); | |
| 2259 | |
| 2260 }); | |
| 2261 | |
| 2262 | |
| 2263 } | |
| 2264 | |
| OLD | NEW |