OLD | NEW |
1 library googleapis.dns.v1.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:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis/dns/v1.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; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
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<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed717() { | 54 buildUnnamed724() { |
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 checkUnnamed717(core.List<api.ResourceRecordSet> o) { | 61 checkUnnamed724(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 buildUnnamed718() { | 67 buildUnnamed725() { |
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 checkUnnamed718(core.List<api.ResourceRecordSet> o) { | 74 checkUnnamed725(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 = buildUnnamed717(); | 85 o.additions = buildUnnamed724(); |
86 o.deletions = buildUnnamed718(); | 86 o.deletions = buildUnnamed725(); |
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 checkUnnamed717(o.additions); | 99 checkUnnamed724(o.additions); |
100 checkUnnamed718(o.deletions); | 100 checkUnnamed725(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 buildUnnamed719() { | 109 buildUnnamed726() { |
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 checkUnnamed719(core.List<api.Change> o) { | 116 checkUnnamed726(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 = buildUnnamed719(); | 127 o.changes = buildUnnamed726(); |
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 checkUnnamed719(o.changes); | 138 checkUnnamed726(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 buildUnnamed720() { | 145 buildUnnamed727() { |
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 checkUnnamed720(core.List<core.String> o) { | 152 checkUnnamed727(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 = buildUnnamed720(); | 170 o.nameServers = buildUnnamed727(); |
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 checkUnnamed720(o.nameServers); | 186 checkUnnamed727(o.nameServers); |
187 } | 187 } |
188 buildCounterManagedZone--; | 188 buildCounterManagedZone--; |
189 } | 189 } |
190 | 190 |
191 buildUnnamed721() { | 191 buildUnnamed728() { |
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 checkUnnamed721(core.List<api.ManagedZone> o) { | 198 checkUnnamed728(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 = buildUnnamed721(); | 210 o.managedZones = buildUnnamed728(); |
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 checkUnnamed721(o.managedZones); | 221 checkUnnamed728(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 buildUnnamed722() { | 283 buildUnnamed729() { |
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 checkUnnamed722(core.List<core.String> o) { | 290 checkUnnamed729(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 = buildUnnamed722(); | 303 o.rrdatas = buildUnnamed729(); |
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 checkUnnamed722(o.rrdatas); | 316 checkUnnamed729(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 buildUnnamed723() { | 323 buildUnnamed730() { |
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 checkUnnamed723(core.List<api.ResourceRecordSet> o) { | 330 checkUnnamed730(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 = buildUnnamed723(); | 343 o.rrsets = buildUnnamed730(); |
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 checkUnnamed723(o.rrsets); | 354 checkUnnamed730(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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 | 432 |
433 unittest.group("resource-ChangesResourceApi", () { | 433 unittest.group("resource-ChangesResourceApi", () { |
434 unittest.test("method--create", () { | 434 unittest.test("method--create", () { |
435 | 435 |
436 var mock = new HttpServerMock(); | 436 var mock = new HttpServerMock(); |
437 api.ChangesResourceApi res = new api.DnsApi(mock).changes; | 437 api.ChangesResourceApi res = new api.DnsApi(mock).changes; |
438 var arg_request = buildChange(); | 438 var arg_request = buildChange(); |
439 var arg_project = "foo"; | 439 var arg_project = "foo"; |
440 var arg_managedZone = "foo"; | 440 var arg_managedZone = "foo"; |
441 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 441 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
442 var obj = new api.Change.fromJson(json); | 442 var obj = new api.Change.fromJson(json); |
443 checkChange(obj); | 443 checkChange(obj); |
444 | 444 |
445 var path = (req.url).path; | 445 var path = (req.url).path; |
446 var pathOffset = 0; | 446 var pathOffset = 0; |
447 var index; | 447 var index; |
448 var subPart; | 448 var subPart; |
449 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 449 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
450 pathOffset += 1; | 450 pathOffset += 1; |
451 | 451 |
(...skipping 14 matching lines...) Expand all Loading... |
466 } | 466 } |
467 } | 467 } |
468 | 468 |
469 | 469 |
470 var h = { | 470 var h = { |
471 "content-type" : "application/json; charset=utf-8", | 471 "content-type" : "application/json; charset=utf-8", |
472 }; | 472 }; |
473 var resp = convert.JSON.encode(buildChange()); | 473 var resp = convert.JSON.encode(buildChange()); |
474 return new async.Future.value(stringResponse(200, h, resp)); | 474 return new async.Future.value(stringResponse(200, h, resp)); |
475 }), true); | 475 }), true); |
476 res.create(arg_request, arg_project, arg_managedZone).then(unittest.expect
Async(((api.Change response) { | 476 res.create(arg_request, arg_project, arg_managedZone).then(unittest.expect
Async1(((api.Change response) { |
477 checkChange(response); | 477 checkChange(response); |
478 }))); | 478 }))); |
479 }); | 479 }); |
480 | 480 |
481 unittest.test("method--get", () { | 481 unittest.test("method--get", () { |
482 | 482 |
483 var mock = new HttpServerMock(); | 483 var mock = new HttpServerMock(); |
484 api.ChangesResourceApi res = new api.DnsApi(mock).changes; | 484 api.ChangesResourceApi res = new api.DnsApi(mock).changes; |
485 var arg_project = "foo"; | 485 var arg_project = "foo"; |
486 var arg_managedZone = "foo"; | 486 var arg_managedZone = "foo"; |
487 var arg_changeId = "foo"; | 487 var arg_changeId = "foo"; |
488 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 488 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
489 var path = (req.url).path; | 489 var path = (req.url).path; |
490 var pathOffset = 0; | 490 var pathOffset = 0; |
491 var index; | 491 var index; |
492 var subPart; | 492 var subPart; |
493 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 493 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
494 pathOffset += 1; | 494 pathOffset += 1; |
495 | 495 |
496 var query = (req.url).query; | 496 var query = (req.url).query; |
497 var queryOffset = 0; | 497 var queryOffset = 0; |
498 var queryMap = {}; | 498 var queryMap = {}; |
(...skipping 11 matching lines...) Expand all Loading... |
510 } | 510 } |
511 } | 511 } |
512 | 512 |
513 | 513 |
514 var h = { | 514 var h = { |
515 "content-type" : "application/json; charset=utf-8", | 515 "content-type" : "application/json; charset=utf-8", |
516 }; | 516 }; |
517 var resp = convert.JSON.encode(buildChange()); | 517 var resp = convert.JSON.encode(buildChange()); |
518 return new async.Future.value(stringResponse(200, h, resp)); | 518 return new async.Future.value(stringResponse(200, h, resp)); |
519 }), true); | 519 }), true); |
520 res.get(arg_project, arg_managedZone, arg_changeId).then(unittest.expectAs
ync(((api.Change response) { | 520 res.get(arg_project, arg_managedZone, arg_changeId).then(unittest.expectAs
ync1(((api.Change response) { |
521 checkChange(response); | 521 checkChange(response); |
522 }))); | 522 }))); |
523 }); | 523 }); |
524 | 524 |
525 unittest.test("method--list", () { | 525 unittest.test("method--list", () { |
526 | 526 |
527 var mock = new HttpServerMock(); | 527 var mock = new HttpServerMock(); |
528 api.ChangesResourceApi res = new api.DnsApi(mock).changes; | 528 api.ChangesResourceApi res = new api.DnsApi(mock).changes; |
529 var arg_project = "foo"; | 529 var arg_project = "foo"; |
530 var arg_managedZone = "foo"; | 530 var arg_managedZone = "foo"; |
531 var arg_maxResults = 42; | 531 var arg_maxResults = 42; |
532 var arg_pageToken = "foo"; | 532 var arg_pageToken = "foo"; |
533 var arg_sortBy = "foo"; | 533 var arg_sortBy = "foo"; |
534 var arg_sortOrder = "foo"; | 534 var arg_sortOrder = "foo"; |
535 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 535 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
536 var path = (req.url).path; | 536 var path = (req.url).path; |
537 var pathOffset = 0; | 537 var pathOffset = 0; |
538 var index; | 538 var index; |
539 var subPart; | 539 var subPart; |
540 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 540 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
541 pathOffset += 1; | 541 pathOffset += 1; |
542 | 542 |
543 var query = (req.url).query; | 543 var query = (req.url).query; |
544 var queryOffset = 0; | 544 var queryOffset = 0; |
545 var queryMap = {}; | 545 var queryMap = {}; |
(...skipping 15 matching lines...) Expand all Loading... |
561 unittest.expect(queryMap["sortBy"].first, unittest.equals(arg_sortBy)); | 561 unittest.expect(queryMap["sortBy"].first, unittest.equals(arg_sortBy)); |
562 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); | 562 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); |
563 | 563 |
564 | 564 |
565 var h = { | 565 var h = { |
566 "content-type" : "application/json; charset=utf-8", | 566 "content-type" : "application/json; charset=utf-8", |
567 }; | 567 }; |
568 var resp = convert.JSON.encode(buildChangesListResponse()); | 568 var resp = convert.JSON.encode(buildChangesListResponse()); |
569 return new async.Future.value(stringResponse(200, h, resp)); | 569 return new async.Future.value(stringResponse(200, h, resp)); |
570 }), true); | 570 }), true); |
571 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) { | 571 res.list(arg_project, arg_managedZone, maxResults: arg_maxResults, pageTok
en: arg_pageToken, sortBy: arg_sortBy, sortOrder: arg_sortOrder).then(unittest.e
xpectAsync1(((api.ChangesListResponse response) { |
572 checkChangesListResponse(response); | 572 checkChangesListResponse(response); |
573 }))); | 573 }))); |
574 }); | 574 }); |
575 | 575 |
576 }); | 576 }); |
577 | 577 |
578 | 578 |
579 unittest.group("resource-ManagedZonesResourceApi", () { | 579 unittest.group("resource-ManagedZonesResourceApi", () { |
580 unittest.test("method--create", () { | 580 unittest.test("method--create", () { |
581 | 581 |
582 var mock = new HttpServerMock(); | 582 var mock = new HttpServerMock(); |
583 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; | 583 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
584 var arg_request = buildManagedZone(); | 584 var arg_request = buildManagedZone(); |
585 var arg_project = "foo"; | 585 var arg_project = "foo"; |
586 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 586 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
587 var obj = new api.ManagedZone.fromJson(json); | 587 var obj = new api.ManagedZone.fromJson(json); |
588 checkManagedZone(obj); | 588 checkManagedZone(obj); |
589 | 589 |
590 var path = (req.url).path; | 590 var path = (req.url).path; |
591 var pathOffset = 0; | 591 var pathOffset = 0; |
592 var index; | 592 var index; |
593 var subPart; | 593 var subPart; |
594 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 594 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
595 pathOffset += 1; | 595 pathOffset += 1; |
596 | 596 |
(...skipping 14 matching lines...) Expand all Loading... |
611 } | 611 } |
612 } | 612 } |
613 | 613 |
614 | 614 |
615 var h = { | 615 var h = { |
616 "content-type" : "application/json; charset=utf-8", | 616 "content-type" : "application/json; charset=utf-8", |
617 }; | 617 }; |
618 var resp = convert.JSON.encode(buildManagedZone()); | 618 var resp = convert.JSON.encode(buildManagedZone()); |
619 return new async.Future.value(stringResponse(200, h, resp)); | 619 return new async.Future.value(stringResponse(200, h, resp)); |
620 }), true); | 620 }), true); |
621 res.create(arg_request, arg_project).then(unittest.expectAsync(((api.Manag
edZone response) { | 621 res.create(arg_request, arg_project).then(unittest.expectAsync1(((api.Mana
gedZone response) { |
622 checkManagedZone(response); | 622 checkManagedZone(response); |
623 }))); | 623 }))); |
624 }); | 624 }); |
625 | 625 |
626 unittest.test("method--delete", () { | 626 unittest.test("method--delete", () { |
627 | 627 |
628 var mock = new HttpServerMock(); | 628 var mock = new HttpServerMock(); |
629 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; | 629 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
630 var arg_project = "foo"; | 630 var arg_project = "foo"; |
631 var arg_managedZone = "foo"; | 631 var arg_managedZone = "foo"; |
632 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 632 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
633 var path = (req.url).path; | 633 var path = (req.url).path; |
634 var pathOffset = 0; | 634 var pathOffset = 0; |
635 var index; | 635 var index; |
636 var subPart; | 636 var subPart; |
637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
638 pathOffset += 1; | 638 pathOffset += 1; |
639 | 639 |
640 var query = (req.url).query; | 640 var query = (req.url).query; |
641 var queryOffset = 0; | 641 var queryOffset = 0; |
642 var queryMap = {}; | 642 var queryMap = {}; |
(...skipping 11 matching lines...) Expand all Loading... |
654 } | 654 } |
655 } | 655 } |
656 | 656 |
657 | 657 |
658 var h = { | 658 var h = { |
659 "content-type" : "application/json; charset=utf-8", | 659 "content-type" : "application/json; charset=utf-8", |
660 }; | 660 }; |
661 var resp = ""; | 661 var resp = ""; |
662 return new async.Future.value(stringResponse(200, h, resp)); | 662 return new async.Future.value(stringResponse(200, h, resp)); |
663 }), true); | 663 }), true); |
664 res.delete(arg_project, arg_managedZone).then(unittest.expectAsync((_) {})
); | 664 res.delete(arg_project, arg_managedZone).then(unittest.expectAsync1((_) {}
)); |
665 }); | 665 }); |
666 | 666 |
667 unittest.test("method--get", () { | 667 unittest.test("method--get", () { |
668 | 668 |
669 var mock = new HttpServerMock(); | 669 var mock = new HttpServerMock(); |
670 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; | 670 api.ManagedZonesResourceApi res = new api.DnsApi(mock).managedZones; |
671 var arg_project = "foo"; | 671 var arg_project = "foo"; |
672 var arg_managedZone = "foo"; | 672 var arg_managedZone = "foo"; |
673 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 673 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
674 var path = (req.url).path; | 674 var path = (req.url).path; |
675 var pathOffset = 0; | 675 var pathOffset = 0; |
676 var index; | 676 var index; |
677 var subPart; | 677 var subPart; |
678 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 678 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
679 pathOffset += 1; | 679 pathOffset += 1; |
680 | 680 |
681 var query = (req.url).query; | 681 var query = (req.url).query; |
682 var queryOffset = 0; | 682 var queryOffset = 0; |
683 var queryMap = {}; | 683 var queryMap = {}; |
(...skipping 11 matching lines...) Expand all Loading... |
695 } | 695 } |
696 } | 696 } |
697 | 697 |
698 | 698 |
699 var h = { | 699 var h = { |
700 "content-type" : "application/json; charset=utf-8", | 700 "content-type" : "application/json; charset=utf-8", |
701 }; | 701 }; |
702 var resp = convert.JSON.encode(buildManagedZone()); | 702 var resp = convert.JSON.encode(buildManagedZone()); |
703 return new async.Future.value(stringResponse(200, h, resp)); | 703 return new async.Future.value(stringResponse(200, h, resp)); |
704 }), true); | 704 }), true); |
705 res.get(arg_project, arg_managedZone).then(unittest.expectAsync(((api.Mana
gedZone response) { | 705 res.get(arg_project, arg_managedZone).then(unittest.expectAsync1(((api.Man
agedZone 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_dnsName = "foo"; |
716 var arg_maxResults = 42; | 716 var arg_maxResults = 42; |
717 var arg_pageToken = "foo"; | 717 var arg_pageToken = "foo"; |
718 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 718 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
719 var path = (req.url).path; | 719 var path = (req.url).path; |
720 var pathOffset = 0; | 720 var pathOffset = 0; |
721 var index; | 721 var index; |
722 var subPart; | 722 var subPart; |
723 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 723 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
724 pathOffset += 1; | 724 pathOffset += 1; |
725 | 725 |
726 var query = (req.url).query; | 726 var query = (req.url).query; |
727 var queryOffset = 0; | 727 var queryOffset = 0; |
728 var queryMap = {}; | 728 var queryMap = {}; |
(...skipping 14 matching lines...) Expand all Loading... |
743 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)); |
744 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 744 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
745 | 745 |
746 | 746 |
747 var h = { | 747 var h = { |
748 "content-type" : "application/json; charset=utf-8", | 748 "content-type" : "application/json; charset=utf-8", |
749 }; | 749 }; |
750 var resp = convert.JSON.encode(buildManagedZonesListResponse()); | 750 var resp = convert.JSON.encode(buildManagedZonesListResponse()); |
751 return new async.Future.value(stringResponse(200, h, resp)); | 751 return new async.Future.value(stringResponse(200, h, resp)); |
752 }), true); | 752 }), true); |
753 res.list(arg_project, dnsName: arg_dnsName, maxResults: arg_maxResults, pa
geToken: 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.expectAsync1(((api.ManagedZonesListRespons
e response) { |
754 checkManagedZonesListResponse(response); | 754 checkManagedZonesListResponse(response); |
755 }))); | 755 }))); |
756 }); | 756 }); |
757 | 757 |
758 }); | 758 }); |
759 | 759 |
760 | 760 |
761 unittest.group("resource-ProjectsResourceApi", () { | 761 unittest.group("resource-ProjectsResourceApi", () { |
762 unittest.test("method--get", () { | 762 unittest.test("method--get", () { |
763 | 763 |
764 var mock = new HttpServerMock(); | 764 var mock = new HttpServerMock(); |
765 api.ProjectsResourceApi res = new api.DnsApi(mock).projects; | 765 api.ProjectsResourceApi res = new api.DnsApi(mock).projects; |
766 var arg_project = "foo"; | 766 var arg_project = "foo"; |
767 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 767 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
768 var path = (req.url).path; | 768 var path = (req.url).path; |
769 var pathOffset = 0; | 769 var pathOffset = 0; |
770 var index; | 770 var index; |
771 var subPart; | 771 var subPart; |
772 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 772 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
773 pathOffset += 1; | 773 pathOffset += 1; |
774 | 774 |
775 var query = (req.url).query; | 775 var query = (req.url).query; |
776 var queryOffset = 0; | 776 var queryOffset = 0; |
777 var queryMap = {}; | 777 var queryMap = {}; |
(...skipping 11 matching lines...) Expand all Loading... |
789 } | 789 } |
790 } | 790 } |
791 | 791 |
792 | 792 |
793 var h = { | 793 var h = { |
794 "content-type" : "application/json; charset=utf-8", | 794 "content-type" : "application/json; charset=utf-8", |
795 }; | 795 }; |
796 var resp = convert.JSON.encode(buildProject()); | 796 var resp = convert.JSON.encode(buildProject()); |
797 return new async.Future.value(stringResponse(200, h, resp)); | 797 return new async.Future.value(stringResponse(200, h, resp)); |
798 }), true); | 798 }), true); |
799 res.get(arg_project).then(unittest.expectAsync(((api.Project response) { | 799 res.get(arg_project).then(unittest.expectAsync1(((api.Project response) { |
800 checkProject(response); | 800 checkProject(response); |
801 }))); | 801 }))); |
802 }); | 802 }); |
803 | 803 |
804 }); | 804 }); |
805 | 805 |
806 | 806 |
807 unittest.group("resource-ResourceRecordSetsResourceApi", () { | 807 unittest.group("resource-ResourceRecordSetsResourceApi", () { |
808 unittest.test("method--list", () { | 808 unittest.test("method--list", () { |
809 | 809 |
810 var mock = new HttpServerMock(); | 810 var mock = new HttpServerMock(); |
811 api.ResourceRecordSetsResourceApi res = new api.DnsApi(mock).resourceRecor
dSets; | 811 api.ResourceRecordSetsResourceApi res = new api.DnsApi(mock).resourceRecor
dSets; |
812 var arg_project = "foo"; | 812 var arg_project = "foo"; |
813 var arg_managedZone = "foo"; | 813 var arg_managedZone = "foo"; |
814 var arg_maxResults = 42; | 814 var arg_maxResults = 42; |
815 var arg_name = "foo"; | 815 var arg_name = "foo"; |
816 var arg_pageToken = "foo"; | 816 var arg_pageToken = "foo"; |
817 var arg_type = "foo"; | 817 var arg_type = "foo"; |
818 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 818 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
819 var path = (req.url).path; | 819 var path = (req.url).path; |
820 var pathOffset = 0; | 820 var pathOffset = 0; |
821 var index; | 821 var index; |
822 var subPart; | 822 var subPart; |
823 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 823 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
824 pathOffset += 1; | 824 pathOffset += 1; |
825 | 825 |
826 var query = (req.url).query; | 826 var query = (req.url).query; |
827 var queryOffset = 0; | 827 var queryOffset = 0; |
828 var queryMap = {}; | 828 var queryMap = {}; |
(...skipping 15 matching lines...) Expand all Loading... |
844 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 844 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
845 unittest.expect(queryMap["type"].first, unittest.equals(arg_type)); | 845 unittest.expect(queryMap["type"].first, unittest.equals(arg_type)); |
846 | 846 |
847 | 847 |
848 var h = { | 848 var h = { |
849 "content-type" : "application/json; charset=utf-8", | 849 "content-type" : "application/json; charset=utf-8", |
850 }; | 850 }; |
851 var resp = convert.JSON.encode(buildResourceRecordSetsListResponse()); | 851 var resp = convert.JSON.encode(buildResourceRecordSetsListResponse()); |
852 return new async.Future.value(stringResponse(200, h, resp)); | 852 return new async.Future.value(stringResponse(200, h, resp)); |
853 }), true); | 853 }), true); |
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) { | 854 res.list(arg_project, arg_managedZone, maxResults: arg_maxResults, name: a
rg_name, pageToken: arg_pageToken, type: arg_type).then(unittest.expectAsync1(((
api.ResourceRecordSetsListResponse response) { |
855 checkResourceRecordSetsListResponse(response); | 855 checkResourceRecordSetsListResponse(response); |
856 }))); | 856 }))); |
857 }); | 857 }); |
858 | 858 |
859 }); | 859 }); |
860 | 860 |
861 | 861 |
862 } | 862 } |
863 | 863 |
OLD | NEW |