| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 buildUnnamed1927() { | 54 core.int buildCounterAncestor = 0; |
| 55 buildAncestor() { |
| 56 var o = new api.Ancestor(); |
| 57 buildCounterAncestor++; |
| 58 if (buildCounterAncestor < 3) { |
| 59 o.resourceId = buildResourceId(); |
| 60 } |
| 61 buildCounterAncestor--; |
| 62 return o; |
| 63 } |
| 64 |
| 65 checkAncestor(api.Ancestor o) { |
| 66 buildCounterAncestor++; |
| 67 if (buildCounterAncestor < 3) { |
| 68 checkResourceId(o.resourceId); |
| 69 } |
| 70 buildCounterAncestor--; |
| 71 } |
| 72 |
| 73 buildUnnamed1697() { |
| 55 var o = new core.List<core.String>(); | 74 var o = new core.List<core.String>(); |
| 56 o.add("foo"); | 75 o.add("foo"); |
| 57 o.add("foo"); | 76 o.add("foo"); |
| 58 return o; | 77 return o; |
| 59 } | 78 } |
| 60 | 79 |
| 61 checkUnnamed1927(core.List<core.String> o) { | 80 checkUnnamed1697(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 81 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); | 82 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); | 83 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } | 84 } |
| 66 | 85 |
| 67 core.int buildCounterBinding = 0; | 86 core.int buildCounterBinding = 0; |
| 68 buildBinding() { | 87 buildBinding() { |
| 69 var o = new api.Binding(); | 88 var o = new api.Binding(); |
| 70 buildCounterBinding++; | 89 buildCounterBinding++; |
| 71 if (buildCounterBinding < 3) { | 90 if (buildCounterBinding < 3) { |
| 72 o.members = buildUnnamed1927(); | 91 o.members = buildUnnamed1697(); |
| 73 o.role = "foo"; | 92 o.role = "foo"; |
| 74 } | 93 } |
| 75 buildCounterBinding--; | 94 buildCounterBinding--; |
| 76 return o; | 95 return o; |
| 77 } | 96 } |
| 78 | 97 |
| 79 checkBinding(api.Binding o) { | 98 checkBinding(api.Binding o) { |
| 80 buildCounterBinding++; | 99 buildCounterBinding++; |
| 81 if (buildCounterBinding < 3) { | 100 if (buildCounterBinding < 3) { |
| 82 checkUnnamed1927(o.members); | 101 checkUnnamed1697(o.members); |
| 83 unittest.expect(o.role, unittest.equals('foo')); | 102 unittest.expect(o.role, unittest.equals('foo')); |
| 84 } | 103 } |
| 85 buildCounterBinding--; | 104 buildCounterBinding--; |
| 86 } | 105 } |
| 87 | 106 |
| 88 core.int buildCounterEmpty = 0; | 107 core.int buildCounterEmpty = 0; |
| 89 buildEmpty() { | 108 buildEmpty() { |
| 90 var o = new api.Empty(); | 109 var o = new api.Empty(); |
| 91 buildCounterEmpty++; | 110 buildCounterEmpty++; |
| 92 if (buildCounterEmpty < 3) { | 111 if (buildCounterEmpty < 3) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 158 } |
| 140 | 159 |
| 141 checkFolderOperationError(api.FolderOperationError o) { | 160 checkFolderOperationError(api.FolderOperationError o) { |
| 142 buildCounterFolderOperationError++; | 161 buildCounterFolderOperationError++; |
| 143 if (buildCounterFolderOperationError < 3) { | 162 if (buildCounterFolderOperationError < 3) { |
| 144 unittest.expect(o.errorMessageId, unittest.equals('foo')); | 163 unittest.expect(o.errorMessageId, unittest.equals('foo')); |
| 145 } | 164 } |
| 146 buildCounterFolderOperationError--; | 165 buildCounterFolderOperationError--; |
| 147 } | 166 } |
| 148 | 167 |
| 168 core.int buildCounterGetAncestryRequest = 0; |
| 169 buildGetAncestryRequest() { |
| 170 var o = new api.GetAncestryRequest(); |
| 171 buildCounterGetAncestryRequest++; |
| 172 if (buildCounterGetAncestryRequest < 3) { |
| 173 } |
| 174 buildCounterGetAncestryRequest--; |
| 175 return o; |
| 176 } |
| 177 |
| 178 checkGetAncestryRequest(api.GetAncestryRequest o) { |
| 179 buildCounterGetAncestryRequest++; |
| 180 if (buildCounterGetAncestryRequest < 3) { |
| 181 } |
| 182 buildCounterGetAncestryRequest--; |
| 183 } |
| 184 |
| 185 buildUnnamed1698() { |
| 186 var o = new core.List<api.Ancestor>(); |
| 187 o.add(buildAncestor()); |
| 188 o.add(buildAncestor()); |
| 189 return o; |
| 190 } |
| 191 |
| 192 checkUnnamed1698(core.List<api.Ancestor> o) { |
| 193 unittest.expect(o, unittest.hasLength(2)); |
| 194 checkAncestor(o[0]); |
| 195 checkAncestor(o[1]); |
| 196 } |
| 197 |
| 198 core.int buildCounterGetAncestryResponse = 0; |
| 199 buildGetAncestryResponse() { |
| 200 var o = new api.GetAncestryResponse(); |
| 201 buildCounterGetAncestryResponse++; |
| 202 if (buildCounterGetAncestryResponse < 3) { |
| 203 o.ancestor = buildUnnamed1698(); |
| 204 } |
| 205 buildCounterGetAncestryResponse--; |
| 206 return o; |
| 207 } |
| 208 |
| 209 checkGetAncestryResponse(api.GetAncestryResponse o) { |
| 210 buildCounterGetAncestryResponse++; |
| 211 if (buildCounterGetAncestryResponse < 3) { |
| 212 checkUnnamed1698(o.ancestor); |
| 213 } |
| 214 buildCounterGetAncestryResponse--; |
| 215 } |
| 216 |
| 149 core.int buildCounterGetIamPolicyRequest = 0; | 217 core.int buildCounterGetIamPolicyRequest = 0; |
| 150 buildGetIamPolicyRequest() { | 218 buildGetIamPolicyRequest() { |
| 151 var o = new api.GetIamPolicyRequest(); | 219 var o = new api.GetIamPolicyRequest(); |
| 152 buildCounterGetIamPolicyRequest++; | 220 buildCounterGetIamPolicyRequest++; |
| 153 if (buildCounterGetIamPolicyRequest < 3) { | 221 if (buildCounterGetIamPolicyRequest < 3) { |
| 154 } | 222 } |
| 155 buildCounterGetIamPolicyRequest--; | 223 buildCounterGetIamPolicyRequest--; |
| 156 return o; | 224 return o; |
| 157 } | 225 } |
| 158 | 226 |
| 159 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { | 227 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| 160 buildCounterGetIamPolicyRequest++; | 228 buildCounterGetIamPolicyRequest++; |
| 161 if (buildCounterGetIamPolicyRequest < 3) { | 229 if (buildCounterGetIamPolicyRequest < 3) { |
| 162 } | 230 } |
| 163 buildCounterGetIamPolicyRequest--; | 231 buildCounterGetIamPolicyRequest--; |
| 164 } | 232 } |
| 165 | 233 |
| 166 buildUnnamed1928() { | 234 buildUnnamed1699() { |
| 167 var o = new core.List<api.Project>(); | 235 var o = new core.List<api.Project>(); |
| 168 o.add(buildProject()); | 236 o.add(buildProject()); |
| 169 o.add(buildProject()); | 237 o.add(buildProject()); |
| 170 return o; | 238 return o; |
| 171 } | 239 } |
| 172 | 240 |
| 173 checkUnnamed1928(core.List<api.Project> o) { | 241 checkUnnamed1699(core.List<api.Project> o) { |
| 174 unittest.expect(o, unittest.hasLength(2)); | 242 unittest.expect(o, unittest.hasLength(2)); |
| 175 checkProject(o[0]); | 243 checkProject(o[0]); |
| 176 checkProject(o[1]); | 244 checkProject(o[1]); |
| 177 } | 245 } |
| 178 | 246 |
| 179 core.int buildCounterListProjectsResponse = 0; | 247 core.int buildCounterListProjectsResponse = 0; |
| 180 buildListProjectsResponse() { | 248 buildListProjectsResponse() { |
| 181 var o = new api.ListProjectsResponse(); | 249 var o = new api.ListProjectsResponse(); |
| 182 buildCounterListProjectsResponse++; | 250 buildCounterListProjectsResponse++; |
| 183 if (buildCounterListProjectsResponse < 3) { | 251 if (buildCounterListProjectsResponse < 3) { |
| 184 o.nextPageToken = "foo"; | 252 o.nextPageToken = "foo"; |
| 185 o.projects = buildUnnamed1928(); | 253 o.projects = buildUnnamed1699(); |
| 186 } | 254 } |
| 187 buildCounterListProjectsResponse--; | 255 buildCounterListProjectsResponse--; |
| 188 return o; | 256 return o; |
| 189 } | 257 } |
| 190 | 258 |
| 191 checkListProjectsResponse(api.ListProjectsResponse o) { | 259 checkListProjectsResponse(api.ListProjectsResponse o) { |
| 192 buildCounterListProjectsResponse++; | 260 buildCounterListProjectsResponse++; |
| 193 if (buildCounterListProjectsResponse < 3) { | 261 if (buildCounterListProjectsResponse < 3) { |
| 194 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 262 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 195 checkUnnamed1928(o.projects); | 263 checkUnnamed1699(o.projects); |
| 196 } | 264 } |
| 197 buildCounterListProjectsResponse--; | 265 buildCounterListProjectsResponse--; |
| 198 } | 266 } |
| 199 | 267 |
| 200 buildUnnamed1929() { | 268 buildUnnamed1700() { |
| 201 var o = new core.Map<core.String, core.Object>(); | 269 var o = new core.Map<core.String, core.Object>(); |
| 202 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 270 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 203 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 271 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 204 return o; | 272 return o; |
| 205 } | 273 } |
| 206 | 274 |
| 207 checkUnnamed1929(core.Map<core.String, core.Object> o) { | 275 checkUnnamed1700(core.Map<core.String, core.Object> o) { |
| 208 unittest.expect(o, unittest.hasLength(2)); | 276 unittest.expect(o, unittest.hasLength(2)); |
| 209 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')); | 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')); |
| 210 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')); | 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')); |
| 211 } | 279 } |
| 212 | 280 |
| 213 buildUnnamed1930() { | 281 buildUnnamed1701() { |
| 214 var o = new core.Map<core.String, core.Object>(); | 282 var o = new core.Map<core.String, core.Object>(); |
| 215 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 283 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 216 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 284 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 217 return o; | 285 return o; |
| 218 } | 286 } |
| 219 | 287 |
| 220 checkUnnamed1930(core.Map<core.String, core.Object> o) { | 288 checkUnnamed1701(core.Map<core.String, core.Object> o) { |
| 221 unittest.expect(o, unittest.hasLength(2)); | 289 unittest.expect(o, unittest.hasLength(2)); |
| 222 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')); | 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')); |
| 223 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')); | 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')); |
| 224 } | 292 } |
| 225 | 293 |
| 226 core.int buildCounterOperation = 0; | 294 core.int buildCounterOperation = 0; |
| 227 buildOperation() { | 295 buildOperation() { |
| 228 var o = new api.Operation(); | 296 var o = new api.Operation(); |
| 229 buildCounterOperation++; | 297 buildCounterOperation++; |
| 230 if (buildCounterOperation < 3) { | 298 if (buildCounterOperation < 3) { |
| 231 o.done = true; | 299 o.done = true; |
| 232 o.error = buildStatus(); | 300 o.error = buildStatus(); |
| 233 o.metadata = buildUnnamed1929(); | 301 o.metadata = buildUnnamed1700(); |
| 234 o.name = "foo"; | 302 o.name = "foo"; |
| 235 o.response = buildUnnamed1930(); | 303 o.response = buildUnnamed1701(); |
| 236 } | 304 } |
| 237 buildCounterOperation--; | 305 buildCounterOperation--; |
| 238 return o; | 306 return o; |
| 239 } | 307 } |
| 240 | 308 |
| 241 checkOperation(api.Operation o) { | 309 checkOperation(api.Operation o) { |
| 242 buildCounterOperation++; | 310 buildCounterOperation++; |
| 243 if (buildCounterOperation < 3) { | 311 if (buildCounterOperation < 3) { |
| 244 unittest.expect(o.done, unittest.isTrue); | 312 unittest.expect(o.done, unittest.isTrue); |
| 245 checkStatus(o.error); | 313 checkStatus(o.error); |
| 246 checkUnnamed1929(o.metadata); | 314 checkUnnamed1700(o.metadata); |
| 247 unittest.expect(o.name, unittest.equals('foo')); | 315 unittest.expect(o.name, unittest.equals('foo')); |
| 248 checkUnnamed1930(o.response); | 316 checkUnnamed1701(o.response); |
| 249 } | 317 } |
| 250 buildCounterOperation--; | 318 buildCounterOperation--; |
| 251 } | 319 } |
| 252 | 320 |
| 253 core.int buildCounterOrganization = 0; | 321 core.int buildCounterOrganization = 0; |
| 254 buildOrganization() { | 322 buildOrganization() { |
| 255 var o = new api.Organization(); | 323 var o = new api.Organization(); |
| 256 buildCounterOrganization++; | 324 buildCounterOrganization++; |
| 257 if (buildCounterOrganization < 3) { | 325 if (buildCounterOrganization < 3) { |
| 258 o.creationTime = "foo"; | 326 o.creationTime = "foo"; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 289 } | 357 } |
| 290 | 358 |
| 291 checkOrganizationOwner(api.OrganizationOwner o) { | 359 checkOrganizationOwner(api.OrganizationOwner o) { |
| 292 buildCounterOrganizationOwner++; | 360 buildCounterOrganizationOwner++; |
| 293 if (buildCounterOrganizationOwner < 3) { | 361 if (buildCounterOrganizationOwner < 3) { |
| 294 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); | 362 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); |
| 295 } | 363 } |
| 296 buildCounterOrganizationOwner--; | 364 buildCounterOrganizationOwner--; |
| 297 } | 365 } |
| 298 | 366 |
| 299 buildUnnamed1931() { | 367 buildUnnamed1702() { |
| 300 var o = new core.List<api.Binding>(); | 368 var o = new core.List<api.Binding>(); |
| 301 o.add(buildBinding()); | 369 o.add(buildBinding()); |
| 302 o.add(buildBinding()); | 370 o.add(buildBinding()); |
| 303 return o; | 371 return o; |
| 304 } | 372 } |
| 305 | 373 |
| 306 checkUnnamed1931(core.List<api.Binding> o) { | 374 checkUnnamed1702(core.List<api.Binding> o) { |
| 307 unittest.expect(o, unittest.hasLength(2)); | 375 unittest.expect(o, unittest.hasLength(2)); |
| 308 checkBinding(o[0]); | 376 checkBinding(o[0]); |
| 309 checkBinding(o[1]); | 377 checkBinding(o[1]); |
| 310 } | 378 } |
| 311 | 379 |
| 312 core.int buildCounterPolicy = 0; | 380 core.int buildCounterPolicy = 0; |
| 313 buildPolicy() { | 381 buildPolicy() { |
| 314 var o = new api.Policy(); | 382 var o = new api.Policy(); |
| 315 buildCounterPolicy++; | 383 buildCounterPolicy++; |
| 316 if (buildCounterPolicy < 3) { | 384 if (buildCounterPolicy < 3) { |
| 317 o.bindings = buildUnnamed1931(); | 385 o.bindings = buildUnnamed1702(); |
| 318 o.etag = "foo"; | 386 o.etag = "foo"; |
| 319 o.version = 42; | 387 o.version = 42; |
| 320 } | 388 } |
| 321 buildCounterPolicy--; | 389 buildCounterPolicy--; |
| 322 return o; | 390 return o; |
| 323 } | 391 } |
| 324 | 392 |
| 325 checkPolicy(api.Policy o) { | 393 checkPolicy(api.Policy o) { |
| 326 buildCounterPolicy++; | 394 buildCounterPolicy++; |
| 327 if (buildCounterPolicy < 3) { | 395 if (buildCounterPolicy < 3) { |
| 328 checkUnnamed1931(o.bindings); | 396 checkUnnamed1702(o.bindings); |
| 329 unittest.expect(o.etag, unittest.equals('foo')); | 397 unittest.expect(o.etag, unittest.equals('foo')); |
| 330 unittest.expect(o.version, unittest.equals(42)); | 398 unittest.expect(o.version, unittest.equals(42)); |
| 331 } | 399 } |
| 332 buildCounterPolicy--; | 400 buildCounterPolicy--; |
| 333 } | 401 } |
| 334 | 402 |
| 335 buildUnnamed1932() { | 403 buildUnnamed1703() { |
| 336 var o = new core.Map<core.String, core.String>(); | 404 var o = new core.Map<core.String, core.String>(); |
| 337 o["x"] = "foo"; | 405 o["x"] = "foo"; |
| 338 o["y"] = "foo"; | 406 o["y"] = "foo"; |
| 339 return o; | 407 return o; |
| 340 } | 408 } |
| 341 | 409 |
| 342 checkUnnamed1932(core.Map<core.String, core.String> o) { | 410 checkUnnamed1703(core.Map<core.String, core.String> o) { |
| 343 unittest.expect(o, unittest.hasLength(2)); | 411 unittest.expect(o, unittest.hasLength(2)); |
| 344 unittest.expect(o["x"], unittest.equals('foo')); | 412 unittest.expect(o["x"], unittest.equals('foo')); |
| 345 unittest.expect(o["y"], unittest.equals('foo')); | 413 unittest.expect(o["y"], unittest.equals('foo')); |
| 346 } | 414 } |
| 347 | 415 |
| 348 core.int buildCounterProject = 0; | 416 core.int buildCounterProject = 0; |
| 349 buildProject() { | 417 buildProject() { |
| 350 var o = new api.Project(); | 418 var o = new api.Project(); |
| 351 buildCounterProject++; | 419 buildCounterProject++; |
| 352 if (buildCounterProject < 3) { | 420 if (buildCounterProject < 3) { |
| 353 o.createTime = "foo"; | 421 o.createTime = "foo"; |
| 354 o.labels = buildUnnamed1932(); | 422 o.labels = buildUnnamed1703(); |
| 355 o.lifecycleState = "foo"; | 423 o.lifecycleState = "foo"; |
| 356 o.name = "foo"; | 424 o.name = "foo"; |
| 357 o.parent = buildResourceId(); | 425 o.parent = buildResourceId(); |
| 358 o.projectId = "foo"; | 426 o.projectId = "foo"; |
| 359 o.projectNumber = "foo"; | 427 o.projectNumber = "foo"; |
| 360 } | 428 } |
| 361 buildCounterProject--; | 429 buildCounterProject--; |
| 362 return o; | 430 return o; |
| 363 } | 431 } |
| 364 | 432 |
| 365 checkProject(api.Project o) { | 433 checkProject(api.Project o) { |
| 366 buildCounterProject++; | 434 buildCounterProject++; |
| 367 if (buildCounterProject < 3) { | 435 if (buildCounterProject < 3) { |
| 368 unittest.expect(o.createTime, unittest.equals('foo')); | 436 unittest.expect(o.createTime, unittest.equals('foo')); |
| 369 checkUnnamed1932(o.labels); | 437 checkUnnamed1703(o.labels); |
| 370 unittest.expect(o.lifecycleState, unittest.equals('foo')); | 438 unittest.expect(o.lifecycleState, unittest.equals('foo')); |
| 371 unittest.expect(o.name, unittest.equals('foo')); | 439 unittest.expect(o.name, unittest.equals('foo')); |
| 372 checkResourceId(o.parent); | 440 checkResourceId(o.parent); |
| 373 unittest.expect(o.projectId, unittest.equals('foo')); | 441 unittest.expect(o.projectId, unittest.equals('foo')); |
| 374 unittest.expect(o.projectNumber, unittest.equals('foo')); | 442 unittest.expect(o.projectNumber, unittest.equals('foo')); |
| 375 } | 443 } |
| 376 buildCounterProject--; | 444 buildCounterProject--; |
| 377 } | 445 } |
| 378 | 446 |
| 379 core.int buildCounterProjectCreationStatus = 0; | 447 core.int buildCounterProjectCreationStatus = 0; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) { | 504 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) { |
| 437 buildCounterSearchOrganizationsRequest++; | 505 buildCounterSearchOrganizationsRequest++; |
| 438 if (buildCounterSearchOrganizationsRequest < 3) { | 506 if (buildCounterSearchOrganizationsRequest < 3) { |
| 439 unittest.expect(o.filter, unittest.equals('foo')); | 507 unittest.expect(o.filter, unittest.equals('foo')); |
| 440 unittest.expect(o.pageSize, unittest.equals(42)); | 508 unittest.expect(o.pageSize, unittest.equals(42)); |
| 441 unittest.expect(o.pageToken, unittest.equals('foo')); | 509 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 442 } | 510 } |
| 443 buildCounterSearchOrganizationsRequest--; | 511 buildCounterSearchOrganizationsRequest--; |
| 444 } | 512 } |
| 445 | 513 |
| 446 buildUnnamed1933() { | 514 buildUnnamed1704() { |
| 447 var o = new core.List<api.Organization>(); | 515 var o = new core.List<api.Organization>(); |
| 448 o.add(buildOrganization()); | 516 o.add(buildOrganization()); |
| 449 o.add(buildOrganization()); | 517 o.add(buildOrganization()); |
| 450 return o; | 518 return o; |
| 451 } | 519 } |
| 452 | 520 |
| 453 checkUnnamed1933(core.List<api.Organization> o) { | 521 checkUnnamed1704(core.List<api.Organization> o) { |
| 454 unittest.expect(o, unittest.hasLength(2)); | 522 unittest.expect(o, unittest.hasLength(2)); |
| 455 checkOrganization(o[0]); | 523 checkOrganization(o[0]); |
| 456 checkOrganization(o[1]); | 524 checkOrganization(o[1]); |
| 457 } | 525 } |
| 458 | 526 |
| 459 core.int buildCounterSearchOrganizationsResponse = 0; | 527 core.int buildCounterSearchOrganizationsResponse = 0; |
| 460 buildSearchOrganizationsResponse() { | 528 buildSearchOrganizationsResponse() { |
| 461 var o = new api.SearchOrganizationsResponse(); | 529 var o = new api.SearchOrganizationsResponse(); |
| 462 buildCounterSearchOrganizationsResponse++; | 530 buildCounterSearchOrganizationsResponse++; |
| 463 if (buildCounterSearchOrganizationsResponse < 3) { | 531 if (buildCounterSearchOrganizationsResponse < 3) { |
| 464 o.nextPageToken = "foo"; | 532 o.nextPageToken = "foo"; |
| 465 o.organizations = buildUnnamed1933(); | 533 o.organizations = buildUnnamed1704(); |
| 466 } | 534 } |
| 467 buildCounterSearchOrganizationsResponse--; | 535 buildCounterSearchOrganizationsResponse--; |
| 468 return o; | 536 return o; |
| 469 } | 537 } |
| 470 | 538 |
| 471 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) { | 539 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) { |
| 472 buildCounterSearchOrganizationsResponse++; | 540 buildCounterSearchOrganizationsResponse++; |
| 473 if (buildCounterSearchOrganizationsResponse < 3) { | 541 if (buildCounterSearchOrganizationsResponse < 3) { |
| 474 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 542 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 475 checkUnnamed1933(o.organizations); | 543 checkUnnamed1704(o.organizations); |
| 476 } | 544 } |
| 477 buildCounterSearchOrganizationsResponse--; | 545 buildCounterSearchOrganizationsResponse--; |
| 478 } | 546 } |
| 479 | 547 |
| 480 core.int buildCounterSetIamPolicyRequest = 0; | 548 core.int buildCounterSetIamPolicyRequest = 0; |
| 481 buildSetIamPolicyRequest() { | 549 buildSetIamPolicyRequest() { |
| 482 var o = new api.SetIamPolicyRequest(); | 550 var o = new api.SetIamPolicyRequest(); |
| 483 buildCounterSetIamPolicyRequest++; | 551 buildCounterSetIamPolicyRequest++; |
| 484 if (buildCounterSetIamPolicyRequest < 3) { | 552 if (buildCounterSetIamPolicyRequest < 3) { |
| 485 o.policy = buildPolicy(); | 553 o.policy = buildPolicy(); |
| 486 } | 554 } |
| 487 buildCounterSetIamPolicyRequest--; | 555 buildCounterSetIamPolicyRequest--; |
| 488 return o; | 556 return o; |
| 489 } | 557 } |
| 490 | 558 |
| 491 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { | 559 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| 492 buildCounterSetIamPolicyRequest++; | 560 buildCounterSetIamPolicyRequest++; |
| 493 if (buildCounterSetIamPolicyRequest < 3) { | 561 if (buildCounterSetIamPolicyRequest < 3) { |
| 494 checkPolicy(o.policy); | 562 checkPolicy(o.policy); |
| 495 } | 563 } |
| 496 buildCounterSetIamPolicyRequest--; | 564 buildCounterSetIamPolicyRequest--; |
| 497 } | 565 } |
| 498 | 566 |
| 499 buildUnnamed1934() { | 567 buildUnnamed1705() { |
| 500 var o = new core.Map<core.String, core.Object>(); | 568 var o = new core.Map<core.String, core.Object>(); |
| 501 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 569 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 502 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 570 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 503 return o; | 571 return o; |
| 504 } | 572 } |
| 505 | 573 |
| 506 checkUnnamed1934(core.Map<core.String, core.Object> o) { | 574 checkUnnamed1705(core.Map<core.String, core.Object> o) { |
| 507 unittest.expect(o, unittest.hasLength(2)); | 575 unittest.expect(o, unittest.hasLength(2)); |
| 508 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')); | 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')); |
| 509 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')); | 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')); |
| 510 } | 578 } |
| 511 | 579 |
| 512 buildUnnamed1935() { | 580 buildUnnamed1706() { |
| 513 var o = new core.List<core.Map<core.String, core.Object>>(); | 581 var o = new core.List<core.Map<core.String, core.Object>>(); |
| 514 o.add(buildUnnamed1934()); | 582 o.add(buildUnnamed1705()); |
| 515 o.add(buildUnnamed1934()); | 583 o.add(buildUnnamed1705()); |
| 516 return o; | 584 return o; |
| 517 } | 585 } |
| 518 | 586 |
| 519 checkUnnamed1935(core.List<core.Map<core.String, core.Object>> o) { | 587 checkUnnamed1706(core.List<core.Map<core.String, core.Object>> o) { |
| 520 unittest.expect(o, unittest.hasLength(2)); | 588 unittest.expect(o, unittest.hasLength(2)); |
| 521 checkUnnamed1934(o[0]); | 589 checkUnnamed1705(o[0]); |
| 522 checkUnnamed1934(o[1]); | 590 checkUnnamed1705(o[1]); |
| 523 } | 591 } |
| 524 | 592 |
| 525 core.int buildCounterStatus = 0; | 593 core.int buildCounterStatus = 0; |
| 526 buildStatus() { | 594 buildStatus() { |
| 527 var o = new api.Status(); | 595 var o = new api.Status(); |
| 528 buildCounterStatus++; | 596 buildCounterStatus++; |
| 529 if (buildCounterStatus < 3) { | 597 if (buildCounterStatus < 3) { |
| 530 o.code = 42; | 598 o.code = 42; |
| 531 o.details = buildUnnamed1935(); | 599 o.details = buildUnnamed1706(); |
| 532 o.message = "foo"; | 600 o.message = "foo"; |
| 533 } | 601 } |
| 534 buildCounterStatus--; | 602 buildCounterStatus--; |
| 535 return o; | 603 return o; |
| 536 } | 604 } |
| 537 | 605 |
| 538 checkStatus(api.Status o) { | 606 checkStatus(api.Status o) { |
| 539 buildCounterStatus++; | 607 buildCounterStatus++; |
| 540 if (buildCounterStatus < 3) { | 608 if (buildCounterStatus < 3) { |
| 541 unittest.expect(o.code, unittest.equals(42)); | 609 unittest.expect(o.code, unittest.equals(42)); |
| 542 checkUnnamed1935(o.details); | 610 checkUnnamed1706(o.details); |
| 543 unittest.expect(o.message, unittest.equals('foo')); | 611 unittest.expect(o.message, unittest.equals('foo')); |
| 544 } | 612 } |
| 545 buildCounterStatus--; | 613 buildCounterStatus--; |
| 546 } | 614 } |
| 547 | 615 |
| 548 buildUnnamed1936() { | 616 buildUnnamed1707() { |
| 549 var o = new core.List<core.String>(); | 617 var o = new core.List<core.String>(); |
| 550 o.add("foo"); | 618 o.add("foo"); |
| 551 o.add("foo"); | 619 o.add("foo"); |
| 552 return o; | 620 return o; |
| 553 } | 621 } |
| 554 | 622 |
| 555 checkUnnamed1936(core.List<core.String> o) { | 623 checkUnnamed1707(core.List<core.String> o) { |
| 556 unittest.expect(o, unittest.hasLength(2)); | 624 unittest.expect(o, unittest.hasLength(2)); |
| 557 unittest.expect(o[0], unittest.equals('foo')); | 625 unittest.expect(o[0], unittest.equals('foo')); |
| 558 unittest.expect(o[1], unittest.equals('foo')); | 626 unittest.expect(o[1], unittest.equals('foo')); |
| 559 } | 627 } |
| 560 | 628 |
| 561 core.int buildCounterTestIamPermissionsRequest = 0; | 629 core.int buildCounterTestIamPermissionsRequest = 0; |
| 562 buildTestIamPermissionsRequest() { | 630 buildTestIamPermissionsRequest() { |
| 563 var o = new api.TestIamPermissionsRequest(); | 631 var o = new api.TestIamPermissionsRequest(); |
| 564 buildCounterTestIamPermissionsRequest++; | 632 buildCounterTestIamPermissionsRequest++; |
| 565 if (buildCounterTestIamPermissionsRequest < 3) { | 633 if (buildCounterTestIamPermissionsRequest < 3) { |
| 566 o.permissions = buildUnnamed1936(); | 634 o.permissions = buildUnnamed1707(); |
| 567 } | 635 } |
| 568 buildCounterTestIamPermissionsRequest--; | 636 buildCounterTestIamPermissionsRequest--; |
| 569 return o; | 637 return o; |
| 570 } | 638 } |
| 571 | 639 |
| 572 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 640 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 573 buildCounterTestIamPermissionsRequest++; | 641 buildCounterTestIamPermissionsRequest++; |
| 574 if (buildCounterTestIamPermissionsRequest < 3) { | 642 if (buildCounterTestIamPermissionsRequest < 3) { |
| 575 checkUnnamed1936(o.permissions); | 643 checkUnnamed1707(o.permissions); |
| 576 } | 644 } |
| 577 buildCounterTestIamPermissionsRequest--; | 645 buildCounterTestIamPermissionsRequest--; |
| 578 } | 646 } |
| 579 | 647 |
| 580 buildUnnamed1937() { | 648 buildUnnamed1708() { |
| 581 var o = new core.List<core.String>(); | 649 var o = new core.List<core.String>(); |
| 582 o.add("foo"); | 650 o.add("foo"); |
| 583 o.add("foo"); | 651 o.add("foo"); |
| 584 return o; | 652 return o; |
| 585 } | 653 } |
| 586 | 654 |
| 587 checkUnnamed1937(core.List<core.String> o) { | 655 checkUnnamed1708(core.List<core.String> o) { |
| 588 unittest.expect(o, unittest.hasLength(2)); | 656 unittest.expect(o, unittest.hasLength(2)); |
| 589 unittest.expect(o[0], unittest.equals('foo')); | 657 unittest.expect(o[0], unittest.equals('foo')); |
| 590 unittest.expect(o[1], unittest.equals('foo')); | 658 unittest.expect(o[1], unittest.equals('foo')); |
| 591 } | 659 } |
| 592 | 660 |
| 593 core.int buildCounterTestIamPermissionsResponse = 0; | 661 core.int buildCounterTestIamPermissionsResponse = 0; |
| 594 buildTestIamPermissionsResponse() { | 662 buildTestIamPermissionsResponse() { |
| 595 var o = new api.TestIamPermissionsResponse(); | 663 var o = new api.TestIamPermissionsResponse(); |
| 596 buildCounterTestIamPermissionsResponse++; | 664 buildCounterTestIamPermissionsResponse++; |
| 597 if (buildCounterTestIamPermissionsResponse < 3) { | 665 if (buildCounterTestIamPermissionsResponse < 3) { |
| 598 o.permissions = buildUnnamed1937(); | 666 o.permissions = buildUnnamed1708(); |
| 599 } | 667 } |
| 600 buildCounterTestIamPermissionsResponse--; | 668 buildCounterTestIamPermissionsResponse--; |
| 601 return o; | 669 return o; |
| 602 } | 670 } |
| 603 | 671 |
| 604 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 672 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 605 buildCounterTestIamPermissionsResponse++; | 673 buildCounterTestIamPermissionsResponse++; |
| 606 if (buildCounterTestIamPermissionsResponse < 3) { | 674 if (buildCounterTestIamPermissionsResponse < 3) { |
| 607 checkUnnamed1937(o.permissions); | 675 checkUnnamed1708(o.permissions); |
| 608 } | 676 } |
| 609 buildCounterTestIamPermissionsResponse--; | 677 buildCounterTestIamPermissionsResponse--; |
| 610 } | 678 } |
| 611 | 679 |
| 612 core.int buildCounterUndeleteProjectRequest = 0; | 680 core.int buildCounterUndeleteProjectRequest = 0; |
| 613 buildUndeleteProjectRequest() { | 681 buildUndeleteProjectRequest() { |
| 614 var o = new api.UndeleteProjectRequest(); | 682 var o = new api.UndeleteProjectRequest(); |
| 615 buildCounterUndeleteProjectRequest++; | 683 buildCounterUndeleteProjectRequest++; |
| 616 if (buildCounterUndeleteProjectRequest < 3) { | 684 if (buildCounterUndeleteProjectRequest < 3) { |
| 617 } | 685 } |
| 618 buildCounterUndeleteProjectRequest--; | 686 buildCounterUndeleteProjectRequest--; |
| 619 return o; | 687 return o; |
| 620 } | 688 } |
| 621 | 689 |
| 622 checkUndeleteProjectRequest(api.UndeleteProjectRequest o) { | 690 checkUndeleteProjectRequest(api.UndeleteProjectRequest o) { |
| 623 buildCounterUndeleteProjectRequest++; | 691 buildCounterUndeleteProjectRequest++; |
| 624 if (buildCounterUndeleteProjectRequest < 3) { | 692 if (buildCounterUndeleteProjectRequest < 3) { |
| 625 } | 693 } |
| 626 buildCounterUndeleteProjectRequest--; | 694 buildCounterUndeleteProjectRequest--; |
| 627 } | 695 } |
| 628 | 696 |
| 629 | 697 |
| 630 main() { | 698 main() { |
| 699 unittest.group("obj-schema-Ancestor", () { |
| 700 unittest.test("to-json--from-json", () { |
| 701 var o = buildAncestor(); |
| 702 var od = new api.Ancestor.fromJson(o.toJson()); |
| 703 checkAncestor(od); |
| 704 }); |
| 705 }); |
| 706 |
| 707 |
| 631 unittest.group("obj-schema-Binding", () { | 708 unittest.group("obj-schema-Binding", () { |
| 632 unittest.test("to-json--from-json", () { | 709 unittest.test("to-json--from-json", () { |
| 633 var o = buildBinding(); | 710 var o = buildBinding(); |
| 634 var od = new api.Binding.fromJson(o.toJson()); | 711 var od = new api.Binding.fromJson(o.toJson()); |
| 635 checkBinding(od); | 712 checkBinding(od); |
| 636 }); | 713 }); |
| 637 }); | 714 }); |
| 638 | 715 |
| 639 | 716 |
| 640 unittest.group("obj-schema-Empty", () { | 717 unittest.group("obj-schema-Empty", () { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 657 | 734 |
| 658 unittest.group("obj-schema-FolderOperationError", () { | 735 unittest.group("obj-schema-FolderOperationError", () { |
| 659 unittest.test("to-json--from-json", () { | 736 unittest.test("to-json--from-json", () { |
| 660 var o = buildFolderOperationError(); | 737 var o = buildFolderOperationError(); |
| 661 var od = new api.FolderOperationError.fromJson(o.toJson()); | 738 var od = new api.FolderOperationError.fromJson(o.toJson()); |
| 662 checkFolderOperationError(od); | 739 checkFolderOperationError(od); |
| 663 }); | 740 }); |
| 664 }); | 741 }); |
| 665 | 742 |
| 666 | 743 |
| 744 unittest.group("obj-schema-GetAncestryRequest", () { |
| 745 unittest.test("to-json--from-json", () { |
| 746 var o = buildGetAncestryRequest(); |
| 747 var od = new api.GetAncestryRequest.fromJson(o.toJson()); |
| 748 checkGetAncestryRequest(od); |
| 749 }); |
| 750 }); |
| 751 |
| 752 |
| 753 unittest.group("obj-schema-GetAncestryResponse", () { |
| 754 unittest.test("to-json--from-json", () { |
| 755 var o = buildGetAncestryResponse(); |
| 756 var od = new api.GetAncestryResponse.fromJson(o.toJson()); |
| 757 checkGetAncestryResponse(od); |
| 758 }); |
| 759 }); |
| 760 |
| 761 |
| 667 unittest.group("obj-schema-GetIamPolicyRequest", () { | 762 unittest.group("obj-schema-GetIamPolicyRequest", () { |
| 668 unittest.test("to-json--from-json", () { | 763 unittest.test("to-json--from-json", () { |
| 669 var o = buildGetIamPolicyRequest(); | 764 var o = buildGetIamPolicyRequest(); |
| 670 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); | 765 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); |
| 671 checkGetIamPolicyRequest(od); | 766 checkGetIamPolicyRequest(od); |
| 672 }); | 767 }); |
| 673 }); | 768 }); |
| 674 | 769 |
| 675 | 770 |
| 676 unittest.group("obj-schema-ListProjectsResponse", () { | 771 unittest.group("obj-schema-ListProjectsResponse", () { |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 "content-type" : "application/json; charset=utf-8", | 1330 "content-type" : "application/json; charset=utf-8", |
| 1236 }; | 1331 }; |
| 1237 var resp = convert.JSON.encode(buildProject()); | 1332 var resp = convert.JSON.encode(buildProject()); |
| 1238 return new async.Future.value(stringResponse(200, h, resp)); | 1333 return new async.Future.value(stringResponse(200, h, resp)); |
| 1239 }), true); | 1334 }), true); |
| 1240 res.get(arg_projectId).then(unittest.expectAsync(((api.Project response) { | 1335 res.get(arg_projectId).then(unittest.expectAsync(((api.Project response) { |
| 1241 checkProject(response); | 1336 checkProject(response); |
| 1242 }))); | 1337 }))); |
| 1243 }); | 1338 }); |
| 1244 | 1339 |
| 1340 unittest.test("method--getAncestry", () { |
| 1341 |
| 1342 var mock = new HttpServerMock(); |
| 1343 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1344 var arg_request = buildGetAncestryRequest(); |
| 1345 var arg_projectId = "foo"; |
| 1346 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1347 var obj = new api.GetAncestryRequest.fromJson(json); |
| 1348 checkGetAncestryRequest(obj); |
| 1349 |
| 1350 var path = (req.url).path; |
| 1351 var pathOffset = 0; |
| 1352 var index; |
| 1353 var subPart; |
| 1354 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1355 pathOffset += 1; |
| 1356 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
| 1357 pathOffset += 12; |
| 1358 index = path.indexOf(":getAncestry", pathOffset); |
| 1359 unittest.expect(index >= 0, unittest.isTrue); |
| 1360 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1361 pathOffset = index; |
| 1362 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1363 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals(":getAncestry")); |
| 1364 pathOffset += 12; |
| 1365 |
| 1366 var query = (req.url).query; |
| 1367 var queryOffset = 0; |
| 1368 var queryMap = {}; |
| 1369 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1370 parseBool(n) { |
| 1371 if (n == "true") return true; |
| 1372 if (n == "false") return false; |
| 1373 if (n == null) return null; |
| 1374 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1375 } |
| 1376 if (query.length > 0) { |
| 1377 for (var part in query.split("&")) { |
| 1378 var keyvalue = part.split("="); |
| 1379 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1380 } |
| 1381 } |
| 1382 |
| 1383 |
| 1384 var h = { |
| 1385 "content-type" : "application/json; charset=utf-8", |
| 1386 }; |
| 1387 var resp = convert.JSON.encode(buildGetAncestryResponse()); |
| 1388 return new async.Future.value(stringResponse(200, h, resp)); |
| 1389 }), true); |
| 1390 res.getAncestry(arg_request, arg_projectId).then(unittest.expectAsync(((ap
i.GetAncestryResponse response) { |
| 1391 checkGetAncestryResponse(response); |
| 1392 }))); |
| 1393 }); |
| 1394 |
| 1245 unittest.test("method--getIamPolicy", () { | 1395 unittest.test("method--getIamPolicy", () { |
| 1246 | 1396 |
| 1247 var mock = new HttpServerMock(); | 1397 var mock = new HttpServerMock(); |
| 1248 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1398 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1249 var arg_request = buildGetIamPolicyRequest(); | 1399 var arg_request = buildGetIamPolicyRequest(); |
| 1250 var arg_resource = "foo"; | 1400 var arg_resource = "foo"; |
| 1251 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1401 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1252 var obj = new api.GetIamPolicyRequest.fromJson(json); | 1402 var obj = new api.GetIamPolicyRequest.fromJson(json); |
| 1253 checkGetIamPolicyRequest(obj); | 1403 checkGetIamPolicyRequest(obj); |
| 1254 | 1404 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 }), true); | 1444 }), true); |
| 1295 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1445 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { |
| 1296 checkPolicy(response); | 1446 checkPolicy(response); |
| 1297 }))); | 1447 }))); |
| 1298 }); | 1448 }); |
| 1299 | 1449 |
| 1300 unittest.test("method--list", () { | 1450 unittest.test("method--list", () { |
| 1301 | 1451 |
| 1302 var mock = new HttpServerMock(); | 1452 var mock = new HttpServerMock(); |
| 1303 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1453 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1304 var arg_pageToken = "foo"; | |
| 1305 var arg_pageSize = 42; | 1454 var arg_pageSize = 42; |
| 1306 var arg_filter = "foo"; | 1455 var arg_filter = "foo"; |
| 1456 var arg_pageToken = "foo"; |
| 1307 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1457 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1308 var path = (req.url).path; | 1458 var path = (req.url).path; |
| 1309 var pathOffset = 0; | 1459 var pathOffset = 0; |
| 1310 var index; | 1460 var index; |
| 1311 var subPart; | 1461 var subPart; |
| 1312 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1462 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1313 pathOffset += 1; | 1463 pathOffset += 1; |
| 1314 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("v1/projects")); | 1464 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("v1/projects")); |
| 1315 pathOffset += 11; | 1465 pathOffset += 11; |
| 1316 | 1466 |
| 1317 var query = (req.url).query; | 1467 var query = (req.url).query; |
| 1318 var queryOffset = 0; | 1468 var queryOffset = 0; |
| 1319 var queryMap = {}; | 1469 var queryMap = {}; |
| 1320 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1470 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1321 parseBool(n) { | 1471 parseBool(n) { |
| 1322 if (n == "true") return true; | 1472 if (n == "true") return true; |
| 1323 if (n == "false") return false; | 1473 if (n == "false") return false; |
| 1324 if (n == null) return null; | 1474 if (n == null) return null; |
| 1325 throw new core.ArgumentError("Invalid boolean: $n"); | 1475 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1326 } | 1476 } |
| 1327 if (query.length > 0) { | 1477 if (query.length > 0) { |
| 1328 for (var part in query.split("&")) { | 1478 for (var part in query.split("&")) { |
| 1329 var keyvalue = part.split("="); | 1479 var keyvalue = part.split("="); |
| 1330 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1480 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1331 } | 1481 } |
| 1332 } | 1482 } |
| 1333 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1334 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1483 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1335 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1484 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1485 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1336 | 1486 |
| 1337 | 1487 |
| 1338 var h = { | 1488 var h = { |
| 1339 "content-type" : "application/json; charset=utf-8", | 1489 "content-type" : "application/json; charset=utf-8", |
| 1340 }; | 1490 }; |
| 1341 var resp = convert.JSON.encode(buildListProjectsResponse()); | 1491 var resp = convert.JSON.encode(buildListProjectsResponse()); |
| 1342 return new async.Future.value(stringResponse(200, h, resp)); | 1492 return new async.Future.value(stringResponse(200, h, resp)); |
| 1343 }), true); | 1493 }), true); |
| 1344 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize, filter: arg_fil
ter).then(unittest.expectAsync(((api.ListProjectsResponse response) { | 1494 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ListProjectsResponse response) { |
| 1345 checkListProjectsResponse(response); | 1495 checkListProjectsResponse(response); |
| 1346 }))); | 1496 }))); |
| 1347 }); | 1497 }); |
| 1348 | 1498 |
| 1349 unittest.test("method--setIamPolicy", () { | 1499 unittest.test("method--setIamPolicy", () { |
| 1350 | 1500 |
| 1351 var mock = new HttpServerMock(); | 1501 var mock = new HttpServerMock(); |
| 1352 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1502 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1353 var arg_request = buildSetIamPolicyRequest(); | 1503 var arg_request = buildSetIamPolicyRequest(); |
| 1354 var arg_resource = "foo"; | 1504 var arg_resource = "foo"; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { | 1710 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { |
| 1561 checkProject(response); | 1711 checkProject(response); |
| 1562 }))); | 1712 }))); |
| 1563 }); | 1713 }); |
| 1564 | 1714 |
| 1565 }); | 1715 }); |
| 1566 | 1716 |
| 1567 | 1717 |
| 1568 } | 1718 } |
| 1569 | 1719 |
| OLD | NEW |