OLD | NEW |
(Empty) | |
| 1 library googleapis_beta.dns.v2beta1.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 |
| 12 import 'package:googleapis_beta/dns/v2beta1.dart' as api; |
| 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 53 |
| 54 buildUnnamed3632() { |
| 55 var o = new core.List<api.ResourceRecordSet>(); |
| 56 o.add(buildResourceRecordSet()); |
| 57 o.add(buildResourceRecordSet()); |
| 58 return o; |
| 59 } |
| 60 |
| 61 checkUnnamed3632(core.List<api.ResourceRecordSet> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 checkResourceRecordSet(o[0]); |
| 64 checkResourceRecordSet(o[1]); |
| 65 } |
| 66 |
| 67 buildUnnamed3633() { |
| 68 var o = new core.List<api.ResourceRecordSet>(); |
| 69 o.add(buildResourceRecordSet()); |
| 70 o.add(buildResourceRecordSet()); |
| 71 return o; |
| 72 } |
| 73 |
| 74 checkUnnamed3633(core.List<api.ResourceRecordSet> o) { |
| 75 unittest.expect(o, unittest.hasLength(2)); |
| 76 checkResourceRecordSet(o[0]); |
| 77 checkResourceRecordSet(o[1]); |
| 78 } |
| 79 |
| 80 core.int buildCounterChange = 0; |
| 81 buildChange() { |
| 82 var o = new api.Change(); |
| 83 buildCounterChange++; |
| 84 if (buildCounterChange < 3) { |
| 85 o.additions = buildUnnamed3632(); |
| 86 o.deletions = buildUnnamed3633(); |
| 87 o.id = "foo"; |
| 88 o.isServing = true; |
| 89 o.kind = "foo"; |
| 90 o.startTime = "foo"; |
| 91 o.status = "foo"; |
| 92 } |
| 93 buildCounterChange--; |
| 94 return o; |
| 95 } |
| 96 |
| 97 checkChange(api.Change o) { |
| 98 buildCounterChange++; |
| 99 if (buildCounterChange < 3) { |
| 100 checkUnnamed3632(o.additions); |
| 101 checkUnnamed3633(o.deletions); |
| 102 unittest.expect(o.id, unittest.equals('foo')); |
| 103 unittest.expect(o.isServing, unittest.isTrue); |
| 104 unittest.expect(o.kind, unittest.equals('foo')); |
| 105 unittest.expect(o.startTime, unittest.equals('foo')); |
| 106 unittest.expect(o.status, unittest.equals('foo')); |
| 107 } |
| 108 buildCounterChange--; |
| 109 } |
| 110 |
| 111 buildUnnamed3634() { |
| 112 var o = new core.List<api.Change>(); |
| 113 o.add(buildChange()); |
| 114 o.add(buildChange()); |
| 115 return o; |
| 116 } |
| 117 |
| 118 checkUnnamed3634(core.List<api.Change> o) { |
| 119 unittest.expect(o, unittest.hasLength(2)); |
| 120 checkChange(o[0]); |
| 121 checkChange(o[1]); |
| 122 } |
| 123 |
| 124 core.int buildCounterChangesListResponse = 0; |
| 125 buildChangesListResponse() { |
| 126 var o = new api.ChangesListResponse(); |
| 127 buildCounterChangesListResponse++; |
| 128 if (buildCounterChangesListResponse < 3) { |
| 129 o.changes = buildUnnamed3634(); |
| 130 o.header = buildResponseHeader(); |
| 131 o.kind = "foo"; |
| 132 o.nextPageToken = "foo"; |
| 133 } |
| 134 buildCounterChangesListResponse--; |
| 135 return o; |
| 136 } |
| 137 |
| 138 checkChangesListResponse(api.ChangesListResponse o) { |
| 139 buildCounterChangesListResponse++; |
| 140 if (buildCounterChangesListResponse < 3) { |
| 141 checkUnnamed3634(o.changes); |
| 142 checkResponseHeader(o.header); |
| 143 unittest.expect(o.kind, unittest.equals('foo')); |
| 144 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 145 } |
| 146 buildCounterChangesListResponse--; |
| 147 } |
| 148 |
| 149 buildUnnamed3635() { |
| 150 var o = new core.List<api.DnsKeyDigest>(); |
| 151 o.add(buildDnsKeyDigest()); |
| 152 o.add(buildDnsKeyDigest()); |
| 153 return o; |
| 154 } |
| 155 |
| 156 checkUnnamed3635(core.List<api.DnsKeyDigest> o) { |
| 157 unittest.expect(o, unittest.hasLength(2)); |
| 158 checkDnsKeyDigest(o[0]); |
| 159 checkDnsKeyDigest(o[1]); |
| 160 } |
| 161 |
| 162 core.int buildCounterDnsKey = 0; |
| 163 buildDnsKey() { |
| 164 var o = new api.DnsKey(); |
| 165 buildCounterDnsKey++; |
| 166 if (buildCounterDnsKey < 3) { |
| 167 o.algorithm = "foo"; |
| 168 o.creationTime = "foo"; |
| 169 o.description = "foo"; |
| 170 o.digests = buildUnnamed3635(); |
| 171 o.id = "foo"; |
| 172 o.isActive = true; |
| 173 o.keyLength = 42; |
| 174 o.keyTag = 42; |
| 175 o.kind = "foo"; |
| 176 o.publicKey = "foo"; |
| 177 o.type = "foo"; |
| 178 } |
| 179 buildCounterDnsKey--; |
| 180 return o; |
| 181 } |
| 182 |
| 183 checkDnsKey(api.DnsKey o) { |
| 184 buildCounterDnsKey++; |
| 185 if (buildCounterDnsKey < 3) { |
| 186 unittest.expect(o.algorithm, unittest.equals('foo')); |
| 187 unittest.expect(o.creationTime, unittest.equals('foo')); |
| 188 unittest.expect(o.description, unittest.equals('foo')); |
| 189 checkUnnamed3635(o.digests); |
| 190 unittest.expect(o.id, unittest.equals('foo')); |
| 191 unittest.expect(o.isActive, unittest.isTrue); |
| 192 unittest.expect(o.keyLength, unittest.equals(42)); |
| 193 unittest.expect(o.keyTag, unittest.equals(42)); |
| 194 unittest.expect(o.kind, unittest.equals('foo')); |
| 195 unittest.expect(o.publicKey, unittest.equals('foo')); |
| 196 unittest.expect(o.type, unittest.equals('foo')); |
| 197 } |
| 198 buildCounterDnsKey--; |
| 199 } |
| 200 |
| 201 core.int buildCounterDnsKeyDigest = 0; |
| 202 buildDnsKeyDigest() { |
| 203 var o = new api.DnsKeyDigest(); |
| 204 buildCounterDnsKeyDigest++; |
| 205 if (buildCounterDnsKeyDigest < 3) { |
| 206 o.digest = "foo"; |
| 207 o.type = "foo"; |
| 208 } |
| 209 buildCounterDnsKeyDigest--; |
| 210 return o; |
| 211 } |
| 212 |
| 213 checkDnsKeyDigest(api.DnsKeyDigest o) { |
| 214 buildCounterDnsKeyDigest++; |
| 215 if (buildCounterDnsKeyDigest < 3) { |
| 216 unittest.expect(o.digest, unittest.equals('foo')); |
| 217 unittest.expect(o.type, unittest.equals('foo')); |
| 218 } |
| 219 buildCounterDnsKeyDigest--; |
| 220 } |
| 221 |
| 222 core.int buildCounterDnsKeySpec = 0; |
| 223 buildDnsKeySpec() { |
| 224 var o = new api.DnsKeySpec(); |
| 225 buildCounterDnsKeySpec++; |
| 226 if (buildCounterDnsKeySpec < 3) { |
| 227 o.algorithm = "foo"; |
| 228 o.keyLength = 42; |
| 229 o.keyType = "foo"; |
| 230 o.kind = "foo"; |
| 231 } |
| 232 buildCounterDnsKeySpec--; |
| 233 return o; |
| 234 } |
| 235 |
| 236 checkDnsKeySpec(api.DnsKeySpec o) { |
| 237 buildCounterDnsKeySpec++; |
| 238 if (buildCounterDnsKeySpec < 3) { |
| 239 unittest.expect(o.algorithm, unittest.equals('foo')); |
| 240 unittest.expect(o.keyLength, unittest.equals(42)); |
| 241 unittest.expect(o.keyType, unittest.equals('foo')); |
| 242 unittest.expect(o.kind, unittest.equals('foo')); |
| 243 } |
| 244 buildCounterDnsKeySpec--; |
| 245 } |
| 246 |
| 247 buildUnnamed3636() { |
| 248 var o = new core.List<api.DnsKey>(); |
| 249 o.add(buildDnsKey()); |
| 250 o.add(buildDnsKey()); |
| 251 return o; |
| 252 } |
| 253 |
| 254 checkUnnamed3636(core.List<api.DnsKey> o) { |
| 255 unittest.expect(o, unittest.hasLength(2)); |
| 256 checkDnsKey(o[0]); |
| 257 checkDnsKey(o[1]); |
| 258 } |
| 259 |
| 260 core.int buildCounterDnsKeysListResponse = 0; |
| 261 buildDnsKeysListResponse() { |
| 262 var o = new api.DnsKeysListResponse(); |
| 263 buildCounterDnsKeysListResponse++; |
| 264 if (buildCounterDnsKeysListResponse < 3) { |
| 265 o.dnsKeys = buildUnnamed3636(); |
| 266 o.header = buildResponseHeader(); |
| 267 o.kind = "foo"; |
| 268 o.nextPageToken = "foo"; |
| 269 } |
| 270 buildCounterDnsKeysListResponse--; |
| 271 return o; |
| 272 } |
| 273 |
| 274 checkDnsKeysListResponse(api.DnsKeysListResponse o) { |
| 275 buildCounterDnsKeysListResponse++; |
| 276 if (buildCounterDnsKeysListResponse < 3) { |
| 277 checkUnnamed3636(o.dnsKeys); |
| 278 checkResponseHeader(o.header); |
| 279 unittest.expect(o.kind, unittest.equals('foo')); |
| 280 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 281 } |
| 282 buildCounterDnsKeysListResponse--; |
| 283 } |
| 284 |
| 285 buildUnnamed3637() { |
| 286 var o = new core.List<core.String>(); |
| 287 o.add("foo"); |
| 288 o.add("foo"); |
| 289 return o; |
| 290 } |
| 291 |
| 292 checkUnnamed3637(core.List<core.String> o) { |
| 293 unittest.expect(o, unittest.hasLength(2)); |
| 294 unittest.expect(o[0], unittest.equals('foo')); |
| 295 unittest.expect(o[1], unittest.equals('foo')); |
| 296 } |
| 297 |
| 298 core.int buildCounterManagedZone = 0; |
| 299 buildManagedZone() { |
| 300 var o = new api.ManagedZone(); |
| 301 buildCounterManagedZone++; |
| 302 if (buildCounterManagedZone < 3) { |
| 303 o.creationTime = "foo"; |
| 304 o.description = "foo"; |
| 305 o.dnsName = "foo"; |
| 306 o.dnssecConfig = buildManagedZoneDnsSecConfig(); |
| 307 o.id = "foo"; |
| 308 o.kind = "foo"; |
| 309 o.name = "foo"; |
| 310 o.nameServerSet = "foo"; |
| 311 o.nameServers = buildUnnamed3637(); |
| 312 } |
| 313 buildCounterManagedZone--; |
| 314 return o; |
| 315 } |
| 316 |
| 317 checkManagedZone(api.ManagedZone o) { |
| 318 buildCounterManagedZone++; |
| 319 if (buildCounterManagedZone < 3) { |
| 320 unittest.expect(o.creationTime, unittest.equals('foo')); |
| 321 unittest.expect(o.description, unittest.equals('foo')); |
| 322 unittest.expect(o.dnsName, unittest.equals('foo')); |
| 323 checkManagedZoneDnsSecConfig(o.dnssecConfig); |
| 324 unittest.expect(o.id, unittest.equals('foo')); |
| 325 unittest.expect(o.kind, unittest.equals('foo')); |
| 326 unittest.expect(o.name, unittest.equals('foo')); |
| 327 unittest.expect(o.nameServerSet, unittest.equals('foo')); |
| 328 checkUnnamed3637(o.nameServers); |
| 329 } |
| 330 buildCounterManagedZone--; |
| 331 } |
| 332 |
| 333 buildUnnamed3638() { |
| 334 var o = new core.List<api.DnsKeySpec>(); |
| 335 o.add(buildDnsKeySpec()); |
| 336 o.add(buildDnsKeySpec()); |
| 337 return o; |
| 338 } |
| 339 |
| 340 checkUnnamed3638(core.List<api.DnsKeySpec> o) { |
| 341 unittest.expect(o, unittest.hasLength(2)); |
| 342 checkDnsKeySpec(o[0]); |
| 343 checkDnsKeySpec(o[1]); |
| 344 } |
| 345 |
| 346 core.int buildCounterManagedZoneDnsSecConfig = 0; |
| 347 buildManagedZoneDnsSecConfig() { |
| 348 var o = new api.ManagedZoneDnsSecConfig(); |
| 349 buildCounterManagedZoneDnsSecConfig++; |
| 350 if (buildCounterManagedZoneDnsSecConfig < 3) { |
| 351 o.defaultKeySpecs = buildUnnamed3638(); |
| 352 o.kind = "foo"; |
| 353 o.nonExistence = "foo"; |
| 354 o.state = "foo"; |
| 355 } |
| 356 buildCounterManagedZoneDnsSecConfig--; |
| 357 return o; |
| 358 } |
| 359 |
| 360 checkManagedZoneDnsSecConfig(api.ManagedZoneDnsSecConfig o) { |
| 361 buildCounterManagedZoneDnsSecConfig++; |
| 362 if (buildCounterManagedZoneDnsSecConfig < 3) { |
| 363 checkUnnamed3638(o.defaultKeySpecs); |
| 364 unittest.expect(o.kind, unittest.equals('foo')); |
| 365 unittest.expect(o.nonExistence, unittest.equals('foo')); |
| 366 unittest.expect(o.state, unittest.equals('foo')); |
| 367 } |
| 368 buildCounterManagedZoneDnsSecConfig--; |
| 369 } |
| 370 |
| 371 buildUnnamed3639() { |
| 372 var o = new core.List<api.Operation>(); |
| 373 o.add(buildOperation()); |
| 374 o.add(buildOperation()); |
| 375 return o; |
| 376 } |
| 377 |
| 378 checkUnnamed3639(core.List<api.Operation> o) { |
| 379 unittest.expect(o, unittest.hasLength(2)); |
| 380 checkOperation(o[0]); |
| 381 checkOperation(o[1]); |
| 382 } |
| 383 |
| 384 core.int buildCounterManagedZoneOperationsListResponse = 0; |
| 385 buildManagedZoneOperationsListResponse() { |
| 386 var o = new api.ManagedZoneOperationsListResponse(); |
| 387 buildCounterManagedZoneOperationsListResponse++; |
| 388 if (buildCounterManagedZoneOperationsListResponse < 3) { |
| 389 o.header = buildResponseHeader(); |
| 390 o.kind = "foo"; |
| 391 o.nextPageToken = "foo"; |
| 392 o.operations = buildUnnamed3639(); |
| 393 } |
| 394 buildCounterManagedZoneOperationsListResponse--; |
| 395 return o; |
| 396 } |
| 397 |
| 398 checkManagedZoneOperationsListResponse(api.ManagedZoneOperationsListResponse o)
{ |
| 399 buildCounterManagedZoneOperationsListResponse++; |
| 400 if (buildCounterManagedZoneOperationsListResponse < 3) { |
| 401 checkResponseHeader(o.header); |
| 402 unittest.expect(o.kind, unittest.equals('foo')); |
| 403 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 404 checkUnnamed3639(o.operations); |
| 405 } |
| 406 buildCounterManagedZoneOperationsListResponse--; |
| 407 } |
| 408 |
| 409 core.int buildCounterManagedZonesDeleteResponse = 0; |
| 410 buildManagedZonesDeleteResponse() { |
| 411 var o = new api.ManagedZonesDeleteResponse(); |
| 412 buildCounterManagedZonesDeleteResponse++; |
| 413 if (buildCounterManagedZonesDeleteResponse < 3) { |
| 414 o.header = buildResponseHeader(); |
| 415 } |
| 416 buildCounterManagedZonesDeleteResponse--; |
| 417 return o; |
| 418 } |
| 419 |
| 420 checkManagedZonesDeleteResponse(api.ManagedZonesDeleteResponse o) { |
| 421 buildCounterManagedZonesDeleteResponse++; |
| 422 if (buildCounterManagedZonesDeleteResponse < 3) { |
| 423 checkResponseHeader(o.header); |
| 424 } |
| 425 buildCounterManagedZonesDeleteResponse--; |
| 426 } |
| 427 |
| 428 buildUnnamed3640() { |
| 429 var o = new core.List<api.ManagedZone>(); |
| 430 o.add(buildManagedZone()); |
| 431 o.add(buildManagedZone()); |
| 432 return o; |
| 433 } |
| 434 |
| 435 checkUnnamed3640(core.List<api.ManagedZone> o) { |
| 436 unittest.expect(o, unittest.hasLength(2)); |
| 437 checkManagedZone(o[0]); |
| 438 checkManagedZone(o[1]); |
| 439 } |
| 440 |
| 441 core.int buildCounterManagedZonesListResponse = 0; |
| 442 buildManagedZonesListResponse() { |
| 443 var o = new api.ManagedZonesListResponse(); |
| 444 buildCounterManagedZonesListResponse++; |
| 445 if (buildCounterManagedZonesListResponse < 3) { |
| 446 o.header = buildResponseHeader(); |
| 447 o.kind = "foo"; |
| 448 o.managedZones = buildUnnamed3640(); |
| 449 o.nextPageToken = "foo"; |
| 450 } |
| 451 buildCounterManagedZonesListResponse--; |
| 452 return o; |
| 453 } |
| 454 |
| 455 checkManagedZonesListResponse(api.ManagedZonesListResponse o) { |
| 456 buildCounterManagedZonesListResponse++; |
| 457 if (buildCounterManagedZonesListResponse < 3) { |
| 458 checkResponseHeader(o.header); |
| 459 unittest.expect(o.kind, unittest.equals('foo')); |
| 460 checkUnnamed3640(o.managedZones); |
| 461 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 462 } |
| 463 buildCounterManagedZonesListResponse--; |
| 464 } |
| 465 |
| 466 core.int buildCounterOperation = 0; |
| 467 buildOperation() { |
| 468 var o = new api.Operation(); |
| 469 buildCounterOperation++; |
| 470 if (buildCounterOperation < 3) { |
| 471 o.dnsKeyContext = buildOperationDnsKeyContext(); |
| 472 o.id = "foo"; |
| 473 o.kind = "foo"; |
| 474 o.startTime = "foo"; |
| 475 o.status = "foo"; |
| 476 o.type = "foo"; |
| 477 o.user = "foo"; |
| 478 o.zoneContext = buildOperationManagedZoneContext(); |
| 479 } |
| 480 buildCounterOperation--; |
| 481 return o; |
| 482 } |
| 483 |
| 484 checkOperation(api.Operation o) { |
| 485 buildCounterOperation++; |
| 486 if (buildCounterOperation < 3) { |
| 487 checkOperationDnsKeyContext(o.dnsKeyContext); |
| 488 unittest.expect(o.id, unittest.equals('foo')); |
| 489 unittest.expect(o.kind, unittest.equals('foo')); |
| 490 unittest.expect(o.startTime, unittest.equals('foo')); |
| 491 unittest.expect(o.status, unittest.equals('foo')); |
| 492 unittest.expect(o.type, unittest.equals('foo')); |
| 493 unittest.expect(o.user, unittest.equals('foo')); |
| 494 checkOperationManagedZoneContext(o.zoneContext); |
| 495 } |
| 496 buildCounterOperation--; |
| 497 } |
| 498 |
| 499 core.int buildCounterOperationDnsKeyContext = 0; |
| 500 buildOperationDnsKeyContext() { |
| 501 var o = new api.OperationDnsKeyContext(); |
| 502 buildCounterOperationDnsKeyContext++; |
| 503 if (buildCounterOperationDnsKeyContext < 3) { |
| 504 o.newValue = buildDnsKey(); |
| 505 o.oldValue = buildDnsKey(); |
| 506 } |
| 507 buildCounterOperationDnsKeyContext--; |
| 508 return o; |
| 509 } |
| 510 |
| 511 checkOperationDnsKeyContext(api.OperationDnsKeyContext o) { |
| 512 buildCounterOperationDnsKeyContext++; |
| 513 if (buildCounterOperationDnsKeyContext < 3) { |
| 514 checkDnsKey(o.newValue); |
| 515 checkDnsKey(o.oldValue); |
| 516 } |
| 517 buildCounterOperationDnsKeyContext--; |
| 518 } |
| 519 |
| 520 core.int buildCounterOperationManagedZoneContext = 0; |
| 521 buildOperationManagedZoneContext() { |
| 522 var o = new api.OperationManagedZoneContext(); |
| 523 buildCounterOperationManagedZoneContext++; |
| 524 if (buildCounterOperationManagedZoneContext < 3) { |
| 525 o.newValue = buildManagedZone(); |
| 526 o.oldValue = buildManagedZone(); |
| 527 } |
| 528 buildCounterOperationManagedZoneContext--; |
| 529 return o; |
| 530 } |
| 531 |
| 532 checkOperationManagedZoneContext(api.OperationManagedZoneContext o) { |
| 533 buildCounterOperationManagedZoneContext++; |
| 534 if (buildCounterOperationManagedZoneContext < 3) { |
| 535 checkManagedZone(o.newValue); |
| 536 checkManagedZone(o.oldValue); |
| 537 } |
| 538 buildCounterOperationManagedZoneContext--; |
| 539 } |
| 540 |
| 541 core.int buildCounterProject = 0; |
| 542 buildProject() { |
| 543 var o = new api.Project(); |
| 544 buildCounterProject++; |
| 545 if (buildCounterProject < 3) { |
| 546 o.id = "foo"; |
| 547 o.kind = "foo"; |
| 548 o.number = "foo"; |
| 549 o.quota = buildQuota(); |
| 550 } |
| 551 buildCounterProject--; |
| 552 return o; |
| 553 } |
| 554 |
| 555 checkProject(api.Project o) { |
| 556 buildCounterProject++; |
| 557 if (buildCounterProject < 3) { |
| 558 unittest.expect(o.id, unittest.equals('foo')); |
| 559 unittest.expect(o.kind, unittest.equals('foo')); |
| 560 unittest.expect(o.number, unittest.equals('foo')); |
| 561 checkQuota(o.quota); |
| 562 } |
| 563 buildCounterProject--; |
| 564 } |
| 565 |
| 566 buildUnnamed3641() { |
| 567 var o = new core.List<api.DnsKeySpec>(); |
| 568 o.add(buildDnsKeySpec()); |
| 569 o.add(buildDnsKeySpec()); |
| 570 return o; |
| 571 } |
| 572 |
| 573 checkUnnamed3641(core.List<api.DnsKeySpec> o) { |
| 574 unittest.expect(o, unittest.hasLength(2)); |
| 575 checkDnsKeySpec(o[0]); |
| 576 checkDnsKeySpec(o[1]); |
| 577 } |
| 578 |
| 579 core.int buildCounterQuota = 0; |
| 580 buildQuota() { |
| 581 var o = new api.Quota(); |
| 582 buildCounterQuota++; |
| 583 if (buildCounterQuota < 3) { |
| 584 o.dnsKeysPerManagedZone = 42; |
| 585 o.kind = "foo"; |
| 586 o.managedZones = 42; |
| 587 o.resourceRecordsPerRrset = 42; |
| 588 o.rrsetAdditionsPerChange = 42; |
| 589 o.rrsetDeletionsPerChange = 42; |
| 590 o.rrsetsPerManagedZone = 42; |
| 591 o.totalRrdataSizePerChange = 42; |
| 592 o.whitelistedKeySpecs = buildUnnamed3641(); |
| 593 } |
| 594 buildCounterQuota--; |
| 595 return o; |
| 596 } |
| 597 |
| 598 checkQuota(api.Quota o) { |
| 599 buildCounterQuota++; |
| 600 if (buildCounterQuota < 3) { |
| 601 unittest.expect(o.dnsKeysPerManagedZone, unittest.equals(42)); |
| 602 unittest.expect(o.kind, unittest.equals('foo')); |
| 603 unittest.expect(o.managedZones, unittest.equals(42)); |
| 604 unittest.expect(o.resourceRecordsPerRrset, unittest.equals(42)); |
| 605 unittest.expect(o.rrsetAdditionsPerChange, unittest.equals(42)); |
| 606 unittest.expect(o.rrsetDeletionsPerChange, unittest.equals(42)); |
| 607 unittest.expect(o.rrsetsPerManagedZone, unittest.equals(42)); |
| 608 unittest.expect(o.totalRrdataSizePerChange, unittest.equals(42)); |
| 609 checkUnnamed3641(o.whitelistedKeySpecs); |
| 610 } |
| 611 buildCounterQuota--; |
| 612 } |
| 613 |
| 614 buildUnnamed3642() { |
| 615 var o = new core.List<core.String>(); |
| 616 o.add("foo"); |
| 617 o.add("foo"); |
| 618 return o; |
| 619 } |
| 620 |
| 621 checkUnnamed3642(core.List<core.String> o) { |
| 622 unittest.expect(o, unittest.hasLength(2)); |
| 623 unittest.expect(o[0], unittest.equals('foo')); |
| 624 unittest.expect(o[1], unittest.equals('foo')); |
| 625 } |
| 626 |
| 627 buildUnnamed3643() { |
| 628 var o = new core.List<core.String>(); |
| 629 o.add("foo"); |
| 630 o.add("foo"); |
| 631 return o; |
| 632 } |
| 633 |
| 634 checkUnnamed3643(core.List<core.String> o) { |
| 635 unittest.expect(o, unittest.hasLength(2)); |
| 636 unittest.expect(o[0], unittest.equals('foo')); |
| 637 unittest.expect(o[1], unittest.equals('foo')); |
| 638 } |
| 639 |
| 640 core.int buildCounterResourceRecordSet = 0; |
| 641 buildResourceRecordSet() { |
| 642 var o = new api.ResourceRecordSet(); |
| 643 buildCounterResourceRecordSet++; |
| 644 if (buildCounterResourceRecordSet < 3) { |
| 645 o.kind = "foo"; |
| 646 o.name = "foo"; |
| 647 o.rrdatas = buildUnnamed3642(); |
| 648 o.signatureRrdatas = buildUnnamed3643(); |
| 649 o.ttl = 42; |
| 650 o.type = "foo"; |
| 651 } |
| 652 buildCounterResourceRecordSet--; |
| 653 return o; |
| 654 } |
| 655 |
| 656 checkResourceRecordSet(api.ResourceRecordSet o) { |
| 657 buildCounterResourceRecordSet++; |
| 658 if (buildCounterResourceRecordSet < 3) { |
| 659 unittest.expect(o.kind, unittest.equals('foo')); |
| 660 unittest.expect(o.name, unittest.equals('foo')); |
| 661 checkUnnamed3642(o.rrdatas); |
| 662 checkUnnamed3643(o.signatureRrdatas); |
| 663 unittest.expect(o.ttl, unittest.equals(42)); |
| 664 unittest.expect(o.type, unittest.equals('foo')); |
| 665 } |
| 666 buildCounterResourceRecordSet--; |
| 667 } |
| 668 |
| 669 buildUnnamed3644() { |
| 670 var o = new core.List<api.ResourceRecordSet>(); |
| 671 o.add(buildResourceRecordSet()); |
| 672 o.add(buildResourceRecordSet()); |
| 673 return o; |
| 674 } |
| 675 |
| 676 checkUnnamed3644(core.List<api.ResourceRecordSet> o) { |
| 677 unittest.expect(o, unittest.hasLength(2)); |
| 678 checkResourceRecordSet(o[0]); |
| 679 checkResourceRecordSet(o[1]); |
| 680 } |
| 681 |
| 682 core.int buildCounterResourceRecordSetsListResponse = 0; |
| 683 buildResourceRecordSetsListResponse() { |
| 684 var o = new api.ResourceRecordSetsListResponse(); |
| 685 buildCounterResourceRecordSetsListResponse++; |
| 686 if (buildCounterResourceRecordSetsListResponse < 3) { |
| 687 o.header = buildResponseHeader(); |
| 688 o.kind = "foo"; |
| 689 o.nextPageToken = "foo"; |
| 690 o.rrsets = buildUnnamed3644(); |
| 691 } |
| 692 buildCounterResourceRecordSetsListResponse--; |
| 693 return o; |
| 694 } |
| 695 |
| 696 checkResourceRecordSetsListResponse(api.ResourceRecordSetsListResponse o) { |
| 697 buildCounterResourceRecordSetsListResponse++; |
| 698 if (buildCounterResourceRecordSetsListResponse < 3) { |
| 699 checkResponseHeader(o.header); |
| 700 unittest.expect(o.kind, unittest.equals('foo')); |
| 701 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 702 checkUnnamed3644(o.rrsets); |
| 703 } |
| 704 buildCounterResourceRecordSetsListResponse--; |
| 705 } |
| 706 |
| 707 core.int buildCounterResponseHeader = 0; |
| 708 buildResponseHeader() { |
| 709 var o = new api.ResponseHeader(); |
| 710 buildCounterResponseHeader++; |
| 711 if (buildCounterResponseHeader < 3) { |
| 712 o.operationId = "foo"; |
| 713 } |
| 714 buildCounterResponseHeader--; |
| 715 return o; |
| 716 } |
| 717 |
| 718 checkResponseHeader(api.ResponseHeader o) { |
| 719 buildCounterResponseHeader++; |
| 720 if (buildCounterResponseHeader < 3) { |
| 721 unittest.expect(o.operationId, unittest.equals('foo')); |
| 722 } |
| 723 buildCounterResponseHeader--; |
| 724 } |
| 725 |
| 726 |
| 727 main() { |
| 728 unittest.group("obj-schema-Change", () { |
| 729 unittest.test("to-json--from-json", () { |
| 730 var o = buildChange(); |
| 731 var od = new api.Change.fromJson(o.toJson()); |
| 732 checkChange(od); |
| 733 }); |
| 734 }); |
| 735 |
| 736 |
| 737 unittest.group("obj-schema-ChangesListResponse", () { |
| 738 unittest.test("to-json--from-json", () { |
| 739 var o = buildChangesListResponse(); |
| 740 var od = new api.ChangesListResponse.fromJson(o.toJson()); |
| 741 checkChangesListResponse(od); |
| 742 }); |
| 743 }); |
| 744 |
| 745 |
| 746 unittest.group("obj-schema-DnsKey", () { |
| 747 unittest.test("to-json--from-json", () { |
| 748 var o = buildDnsKey(); |
| 749 var od = new api.DnsKey.fromJson(o.toJson()); |
| 750 checkDnsKey(od); |
| 751 }); |
| 752 }); |
| 753 |
| 754 |
| 755 unittest.group("obj-schema-DnsKeyDigest", () { |
| 756 unittest.test("to-json--from-json", () { |
| 757 var o = buildDnsKeyDigest(); |
| 758 var od = new api.DnsKeyDigest.fromJson(o.toJson()); |
| 759 checkDnsKeyDigest(od); |
| 760 }); |
| 761 }); |
| 762 |
| 763 |
| 764 unittest.group("obj-schema-DnsKeySpec", () { |
| 765 unittest.test("to-json--from-json", () { |
| 766 var o = buildDnsKeySpec(); |
| 767 var od = new api.DnsKeySpec.fromJson(o.toJson()); |
| 768 checkDnsKeySpec(od); |
| 769 }); |
| 770 }); |
| 771 |
| 772 |
| 773 unittest.group("obj-schema-DnsKeysListResponse", () { |
| 774 unittest.test("to-json--from-json", () { |
| 775 var o = buildDnsKeysListResponse(); |
| 776 var od = new api.DnsKeysListResponse.fromJson(o.toJson()); |
| 777 checkDnsKeysListResponse(od); |
| 778 }); |
| 779 }); |
| 780 |
| 781 |
| 782 unittest.group("obj-schema-ManagedZone", () { |
| 783 unittest.test("to-json--from-json", () { |
| 784 var o = buildManagedZone(); |
| 785 var od = new api.ManagedZone.fromJson(o.toJson()); |
| 786 checkManagedZone(od); |
| 787 }); |
| 788 }); |
| 789 |
| 790 |
| 791 unittest.group("obj-schema-ManagedZoneDnsSecConfig", () { |
| 792 unittest.test("to-json--from-json", () { |
| 793 var o = buildManagedZoneDnsSecConfig(); |
| 794 var od = new api.ManagedZoneDnsSecConfig.fromJson(o.toJson()); |
| 795 checkManagedZoneDnsSecConfig(od); |
| 796 }); |
| 797 }); |
| 798 |
| 799 |
| 800 unittest.group("obj-schema-ManagedZoneOperationsListResponse", () { |
| 801 unittest.test("to-json--from-json", () { |
| 802 var o = buildManagedZoneOperationsListResponse(); |
| 803 var od = new api.ManagedZoneOperationsListResponse.fromJson(o.toJson()); |
| 804 checkManagedZoneOperationsListResponse(od); |
| 805 }); |
| 806 }); |
| 807 |
| 808 |
| 809 unittest.group("obj-schema-ManagedZonesDeleteResponse", () { |
| 810 unittest.test("to-json--from-json", () { |
| 811 var o = buildManagedZonesDeleteResponse(); |
| 812 var od = new api.ManagedZonesDeleteResponse.fromJson(o.toJson()); |
| 813 checkManagedZonesDeleteResponse(od); |
| 814 }); |
| 815 }); |
| 816 |
| 817 |
| 818 unittest.group("obj-schema-ManagedZonesListResponse", () { |
| 819 unittest.test("to-json--from-json", () { |
| 820 var o = buildManagedZonesListResponse(); |
| 821 var od = new api.ManagedZonesListResponse.fromJson(o.toJson()); |
| 822 checkManagedZonesListResponse(od); |
| 823 }); |
| 824 }); |
| 825 |
| 826 |
| 827 unittest.group("obj-schema-Operation", () { |
| 828 unittest.test("to-json--from-json", () { |
| 829 var o = buildOperation(); |
| 830 var od = new api.Operation.fromJson(o.toJson()); |
| 831 checkOperation(od); |
| 832 }); |
| 833 }); |
| 834 |
| 835 |
| 836 unittest.group("obj-schema-OperationDnsKeyContext", () { |
| 837 unittest.test("to-json--from-json", () { |
| 838 var o = buildOperationDnsKeyContext(); |
| 839 var od = new api.OperationDnsKeyContext.fromJson(o.toJson()); |
| 840 checkOperationDnsKeyContext(od); |
| 841 }); |
| 842 }); |
| 843 |
| 844 |
| 845 unittest.group("obj-schema-OperationManagedZoneContext", () { |
| 846 unittest.test("to-json--from-json", () { |
| 847 var o = buildOperationManagedZoneContext(); |
| 848 var od = new api.OperationManagedZoneContext.fromJson(o.toJson()); |
| 849 checkOperationManagedZoneContext(od); |
| 850 }); |
| 851 }); |
| 852 |
| 853 |
| 854 unittest.group("obj-schema-Project", () { |
| 855 unittest.test("to-json--from-json", () { |
| 856 var o = buildProject(); |
| 857 var od = new api.Project.fromJson(o.toJson()); |
| 858 checkProject(od); |
| 859 }); |
| 860 }); |
| 861 |
| 862 |
| 863 unittest.group("obj-schema-Quota", () { |
| 864 unittest.test("to-json--from-json", () { |
| 865 var o = buildQuota(); |
| 866 var od = new api.Quota.fromJson(o.toJson()); |
| 867 checkQuota(od); |
| 868 }); |
| 869 }); |
| 870 |
| 871 |
| 872 unittest.group("obj-schema-ResourceRecordSet", () { |
| 873 unittest.test("to-json--from-json", () { |
| 874 var o = buildResourceRecordSet(); |
| 875 var od = new api.ResourceRecordSet.fromJson(o.toJson()); |
| 876 checkResourceRecordSet(od); |
| 877 }); |
| 878 }); |
| 879 |
| 880 |
| 881 unittest.group("obj-schema-ResourceRecordSetsListResponse", () { |
| 882 unittest.test("to-json--from-json", () { |
| 883 var o = buildResourceRecordSetsListResponse(); |
| 884 var od = new api.ResourceRecordSetsListResponse.fromJson(o.toJson()); |
| 885 checkResourceRecordSetsListResponse(od); |
| 886 }); |
| 887 }); |
| 888 |
| 889 |
| 890 unittest.group("obj-schema-ResponseHeader", () { |
| 891 unittest.test("to-json--from-json", () { |
| 892 var o = buildResponseHeader(); |
| 893 var od = new api.ResponseHeader.fromJson(o.toJson()); |
| 894 checkResponseHeader(od); |
| 895 }); |
| 896 }); |
| 897 |
| 898 |
| 899 unittest.group("resource-ChangesResourceApi", () { |
| 900 unittest.test("method--create", () { |
| 901 |
| 902 var mock = new HttpServerMock(); |
| 903 api.ChangesResourceApi res = new api.DnsApi(mock).changes; |
| 904 var arg_request = buildChange(); |
| 905 var arg_project = "foo"; |
| 906 var arg_managedZone = "foo"; |
| 907 var arg_clientOperationId = "foo"; |
| 908 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 909 var obj = new api.Change.fromJson(json); |
| 910 checkChange(obj); |
| 911 |
| 912 var path = (req.url).path; |
| 913 var pathOffset = 0; |
| 914 var index; |
| 915 var subPart; |
| 916 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 917 pathOffset += 1; |
| 918 |
| 919 var query = (req.url).query; |
| 920 var queryOffset = 0; |
| 921 var queryMap = {}; |
| 922 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 923 parseBool(n) { |
| 924 if (n == "true") return true; |
| 925 if (n == "false") return false; |
| 926 if (n == null) return null; |
| 927 throw new core.ArgumentError("Invalid boolean: $n"); |
| 928 } |
| 929 if (query.length > 0) { |
| 930 for (var part in query.split("&")) { |
| 931 var keyvalue = part.split("="); |
| 932 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 933 } |
| 934 } |
| 935 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 936 |
| 937 |
| 938 var h = { |
| 939 "content-type" : "application/json; charset=utf-8", |
| 940 }; |
| 941 var resp = convert.JSON.encode(buildChange()); |
| 942 return new async.Future.value(stringResponse(200, h, resp)); |
| 943 }), true); |
| 944 res.create(arg_request, arg_project, arg_managedZone, clientOperationId: a
rg_clientOperationId).then(unittest.expectAsync(((api.Change response) { |
| 945 checkChange(response); |
| 946 }))); |
| 947 }); |
| 948 |
| 949 unittest.test("method--get", () { |
| 950 |
| 951 var mock = new HttpServerMock(); |
| 952 api.ChangesResourceApi res = new api.DnsApi(mock).changes; |
| 953 var arg_project = "foo"; |
| 954 var arg_managedZone = "foo"; |
| 955 var arg_changeId = "foo"; |
| 956 var arg_clientOperationId = "foo"; |
| 957 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 958 var path = (req.url).path; |
| 959 var pathOffset = 0; |
| 960 var index; |
| 961 var subPart; |
| 962 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 963 pathOffset += 1; |
| 964 |
| 965 var query = (req.url).query; |
| 966 var queryOffset = 0; |
| 967 var queryMap = {}; |
| 968 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 969 parseBool(n) { |
| 970 if (n == "true") return true; |
| 971 if (n == "false") return false; |
| 972 if (n == null) return null; |
| 973 throw new core.ArgumentError("Invalid boolean: $n"); |
| 974 } |
| 975 if (query.length > 0) { |
| 976 for (var part in query.split("&")) { |
| 977 var keyvalue = part.split("="); |
| 978 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 979 } |
| 980 } |
| 981 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 982 |
| 983 |
| 984 var h = { |
| 985 "content-type" : "application/json; charset=utf-8", |
| 986 }; |
| 987 var resp = convert.JSON.encode(buildChange()); |
| 988 return new async.Future.value(stringResponse(200, h, resp)); |
| 989 }), true); |
| 990 res.get(arg_project, arg_managedZone, arg_changeId, clientOperationId: arg
_clientOperationId).then(unittest.expectAsync(((api.Change response) { |
| 991 checkChange(response); |
| 992 }))); |
| 993 }); |
| 994 |
| 995 unittest.test("method--list", () { |
| 996 |
| 997 var mock = new HttpServerMock(); |
| 998 api.ChangesResourceApi res = new api.DnsApi(mock).changes; |
| 999 var arg_project = "foo"; |
| 1000 var arg_managedZone = "foo"; |
| 1001 var arg_maxResults = 42; |
| 1002 var arg_pageToken = "foo"; |
| 1003 var arg_sortBy = "foo"; |
| 1004 var arg_sortOrder = "foo"; |
| 1005 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1006 var path = (req.url).path; |
| 1007 var pathOffset = 0; |
| 1008 var index; |
| 1009 var subPart; |
| 1010 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1011 pathOffset += 1; |
| 1012 |
| 1013 var query = (req.url).query; |
| 1014 var queryOffset = 0; |
| 1015 var queryMap = {}; |
| 1016 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1017 parseBool(n) { |
| 1018 if (n == "true") return true; |
| 1019 if (n == "false") return false; |
| 1020 if (n == null) return null; |
| 1021 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1022 } |
| 1023 if (query.length > 0) { |
| 1024 for (var part in query.split("&")) { |
| 1025 var keyvalue = part.split("="); |
| 1026 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1027 } |
| 1028 } |
| 1029 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1030 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1031 unittest.expect(queryMap["sortBy"].first, unittest.equals(arg_sortBy)); |
| 1032 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); |
| 1033 |
| 1034 |
| 1035 var h = { |
| 1036 "content-type" : "application/json; charset=utf-8", |
| 1037 }; |
| 1038 var resp = convert.JSON.encode(buildChangesListResponse()); |
| 1039 return new async.Future.value(stringResponse(200, h, resp)); |
| 1040 }), true); |
| 1041 res.list(arg_project, arg_managedZone, maxResults: arg_maxResults, pageTok
en: arg_pageToken, sortBy: arg_sortBy, sortOrder: arg_sortOrder).then(unittest.e
xpectAsync(((api.ChangesListResponse response) { |
| 1042 checkChangesListResponse(response); |
| 1043 }))); |
| 1044 }); |
| 1045 |
| 1046 }); |
| 1047 |
| 1048 |
| 1049 unittest.group("resource-DnskeysResourceApi", () { |
| 1050 unittest.test("method--get", () { |
| 1051 |
| 1052 var mock = new HttpServerMock(); |
| 1053 api.DnskeysResourceApi res = new api.DnsApi(mock).dnskeys; |
| 1054 var arg_project = "foo"; |
| 1055 var arg_managedZone = "foo"; |
| 1056 var arg_dnsKeyId = "foo"; |
| 1057 var arg_clientOperationId = "foo"; |
| 1058 var arg_digestType = "foo"; |
| 1059 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1060 var path = (req.url).path; |
| 1061 var pathOffset = 0; |
| 1062 var index; |
| 1063 var subPart; |
| 1064 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1065 pathOffset += 1; |
| 1066 |
| 1067 var query = (req.url).query; |
| 1068 var queryOffset = 0; |
| 1069 var queryMap = {}; |
| 1070 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1071 parseBool(n) { |
| 1072 if (n == "true") return true; |
| 1073 if (n == "false") return false; |
| 1074 if (n == null) return null; |
| 1075 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1076 } |
| 1077 if (query.length > 0) { |
| 1078 for (var part in query.split("&")) { |
| 1079 var keyvalue = part.split("="); |
| 1080 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1081 } |
| 1082 } |
| 1083 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1084 unittest.expect(queryMap["digestType"].first, unittest.equals(arg_digest
Type)); |
| 1085 |
| 1086 |
| 1087 var h = { |
| 1088 "content-type" : "application/json; charset=utf-8", |
| 1089 }; |
| 1090 var resp = convert.JSON.encode(buildDnsKey()); |
| 1091 return new async.Future.value(stringResponse(200, h, resp)); |
| 1092 }), true); |
| 1093 res.get(arg_project, arg_managedZone, arg_dnsKeyId, clientOperationId: arg
_clientOperationId, digestType: arg_digestType).then(unittest.expectAsync(((api.
DnsKey response) { |
| 1094 checkDnsKey(response); |
| 1095 }))); |
| 1096 }); |
| 1097 |
| 1098 unittest.test("method--list", () { |
| 1099 |
| 1100 var mock = new HttpServerMock(); |
| 1101 api.DnskeysResourceApi res = new api.DnsApi(mock).dnskeys; |
| 1102 var arg_project = "foo"; |
| 1103 var arg_managedZone = "foo"; |
| 1104 var arg_digestType = "foo"; |
| 1105 var arg_maxResults = 42; |
| 1106 var arg_pageToken = "foo"; |
| 1107 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1108 var path = (req.url).path; |
| 1109 var pathOffset = 0; |
| 1110 var index; |
| 1111 var subPart; |
| 1112 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1113 pathOffset += 1; |
| 1114 |
| 1115 var query = (req.url).query; |
| 1116 var queryOffset = 0; |
| 1117 var queryMap = {}; |
| 1118 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1119 parseBool(n) { |
| 1120 if (n == "true") return true; |
| 1121 if (n == "false") return false; |
| 1122 if (n == null) return null; |
| 1123 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1124 } |
| 1125 if (query.length > 0) { |
| 1126 for (var part in query.split("&")) { |
| 1127 var keyvalue = part.split("="); |
| 1128 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1129 } |
| 1130 } |
| 1131 unittest.expect(queryMap["digestType"].first, unittest.equals(arg_digest
Type)); |
| 1132 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1133 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1134 |
| 1135 |
| 1136 var h = { |
| 1137 "content-type" : "application/json; charset=utf-8", |
| 1138 }; |
| 1139 var resp = convert.JSON.encode(buildDnsKeysListResponse()); |
| 1140 return new async.Future.value(stringResponse(200, h, resp)); |
| 1141 }), true); |
| 1142 res.list(arg_project, arg_managedZone, digestType: arg_digestType, maxResu
lts: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.D
nsKeysListResponse response) { |
| 1143 checkDnsKeysListResponse(response); |
| 1144 }))); |
| 1145 }); |
| 1146 |
| 1147 }); |
| 1148 |
| 1149 |
| 1150 unittest.group("resource-ManagedZoneOperationsResourceApi", () { |
| 1151 unittest.test("method--get", () { |
| 1152 |
| 1153 var mock = new HttpServerMock(); |
| 1154 api.ManagedZoneOperationsResourceApi res = new api.DnsApi(mock).managedZon
eOperations; |
| 1155 var arg_project = "foo"; |
| 1156 var arg_managedZone = "foo"; |
| 1157 var arg_operation = "foo"; |
| 1158 var arg_clientOperationId = "foo"; |
| 1159 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1160 var path = (req.url).path; |
| 1161 var pathOffset = 0; |
| 1162 var index; |
| 1163 var subPart; |
| 1164 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1165 pathOffset += 1; |
| 1166 |
| 1167 var query = (req.url).query; |
| 1168 var queryOffset = 0; |
| 1169 var queryMap = {}; |
| 1170 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1171 parseBool(n) { |
| 1172 if (n == "true") return true; |
| 1173 if (n == "false") return false; |
| 1174 if (n == null) return null; |
| 1175 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1176 } |
| 1177 if (query.length > 0) { |
| 1178 for (var part in query.split("&")) { |
| 1179 var keyvalue = part.split("="); |
| 1180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1181 } |
| 1182 } |
| 1183 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1184 |
| 1185 |
| 1186 var h = { |
| 1187 "content-type" : "application/json; charset=utf-8", |
| 1188 }; |
| 1189 var resp = convert.JSON.encode(buildOperation()); |
| 1190 return new async.Future.value(stringResponse(200, h, resp)); |
| 1191 }), true); |
| 1192 res.get(arg_project, arg_managedZone, arg_operation, clientOperationId: ar
g_clientOperationId).then(unittest.expectAsync(((api.Operation response) { |
| 1193 checkOperation(response); |
| 1194 }))); |
| 1195 }); |
| 1196 |
| 1197 unittest.test("method--list", () { |
| 1198 |
| 1199 var mock = new HttpServerMock(); |
| 1200 api.ManagedZoneOperationsResourceApi res = new api.DnsApi(mock).managedZon
eOperations; |
| 1201 var arg_project = "foo"; |
| 1202 var arg_managedZone = "foo"; |
| 1203 var arg_maxResults = 42; |
| 1204 var arg_pageToken = "foo"; |
| 1205 var arg_sortBy = "foo"; |
| 1206 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1207 var path = (req.url).path; |
| 1208 var pathOffset = 0; |
| 1209 var index; |
| 1210 var subPart; |
| 1211 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1212 pathOffset += 1; |
| 1213 |
| 1214 var query = (req.url).query; |
| 1215 var queryOffset = 0; |
| 1216 var queryMap = {}; |
| 1217 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1218 parseBool(n) { |
| 1219 if (n == "true") return true; |
| 1220 if (n == "false") return false; |
| 1221 if (n == null) return null; |
| 1222 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1223 } |
| 1224 if (query.length > 0) { |
| 1225 for (var part in query.split("&")) { |
| 1226 var keyvalue = part.split("="); |
| 1227 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1228 } |
| 1229 } |
| 1230 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1231 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1232 unittest.expect(queryMap["sortBy"].first, unittest.equals(arg_sortBy)); |
| 1233 |
| 1234 |
| 1235 var h = { |
| 1236 "content-type" : "application/json; charset=utf-8", |
| 1237 }; |
| 1238 var resp = convert.JSON.encode(buildManagedZoneOperationsListResponse())
; |
| 1239 return new async.Future.value(stringResponse(200, h, resp)); |
| 1240 }), true); |
| 1241 res.list(arg_project, arg_managedZone, maxResults: arg_maxResults, pageTok
en: arg_pageToken, sortBy: arg_sortBy).then(unittest.expectAsync(((api.ManagedZo
neOperationsListResponse response) { |
| 1242 checkManagedZoneOperationsListResponse(response); |
| 1243 }))); |
| 1244 }); |
| 1245 |
| 1246 }); |
| 1247 |
| 1248 |
| 1249 unittest.group("resource-ManagedZonesResourceApi", () { |
| 1250 unittest.test("method--create", () { |
| 1251 |
| 1252 var mock = new HttpServerMock(); |
| 1253 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 1254 var arg_request = buildManagedZone(); |
| 1255 var arg_project = "foo"; |
| 1256 var arg_clientOperationId = "foo"; |
| 1257 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1258 var obj = new api.ManagedZone.fromJson(json); |
| 1259 checkManagedZone(obj); |
| 1260 |
| 1261 var path = (req.url).path; |
| 1262 var pathOffset = 0; |
| 1263 var index; |
| 1264 var subPart; |
| 1265 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1266 pathOffset += 1; |
| 1267 |
| 1268 var query = (req.url).query; |
| 1269 var queryOffset = 0; |
| 1270 var queryMap = {}; |
| 1271 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1272 parseBool(n) { |
| 1273 if (n == "true") return true; |
| 1274 if (n == "false") return false; |
| 1275 if (n == null) return null; |
| 1276 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1277 } |
| 1278 if (query.length > 0) { |
| 1279 for (var part in query.split("&")) { |
| 1280 var keyvalue = part.split("="); |
| 1281 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1282 } |
| 1283 } |
| 1284 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1285 |
| 1286 |
| 1287 var h = { |
| 1288 "content-type" : "application/json; charset=utf-8", |
| 1289 }; |
| 1290 var resp = convert.JSON.encode(buildManagedZone()); |
| 1291 return new async.Future.value(stringResponse(200, h, resp)); |
| 1292 }), true); |
| 1293 res.create(arg_request, arg_project, clientOperationId: arg_clientOperatio
nId).then(unittest.expectAsync(((api.ManagedZone response) { |
| 1294 checkManagedZone(response); |
| 1295 }))); |
| 1296 }); |
| 1297 |
| 1298 unittest.test("method--delete", () { |
| 1299 |
| 1300 var mock = new HttpServerMock(); |
| 1301 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 1302 var arg_project = "foo"; |
| 1303 var arg_managedZone = "foo"; |
| 1304 var arg_clientOperationId = "foo"; |
| 1305 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1306 var path = (req.url).path; |
| 1307 var pathOffset = 0; |
| 1308 var index; |
| 1309 var subPart; |
| 1310 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1311 pathOffset += 1; |
| 1312 |
| 1313 var query = (req.url).query; |
| 1314 var queryOffset = 0; |
| 1315 var queryMap = {}; |
| 1316 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1317 parseBool(n) { |
| 1318 if (n == "true") return true; |
| 1319 if (n == "false") return false; |
| 1320 if (n == null) return null; |
| 1321 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1322 } |
| 1323 if (query.length > 0) { |
| 1324 for (var part in query.split("&")) { |
| 1325 var keyvalue = part.split("="); |
| 1326 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1327 } |
| 1328 } |
| 1329 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1330 |
| 1331 |
| 1332 var h = { |
| 1333 "content-type" : "application/json; charset=utf-8", |
| 1334 }; |
| 1335 var resp = convert.JSON.encode(buildManagedZonesDeleteResponse()); |
| 1336 return new async.Future.value(stringResponse(200, h, resp)); |
| 1337 }), true); |
| 1338 res.delete(arg_project, arg_managedZone, clientOperationId: arg_clientOper
ationId).then(unittest.expectAsync(((api.ManagedZonesDeleteResponse response) { |
| 1339 checkManagedZonesDeleteResponse(response); |
| 1340 }))); |
| 1341 }); |
| 1342 |
| 1343 unittest.test("method--get", () { |
| 1344 |
| 1345 var mock = new HttpServerMock(); |
| 1346 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 1347 var arg_project = "foo"; |
| 1348 var arg_managedZone = "foo"; |
| 1349 var arg_clientOperationId = "foo"; |
| 1350 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1351 var path = (req.url).path; |
| 1352 var pathOffset = 0; |
| 1353 var index; |
| 1354 var subPart; |
| 1355 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1356 pathOffset += 1; |
| 1357 |
| 1358 var query = (req.url).query; |
| 1359 var queryOffset = 0; |
| 1360 var queryMap = {}; |
| 1361 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1362 parseBool(n) { |
| 1363 if (n == "true") return true; |
| 1364 if (n == "false") return false; |
| 1365 if (n == null) return null; |
| 1366 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1367 } |
| 1368 if (query.length > 0) { |
| 1369 for (var part in query.split("&")) { |
| 1370 var keyvalue = part.split("="); |
| 1371 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1372 } |
| 1373 } |
| 1374 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1375 |
| 1376 |
| 1377 var h = { |
| 1378 "content-type" : "application/json; charset=utf-8", |
| 1379 }; |
| 1380 var resp = convert.JSON.encode(buildManagedZone()); |
| 1381 return new async.Future.value(stringResponse(200, h, resp)); |
| 1382 }), true); |
| 1383 res.get(arg_project, arg_managedZone, clientOperationId: arg_clientOperati
onId).then(unittest.expectAsync(((api.ManagedZone response) { |
| 1384 checkManagedZone(response); |
| 1385 }))); |
| 1386 }); |
| 1387 |
| 1388 unittest.test("method--list", () { |
| 1389 |
| 1390 var mock = new HttpServerMock(); |
| 1391 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 1392 var arg_project = "foo"; |
| 1393 var arg_dnsName = "foo"; |
| 1394 var arg_maxResults = 42; |
| 1395 var arg_pageToken = "foo"; |
| 1396 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1397 var path = (req.url).path; |
| 1398 var pathOffset = 0; |
| 1399 var index; |
| 1400 var subPart; |
| 1401 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1402 pathOffset += 1; |
| 1403 |
| 1404 var query = (req.url).query; |
| 1405 var queryOffset = 0; |
| 1406 var queryMap = {}; |
| 1407 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1408 parseBool(n) { |
| 1409 if (n == "true") return true; |
| 1410 if (n == "false") return false; |
| 1411 if (n == null) return null; |
| 1412 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1413 } |
| 1414 if (query.length > 0) { |
| 1415 for (var part in query.split("&")) { |
| 1416 var keyvalue = part.split("="); |
| 1417 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1418 } |
| 1419 } |
| 1420 unittest.expect(queryMap["dnsName"].first, unittest.equals(arg_dnsName))
; |
| 1421 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1422 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1423 |
| 1424 |
| 1425 var h = { |
| 1426 "content-type" : "application/json; charset=utf-8", |
| 1427 }; |
| 1428 var resp = convert.JSON.encode(buildManagedZonesListResponse()); |
| 1429 return new async.Future.value(stringResponse(200, h, resp)); |
| 1430 }), true); |
| 1431 res.list(arg_project, dnsName: arg_dnsName, maxResults: arg_maxResults, pa
geToken: arg_pageToken).then(unittest.expectAsync(((api.ManagedZonesListResponse
response) { |
| 1432 checkManagedZonesListResponse(response); |
| 1433 }))); |
| 1434 }); |
| 1435 |
| 1436 unittest.test("method--patch", () { |
| 1437 |
| 1438 var mock = new HttpServerMock(); |
| 1439 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 1440 var arg_request = buildManagedZone(); |
| 1441 var arg_project = "foo"; |
| 1442 var arg_managedZone = "foo"; |
| 1443 var arg_clientOperationId = "foo"; |
| 1444 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1445 var obj = new api.ManagedZone.fromJson(json); |
| 1446 checkManagedZone(obj); |
| 1447 |
| 1448 var path = (req.url).path; |
| 1449 var pathOffset = 0; |
| 1450 var index; |
| 1451 var subPart; |
| 1452 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1453 pathOffset += 1; |
| 1454 |
| 1455 var query = (req.url).query; |
| 1456 var queryOffset = 0; |
| 1457 var queryMap = {}; |
| 1458 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1459 parseBool(n) { |
| 1460 if (n == "true") return true; |
| 1461 if (n == "false") return false; |
| 1462 if (n == null) return null; |
| 1463 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1464 } |
| 1465 if (query.length > 0) { |
| 1466 for (var part in query.split("&")) { |
| 1467 var keyvalue = part.split("="); |
| 1468 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1469 } |
| 1470 } |
| 1471 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1472 |
| 1473 |
| 1474 var h = { |
| 1475 "content-type" : "application/json; charset=utf-8", |
| 1476 }; |
| 1477 var resp = convert.JSON.encode(buildOperation()); |
| 1478 return new async.Future.value(stringResponse(200, h, resp)); |
| 1479 }), true); |
| 1480 res.patch(arg_request, arg_project, arg_managedZone, clientOperationId: ar
g_clientOperationId).then(unittest.expectAsync(((api.Operation response) { |
| 1481 checkOperation(response); |
| 1482 }))); |
| 1483 }); |
| 1484 |
| 1485 unittest.test("method--update", () { |
| 1486 |
| 1487 var mock = new HttpServerMock(); |
| 1488 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 1489 var arg_request = buildManagedZone(); |
| 1490 var arg_project = "foo"; |
| 1491 var arg_managedZone = "foo"; |
| 1492 var arg_clientOperationId = "foo"; |
| 1493 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1494 var obj = new api.ManagedZone.fromJson(json); |
| 1495 checkManagedZone(obj); |
| 1496 |
| 1497 var path = (req.url).path; |
| 1498 var pathOffset = 0; |
| 1499 var index; |
| 1500 var subPart; |
| 1501 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1502 pathOffset += 1; |
| 1503 |
| 1504 var query = (req.url).query; |
| 1505 var queryOffset = 0; |
| 1506 var queryMap = {}; |
| 1507 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1508 parseBool(n) { |
| 1509 if (n == "true") return true; |
| 1510 if (n == "false") return false; |
| 1511 if (n == null) return null; |
| 1512 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1513 } |
| 1514 if (query.length > 0) { |
| 1515 for (var part in query.split("&")) { |
| 1516 var keyvalue = part.split("="); |
| 1517 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1518 } |
| 1519 } |
| 1520 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1521 |
| 1522 |
| 1523 var h = { |
| 1524 "content-type" : "application/json; charset=utf-8", |
| 1525 }; |
| 1526 var resp = convert.JSON.encode(buildOperation()); |
| 1527 return new async.Future.value(stringResponse(200, h, resp)); |
| 1528 }), true); |
| 1529 res.update(arg_request, arg_project, arg_managedZone, clientOperationId: a
rg_clientOperationId).then(unittest.expectAsync(((api.Operation response) { |
| 1530 checkOperation(response); |
| 1531 }))); |
| 1532 }); |
| 1533 |
| 1534 }); |
| 1535 |
| 1536 |
| 1537 unittest.group("resource-ProjectsResourceApi", () { |
| 1538 unittest.test("method--get", () { |
| 1539 |
| 1540 var mock = new HttpServerMock(); |
| 1541 api.ProjectsResourceApi res = new api.DnsApi(mock).projects; |
| 1542 var arg_project = "foo"; |
| 1543 var arg_clientOperationId = "foo"; |
| 1544 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1545 var path = (req.url).path; |
| 1546 var pathOffset = 0; |
| 1547 var index; |
| 1548 var subPart; |
| 1549 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1550 pathOffset += 1; |
| 1551 |
| 1552 var query = (req.url).query; |
| 1553 var queryOffset = 0; |
| 1554 var queryMap = {}; |
| 1555 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1556 parseBool(n) { |
| 1557 if (n == "true") return true; |
| 1558 if (n == "false") return false; |
| 1559 if (n == null) return null; |
| 1560 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1561 } |
| 1562 if (query.length > 0) { |
| 1563 for (var part in query.split("&")) { |
| 1564 var keyvalue = part.split("="); |
| 1565 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1566 } |
| 1567 } |
| 1568 unittest.expect(queryMap["clientOperationId"].first, unittest.equals(arg
_clientOperationId)); |
| 1569 |
| 1570 |
| 1571 var h = { |
| 1572 "content-type" : "application/json; charset=utf-8", |
| 1573 }; |
| 1574 var resp = convert.JSON.encode(buildProject()); |
| 1575 return new async.Future.value(stringResponse(200, h, resp)); |
| 1576 }), true); |
| 1577 res.get(arg_project, clientOperationId: arg_clientOperationId).then(unitte
st.expectAsync(((api.Project response) { |
| 1578 checkProject(response); |
| 1579 }))); |
| 1580 }); |
| 1581 |
| 1582 }); |
| 1583 |
| 1584 |
| 1585 unittest.group("resource-ResourceRecordSetsResourceApi", () { |
| 1586 unittest.test("method--list", () { |
| 1587 |
| 1588 var mock = new HttpServerMock(); |
| 1589 api.ResourceRecordSetsResourceApi res = new api.DnsApi(mock).resourceRecor
dSets; |
| 1590 var arg_project = "foo"; |
| 1591 var arg_managedZone = "foo"; |
| 1592 var arg_maxResults = 42; |
| 1593 var arg_name = "foo"; |
| 1594 var arg_pageToken = "foo"; |
| 1595 var arg_type = "foo"; |
| 1596 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1597 var path = (req.url).path; |
| 1598 var pathOffset = 0; |
| 1599 var index; |
| 1600 var subPart; |
| 1601 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1602 pathOffset += 1; |
| 1603 |
| 1604 var query = (req.url).query; |
| 1605 var queryOffset = 0; |
| 1606 var queryMap = {}; |
| 1607 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1608 parseBool(n) { |
| 1609 if (n == "true") return true; |
| 1610 if (n == "false") return false; |
| 1611 if (n == null) return null; |
| 1612 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1613 } |
| 1614 if (query.length > 0) { |
| 1615 for (var part in query.split("&")) { |
| 1616 var keyvalue = part.split("="); |
| 1617 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1618 } |
| 1619 } |
| 1620 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1621 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
| 1622 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1623 unittest.expect(queryMap["type"].first, unittest.equals(arg_type)); |
| 1624 |
| 1625 |
| 1626 var h = { |
| 1627 "content-type" : "application/json; charset=utf-8", |
| 1628 }; |
| 1629 var resp = convert.JSON.encode(buildResourceRecordSetsListResponse()); |
| 1630 return new async.Future.value(stringResponse(200, h, resp)); |
| 1631 }), true); |
| 1632 res.list(arg_project, arg_managedZone, maxResults: arg_maxResults, name: a
rg_name, pageToken: arg_pageToken, type: arg_type).then(unittest.expectAsync(((a
pi.ResourceRecordSetsListResponse response) { |
| 1633 checkResourceRecordSetsListResponse(response); |
| 1634 }))); |
| 1635 }); |
| 1636 |
| 1637 }); |
| 1638 |
| 1639 |
| 1640 } |
| 1641 |
OLD | NEW |