OLD | NEW |
1 library googleapis.cloudresourcemanager.v1.test; | 1 library googleapis.cloudresourcemanager.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; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 checkAncestor(api.Ancestor o) { | 65 checkAncestor(api.Ancestor o) { |
66 buildCounterAncestor++; | 66 buildCounterAncestor++; |
67 if (buildCounterAncestor < 3) { | 67 if (buildCounterAncestor < 3) { |
68 checkResourceId(o.resourceId); | 68 checkResourceId(o.resourceId); |
69 } | 69 } |
70 buildCounterAncestor--; | 70 buildCounterAncestor--; |
71 } | 71 } |
72 | 72 |
73 buildUnnamed1787() { | 73 buildUnnamed1555() { |
74 var o = new core.List<core.String>(); | 74 var o = new core.List<core.String>(); |
75 o.add("foo"); | 75 o.add("foo"); |
76 o.add("foo"); | 76 o.add("foo"); |
77 return o; | 77 return o; |
78 } | 78 } |
79 | 79 |
80 checkUnnamed1787(core.List<core.String> o) { | 80 checkUnnamed1555(core.List<core.String> o) { |
81 unittest.expect(o, unittest.hasLength(2)); | 81 unittest.expect(o, unittest.hasLength(2)); |
82 unittest.expect(o[0], unittest.equals('foo')); | 82 unittest.expect(o[0], unittest.equals('foo')); |
83 unittest.expect(o[1], unittest.equals('foo')); | 83 unittest.expect(o[1], unittest.equals('foo')); |
84 } | 84 } |
85 | 85 |
86 core.int buildCounterBinding = 0; | 86 core.int buildCounterBinding = 0; |
87 buildBinding() { | 87 buildBinding() { |
88 var o = new api.Binding(); | 88 var o = new api.Binding(); |
89 buildCounterBinding++; | 89 buildCounterBinding++; |
90 if (buildCounterBinding < 3) { | 90 if (buildCounterBinding < 3) { |
91 o.members = buildUnnamed1787(); | 91 o.members = buildUnnamed1555(); |
92 o.role = "foo"; | 92 o.role = "foo"; |
93 } | 93 } |
94 buildCounterBinding--; | 94 buildCounterBinding--; |
95 return o; | 95 return o; |
96 } | 96 } |
97 | 97 |
98 checkBinding(api.Binding o) { | 98 checkBinding(api.Binding o) { |
99 buildCounterBinding++; | 99 buildCounterBinding++; |
100 if (buildCounterBinding < 3) { | 100 if (buildCounterBinding < 3) { |
101 checkUnnamed1787(o.members); | 101 checkUnnamed1555(o.members); |
102 unittest.expect(o.role, unittest.equals('foo')); | 102 unittest.expect(o.role, unittest.equals('foo')); |
103 } | 103 } |
104 buildCounterBinding--; | 104 buildCounterBinding--; |
105 } | 105 } |
106 | 106 |
107 core.int buildCounterEmpty = 0; | 107 core.int buildCounterEmpty = 0; |
108 buildEmpty() { | 108 buildEmpty() { |
109 var o = new api.Empty(); | 109 var o = new api.Empty(); |
110 buildCounterEmpty++; | 110 buildCounterEmpty++; |
111 if (buildCounterEmpty < 3) { | 111 if (buildCounterEmpty < 3) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return o; | 175 return o; |
176 } | 176 } |
177 | 177 |
178 checkGetAncestryRequest(api.GetAncestryRequest o) { | 178 checkGetAncestryRequest(api.GetAncestryRequest o) { |
179 buildCounterGetAncestryRequest++; | 179 buildCounterGetAncestryRequest++; |
180 if (buildCounterGetAncestryRequest < 3) { | 180 if (buildCounterGetAncestryRequest < 3) { |
181 } | 181 } |
182 buildCounterGetAncestryRequest--; | 182 buildCounterGetAncestryRequest--; |
183 } | 183 } |
184 | 184 |
185 buildUnnamed1788() { | 185 buildUnnamed1556() { |
186 var o = new core.List<api.Ancestor>(); | 186 var o = new core.List<api.Ancestor>(); |
187 o.add(buildAncestor()); | 187 o.add(buildAncestor()); |
188 o.add(buildAncestor()); | 188 o.add(buildAncestor()); |
189 return o; | 189 return o; |
190 } | 190 } |
191 | 191 |
192 checkUnnamed1788(core.List<api.Ancestor> o) { | 192 checkUnnamed1556(core.List<api.Ancestor> o) { |
193 unittest.expect(o, unittest.hasLength(2)); | 193 unittest.expect(o, unittest.hasLength(2)); |
194 checkAncestor(o[0]); | 194 checkAncestor(o[0]); |
195 checkAncestor(o[1]); | 195 checkAncestor(o[1]); |
196 } | 196 } |
197 | 197 |
198 core.int buildCounterGetAncestryResponse = 0; | 198 core.int buildCounterGetAncestryResponse = 0; |
199 buildGetAncestryResponse() { | 199 buildGetAncestryResponse() { |
200 var o = new api.GetAncestryResponse(); | 200 var o = new api.GetAncestryResponse(); |
201 buildCounterGetAncestryResponse++; | 201 buildCounterGetAncestryResponse++; |
202 if (buildCounterGetAncestryResponse < 3) { | 202 if (buildCounterGetAncestryResponse < 3) { |
203 o.ancestor = buildUnnamed1788(); | 203 o.ancestor = buildUnnamed1556(); |
204 } | 204 } |
205 buildCounterGetAncestryResponse--; | 205 buildCounterGetAncestryResponse--; |
206 return o; | 206 return o; |
207 } | 207 } |
208 | 208 |
209 checkGetAncestryResponse(api.GetAncestryResponse o) { | 209 checkGetAncestryResponse(api.GetAncestryResponse o) { |
210 buildCounterGetAncestryResponse++; | 210 buildCounterGetAncestryResponse++; |
211 if (buildCounterGetAncestryResponse < 3) { | 211 if (buildCounterGetAncestryResponse < 3) { |
212 checkUnnamed1788(o.ancestor); | 212 checkUnnamed1556(o.ancestor); |
213 } | 213 } |
214 buildCounterGetAncestryResponse--; | 214 buildCounterGetAncestryResponse--; |
215 } | 215 } |
216 | 216 |
217 core.int buildCounterGetIamPolicyRequest = 0; | 217 core.int buildCounterGetIamPolicyRequest = 0; |
218 buildGetIamPolicyRequest() { | 218 buildGetIamPolicyRequest() { |
219 var o = new api.GetIamPolicyRequest(); | 219 var o = new api.GetIamPolicyRequest(); |
220 buildCounterGetIamPolicyRequest++; | 220 buildCounterGetIamPolicyRequest++; |
221 if (buildCounterGetIamPolicyRequest < 3) { | 221 if (buildCounterGetIamPolicyRequest < 3) { |
222 } | 222 } |
223 buildCounterGetIamPolicyRequest--; | 223 buildCounterGetIamPolicyRequest--; |
224 return o; | 224 return o; |
225 } | 225 } |
226 | 226 |
227 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { | 227 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
228 buildCounterGetIamPolicyRequest++; | 228 buildCounterGetIamPolicyRequest++; |
229 if (buildCounterGetIamPolicyRequest < 3) { | 229 if (buildCounterGetIamPolicyRequest < 3) { |
230 } | 230 } |
231 buildCounterGetIamPolicyRequest--; | 231 buildCounterGetIamPolicyRequest--; |
232 } | 232 } |
233 | 233 |
234 buildUnnamed1789() { | 234 buildUnnamed1557() { |
| 235 var o = new core.List<core.String>(); |
| 236 o.add("foo"); |
| 237 o.add("foo"); |
| 238 return o; |
| 239 } |
| 240 |
| 241 checkUnnamed1557(core.List<core.String> o) { |
| 242 unittest.expect(o, unittest.hasLength(2)); |
| 243 unittest.expect(o[0], unittest.equals('foo')); |
| 244 unittest.expect(o[1], unittest.equals('foo')); |
| 245 } |
| 246 |
| 247 core.int buildCounterLien = 0; |
| 248 buildLien() { |
| 249 var o = new api.Lien(); |
| 250 buildCounterLien++; |
| 251 if (buildCounterLien < 3) { |
| 252 o.createTime = "foo"; |
| 253 o.name = "foo"; |
| 254 o.origin = "foo"; |
| 255 o.parent = "foo"; |
| 256 o.reason = "foo"; |
| 257 o.restrictions = buildUnnamed1557(); |
| 258 } |
| 259 buildCounterLien--; |
| 260 return o; |
| 261 } |
| 262 |
| 263 checkLien(api.Lien o) { |
| 264 buildCounterLien++; |
| 265 if (buildCounterLien < 3) { |
| 266 unittest.expect(o.createTime, unittest.equals('foo')); |
| 267 unittest.expect(o.name, unittest.equals('foo')); |
| 268 unittest.expect(o.origin, unittest.equals('foo')); |
| 269 unittest.expect(o.parent, unittest.equals('foo')); |
| 270 unittest.expect(o.reason, unittest.equals('foo')); |
| 271 checkUnnamed1557(o.restrictions); |
| 272 } |
| 273 buildCounterLien--; |
| 274 } |
| 275 |
| 276 buildUnnamed1558() { |
| 277 var o = new core.List<api.Lien>(); |
| 278 o.add(buildLien()); |
| 279 o.add(buildLien()); |
| 280 return o; |
| 281 } |
| 282 |
| 283 checkUnnamed1558(core.List<api.Lien> o) { |
| 284 unittest.expect(o, unittest.hasLength(2)); |
| 285 checkLien(o[0]); |
| 286 checkLien(o[1]); |
| 287 } |
| 288 |
| 289 core.int buildCounterListLiensResponse = 0; |
| 290 buildListLiensResponse() { |
| 291 var o = new api.ListLiensResponse(); |
| 292 buildCounterListLiensResponse++; |
| 293 if (buildCounterListLiensResponse < 3) { |
| 294 o.liens = buildUnnamed1558(); |
| 295 o.nextPageToken = "foo"; |
| 296 } |
| 297 buildCounterListLiensResponse--; |
| 298 return o; |
| 299 } |
| 300 |
| 301 checkListLiensResponse(api.ListLiensResponse o) { |
| 302 buildCounterListLiensResponse++; |
| 303 if (buildCounterListLiensResponse < 3) { |
| 304 checkUnnamed1558(o.liens); |
| 305 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 306 } |
| 307 buildCounterListLiensResponse--; |
| 308 } |
| 309 |
| 310 buildUnnamed1559() { |
235 var o = new core.List<api.Project>(); | 311 var o = new core.List<api.Project>(); |
236 o.add(buildProject()); | 312 o.add(buildProject()); |
237 o.add(buildProject()); | 313 o.add(buildProject()); |
238 return o; | 314 return o; |
239 } | 315 } |
240 | 316 |
241 checkUnnamed1789(core.List<api.Project> o) { | 317 checkUnnamed1559(core.List<api.Project> o) { |
242 unittest.expect(o, unittest.hasLength(2)); | 318 unittest.expect(o, unittest.hasLength(2)); |
243 checkProject(o[0]); | 319 checkProject(o[0]); |
244 checkProject(o[1]); | 320 checkProject(o[1]); |
245 } | 321 } |
246 | 322 |
247 core.int buildCounterListProjectsResponse = 0; | 323 core.int buildCounterListProjectsResponse = 0; |
248 buildListProjectsResponse() { | 324 buildListProjectsResponse() { |
249 var o = new api.ListProjectsResponse(); | 325 var o = new api.ListProjectsResponse(); |
250 buildCounterListProjectsResponse++; | 326 buildCounterListProjectsResponse++; |
251 if (buildCounterListProjectsResponse < 3) { | 327 if (buildCounterListProjectsResponse < 3) { |
252 o.nextPageToken = "foo"; | 328 o.nextPageToken = "foo"; |
253 o.projects = buildUnnamed1789(); | 329 o.projects = buildUnnamed1559(); |
254 } | 330 } |
255 buildCounterListProjectsResponse--; | 331 buildCounterListProjectsResponse--; |
256 return o; | 332 return o; |
257 } | 333 } |
258 | 334 |
259 checkListProjectsResponse(api.ListProjectsResponse o) { | 335 checkListProjectsResponse(api.ListProjectsResponse o) { |
260 buildCounterListProjectsResponse++; | 336 buildCounterListProjectsResponse++; |
261 if (buildCounterListProjectsResponse < 3) { | 337 if (buildCounterListProjectsResponse < 3) { |
262 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 338 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
263 checkUnnamed1789(o.projects); | 339 checkUnnamed1559(o.projects); |
264 } | 340 } |
265 buildCounterListProjectsResponse--; | 341 buildCounterListProjectsResponse--; |
266 } | 342 } |
267 | 343 |
268 buildUnnamed1790() { | 344 buildUnnamed1560() { |
269 var o = new core.Map<core.String, core.Object>(); | 345 var o = new core.Map<core.String, core.Object>(); |
270 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 346 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
271 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 347 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
272 return o; | 348 return o; |
273 } | 349 } |
274 | 350 |
275 checkUnnamed1790(core.Map<core.String, core.Object> o) { | 351 checkUnnamed1560(core.Map<core.String, core.Object> o) { |
276 unittest.expect(o, unittest.hasLength(2)); | 352 unittest.expect(o, unittest.hasLength(2)); |
277 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 353 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
278 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 354 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
279 } | 355 } |
280 | 356 |
281 buildUnnamed1791() { | 357 buildUnnamed1561() { |
282 var o = new core.Map<core.String, core.Object>(); | 358 var o = new core.Map<core.String, core.Object>(); |
283 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 359 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
284 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 360 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
285 return o; | 361 return o; |
286 } | 362 } |
287 | 363 |
288 checkUnnamed1791(core.Map<core.String, core.Object> o) { | 364 checkUnnamed1561(core.Map<core.String, core.Object> o) { |
289 unittest.expect(o, unittest.hasLength(2)); | 365 unittest.expect(o, unittest.hasLength(2)); |
290 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 366 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
291 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 367 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
292 } | 368 } |
293 | 369 |
294 core.int buildCounterOperation = 0; | 370 core.int buildCounterOperation = 0; |
295 buildOperation() { | 371 buildOperation() { |
296 var o = new api.Operation(); | 372 var o = new api.Operation(); |
297 buildCounterOperation++; | 373 buildCounterOperation++; |
298 if (buildCounterOperation < 3) { | 374 if (buildCounterOperation < 3) { |
299 o.done = true; | 375 o.done = true; |
300 o.error = buildStatus(); | 376 o.error = buildStatus(); |
301 o.metadata = buildUnnamed1790(); | 377 o.metadata = buildUnnamed1560(); |
302 o.name = "foo"; | 378 o.name = "foo"; |
303 o.response = buildUnnamed1791(); | 379 o.response = buildUnnamed1561(); |
304 } | 380 } |
305 buildCounterOperation--; | 381 buildCounterOperation--; |
306 return o; | 382 return o; |
307 } | 383 } |
308 | 384 |
309 checkOperation(api.Operation o) { | 385 checkOperation(api.Operation o) { |
310 buildCounterOperation++; | 386 buildCounterOperation++; |
311 if (buildCounterOperation < 3) { | 387 if (buildCounterOperation < 3) { |
312 unittest.expect(o.done, unittest.isTrue); | 388 unittest.expect(o.done, unittest.isTrue); |
313 checkStatus(o.error); | 389 checkStatus(o.error); |
314 checkUnnamed1790(o.metadata); | 390 checkUnnamed1560(o.metadata); |
315 unittest.expect(o.name, unittest.equals('foo')); | 391 unittest.expect(o.name, unittest.equals('foo')); |
316 checkUnnamed1791(o.response); | 392 checkUnnamed1561(o.response); |
317 } | 393 } |
318 buildCounterOperation--; | 394 buildCounterOperation--; |
319 } | 395 } |
320 | 396 |
321 core.int buildCounterOrganization = 0; | 397 core.int buildCounterOrganization = 0; |
322 buildOrganization() { | 398 buildOrganization() { |
323 var o = new api.Organization(); | 399 var o = new api.Organization(); |
324 buildCounterOrganization++; | 400 buildCounterOrganization++; |
325 if (buildCounterOrganization < 3) { | 401 if (buildCounterOrganization < 3) { |
326 o.creationTime = "foo"; | 402 o.creationTime = "foo"; |
(...skipping 30 matching lines...) Expand all Loading... |
357 } | 433 } |
358 | 434 |
359 checkOrganizationOwner(api.OrganizationOwner o) { | 435 checkOrganizationOwner(api.OrganizationOwner o) { |
360 buildCounterOrganizationOwner++; | 436 buildCounterOrganizationOwner++; |
361 if (buildCounterOrganizationOwner < 3) { | 437 if (buildCounterOrganizationOwner < 3) { |
362 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); | 438 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); |
363 } | 439 } |
364 buildCounterOrganizationOwner--; | 440 buildCounterOrganizationOwner--; |
365 } | 441 } |
366 | 442 |
367 buildUnnamed1792() { | 443 buildUnnamed1562() { |
368 var o = new core.List<api.Binding>(); | 444 var o = new core.List<api.Binding>(); |
369 o.add(buildBinding()); | 445 o.add(buildBinding()); |
370 o.add(buildBinding()); | 446 o.add(buildBinding()); |
371 return o; | 447 return o; |
372 } | 448 } |
373 | 449 |
374 checkUnnamed1792(core.List<api.Binding> o) { | 450 checkUnnamed1562(core.List<api.Binding> o) { |
375 unittest.expect(o, unittest.hasLength(2)); | 451 unittest.expect(o, unittest.hasLength(2)); |
376 checkBinding(o[0]); | 452 checkBinding(o[0]); |
377 checkBinding(o[1]); | 453 checkBinding(o[1]); |
378 } | 454 } |
379 | 455 |
380 core.int buildCounterPolicy = 0; | 456 core.int buildCounterPolicy = 0; |
381 buildPolicy() { | 457 buildPolicy() { |
382 var o = new api.Policy(); | 458 var o = new api.Policy(); |
383 buildCounterPolicy++; | 459 buildCounterPolicy++; |
384 if (buildCounterPolicy < 3) { | 460 if (buildCounterPolicy < 3) { |
385 o.bindings = buildUnnamed1792(); | 461 o.bindings = buildUnnamed1562(); |
386 o.etag = "foo"; | 462 o.etag = "foo"; |
387 o.version = 42; | 463 o.version = 42; |
388 } | 464 } |
389 buildCounterPolicy--; | 465 buildCounterPolicy--; |
390 return o; | 466 return o; |
391 } | 467 } |
392 | 468 |
393 checkPolicy(api.Policy o) { | 469 checkPolicy(api.Policy o) { |
394 buildCounterPolicy++; | 470 buildCounterPolicy++; |
395 if (buildCounterPolicy < 3) { | 471 if (buildCounterPolicy < 3) { |
396 checkUnnamed1792(o.bindings); | 472 checkUnnamed1562(o.bindings); |
397 unittest.expect(o.etag, unittest.equals('foo')); | 473 unittest.expect(o.etag, unittest.equals('foo')); |
398 unittest.expect(o.version, unittest.equals(42)); | 474 unittest.expect(o.version, unittest.equals(42)); |
399 } | 475 } |
400 buildCounterPolicy--; | 476 buildCounterPolicy--; |
401 } | 477 } |
402 | 478 |
403 buildUnnamed1793() { | 479 buildUnnamed1563() { |
404 var o = new core.Map<core.String, core.String>(); | 480 var o = new core.Map<core.String, core.String>(); |
405 o["x"] = "foo"; | 481 o["x"] = "foo"; |
406 o["y"] = "foo"; | 482 o["y"] = "foo"; |
407 return o; | 483 return o; |
408 } | 484 } |
409 | 485 |
410 checkUnnamed1793(core.Map<core.String, core.String> o) { | 486 checkUnnamed1563(core.Map<core.String, core.String> o) { |
411 unittest.expect(o, unittest.hasLength(2)); | 487 unittest.expect(o, unittest.hasLength(2)); |
412 unittest.expect(o["x"], unittest.equals('foo')); | 488 unittest.expect(o["x"], unittest.equals('foo')); |
413 unittest.expect(o["y"], unittest.equals('foo')); | 489 unittest.expect(o["y"], unittest.equals('foo')); |
414 } | 490 } |
415 | 491 |
416 core.int buildCounterProject = 0; | 492 core.int buildCounterProject = 0; |
417 buildProject() { | 493 buildProject() { |
418 var o = new api.Project(); | 494 var o = new api.Project(); |
419 buildCounterProject++; | 495 buildCounterProject++; |
420 if (buildCounterProject < 3) { | 496 if (buildCounterProject < 3) { |
421 o.createTime = "foo"; | 497 o.createTime = "foo"; |
422 o.labels = buildUnnamed1793(); | 498 o.labels = buildUnnamed1563(); |
423 o.lifecycleState = "foo"; | 499 o.lifecycleState = "foo"; |
424 o.name = "foo"; | 500 o.name = "foo"; |
425 o.parent = buildResourceId(); | 501 o.parent = buildResourceId(); |
426 o.projectId = "foo"; | 502 o.projectId = "foo"; |
427 o.projectNumber = "foo"; | 503 o.projectNumber = "foo"; |
428 } | 504 } |
429 buildCounterProject--; | 505 buildCounterProject--; |
430 return o; | 506 return o; |
431 } | 507 } |
432 | 508 |
433 checkProject(api.Project o) { | 509 checkProject(api.Project o) { |
434 buildCounterProject++; | 510 buildCounterProject++; |
435 if (buildCounterProject < 3) { | 511 if (buildCounterProject < 3) { |
436 unittest.expect(o.createTime, unittest.equals('foo')); | 512 unittest.expect(o.createTime, unittest.equals('foo')); |
437 checkUnnamed1793(o.labels); | 513 checkUnnamed1563(o.labels); |
438 unittest.expect(o.lifecycleState, unittest.equals('foo')); | 514 unittest.expect(o.lifecycleState, unittest.equals('foo')); |
439 unittest.expect(o.name, unittest.equals('foo')); | 515 unittest.expect(o.name, unittest.equals('foo')); |
440 checkResourceId(o.parent); | 516 checkResourceId(o.parent); |
441 unittest.expect(o.projectId, unittest.equals('foo')); | 517 unittest.expect(o.projectId, unittest.equals('foo')); |
442 unittest.expect(o.projectNumber, unittest.equals('foo')); | 518 unittest.expect(o.projectNumber, unittest.equals('foo')); |
443 } | 519 } |
444 buildCounterProject--; | 520 buildCounterProject--; |
445 } | 521 } |
446 | 522 |
447 core.int buildCounterProjectCreationStatus = 0; | 523 core.int buildCounterProjectCreationStatus = 0; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) { | 580 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) { |
505 buildCounterSearchOrganizationsRequest++; | 581 buildCounterSearchOrganizationsRequest++; |
506 if (buildCounterSearchOrganizationsRequest < 3) { | 582 if (buildCounterSearchOrganizationsRequest < 3) { |
507 unittest.expect(o.filter, unittest.equals('foo')); | 583 unittest.expect(o.filter, unittest.equals('foo')); |
508 unittest.expect(o.pageSize, unittest.equals(42)); | 584 unittest.expect(o.pageSize, unittest.equals(42)); |
509 unittest.expect(o.pageToken, unittest.equals('foo')); | 585 unittest.expect(o.pageToken, unittest.equals('foo')); |
510 } | 586 } |
511 buildCounterSearchOrganizationsRequest--; | 587 buildCounterSearchOrganizationsRequest--; |
512 } | 588 } |
513 | 589 |
514 buildUnnamed1794() { | 590 buildUnnamed1564() { |
515 var o = new core.List<api.Organization>(); | 591 var o = new core.List<api.Organization>(); |
516 o.add(buildOrganization()); | 592 o.add(buildOrganization()); |
517 o.add(buildOrganization()); | 593 o.add(buildOrganization()); |
518 return o; | 594 return o; |
519 } | 595 } |
520 | 596 |
521 checkUnnamed1794(core.List<api.Organization> o) { | 597 checkUnnamed1564(core.List<api.Organization> o) { |
522 unittest.expect(o, unittest.hasLength(2)); | 598 unittest.expect(o, unittest.hasLength(2)); |
523 checkOrganization(o[0]); | 599 checkOrganization(o[0]); |
524 checkOrganization(o[1]); | 600 checkOrganization(o[1]); |
525 } | 601 } |
526 | 602 |
527 core.int buildCounterSearchOrganizationsResponse = 0; | 603 core.int buildCounterSearchOrganizationsResponse = 0; |
528 buildSearchOrganizationsResponse() { | 604 buildSearchOrganizationsResponse() { |
529 var o = new api.SearchOrganizationsResponse(); | 605 var o = new api.SearchOrganizationsResponse(); |
530 buildCounterSearchOrganizationsResponse++; | 606 buildCounterSearchOrganizationsResponse++; |
531 if (buildCounterSearchOrganizationsResponse < 3) { | 607 if (buildCounterSearchOrganizationsResponse < 3) { |
532 o.nextPageToken = "foo"; | 608 o.nextPageToken = "foo"; |
533 o.organizations = buildUnnamed1794(); | 609 o.organizations = buildUnnamed1564(); |
534 } | 610 } |
535 buildCounterSearchOrganizationsResponse--; | 611 buildCounterSearchOrganizationsResponse--; |
536 return o; | 612 return o; |
537 } | 613 } |
538 | 614 |
539 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) { | 615 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) { |
540 buildCounterSearchOrganizationsResponse++; | 616 buildCounterSearchOrganizationsResponse++; |
541 if (buildCounterSearchOrganizationsResponse < 3) { | 617 if (buildCounterSearchOrganizationsResponse < 3) { |
542 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 618 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
543 checkUnnamed1794(o.organizations); | 619 checkUnnamed1564(o.organizations); |
544 } | 620 } |
545 buildCounterSearchOrganizationsResponse--; | 621 buildCounterSearchOrganizationsResponse--; |
546 } | 622 } |
547 | 623 |
548 core.int buildCounterSetIamPolicyRequest = 0; | 624 core.int buildCounterSetIamPolicyRequest = 0; |
549 buildSetIamPolicyRequest() { | 625 buildSetIamPolicyRequest() { |
550 var o = new api.SetIamPolicyRequest(); | 626 var o = new api.SetIamPolicyRequest(); |
551 buildCounterSetIamPolicyRequest++; | 627 buildCounterSetIamPolicyRequest++; |
552 if (buildCounterSetIamPolicyRequest < 3) { | 628 if (buildCounterSetIamPolicyRequest < 3) { |
553 o.policy = buildPolicy(); | 629 o.policy = buildPolicy(); |
554 } | 630 } |
555 buildCounterSetIamPolicyRequest--; | 631 buildCounterSetIamPolicyRequest--; |
556 return o; | 632 return o; |
557 } | 633 } |
558 | 634 |
559 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { | 635 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
560 buildCounterSetIamPolicyRequest++; | 636 buildCounterSetIamPolicyRequest++; |
561 if (buildCounterSetIamPolicyRequest < 3) { | 637 if (buildCounterSetIamPolicyRequest < 3) { |
562 checkPolicy(o.policy); | 638 checkPolicy(o.policy); |
563 } | 639 } |
564 buildCounterSetIamPolicyRequest--; | 640 buildCounterSetIamPolicyRequest--; |
565 } | 641 } |
566 | 642 |
567 buildUnnamed1795() { | 643 buildUnnamed1565() { |
568 var o = new core.Map<core.String, core.Object>(); | 644 var o = new core.Map<core.String, core.Object>(); |
569 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 645 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
570 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 646 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
571 return o; | 647 return o; |
572 } | 648 } |
573 | 649 |
574 checkUnnamed1795(core.Map<core.String, core.Object> o) { | 650 checkUnnamed1565(core.Map<core.String, core.Object> o) { |
575 unittest.expect(o, unittest.hasLength(2)); | 651 unittest.expect(o, unittest.hasLength(2)); |
576 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 652 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
577 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 653 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
578 } | 654 } |
579 | 655 |
580 buildUnnamed1796() { | 656 buildUnnamed1566() { |
581 var o = new core.List<core.Map<core.String, core.Object>>(); | 657 var o = new core.List<core.Map<core.String, core.Object>>(); |
582 o.add(buildUnnamed1795()); | 658 o.add(buildUnnamed1565()); |
583 o.add(buildUnnamed1795()); | 659 o.add(buildUnnamed1565()); |
584 return o; | 660 return o; |
585 } | 661 } |
586 | 662 |
587 checkUnnamed1796(core.List<core.Map<core.String, core.Object>> o) { | 663 checkUnnamed1566(core.List<core.Map<core.String, core.Object>> o) { |
588 unittest.expect(o, unittest.hasLength(2)); | 664 unittest.expect(o, unittest.hasLength(2)); |
589 checkUnnamed1795(o[0]); | 665 checkUnnamed1565(o[0]); |
590 checkUnnamed1795(o[1]); | 666 checkUnnamed1565(o[1]); |
591 } | 667 } |
592 | 668 |
593 core.int buildCounterStatus = 0; | 669 core.int buildCounterStatus = 0; |
594 buildStatus() { | 670 buildStatus() { |
595 var o = new api.Status(); | 671 var o = new api.Status(); |
596 buildCounterStatus++; | 672 buildCounterStatus++; |
597 if (buildCounterStatus < 3) { | 673 if (buildCounterStatus < 3) { |
598 o.code = 42; | 674 o.code = 42; |
599 o.details = buildUnnamed1796(); | 675 o.details = buildUnnamed1566(); |
600 o.message = "foo"; | 676 o.message = "foo"; |
601 } | 677 } |
602 buildCounterStatus--; | 678 buildCounterStatus--; |
603 return o; | 679 return o; |
604 } | 680 } |
605 | 681 |
606 checkStatus(api.Status o) { | 682 checkStatus(api.Status o) { |
607 buildCounterStatus++; | 683 buildCounterStatus++; |
608 if (buildCounterStatus < 3) { | 684 if (buildCounterStatus < 3) { |
609 unittest.expect(o.code, unittest.equals(42)); | 685 unittest.expect(o.code, unittest.equals(42)); |
610 checkUnnamed1796(o.details); | 686 checkUnnamed1566(o.details); |
611 unittest.expect(o.message, unittest.equals('foo')); | 687 unittest.expect(o.message, unittest.equals('foo')); |
612 } | 688 } |
613 buildCounterStatus--; | 689 buildCounterStatus--; |
614 } | 690 } |
615 | 691 |
616 buildUnnamed1797() { | 692 buildUnnamed1567() { |
617 var o = new core.List<core.String>(); | 693 var o = new core.List<core.String>(); |
618 o.add("foo"); | 694 o.add("foo"); |
619 o.add("foo"); | 695 o.add("foo"); |
620 return o; | 696 return o; |
621 } | 697 } |
622 | 698 |
623 checkUnnamed1797(core.List<core.String> o) { | 699 checkUnnamed1567(core.List<core.String> o) { |
624 unittest.expect(o, unittest.hasLength(2)); | 700 unittest.expect(o, unittest.hasLength(2)); |
625 unittest.expect(o[0], unittest.equals('foo')); | 701 unittest.expect(o[0], unittest.equals('foo')); |
626 unittest.expect(o[1], unittest.equals('foo')); | 702 unittest.expect(o[1], unittest.equals('foo')); |
627 } | 703 } |
628 | 704 |
629 core.int buildCounterTestIamPermissionsRequest = 0; | 705 core.int buildCounterTestIamPermissionsRequest = 0; |
630 buildTestIamPermissionsRequest() { | 706 buildTestIamPermissionsRequest() { |
631 var o = new api.TestIamPermissionsRequest(); | 707 var o = new api.TestIamPermissionsRequest(); |
632 buildCounterTestIamPermissionsRequest++; | 708 buildCounterTestIamPermissionsRequest++; |
633 if (buildCounterTestIamPermissionsRequest < 3) { | 709 if (buildCounterTestIamPermissionsRequest < 3) { |
634 o.permissions = buildUnnamed1797(); | 710 o.permissions = buildUnnamed1567(); |
635 } | 711 } |
636 buildCounterTestIamPermissionsRequest--; | 712 buildCounterTestIamPermissionsRequest--; |
637 return o; | 713 return o; |
638 } | 714 } |
639 | 715 |
640 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 716 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
641 buildCounterTestIamPermissionsRequest++; | 717 buildCounterTestIamPermissionsRequest++; |
642 if (buildCounterTestIamPermissionsRequest < 3) { | 718 if (buildCounterTestIamPermissionsRequest < 3) { |
643 checkUnnamed1797(o.permissions); | 719 checkUnnamed1567(o.permissions); |
644 } | 720 } |
645 buildCounterTestIamPermissionsRequest--; | 721 buildCounterTestIamPermissionsRequest--; |
646 } | 722 } |
647 | 723 |
648 buildUnnamed1798() { | 724 buildUnnamed1568() { |
649 var o = new core.List<core.String>(); | 725 var o = new core.List<core.String>(); |
650 o.add("foo"); | 726 o.add("foo"); |
651 o.add("foo"); | 727 o.add("foo"); |
652 return o; | 728 return o; |
653 } | 729 } |
654 | 730 |
655 checkUnnamed1798(core.List<core.String> o) { | 731 checkUnnamed1568(core.List<core.String> o) { |
656 unittest.expect(o, unittest.hasLength(2)); | 732 unittest.expect(o, unittest.hasLength(2)); |
657 unittest.expect(o[0], unittest.equals('foo')); | 733 unittest.expect(o[0], unittest.equals('foo')); |
658 unittest.expect(o[1], unittest.equals('foo')); | 734 unittest.expect(o[1], unittest.equals('foo')); |
659 } | 735 } |
660 | 736 |
661 core.int buildCounterTestIamPermissionsResponse = 0; | 737 core.int buildCounterTestIamPermissionsResponse = 0; |
662 buildTestIamPermissionsResponse() { | 738 buildTestIamPermissionsResponse() { |
663 var o = new api.TestIamPermissionsResponse(); | 739 var o = new api.TestIamPermissionsResponse(); |
664 buildCounterTestIamPermissionsResponse++; | 740 buildCounterTestIamPermissionsResponse++; |
665 if (buildCounterTestIamPermissionsResponse < 3) { | 741 if (buildCounterTestIamPermissionsResponse < 3) { |
666 o.permissions = buildUnnamed1798(); | 742 o.permissions = buildUnnamed1568(); |
667 } | 743 } |
668 buildCounterTestIamPermissionsResponse--; | 744 buildCounterTestIamPermissionsResponse--; |
669 return o; | 745 return o; |
670 } | 746 } |
671 | 747 |
672 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 748 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
673 buildCounterTestIamPermissionsResponse++; | 749 buildCounterTestIamPermissionsResponse++; |
674 if (buildCounterTestIamPermissionsResponse < 3) { | 750 if (buildCounterTestIamPermissionsResponse < 3) { |
675 checkUnnamed1798(o.permissions); | 751 checkUnnamed1568(o.permissions); |
676 } | 752 } |
677 buildCounterTestIamPermissionsResponse--; | 753 buildCounterTestIamPermissionsResponse--; |
678 } | 754 } |
679 | 755 |
680 core.int buildCounterUndeleteProjectRequest = 0; | 756 core.int buildCounterUndeleteProjectRequest = 0; |
681 buildUndeleteProjectRequest() { | 757 buildUndeleteProjectRequest() { |
682 var o = new api.UndeleteProjectRequest(); | 758 var o = new api.UndeleteProjectRequest(); |
683 buildCounterUndeleteProjectRequest++; | 759 buildCounterUndeleteProjectRequest++; |
684 if (buildCounterUndeleteProjectRequest < 3) { | 760 if (buildCounterUndeleteProjectRequest < 3) { |
685 } | 761 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 837 |
762 unittest.group("obj-schema-GetIamPolicyRequest", () { | 838 unittest.group("obj-schema-GetIamPolicyRequest", () { |
763 unittest.test("to-json--from-json", () { | 839 unittest.test("to-json--from-json", () { |
764 var o = buildGetIamPolicyRequest(); | 840 var o = buildGetIamPolicyRequest(); |
765 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); | 841 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); |
766 checkGetIamPolicyRequest(od); | 842 checkGetIamPolicyRequest(od); |
767 }); | 843 }); |
768 }); | 844 }); |
769 | 845 |
770 | 846 |
| 847 unittest.group("obj-schema-Lien", () { |
| 848 unittest.test("to-json--from-json", () { |
| 849 var o = buildLien(); |
| 850 var od = new api.Lien.fromJson(o.toJson()); |
| 851 checkLien(od); |
| 852 }); |
| 853 }); |
| 854 |
| 855 |
| 856 unittest.group("obj-schema-ListLiensResponse", () { |
| 857 unittest.test("to-json--from-json", () { |
| 858 var o = buildListLiensResponse(); |
| 859 var od = new api.ListLiensResponse.fromJson(o.toJson()); |
| 860 checkListLiensResponse(od); |
| 861 }); |
| 862 }); |
| 863 |
| 864 |
771 unittest.group("obj-schema-ListProjectsResponse", () { | 865 unittest.group("obj-schema-ListProjectsResponse", () { |
772 unittest.test("to-json--from-json", () { | 866 unittest.test("to-json--from-json", () { |
773 var o = buildListProjectsResponse(); | 867 var o = buildListProjectsResponse(); |
774 var od = new api.ListProjectsResponse.fromJson(o.toJson()); | 868 var od = new api.ListProjectsResponse.fromJson(o.toJson()); |
775 checkListProjectsResponse(od); | 869 checkListProjectsResponse(od); |
776 }); | 870 }); |
777 }); | 871 }); |
778 | 872 |
779 | 873 |
780 unittest.group("obj-schema-Operation", () { | 874 unittest.group("obj-schema-Operation", () { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 | 990 |
897 unittest.group("obj-schema-UndeleteProjectRequest", () { | 991 unittest.group("obj-schema-UndeleteProjectRequest", () { |
898 unittest.test("to-json--from-json", () { | 992 unittest.test("to-json--from-json", () { |
899 var o = buildUndeleteProjectRequest(); | 993 var o = buildUndeleteProjectRequest(); |
900 var od = new api.UndeleteProjectRequest.fromJson(o.toJson()); | 994 var od = new api.UndeleteProjectRequest.fromJson(o.toJson()); |
901 checkUndeleteProjectRequest(od); | 995 checkUndeleteProjectRequest(od); |
902 }); | 996 }); |
903 }); | 997 }); |
904 | 998 |
905 | 999 |
| 1000 unittest.group("resource-LiensResourceApi", () { |
| 1001 unittest.test("method--create", () { |
| 1002 |
| 1003 var mock = new HttpServerMock(); |
| 1004 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; |
| 1005 var arg_request = buildLien(); |
| 1006 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1007 var obj = new api.Lien.fromJson(json); |
| 1008 checkLien(obj); |
| 1009 |
| 1010 var path = (req.url).path; |
| 1011 var pathOffset = 0; |
| 1012 var index; |
| 1013 var subPart; |
| 1014 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1015 pathOffset += 1; |
| 1016 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1/liens")); |
| 1017 pathOffset += 8; |
| 1018 |
| 1019 var query = (req.url).query; |
| 1020 var queryOffset = 0; |
| 1021 var queryMap = {}; |
| 1022 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1023 parseBool(n) { |
| 1024 if (n == "true") return true; |
| 1025 if (n == "false") return false; |
| 1026 if (n == null) return null; |
| 1027 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1028 } |
| 1029 if (query.length > 0) { |
| 1030 for (var part in query.split("&")) { |
| 1031 var keyvalue = part.split("="); |
| 1032 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1033 } |
| 1034 } |
| 1035 |
| 1036 |
| 1037 var h = { |
| 1038 "content-type" : "application/json; charset=utf-8", |
| 1039 }; |
| 1040 var resp = convert.JSON.encode(buildLien()); |
| 1041 return new async.Future.value(stringResponse(200, h, resp)); |
| 1042 }), true); |
| 1043 res.create(arg_request).then(unittest.expectAsync(((api.Lien response) { |
| 1044 checkLien(response); |
| 1045 }))); |
| 1046 }); |
| 1047 |
| 1048 unittest.test("method--delete", () { |
| 1049 |
| 1050 var mock = new HttpServerMock(); |
| 1051 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; |
| 1052 var arg_name = "foo"; |
| 1053 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1054 var path = (req.url).path; |
| 1055 var pathOffset = 0; |
| 1056 var index; |
| 1057 var subPart; |
| 1058 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1059 pathOffset += 1; |
| 1060 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1061 pathOffset += 3; |
| 1062 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1063 |
| 1064 var query = (req.url).query; |
| 1065 var queryOffset = 0; |
| 1066 var queryMap = {}; |
| 1067 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1068 parseBool(n) { |
| 1069 if (n == "true") return true; |
| 1070 if (n == "false") return false; |
| 1071 if (n == null) return null; |
| 1072 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1073 } |
| 1074 if (query.length > 0) { |
| 1075 for (var part in query.split("&")) { |
| 1076 var keyvalue = part.split("="); |
| 1077 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1078 } |
| 1079 } |
| 1080 |
| 1081 |
| 1082 var h = { |
| 1083 "content-type" : "application/json; charset=utf-8", |
| 1084 }; |
| 1085 var resp = convert.JSON.encode(buildEmpty()); |
| 1086 return new async.Future.value(stringResponse(200, h, resp)); |
| 1087 }), true); |
| 1088 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { |
| 1089 checkEmpty(response); |
| 1090 }))); |
| 1091 }); |
| 1092 |
| 1093 unittest.test("method--list", () { |
| 1094 |
| 1095 var mock = new HttpServerMock(); |
| 1096 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; |
| 1097 var arg_parent = "foo"; |
| 1098 var arg_pageToken = "foo"; |
| 1099 var arg_pageSize = 42; |
| 1100 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1101 var path = (req.url).path; |
| 1102 var pathOffset = 0; |
| 1103 var index; |
| 1104 var subPart; |
| 1105 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1106 pathOffset += 1; |
| 1107 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1/liens")); |
| 1108 pathOffset += 8; |
| 1109 |
| 1110 var query = (req.url).query; |
| 1111 var queryOffset = 0; |
| 1112 var queryMap = {}; |
| 1113 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1114 parseBool(n) { |
| 1115 if (n == "true") return true; |
| 1116 if (n == "false") return false; |
| 1117 if (n == null) return null; |
| 1118 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1119 } |
| 1120 if (query.length > 0) { |
| 1121 for (var part in query.split("&")) { |
| 1122 var keyvalue = part.split("="); |
| 1123 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1124 } |
| 1125 } |
| 1126 unittest.expect(queryMap["parent"].first, unittest.equals(arg_parent)); |
| 1127 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1128 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1129 |
| 1130 |
| 1131 var h = { |
| 1132 "content-type" : "application/json; charset=utf-8", |
| 1133 }; |
| 1134 var resp = convert.JSON.encode(buildListLiensResponse()); |
| 1135 return new async.Future.value(stringResponse(200, h, resp)); |
| 1136 }), true); |
| 1137 res.list(parent: arg_parent, pageToken: arg_pageToken, pageSize: arg_pageS
ize).then(unittest.expectAsync(((api.ListLiensResponse response) { |
| 1138 checkListLiensResponse(response); |
| 1139 }))); |
| 1140 }); |
| 1141 |
| 1142 }); |
| 1143 |
| 1144 |
906 unittest.group("resource-OperationsResourceApi", () { | 1145 unittest.group("resource-OperationsResourceApi", () { |
907 unittest.test("method--get", () { | 1146 unittest.test("method--get", () { |
908 | 1147 |
909 var mock = new HttpServerMock(); | 1148 var mock = new HttpServerMock(); |
910 api.OperationsResourceApi res = new api.CloudresourcemanagerApi(mock).oper
ations; | 1149 api.OperationsResourceApi res = new api.CloudresourcemanagerApi(mock).oper
ations; |
911 var arg_name = "foo"; | 1150 var arg_name = "foo"; |
912 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1151 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
913 var path = (req.url).path; | 1152 var path = (req.url).path; |
914 var pathOffset = 0; | 1153 var pathOffset = 0; |
915 var index; | 1154 var index; |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { | 1949 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { |
1711 checkProject(response); | 1950 checkProject(response); |
1712 }))); | 1951 }))); |
1713 }); | 1952 }); |
1714 | 1953 |
1715 }); | 1954 }); |
1716 | 1955 |
1717 | 1956 |
1718 } | 1957 } |
1719 | 1958 |
OLD | NEW |