| OLD | NEW |
| 1 library googleapis_beta.dns.v1beta1.test; | 1 library googleapis.dns.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 | 11 |
| 12 import 'package:googleapis_beta/dns/v1beta1.dart' as api; | 12 import 'package:googleapis/dns/v1.dart' as api; |
| 13 | 13 |
| 14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 15 core.Function _callback; |
| 16 core.bool _expectJson; | 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 19 _callback = callback; |
| 20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
| 21 } | 21 } |
| 22 | 22 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed1627() { | 54 buildUnnamed1586() { |
| 55 var o = new core.List<api.ResourceRecordSet>(); | 55 var o = new core.List<api.ResourceRecordSet>(); |
| 56 o.add(buildResourceRecordSet()); | 56 o.add(buildResourceRecordSet()); |
| 57 o.add(buildResourceRecordSet()); | 57 o.add(buildResourceRecordSet()); |
| 58 return o; | 58 return o; |
| 59 } | 59 } |
| 60 | 60 |
| 61 checkUnnamed1627(core.List<api.ResourceRecordSet> o) { | 61 checkUnnamed1586(core.List<api.ResourceRecordSet> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 checkResourceRecordSet(o[0]); | 63 checkResourceRecordSet(o[0]); |
| 64 checkResourceRecordSet(o[1]); | 64 checkResourceRecordSet(o[1]); |
| 65 } | 65 } |
| 66 | 66 |
| 67 buildUnnamed1628() { | 67 buildUnnamed1587() { |
| 68 var o = new core.List<api.ResourceRecordSet>(); | 68 var o = new core.List<api.ResourceRecordSet>(); |
| 69 o.add(buildResourceRecordSet()); | 69 o.add(buildResourceRecordSet()); |
| 70 o.add(buildResourceRecordSet()); | 70 o.add(buildResourceRecordSet()); |
| 71 return o; | 71 return o; |
| 72 } | 72 } |
| 73 | 73 |
| 74 checkUnnamed1628(core.List<api.ResourceRecordSet> o) { | 74 checkUnnamed1587(core.List<api.ResourceRecordSet> o) { |
| 75 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
| 76 checkResourceRecordSet(o[0]); | 76 checkResourceRecordSet(o[0]); |
| 77 checkResourceRecordSet(o[1]); | 77 checkResourceRecordSet(o[1]); |
| 78 } | 78 } |
| 79 | 79 |
| 80 core.int buildCounterChange = 0; | 80 core.int buildCounterChange = 0; |
| 81 buildChange() { | 81 buildChange() { |
| 82 var o = new api.Change(); | 82 var o = new api.Change(); |
| 83 buildCounterChange++; | 83 buildCounterChange++; |
| 84 if (buildCounterChange < 3) { | 84 if (buildCounterChange < 3) { |
| 85 o.additions = buildUnnamed1627(); | 85 o.additions = buildUnnamed1586(); |
| 86 o.deletions = buildUnnamed1628(); | 86 o.deletions = buildUnnamed1587(); |
| 87 o.id = "foo"; | 87 o.id = "foo"; |
| 88 o.kind = "foo"; | 88 o.kind = "foo"; |
| 89 o.startTime = "foo"; | 89 o.startTime = "foo"; |
| 90 o.status = "foo"; | 90 o.status = "foo"; |
| 91 } | 91 } |
| 92 buildCounterChange--; | 92 buildCounterChange--; |
| 93 return o; | 93 return o; |
| 94 } | 94 } |
| 95 | 95 |
| 96 checkChange(api.Change o) { | 96 checkChange(api.Change o) { |
| 97 buildCounterChange++; | 97 buildCounterChange++; |
| 98 if (buildCounterChange < 3) { | 98 if (buildCounterChange < 3) { |
| 99 checkUnnamed1627(o.additions); | 99 checkUnnamed1586(o.additions); |
| 100 checkUnnamed1628(o.deletions); | 100 checkUnnamed1587(o.deletions); |
| 101 unittest.expect(o.id, unittest.equals('foo')); | 101 unittest.expect(o.id, unittest.equals('foo')); |
| 102 unittest.expect(o.kind, unittest.equals('foo')); | 102 unittest.expect(o.kind, unittest.equals('foo')); |
| 103 unittest.expect(o.startTime, unittest.equals('foo')); | 103 unittest.expect(o.startTime, unittest.equals('foo')); |
| 104 unittest.expect(o.status, unittest.equals('foo')); | 104 unittest.expect(o.status, unittest.equals('foo')); |
| 105 } | 105 } |
| 106 buildCounterChange--; | 106 buildCounterChange--; |
| 107 } | 107 } |
| 108 | 108 |
| 109 buildUnnamed1629() { | 109 buildUnnamed1588() { |
| 110 var o = new core.List<api.Change>(); | 110 var o = new core.List<api.Change>(); |
| 111 o.add(buildChange()); | 111 o.add(buildChange()); |
| 112 o.add(buildChange()); | 112 o.add(buildChange()); |
| 113 return o; | 113 return o; |
| 114 } | 114 } |
| 115 | 115 |
| 116 checkUnnamed1629(core.List<api.Change> o) { | 116 checkUnnamed1588(core.List<api.Change> o) { |
| 117 unittest.expect(o, unittest.hasLength(2)); | 117 unittest.expect(o, unittest.hasLength(2)); |
| 118 checkChange(o[0]); | 118 checkChange(o[0]); |
| 119 checkChange(o[1]); | 119 checkChange(o[1]); |
| 120 } | 120 } |
| 121 | 121 |
| 122 core.int buildCounterChangesListResponse = 0; | 122 core.int buildCounterChangesListResponse = 0; |
| 123 buildChangesListResponse() { | 123 buildChangesListResponse() { |
| 124 var o = new api.ChangesListResponse(); | 124 var o = new api.ChangesListResponse(); |
| 125 buildCounterChangesListResponse++; | 125 buildCounterChangesListResponse++; |
| 126 if (buildCounterChangesListResponse < 3) { | 126 if (buildCounterChangesListResponse < 3) { |
| 127 o.changes = buildUnnamed1629(); | 127 o.changes = buildUnnamed1588(); |
| 128 o.kind = "foo"; | 128 o.kind = "foo"; |
| 129 o.nextPageToken = "foo"; | 129 o.nextPageToken = "foo"; |
| 130 } | 130 } |
| 131 buildCounterChangesListResponse--; | 131 buildCounterChangesListResponse--; |
| 132 return o; | 132 return o; |
| 133 } | 133 } |
| 134 | 134 |
| 135 checkChangesListResponse(api.ChangesListResponse o) { | 135 checkChangesListResponse(api.ChangesListResponse o) { |
| 136 buildCounterChangesListResponse++; | 136 buildCounterChangesListResponse++; |
| 137 if (buildCounterChangesListResponse < 3) { | 137 if (buildCounterChangesListResponse < 3) { |
| 138 checkUnnamed1629(o.changes); | 138 checkUnnamed1588(o.changes); |
| 139 unittest.expect(o.kind, unittest.equals('foo')); | 139 unittest.expect(o.kind, unittest.equals('foo')); |
| 140 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 140 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 141 } | 141 } |
| 142 buildCounterChangesListResponse--; | 142 buildCounterChangesListResponse--; |
| 143 } | 143 } |
| 144 | 144 |
| 145 buildUnnamed1630() { | 145 buildUnnamed1589() { |
| 146 var o = new core.List<core.String>(); | 146 var o = new core.List<core.String>(); |
| 147 o.add("foo"); | 147 o.add("foo"); |
| 148 o.add("foo"); | 148 o.add("foo"); |
| 149 return o; | 149 return o; |
| 150 } | 150 } |
| 151 | 151 |
| 152 checkUnnamed1630(core.List<core.String> o) { | 152 checkUnnamed1589(core.List<core.String> o) { |
| 153 unittest.expect(o, unittest.hasLength(2)); | 153 unittest.expect(o, unittest.hasLength(2)); |
| 154 unittest.expect(o[0], unittest.equals('foo')); | 154 unittest.expect(o[0], unittest.equals('foo')); |
| 155 unittest.expect(o[1], unittest.equals('foo')); | 155 unittest.expect(o[1], unittest.equals('foo')); |
| 156 } | 156 } |
| 157 | 157 |
| 158 core.int buildCounterManagedZone = 0; | 158 core.int buildCounterManagedZone = 0; |
| 159 buildManagedZone() { | 159 buildManagedZone() { |
| 160 var o = new api.ManagedZone(); | 160 var o = new api.ManagedZone(); |
| 161 buildCounterManagedZone++; | 161 buildCounterManagedZone++; |
| 162 if (buildCounterManagedZone < 3) { | 162 if (buildCounterManagedZone < 3) { |
| 163 o.creationTime = "foo"; | 163 o.creationTime = "foo"; |
| 164 o.description = "foo"; | 164 o.description = "foo"; |
| 165 o.dnsName = "foo"; | 165 o.dnsName = "foo"; |
| 166 o.id = "foo"; | 166 o.id = "foo"; |
| 167 o.kind = "foo"; | 167 o.kind = "foo"; |
| 168 o.name = "foo"; | 168 o.name = "foo"; |
| 169 o.nameServerSet = "foo"; | 169 o.nameServerSet = "foo"; |
| 170 o.nameServers = buildUnnamed1630(); | 170 o.nameServers = buildUnnamed1589(); |
| 171 } | 171 } |
| 172 buildCounterManagedZone--; | 172 buildCounterManagedZone--; |
| 173 return o; | 173 return o; |
| 174 } | 174 } |
| 175 | 175 |
| 176 checkManagedZone(api.ManagedZone o) { | 176 checkManagedZone(api.ManagedZone o) { |
| 177 buildCounterManagedZone++; | 177 buildCounterManagedZone++; |
| 178 if (buildCounterManagedZone < 3) { | 178 if (buildCounterManagedZone < 3) { |
| 179 unittest.expect(o.creationTime, unittest.equals('foo')); | 179 unittest.expect(o.creationTime, unittest.equals('foo')); |
| 180 unittest.expect(o.description, unittest.equals('foo')); | 180 unittest.expect(o.description, unittest.equals('foo')); |
| 181 unittest.expect(o.dnsName, unittest.equals('foo')); | 181 unittest.expect(o.dnsName, unittest.equals('foo')); |
| 182 unittest.expect(o.id, unittest.equals('foo')); | 182 unittest.expect(o.id, unittest.equals('foo')); |
| 183 unittest.expect(o.kind, unittest.equals('foo')); | 183 unittest.expect(o.kind, unittest.equals('foo')); |
| 184 unittest.expect(o.name, unittest.equals('foo')); | 184 unittest.expect(o.name, unittest.equals('foo')); |
| 185 unittest.expect(o.nameServerSet, unittest.equals('foo')); | 185 unittest.expect(o.nameServerSet, unittest.equals('foo')); |
| 186 checkUnnamed1630(o.nameServers); | 186 checkUnnamed1589(o.nameServers); |
| 187 } | 187 } |
| 188 buildCounterManagedZone--; | 188 buildCounterManagedZone--; |
| 189 } | 189 } |
| 190 | 190 |
| 191 buildUnnamed1631() { | 191 buildUnnamed1590() { |
| 192 var o = new core.List<api.ManagedZone>(); | 192 var o = new core.List<api.ManagedZone>(); |
| 193 o.add(buildManagedZone()); | 193 o.add(buildManagedZone()); |
| 194 o.add(buildManagedZone()); | 194 o.add(buildManagedZone()); |
| 195 return o; | 195 return o; |
| 196 } | 196 } |
| 197 | 197 |
| 198 checkUnnamed1631(core.List<api.ManagedZone> o) { | 198 checkUnnamed1590(core.List<api.ManagedZone> o) { |
| 199 unittest.expect(o, unittest.hasLength(2)); | 199 unittest.expect(o, unittest.hasLength(2)); |
| 200 checkManagedZone(o[0]); | 200 checkManagedZone(o[0]); |
| 201 checkManagedZone(o[1]); | 201 checkManagedZone(o[1]); |
| 202 } | 202 } |
| 203 | 203 |
| 204 core.int buildCounterManagedZonesListResponse = 0; | 204 core.int buildCounterManagedZonesListResponse = 0; |
| 205 buildManagedZonesListResponse() { | 205 buildManagedZonesListResponse() { |
| 206 var o = new api.ManagedZonesListResponse(); | 206 var o = new api.ManagedZonesListResponse(); |
| 207 buildCounterManagedZonesListResponse++; | 207 buildCounterManagedZonesListResponse++; |
| 208 if (buildCounterManagedZonesListResponse < 3) { | 208 if (buildCounterManagedZonesListResponse < 3) { |
| 209 o.kind = "foo"; | 209 o.kind = "foo"; |
| 210 o.managedZones = buildUnnamed1631(); | 210 o.managedZones = buildUnnamed1590(); |
| 211 o.nextPageToken = "foo"; | 211 o.nextPageToken = "foo"; |
| 212 } | 212 } |
| 213 buildCounterManagedZonesListResponse--; | 213 buildCounterManagedZonesListResponse--; |
| 214 return o; | 214 return o; |
| 215 } | 215 } |
| 216 | 216 |
| 217 checkManagedZonesListResponse(api.ManagedZonesListResponse o) { | 217 checkManagedZonesListResponse(api.ManagedZonesListResponse o) { |
| 218 buildCounterManagedZonesListResponse++; | 218 buildCounterManagedZonesListResponse++; |
| 219 if (buildCounterManagedZonesListResponse < 3) { | 219 if (buildCounterManagedZonesListResponse < 3) { |
| 220 unittest.expect(o.kind, unittest.equals('foo')); | 220 unittest.expect(o.kind, unittest.equals('foo')); |
| 221 checkUnnamed1631(o.managedZones); | 221 checkUnnamed1590(o.managedZones); |
| 222 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 222 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 223 } | 223 } |
| 224 buildCounterManagedZonesListResponse--; | 224 buildCounterManagedZonesListResponse--; |
| 225 } | 225 } |
| 226 | 226 |
| 227 core.int buildCounterProject = 0; | 227 core.int buildCounterProject = 0; |
| 228 buildProject() { | 228 buildProject() { |
| 229 var o = new api.Project(); | 229 var o = new api.Project(); |
| 230 buildCounterProject++; | 230 buildCounterProject++; |
| 231 if (buildCounterProject < 3) { | 231 if (buildCounterProject < 3) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 unittest.expect(o.managedZones, unittest.equals(42)); | 273 unittest.expect(o.managedZones, unittest.equals(42)); |
| 274 unittest.expect(o.resourceRecordsPerRrset, unittest.equals(42)); | 274 unittest.expect(o.resourceRecordsPerRrset, unittest.equals(42)); |
| 275 unittest.expect(o.rrsetAdditionsPerChange, unittest.equals(42)); | 275 unittest.expect(o.rrsetAdditionsPerChange, unittest.equals(42)); |
| 276 unittest.expect(o.rrsetDeletionsPerChange, unittest.equals(42)); | 276 unittest.expect(o.rrsetDeletionsPerChange, unittest.equals(42)); |
| 277 unittest.expect(o.rrsetsPerManagedZone, unittest.equals(42)); | 277 unittest.expect(o.rrsetsPerManagedZone, unittest.equals(42)); |
| 278 unittest.expect(o.totalRrdataSizePerChange, unittest.equals(42)); | 278 unittest.expect(o.totalRrdataSizePerChange, unittest.equals(42)); |
| 279 } | 279 } |
| 280 buildCounterQuota--; | 280 buildCounterQuota--; |
| 281 } | 281 } |
| 282 | 282 |
| 283 buildUnnamed1632() { | 283 buildUnnamed1591() { |
| 284 var o = new core.List<core.String>(); | 284 var o = new core.List<core.String>(); |
| 285 o.add("foo"); | 285 o.add("foo"); |
| 286 o.add("foo"); | 286 o.add("foo"); |
| 287 return o; | 287 return o; |
| 288 } | 288 } |
| 289 | 289 |
| 290 checkUnnamed1632(core.List<core.String> o) { | 290 checkUnnamed1591(core.List<core.String> o) { |
| 291 unittest.expect(o, unittest.hasLength(2)); | 291 unittest.expect(o, unittest.hasLength(2)); |
| 292 unittest.expect(o[0], unittest.equals('foo')); | 292 unittest.expect(o[0], unittest.equals('foo')); |
| 293 unittest.expect(o[1], unittest.equals('foo')); | 293 unittest.expect(o[1], unittest.equals('foo')); |
| 294 } | 294 } |
| 295 | 295 |
| 296 core.int buildCounterResourceRecordSet = 0; | 296 core.int buildCounterResourceRecordSet = 0; |
| 297 buildResourceRecordSet() { | 297 buildResourceRecordSet() { |
| 298 var o = new api.ResourceRecordSet(); | 298 var o = new api.ResourceRecordSet(); |
| 299 buildCounterResourceRecordSet++; | 299 buildCounterResourceRecordSet++; |
| 300 if (buildCounterResourceRecordSet < 3) { | 300 if (buildCounterResourceRecordSet < 3) { |
| 301 o.kind = "foo"; | 301 o.kind = "foo"; |
| 302 o.name = "foo"; | 302 o.name = "foo"; |
| 303 o.rrdatas = buildUnnamed1632(); | 303 o.rrdatas = buildUnnamed1591(); |
| 304 o.ttl = 42; | 304 o.ttl = 42; |
| 305 o.type = "foo"; | 305 o.type = "foo"; |
| 306 } | 306 } |
| 307 buildCounterResourceRecordSet--; | 307 buildCounterResourceRecordSet--; |
| 308 return o; | 308 return o; |
| 309 } | 309 } |
| 310 | 310 |
| 311 checkResourceRecordSet(api.ResourceRecordSet o) { | 311 checkResourceRecordSet(api.ResourceRecordSet o) { |
| 312 buildCounterResourceRecordSet++; | 312 buildCounterResourceRecordSet++; |
| 313 if (buildCounterResourceRecordSet < 3) { | 313 if (buildCounterResourceRecordSet < 3) { |
| 314 unittest.expect(o.kind, unittest.equals('foo')); | 314 unittest.expect(o.kind, unittest.equals('foo')); |
| 315 unittest.expect(o.name, unittest.equals('foo')); | 315 unittest.expect(o.name, unittest.equals('foo')); |
| 316 checkUnnamed1632(o.rrdatas); | 316 checkUnnamed1591(o.rrdatas); |
| 317 unittest.expect(o.ttl, unittest.equals(42)); | 317 unittest.expect(o.ttl, unittest.equals(42)); |
| 318 unittest.expect(o.type, unittest.equals('foo')); | 318 unittest.expect(o.type, unittest.equals('foo')); |
| 319 } | 319 } |
| 320 buildCounterResourceRecordSet--; | 320 buildCounterResourceRecordSet--; |
| 321 } | 321 } |
| 322 | 322 |
| 323 buildUnnamed1633() { | 323 buildUnnamed1592() { |
| 324 var o = new core.List<api.ResourceRecordSet>(); | 324 var o = new core.List<api.ResourceRecordSet>(); |
| 325 o.add(buildResourceRecordSet()); | 325 o.add(buildResourceRecordSet()); |
| 326 o.add(buildResourceRecordSet()); | 326 o.add(buildResourceRecordSet()); |
| 327 return o; | 327 return o; |
| 328 } | 328 } |
| 329 | 329 |
| 330 checkUnnamed1633(core.List<api.ResourceRecordSet> o) { | 330 checkUnnamed1592(core.List<api.ResourceRecordSet> o) { |
| 331 unittest.expect(o, unittest.hasLength(2)); | 331 unittest.expect(o, unittest.hasLength(2)); |
| 332 checkResourceRecordSet(o[0]); | 332 checkResourceRecordSet(o[0]); |
| 333 checkResourceRecordSet(o[1]); | 333 checkResourceRecordSet(o[1]); |
| 334 } | 334 } |
| 335 | 335 |
| 336 core.int buildCounterResourceRecordSetsListResponse = 0; | 336 core.int buildCounterResourceRecordSetsListResponse = 0; |
| 337 buildResourceRecordSetsListResponse() { | 337 buildResourceRecordSetsListResponse() { |
| 338 var o = new api.ResourceRecordSetsListResponse(); | 338 var o = new api.ResourceRecordSetsListResponse(); |
| 339 buildCounterResourceRecordSetsListResponse++; | 339 buildCounterResourceRecordSetsListResponse++; |
| 340 if (buildCounterResourceRecordSetsListResponse < 3) { | 340 if (buildCounterResourceRecordSetsListResponse < 3) { |
| 341 o.kind = "foo"; | 341 o.kind = "foo"; |
| 342 o.nextPageToken = "foo"; | 342 o.nextPageToken = "foo"; |
| 343 o.rrsets = buildUnnamed1633(); | 343 o.rrsets = buildUnnamed1592(); |
| 344 } | 344 } |
| 345 buildCounterResourceRecordSetsListResponse--; | 345 buildCounterResourceRecordSetsListResponse--; |
| 346 return o; | 346 return o; |
| 347 } | 347 } |
| 348 | 348 |
| 349 checkResourceRecordSetsListResponse(api.ResourceRecordSetsListResponse o) { | 349 checkResourceRecordSetsListResponse(api.ResourceRecordSetsListResponse o) { |
| 350 buildCounterResourceRecordSetsListResponse++; | 350 buildCounterResourceRecordSetsListResponse++; |
| 351 if (buildCounterResourceRecordSetsListResponse < 3) { | 351 if (buildCounterResourceRecordSetsListResponse < 3) { |
| 352 unittest.expect(o.kind, unittest.equals('foo')); | 352 unittest.expect(o.kind, unittest.equals('foo')); |
| 353 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 353 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 354 checkUnnamed1633(o.rrsets); | 354 checkUnnamed1592(o.rrsets); |
| 355 } | 355 } |
| 356 buildCounterResourceRecordSetsListResponse--; | 356 buildCounterResourceRecordSetsListResponse--; |
| 357 } | 357 } |
| 358 | 358 |
| 359 | 359 |
| 360 main() { | 360 main() { |
| 361 unittest.group("obj-schema-Change", () { | 361 unittest.group("obj-schema-Change", () { |
| 362 unittest.test("to-json--from-json", () { | 362 unittest.test("to-json--from-json", () { |
| 363 var o = buildChange(); | 363 var o = buildChange(); |
| 364 var od = new api.Change.fromJson(o.toJson()); | 364 var od = new api.Change.fromJson(o.toJson()); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 res.get(arg_project, arg_managedZone).then(unittest.expectAsync(((api.Mana
gedZone response) { | 705 res.get(arg_project, arg_managedZone).then(unittest.expectAsync(((api.Mana
gedZone response) { |
| 706 checkManagedZone(response); | 706 checkManagedZone(response); |
| 707 }))); | 707 }))); |
| 708 }); | 708 }); |
| 709 | 709 |
| 710 unittest.test("method--list", () { | 710 unittest.test("method--list", () { |
| 711 | 711 |
| 712 var mock = new HttpServerMock(); | 712 var mock = new HttpServerMock(); |
| 713 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; | 713 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
| 714 var arg_project = "foo"; | 714 var arg_project = "foo"; |
| 715 var arg_dnsName = "foo"; |
| 715 var arg_maxResults = 42; | 716 var arg_maxResults = 42; |
| 716 var arg_pageToken = "foo"; | 717 var arg_pageToken = "foo"; |
| 717 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 718 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 718 var path = (req.url).path; | 719 var path = (req.url).path; |
| 719 var pathOffset = 0; | 720 var pathOffset = 0; |
| 720 var index; | 721 var index; |
| 721 var subPart; | 722 var subPart; |
| 722 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 723 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 723 pathOffset += 1; | 724 pathOffset += 1; |
| 724 | 725 |
| 725 var query = (req.url).query; | 726 var query = (req.url).query; |
| 726 var queryOffset = 0; | 727 var queryOffset = 0; |
| 727 var queryMap = {}; | 728 var queryMap = {}; |
| 728 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 729 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 729 parseBool(n) { | 730 parseBool(n) { |
| 730 if (n == "true") return true; | 731 if (n == "true") return true; |
| 731 if (n == "false") return false; | 732 if (n == "false") return false; |
| 732 if (n == null) return null; | 733 if (n == null) return null; |
| 733 throw new core.ArgumentError("Invalid boolean: $n"); | 734 throw new core.ArgumentError("Invalid boolean: $n"); |
| 734 } | 735 } |
| 735 if (query.length > 0) { | 736 if (query.length > 0) { |
| 736 for (var part in query.split("&")) { | 737 for (var part in query.split("&")) { |
| 737 var keyvalue = part.split("="); | 738 var keyvalue = part.split("="); |
| 738 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 739 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 739 } | 740 } |
| 740 } | 741 } |
| 742 unittest.expect(queryMap["dnsName"].first, unittest.equals(arg_dnsName))
; |
| 741 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 743 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 742 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 744 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 743 | 745 |
| 744 | 746 |
| 745 var h = { | 747 var h = { |
| 746 "content-type" : "application/json; charset=utf-8", | 748 "content-type" : "application/json; charset=utf-8", |
| 747 }; | 749 }; |
| 748 var resp = convert.JSON.encode(buildManagedZonesListResponse()); | 750 var resp = convert.JSON.encode(buildManagedZonesListResponse()); |
| 749 return new async.Future.value(stringResponse(200, h, resp)); | 751 return new async.Future.value(stringResponse(200, h, resp)); |
| 750 }), true); | 752 }), true); |
| 751 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
).then(unittest.expectAsync(((api.ManagedZonesListResponse response) { | 753 res.list(arg_project, dnsName: arg_dnsName, maxResults: arg_maxResults, pa
geToken: arg_pageToken).then(unittest.expectAsync(((api.ManagedZonesListResponse
response) { |
| 752 checkManagedZonesListResponse(response); | 754 checkManagedZonesListResponse(response); |
| 753 }))); | 755 }))); |
| 754 }); | 756 }); |
| 755 | 757 |
| 756 }); | 758 }); |
| 757 | 759 |
| 758 | 760 |
| 759 unittest.group("resource-ProjectsResourceApi", () { | 761 unittest.group("resource-ProjectsResourceApi", () { |
| 760 unittest.test("method--get", () { | 762 unittest.test("method--get", () { |
| 761 | 763 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 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) { | 854 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) { |
| 853 checkResourceRecordSetsListResponse(response); | 855 checkResourceRecordSetsListResponse(response); |
| 854 }))); | 856 }))); |
| 855 }); | 857 }); |
| 856 | 858 |
| 857 }); | 859 }); |
| 858 | 860 |
| 859 | 861 |
| 860 } | 862 } |
| 861 | 863 |
| OLD | NEW |