| OLD | NEW |
| (Empty) |
| 1 library googleapis.plusDomains.v1.test; | |
| 2 | |
| 3 import "dart:core" as core; | |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | |
| 6 import "dart:convert" as convert; | |
| 7 | |
| 8 import 'package:http/http.dart' as http; | |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:unittest/unittest.dart' as unittest; | |
| 11 import 'package:googleapis/common/common.dart' as common; | |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
| 13 import '../common/common_internal_test.dart' as common_test; | |
| 14 | |
| 15 import 'package:googleapis/plusdomains/v1.dart' as api; | |
| 16 | |
| 17 | |
| 18 | |
| 19 buildUnnamed637() { | |
| 20 var o = new core.List<api.PlusDomainsAclentryResource>(); | |
| 21 o.add(buildPlusDomainsAclentryResource()); | |
| 22 o.add(buildPlusDomainsAclentryResource()); | |
| 23 return o; | |
| 24 } | |
| 25 | |
| 26 checkUnnamed637(core.List<api.PlusDomainsAclentryResource> o) { | |
| 27 unittest.expect(o, unittest.hasLength(2)); | |
| 28 checkPlusDomainsAclentryResource(o[0]); | |
| 29 checkPlusDomainsAclentryResource(o[1]); | |
| 30 } | |
| 31 | |
| 32 core.int buildCounterAcl = 0; | |
| 33 buildAcl() { | |
| 34 var o = new api.Acl(); | |
| 35 buildCounterAcl++; | |
| 36 if (buildCounterAcl < 3) { | |
| 37 o.description = "foo"; | |
| 38 o.domainRestricted = true; | |
| 39 o.items = buildUnnamed637(); | |
| 40 o.kind = "foo"; | |
| 41 } | |
| 42 buildCounterAcl--; | |
| 43 return o; | |
| 44 } | |
| 45 | |
| 46 checkAcl(api.Acl o) { | |
| 47 buildCounterAcl++; | |
| 48 if (buildCounterAcl < 3) { | |
| 49 unittest.expect(o.description, unittest.equals('foo')); | |
| 50 unittest.expect(o.domainRestricted, unittest.isTrue); | |
| 51 checkUnnamed637(o.items); | |
| 52 unittest.expect(o.kind, unittest.equals('foo')); | |
| 53 } | |
| 54 buildCounterAcl--; | |
| 55 } | |
| 56 | |
| 57 core.int buildCounterActivityActorImage = 0; | |
| 58 buildActivityActorImage() { | |
| 59 var o = new api.ActivityActorImage(); | |
| 60 buildCounterActivityActorImage++; | |
| 61 if (buildCounterActivityActorImage < 3) { | |
| 62 o.url = "foo"; | |
| 63 } | |
| 64 buildCounterActivityActorImage--; | |
| 65 return o; | |
| 66 } | |
| 67 | |
| 68 checkActivityActorImage(api.ActivityActorImage o) { | |
| 69 buildCounterActivityActorImage++; | |
| 70 if (buildCounterActivityActorImage < 3) { | |
| 71 unittest.expect(o.url, unittest.equals('foo')); | |
| 72 } | |
| 73 buildCounterActivityActorImage--; | |
| 74 } | |
| 75 | |
| 76 core.int buildCounterActivityActorName = 0; | |
| 77 buildActivityActorName() { | |
| 78 var o = new api.ActivityActorName(); | |
| 79 buildCounterActivityActorName++; | |
| 80 if (buildCounterActivityActorName < 3) { | |
| 81 o.familyName = "foo"; | |
| 82 o.givenName = "foo"; | |
| 83 } | |
| 84 buildCounterActivityActorName--; | |
| 85 return o; | |
| 86 } | |
| 87 | |
| 88 checkActivityActorName(api.ActivityActorName o) { | |
| 89 buildCounterActivityActorName++; | |
| 90 if (buildCounterActivityActorName < 3) { | |
| 91 unittest.expect(o.familyName, unittest.equals('foo')); | |
| 92 unittest.expect(o.givenName, unittest.equals('foo')); | |
| 93 } | |
| 94 buildCounterActivityActorName--; | |
| 95 } | |
| 96 | |
| 97 core.int buildCounterActivityActor = 0; | |
| 98 buildActivityActor() { | |
| 99 var o = new api.ActivityActor(); | |
| 100 buildCounterActivityActor++; | |
| 101 if (buildCounterActivityActor < 3) { | |
| 102 o.displayName = "foo"; | |
| 103 o.id = "foo"; | |
| 104 o.image = buildActivityActorImage(); | |
| 105 o.name = buildActivityActorName(); | |
| 106 o.url = "foo"; | |
| 107 } | |
| 108 buildCounterActivityActor--; | |
| 109 return o; | |
| 110 } | |
| 111 | |
| 112 checkActivityActor(api.ActivityActor o) { | |
| 113 buildCounterActivityActor++; | |
| 114 if (buildCounterActivityActor < 3) { | |
| 115 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 116 unittest.expect(o.id, unittest.equals('foo')); | |
| 117 checkActivityActorImage(o.image); | |
| 118 checkActivityActorName(o.name); | |
| 119 unittest.expect(o.url, unittest.equals('foo')); | |
| 120 } | |
| 121 buildCounterActivityActor--; | |
| 122 } | |
| 123 | |
| 124 core.int buildCounterActivityObjectActorImage = 0; | |
| 125 buildActivityObjectActorImage() { | |
| 126 var o = new api.ActivityObjectActorImage(); | |
| 127 buildCounterActivityObjectActorImage++; | |
| 128 if (buildCounterActivityObjectActorImage < 3) { | |
| 129 o.url = "foo"; | |
| 130 } | |
| 131 buildCounterActivityObjectActorImage--; | |
| 132 return o; | |
| 133 } | |
| 134 | |
| 135 checkActivityObjectActorImage(api.ActivityObjectActorImage o) { | |
| 136 buildCounterActivityObjectActorImage++; | |
| 137 if (buildCounterActivityObjectActorImage < 3) { | |
| 138 unittest.expect(o.url, unittest.equals('foo')); | |
| 139 } | |
| 140 buildCounterActivityObjectActorImage--; | |
| 141 } | |
| 142 | |
| 143 core.int buildCounterActivityObjectActor = 0; | |
| 144 buildActivityObjectActor() { | |
| 145 var o = new api.ActivityObjectActor(); | |
| 146 buildCounterActivityObjectActor++; | |
| 147 if (buildCounterActivityObjectActor < 3) { | |
| 148 o.displayName = "foo"; | |
| 149 o.id = "foo"; | |
| 150 o.image = buildActivityObjectActorImage(); | |
| 151 o.url = "foo"; | |
| 152 } | |
| 153 buildCounterActivityObjectActor--; | |
| 154 return o; | |
| 155 } | |
| 156 | |
| 157 checkActivityObjectActor(api.ActivityObjectActor o) { | |
| 158 buildCounterActivityObjectActor++; | |
| 159 if (buildCounterActivityObjectActor < 3) { | |
| 160 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 161 unittest.expect(o.id, unittest.equals('foo')); | |
| 162 checkActivityObjectActorImage(o.image); | |
| 163 unittest.expect(o.url, unittest.equals('foo')); | |
| 164 } | |
| 165 buildCounterActivityObjectActor--; | |
| 166 } | |
| 167 | |
| 168 core.int buildCounterActivityObjectAttachmentsEmbed = 0; | |
| 169 buildActivityObjectAttachmentsEmbed() { | |
| 170 var o = new api.ActivityObjectAttachmentsEmbed(); | |
| 171 buildCounterActivityObjectAttachmentsEmbed++; | |
| 172 if (buildCounterActivityObjectAttachmentsEmbed < 3) { | |
| 173 o.type = "foo"; | |
| 174 o.url = "foo"; | |
| 175 } | |
| 176 buildCounterActivityObjectAttachmentsEmbed--; | |
| 177 return o; | |
| 178 } | |
| 179 | |
| 180 checkActivityObjectAttachmentsEmbed(api.ActivityObjectAttachmentsEmbed o) { | |
| 181 buildCounterActivityObjectAttachmentsEmbed++; | |
| 182 if (buildCounterActivityObjectAttachmentsEmbed < 3) { | |
| 183 unittest.expect(o.type, unittest.equals('foo')); | |
| 184 unittest.expect(o.url, unittest.equals('foo')); | |
| 185 } | |
| 186 buildCounterActivityObjectAttachmentsEmbed--; | |
| 187 } | |
| 188 | |
| 189 core.int buildCounterActivityObjectAttachmentsFullImage = 0; | |
| 190 buildActivityObjectAttachmentsFullImage() { | |
| 191 var o = new api.ActivityObjectAttachmentsFullImage(); | |
| 192 buildCounterActivityObjectAttachmentsFullImage++; | |
| 193 if (buildCounterActivityObjectAttachmentsFullImage < 3) { | |
| 194 o.height = 42; | |
| 195 o.type = "foo"; | |
| 196 o.url = "foo"; | |
| 197 o.width = 42; | |
| 198 } | |
| 199 buildCounterActivityObjectAttachmentsFullImage--; | |
| 200 return o; | |
| 201 } | |
| 202 | |
| 203 checkActivityObjectAttachmentsFullImage(api.ActivityObjectAttachmentsFullImage o
) { | |
| 204 buildCounterActivityObjectAttachmentsFullImage++; | |
| 205 if (buildCounterActivityObjectAttachmentsFullImage < 3) { | |
| 206 unittest.expect(o.height, unittest.equals(42)); | |
| 207 unittest.expect(o.type, unittest.equals('foo')); | |
| 208 unittest.expect(o.url, unittest.equals('foo')); | |
| 209 unittest.expect(o.width, unittest.equals(42)); | |
| 210 } | |
| 211 buildCounterActivityObjectAttachmentsFullImage--; | |
| 212 } | |
| 213 | |
| 214 core.int buildCounterActivityObjectAttachmentsImage = 0; | |
| 215 buildActivityObjectAttachmentsImage() { | |
| 216 var o = new api.ActivityObjectAttachmentsImage(); | |
| 217 buildCounterActivityObjectAttachmentsImage++; | |
| 218 if (buildCounterActivityObjectAttachmentsImage < 3) { | |
| 219 o.height = 42; | |
| 220 o.type = "foo"; | |
| 221 o.url = "foo"; | |
| 222 o.width = 42; | |
| 223 } | |
| 224 buildCounterActivityObjectAttachmentsImage--; | |
| 225 return o; | |
| 226 } | |
| 227 | |
| 228 checkActivityObjectAttachmentsImage(api.ActivityObjectAttachmentsImage o) { | |
| 229 buildCounterActivityObjectAttachmentsImage++; | |
| 230 if (buildCounterActivityObjectAttachmentsImage < 3) { | |
| 231 unittest.expect(o.height, unittest.equals(42)); | |
| 232 unittest.expect(o.type, unittest.equals('foo')); | |
| 233 unittest.expect(o.url, unittest.equals('foo')); | |
| 234 unittest.expect(o.width, unittest.equals(42)); | |
| 235 } | |
| 236 buildCounterActivityObjectAttachmentsImage--; | |
| 237 } | |
| 238 | |
| 239 core.int buildCounterActivityObjectAttachmentsPreviewThumbnails = 0; | |
| 240 buildActivityObjectAttachmentsPreviewThumbnails() { | |
| 241 var o = new api.ActivityObjectAttachmentsPreviewThumbnails(); | |
| 242 buildCounterActivityObjectAttachmentsPreviewThumbnails++; | |
| 243 if (buildCounterActivityObjectAttachmentsPreviewThumbnails < 3) { | |
| 244 o.url = "foo"; | |
| 245 } | |
| 246 buildCounterActivityObjectAttachmentsPreviewThumbnails--; | |
| 247 return o; | |
| 248 } | |
| 249 | |
| 250 checkActivityObjectAttachmentsPreviewThumbnails(api.ActivityObjectAttachmentsPre
viewThumbnails o) { | |
| 251 buildCounterActivityObjectAttachmentsPreviewThumbnails++; | |
| 252 if (buildCounterActivityObjectAttachmentsPreviewThumbnails < 3) { | |
| 253 unittest.expect(o.url, unittest.equals('foo')); | |
| 254 } | |
| 255 buildCounterActivityObjectAttachmentsPreviewThumbnails--; | |
| 256 } | |
| 257 | |
| 258 buildUnnamed638() { | |
| 259 var o = new core.List<api.ActivityObjectAttachmentsPreviewThumbnails>(); | |
| 260 o.add(buildActivityObjectAttachmentsPreviewThumbnails()); | |
| 261 o.add(buildActivityObjectAttachmentsPreviewThumbnails()); | |
| 262 return o; | |
| 263 } | |
| 264 | |
| 265 checkUnnamed638(core.List<api.ActivityObjectAttachmentsPreviewThumbnails> o) { | |
| 266 unittest.expect(o, unittest.hasLength(2)); | |
| 267 checkActivityObjectAttachmentsPreviewThumbnails(o[0]); | |
| 268 checkActivityObjectAttachmentsPreviewThumbnails(o[1]); | |
| 269 } | |
| 270 | |
| 271 core.int buildCounterActivityObjectAttachmentsThumbnailsImage = 0; | |
| 272 buildActivityObjectAttachmentsThumbnailsImage() { | |
| 273 var o = new api.ActivityObjectAttachmentsThumbnailsImage(); | |
| 274 buildCounterActivityObjectAttachmentsThumbnailsImage++; | |
| 275 if (buildCounterActivityObjectAttachmentsThumbnailsImage < 3) { | |
| 276 o.height = 42; | |
| 277 o.type = "foo"; | |
| 278 o.url = "foo"; | |
| 279 o.width = 42; | |
| 280 } | |
| 281 buildCounterActivityObjectAttachmentsThumbnailsImage--; | |
| 282 return o; | |
| 283 } | |
| 284 | |
| 285 checkActivityObjectAttachmentsThumbnailsImage(api.ActivityObjectAttachmentsThumb
nailsImage o) { | |
| 286 buildCounterActivityObjectAttachmentsThumbnailsImage++; | |
| 287 if (buildCounterActivityObjectAttachmentsThumbnailsImage < 3) { | |
| 288 unittest.expect(o.height, unittest.equals(42)); | |
| 289 unittest.expect(o.type, unittest.equals('foo')); | |
| 290 unittest.expect(o.url, unittest.equals('foo')); | |
| 291 unittest.expect(o.width, unittest.equals(42)); | |
| 292 } | |
| 293 buildCounterActivityObjectAttachmentsThumbnailsImage--; | |
| 294 } | |
| 295 | |
| 296 core.int buildCounterActivityObjectAttachmentsThumbnails = 0; | |
| 297 buildActivityObjectAttachmentsThumbnails() { | |
| 298 var o = new api.ActivityObjectAttachmentsThumbnails(); | |
| 299 buildCounterActivityObjectAttachmentsThumbnails++; | |
| 300 if (buildCounterActivityObjectAttachmentsThumbnails < 3) { | |
| 301 o.description = "foo"; | |
| 302 o.image = buildActivityObjectAttachmentsThumbnailsImage(); | |
| 303 o.url = "foo"; | |
| 304 } | |
| 305 buildCounterActivityObjectAttachmentsThumbnails--; | |
| 306 return o; | |
| 307 } | |
| 308 | |
| 309 checkActivityObjectAttachmentsThumbnails(api.ActivityObjectAttachmentsThumbnails
o) { | |
| 310 buildCounterActivityObjectAttachmentsThumbnails++; | |
| 311 if (buildCounterActivityObjectAttachmentsThumbnails < 3) { | |
| 312 unittest.expect(o.description, unittest.equals('foo')); | |
| 313 checkActivityObjectAttachmentsThumbnailsImage(o.image); | |
| 314 unittest.expect(o.url, unittest.equals('foo')); | |
| 315 } | |
| 316 buildCounterActivityObjectAttachmentsThumbnails--; | |
| 317 } | |
| 318 | |
| 319 buildUnnamed639() { | |
| 320 var o = new core.List<api.ActivityObjectAttachmentsThumbnails>(); | |
| 321 o.add(buildActivityObjectAttachmentsThumbnails()); | |
| 322 o.add(buildActivityObjectAttachmentsThumbnails()); | |
| 323 return o; | |
| 324 } | |
| 325 | |
| 326 checkUnnamed639(core.List<api.ActivityObjectAttachmentsThumbnails> o) { | |
| 327 unittest.expect(o, unittest.hasLength(2)); | |
| 328 checkActivityObjectAttachmentsThumbnails(o[0]); | |
| 329 checkActivityObjectAttachmentsThumbnails(o[1]); | |
| 330 } | |
| 331 | |
| 332 core.int buildCounterActivityObjectAttachments = 0; | |
| 333 buildActivityObjectAttachments() { | |
| 334 var o = new api.ActivityObjectAttachments(); | |
| 335 buildCounterActivityObjectAttachments++; | |
| 336 if (buildCounterActivityObjectAttachments < 3) { | |
| 337 o.content = "foo"; | |
| 338 o.displayName = "foo"; | |
| 339 o.embed = buildActivityObjectAttachmentsEmbed(); | |
| 340 o.fullImage = buildActivityObjectAttachmentsFullImage(); | |
| 341 o.id = "foo"; | |
| 342 o.image = buildActivityObjectAttachmentsImage(); | |
| 343 o.objectType = "foo"; | |
| 344 o.previewThumbnails = buildUnnamed638(); | |
| 345 o.thumbnails = buildUnnamed639(); | |
| 346 o.url = "foo"; | |
| 347 } | |
| 348 buildCounterActivityObjectAttachments--; | |
| 349 return o; | |
| 350 } | |
| 351 | |
| 352 checkActivityObjectAttachments(api.ActivityObjectAttachments o) { | |
| 353 buildCounterActivityObjectAttachments++; | |
| 354 if (buildCounterActivityObjectAttachments < 3) { | |
| 355 unittest.expect(o.content, unittest.equals('foo')); | |
| 356 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 357 checkActivityObjectAttachmentsEmbed(o.embed); | |
| 358 checkActivityObjectAttachmentsFullImage(o.fullImage); | |
| 359 unittest.expect(o.id, unittest.equals('foo')); | |
| 360 checkActivityObjectAttachmentsImage(o.image); | |
| 361 unittest.expect(o.objectType, unittest.equals('foo')); | |
| 362 checkUnnamed638(o.previewThumbnails); | |
| 363 checkUnnamed639(o.thumbnails); | |
| 364 unittest.expect(o.url, unittest.equals('foo')); | |
| 365 } | |
| 366 buildCounterActivityObjectAttachments--; | |
| 367 } | |
| 368 | |
| 369 buildUnnamed640() { | |
| 370 var o = new core.List<api.ActivityObjectAttachments>(); | |
| 371 o.add(buildActivityObjectAttachments()); | |
| 372 o.add(buildActivityObjectAttachments()); | |
| 373 return o; | |
| 374 } | |
| 375 | |
| 376 checkUnnamed640(core.List<api.ActivityObjectAttachments> o) { | |
| 377 unittest.expect(o, unittest.hasLength(2)); | |
| 378 checkActivityObjectAttachments(o[0]); | |
| 379 checkActivityObjectAttachments(o[1]); | |
| 380 } | |
| 381 | |
| 382 core.int buildCounterActivityObjectPlusoners = 0; | |
| 383 buildActivityObjectPlusoners() { | |
| 384 var o = new api.ActivityObjectPlusoners(); | |
| 385 buildCounterActivityObjectPlusoners++; | |
| 386 if (buildCounterActivityObjectPlusoners < 3) { | |
| 387 o.selfLink = "foo"; | |
| 388 o.totalItems = 42; | |
| 389 } | |
| 390 buildCounterActivityObjectPlusoners--; | |
| 391 return o; | |
| 392 } | |
| 393 | |
| 394 checkActivityObjectPlusoners(api.ActivityObjectPlusoners o) { | |
| 395 buildCounterActivityObjectPlusoners++; | |
| 396 if (buildCounterActivityObjectPlusoners < 3) { | |
| 397 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 398 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 399 } | |
| 400 buildCounterActivityObjectPlusoners--; | |
| 401 } | |
| 402 | |
| 403 core.int buildCounterActivityObjectReplies = 0; | |
| 404 buildActivityObjectReplies() { | |
| 405 var o = new api.ActivityObjectReplies(); | |
| 406 buildCounterActivityObjectReplies++; | |
| 407 if (buildCounterActivityObjectReplies < 3) { | |
| 408 o.selfLink = "foo"; | |
| 409 o.totalItems = 42; | |
| 410 } | |
| 411 buildCounterActivityObjectReplies--; | |
| 412 return o; | |
| 413 } | |
| 414 | |
| 415 checkActivityObjectReplies(api.ActivityObjectReplies o) { | |
| 416 buildCounterActivityObjectReplies++; | |
| 417 if (buildCounterActivityObjectReplies < 3) { | |
| 418 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 419 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 420 } | |
| 421 buildCounterActivityObjectReplies--; | |
| 422 } | |
| 423 | |
| 424 core.int buildCounterActivityObjectResharers = 0; | |
| 425 buildActivityObjectResharers() { | |
| 426 var o = new api.ActivityObjectResharers(); | |
| 427 buildCounterActivityObjectResharers++; | |
| 428 if (buildCounterActivityObjectResharers < 3) { | |
| 429 o.selfLink = "foo"; | |
| 430 o.totalItems = 42; | |
| 431 } | |
| 432 buildCounterActivityObjectResharers--; | |
| 433 return o; | |
| 434 } | |
| 435 | |
| 436 checkActivityObjectResharers(api.ActivityObjectResharers o) { | |
| 437 buildCounterActivityObjectResharers++; | |
| 438 if (buildCounterActivityObjectResharers < 3) { | |
| 439 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 440 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 441 } | |
| 442 buildCounterActivityObjectResharers--; | |
| 443 } | |
| 444 | |
| 445 core.int buildCounterActivityObjectStatusForViewer = 0; | |
| 446 buildActivityObjectStatusForViewer() { | |
| 447 var o = new api.ActivityObjectStatusForViewer(); | |
| 448 buildCounterActivityObjectStatusForViewer++; | |
| 449 if (buildCounterActivityObjectStatusForViewer < 3) { | |
| 450 o.canComment = true; | |
| 451 o.canPlusone = true; | |
| 452 o.canUpdate = true; | |
| 453 o.isPlusOned = true; | |
| 454 o.resharingDisabled = true; | |
| 455 } | |
| 456 buildCounterActivityObjectStatusForViewer--; | |
| 457 return o; | |
| 458 } | |
| 459 | |
| 460 checkActivityObjectStatusForViewer(api.ActivityObjectStatusForViewer o) { | |
| 461 buildCounterActivityObjectStatusForViewer++; | |
| 462 if (buildCounterActivityObjectStatusForViewer < 3) { | |
| 463 unittest.expect(o.canComment, unittest.isTrue); | |
| 464 unittest.expect(o.canPlusone, unittest.isTrue); | |
| 465 unittest.expect(o.canUpdate, unittest.isTrue); | |
| 466 unittest.expect(o.isPlusOned, unittest.isTrue); | |
| 467 unittest.expect(o.resharingDisabled, unittest.isTrue); | |
| 468 } | |
| 469 buildCounterActivityObjectStatusForViewer--; | |
| 470 } | |
| 471 | |
| 472 core.int buildCounterActivityObject = 0; | |
| 473 buildActivityObject() { | |
| 474 var o = new api.ActivityObject(); | |
| 475 buildCounterActivityObject++; | |
| 476 if (buildCounterActivityObject < 3) { | |
| 477 o.actor = buildActivityObjectActor(); | |
| 478 o.attachments = buildUnnamed640(); | |
| 479 o.content = "foo"; | |
| 480 o.id = "foo"; | |
| 481 o.objectType = "foo"; | |
| 482 o.originalContent = "foo"; | |
| 483 o.plusoners = buildActivityObjectPlusoners(); | |
| 484 o.replies = buildActivityObjectReplies(); | |
| 485 o.resharers = buildActivityObjectResharers(); | |
| 486 o.statusForViewer = buildActivityObjectStatusForViewer(); | |
| 487 o.url = "foo"; | |
| 488 } | |
| 489 buildCounterActivityObject--; | |
| 490 return o; | |
| 491 } | |
| 492 | |
| 493 checkActivityObject(api.ActivityObject o) { | |
| 494 buildCounterActivityObject++; | |
| 495 if (buildCounterActivityObject < 3) { | |
| 496 checkActivityObjectActor(o.actor); | |
| 497 checkUnnamed640(o.attachments); | |
| 498 unittest.expect(o.content, unittest.equals('foo')); | |
| 499 unittest.expect(o.id, unittest.equals('foo')); | |
| 500 unittest.expect(o.objectType, unittest.equals('foo')); | |
| 501 unittest.expect(o.originalContent, unittest.equals('foo')); | |
| 502 checkActivityObjectPlusoners(o.plusoners); | |
| 503 checkActivityObjectReplies(o.replies); | |
| 504 checkActivityObjectResharers(o.resharers); | |
| 505 checkActivityObjectStatusForViewer(o.statusForViewer); | |
| 506 unittest.expect(o.url, unittest.equals('foo')); | |
| 507 } | |
| 508 buildCounterActivityObject--; | |
| 509 } | |
| 510 | |
| 511 core.int buildCounterActivityProvider = 0; | |
| 512 buildActivityProvider() { | |
| 513 var o = new api.ActivityProvider(); | |
| 514 buildCounterActivityProvider++; | |
| 515 if (buildCounterActivityProvider < 3) { | |
| 516 o.title = "foo"; | |
| 517 } | |
| 518 buildCounterActivityProvider--; | |
| 519 return o; | |
| 520 } | |
| 521 | |
| 522 checkActivityProvider(api.ActivityProvider o) { | |
| 523 buildCounterActivityProvider++; | |
| 524 if (buildCounterActivityProvider < 3) { | |
| 525 unittest.expect(o.title, unittest.equals('foo')); | |
| 526 } | |
| 527 buildCounterActivityProvider--; | |
| 528 } | |
| 529 | |
| 530 core.int buildCounterActivity = 0; | |
| 531 buildActivity() { | |
| 532 var o = new api.Activity(); | |
| 533 buildCounterActivity++; | |
| 534 if (buildCounterActivity < 3) { | |
| 535 o.access = buildAcl(); | |
| 536 o.actor = buildActivityActor(); | |
| 537 o.address = "foo"; | |
| 538 o.annotation = "foo"; | |
| 539 o.crosspostSource = "foo"; | |
| 540 o.etag = "foo"; | |
| 541 o.geocode = "foo"; | |
| 542 o.id = "foo"; | |
| 543 o.kind = "foo"; | |
| 544 o.location = buildPlace(); | |
| 545 o.object = buildActivityObject(); | |
| 546 o.placeId = "foo"; | |
| 547 o.placeName = "foo"; | |
| 548 o.provider = buildActivityProvider(); | |
| 549 o.published = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 550 o.radius = "foo"; | |
| 551 o.title = "foo"; | |
| 552 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 553 o.url = "foo"; | |
| 554 o.verb = "foo"; | |
| 555 } | |
| 556 buildCounterActivity--; | |
| 557 return o; | |
| 558 } | |
| 559 | |
| 560 checkActivity(api.Activity o) { | |
| 561 buildCounterActivity++; | |
| 562 if (buildCounterActivity < 3) { | |
| 563 checkAcl(o.access); | |
| 564 checkActivityActor(o.actor); | |
| 565 unittest.expect(o.address, unittest.equals('foo')); | |
| 566 unittest.expect(o.annotation, unittest.equals('foo')); | |
| 567 unittest.expect(o.crosspostSource, unittest.equals('foo')); | |
| 568 unittest.expect(o.etag, unittest.equals('foo')); | |
| 569 unittest.expect(o.geocode, unittest.equals('foo')); | |
| 570 unittest.expect(o.id, unittest.equals('foo')); | |
| 571 unittest.expect(o.kind, unittest.equals('foo')); | |
| 572 checkPlace(o.location); | |
| 573 checkActivityObject(o.object); | |
| 574 unittest.expect(o.placeId, unittest.equals('foo')); | |
| 575 unittest.expect(o.placeName, unittest.equals('foo')); | |
| 576 checkActivityProvider(o.provider); | |
| 577 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | |
| 578 unittest.expect(o.radius, unittest.equals('foo')); | |
| 579 unittest.expect(o.title, unittest.equals('foo')); | |
| 580 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
| 581 unittest.expect(o.url, unittest.equals('foo')); | |
| 582 unittest.expect(o.verb, unittest.equals('foo')); | |
| 583 } | |
| 584 buildCounterActivity--; | |
| 585 } | |
| 586 | |
| 587 buildUnnamed641() { | |
| 588 var o = new core.List<api.Activity>(); | |
| 589 o.add(buildActivity()); | |
| 590 o.add(buildActivity()); | |
| 591 return o; | |
| 592 } | |
| 593 | |
| 594 checkUnnamed641(core.List<api.Activity> o) { | |
| 595 unittest.expect(o, unittest.hasLength(2)); | |
| 596 checkActivity(o[0]); | |
| 597 checkActivity(o[1]); | |
| 598 } | |
| 599 | |
| 600 core.int buildCounterActivityFeed = 0; | |
| 601 buildActivityFeed() { | |
| 602 var o = new api.ActivityFeed(); | |
| 603 buildCounterActivityFeed++; | |
| 604 if (buildCounterActivityFeed < 3) { | |
| 605 o.etag = "foo"; | |
| 606 o.id = "foo"; | |
| 607 o.items = buildUnnamed641(); | |
| 608 o.kind = "foo"; | |
| 609 o.nextLink = "foo"; | |
| 610 o.nextPageToken = "foo"; | |
| 611 o.selfLink = "foo"; | |
| 612 o.title = "foo"; | |
| 613 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 614 } | |
| 615 buildCounterActivityFeed--; | |
| 616 return o; | |
| 617 } | |
| 618 | |
| 619 checkActivityFeed(api.ActivityFeed o) { | |
| 620 buildCounterActivityFeed++; | |
| 621 if (buildCounterActivityFeed < 3) { | |
| 622 unittest.expect(o.etag, unittest.equals('foo')); | |
| 623 unittest.expect(o.id, unittest.equals('foo')); | |
| 624 checkUnnamed641(o.items); | |
| 625 unittest.expect(o.kind, unittest.equals('foo')); | |
| 626 unittest.expect(o.nextLink, unittest.equals('foo')); | |
| 627 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
| 628 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 629 unittest.expect(o.title, unittest.equals('foo')); | |
| 630 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
| 631 } | |
| 632 buildCounterActivityFeed--; | |
| 633 } | |
| 634 | |
| 635 core.int buildCounterAudience = 0; | |
| 636 buildAudience() { | |
| 637 var o = new api.Audience(); | |
| 638 buildCounterAudience++; | |
| 639 if (buildCounterAudience < 3) { | |
| 640 o.etag = "foo"; | |
| 641 o.item = buildPlusDomainsAclentryResource(); | |
| 642 o.kind = "foo"; | |
| 643 o.memberCount = 42; | |
| 644 o.visibility = "foo"; | |
| 645 } | |
| 646 buildCounterAudience--; | |
| 647 return o; | |
| 648 } | |
| 649 | |
| 650 checkAudience(api.Audience o) { | |
| 651 buildCounterAudience++; | |
| 652 if (buildCounterAudience < 3) { | |
| 653 unittest.expect(o.etag, unittest.equals('foo')); | |
| 654 checkPlusDomainsAclentryResource(o.item); | |
| 655 unittest.expect(o.kind, unittest.equals('foo')); | |
| 656 unittest.expect(o.memberCount, unittest.equals(42)); | |
| 657 unittest.expect(o.visibility, unittest.equals('foo')); | |
| 658 } | |
| 659 buildCounterAudience--; | |
| 660 } | |
| 661 | |
| 662 buildUnnamed642() { | |
| 663 var o = new core.List<api.Audience>(); | |
| 664 o.add(buildAudience()); | |
| 665 o.add(buildAudience()); | |
| 666 return o; | |
| 667 } | |
| 668 | |
| 669 checkUnnamed642(core.List<api.Audience> o) { | |
| 670 unittest.expect(o, unittest.hasLength(2)); | |
| 671 checkAudience(o[0]); | |
| 672 checkAudience(o[1]); | |
| 673 } | |
| 674 | |
| 675 core.int buildCounterAudiencesFeed = 0; | |
| 676 buildAudiencesFeed() { | |
| 677 var o = new api.AudiencesFeed(); | |
| 678 buildCounterAudiencesFeed++; | |
| 679 if (buildCounterAudiencesFeed < 3) { | |
| 680 o.etag = "foo"; | |
| 681 o.items = buildUnnamed642(); | |
| 682 o.kind = "foo"; | |
| 683 o.nextPageToken = "foo"; | |
| 684 o.totalItems = 42; | |
| 685 } | |
| 686 buildCounterAudiencesFeed--; | |
| 687 return o; | |
| 688 } | |
| 689 | |
| 690 checkAudiencesFeed(api.AudiencesFeed o) { | |
| 691 buildCounterAudiencesFeed++; | |
| 692 if (buildCounterAudiencesFeed < 3) { | |
| 693 unittest.expect(o.etag, unittest.equals('foo')); | |
| 694 checkUnnamed642(o.items); | |
| 695 unittest.expect(o.kind, unittest.equals('foo')); | |
| 696 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
| 697 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 698 } | |
| 699 buildCounterAudiencesFeed--; | |
| 700 } | |
| 701 | |
| 702 core.int buildCounterCirclePeople = 0; | |
| 703 buildCirclePeople() { | |
| 704 var o = new api.CirclePeople(); | |
| 705 buildCounterCirclePeople++; | |
| 706 if (buildCounterCirclePeople < 3) { | |
| 707 o.totalItems = 42; | |
| 708 } | |
| 709 buildCounterCirclePeople--; | |
| 710 return o; | |
| 711 } | |
| 712 | |
| 713 checkCirclePeople(api.CirclePeople o) { | |
| 714 buildCounterCirclePeople++; | |
| 715 if (buildCounterCirclePeople < 3) { | |
| 716 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 717 } | |
| 718 buildCounterCirclePeople--; | |
| 719 } | |
| 720 | |
| 721 core.int buildCounterCircle = 0; | |
| 722 buildCircle() { | |
| 723 var o = new api.Circle(); | |
| 724 buildCounterCircle++; | |
| 725 if (buildCounterCircle < 3) { | |
| 726 o.description = "foo"; | |
| 727 o.displayName = "foo"; | |
| 728 o.etag = "foo"; | |
| 729 o.id = "foo"; | |
| 730 o.kind = "foo"; | |
| 731 o.people = buildCirclePeople(); | |
| 732 o.selfLink = "foo"; | |
| 733 } | |
| 734 buildCounterCircle--; | |
| 735 return o; | |
| 736 } | |
| 737 | |
| 738 checkCircle(api.Circle o) { | |
| 739 buildCounterCircle++; | |
| 740 if (buildCounterCircle < 3) { | |
| 741 unittest.expect(o.description, unittest.equals('foo')); | |
| 742 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 743 unittest.expect(o.etag, unittest.equals('foo')); | |
| 744 unittest.expect(o.id, unittest.equals('foo')); | |
| 745 unittest.expect(o.kind, unittest.equals('foo')); | |
| 746 checkCirclePeople(o.people); | |
| 747 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 748 } | |
| 749 buildCounterCircle--; | |
| 750 } | |
| 751 | |
| 752 buildUnnamed643() { | |
| 753 var o = new core.List<api.Circle>(); | |
| 754 o.add(buildCircle()); | |
| 755 o.add(buildCircle()); | |
| 756 return o; | |
| 757 } | |
| 758 | |
| 759 checkUnnamed643(core.List<api.Circle> o) { | |
| 760 unittest.expect(o, unittest.hasLength(2)); | |
| 761 checkCircle(o[0]); | |
| 762 checkCircle(o[1]); | |
| 763 } | |
| 764 | |
| 765 core.int buildCounterCircleFeed = 0; | |
| 766 buildCircleFeed() { | |
| 767 var o = new api.CircleFeed(); | |
| 768 buildCounterCircleFeed++; | |
| 769 if (buildCounterCircleFeed < 3) { | |
| 770 o.etag = "foo"; | |
| 771 o.items = buildUnnamed643(); | |
| 772 o.kind = "foo"; | |
| 773 o.nextLink = "foo"; | |
| 774 o.nextPageToken = "foo"; | |
| 775 o.selfLink = "foo"; | |
| 776 o.title = "foo"; | |
| 777 o.totalItems = 42; | |
| 778 } | |
| 779 buildCounterCircleFeed--; | |
| 780 return o; | |
| 781 } | |
| 782 | |
| 783 checkCircleFeed(api.CircleFeed o) { | |
| 784 buildCounterCircleFeed++; | |
| 785 if (buildCounterCircleFeed < 3) { | |
| 786 unittest.expect(o.etag, unittest.equals('foo')); | |
| 787 checkUnnamed643(o.items); | |
| 788 unittest.expect(o.kind, unittest.equals('foo')); | |
| 789 unittest.expect(o.nextLink, unittest.equals('foo')); | |
| 790 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
| 791 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 792 unittest.expect(o.title, unittest.equals('foo')); | |
| 793 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 794 } | |
| 795 buildCounterCircleFeed--; | |
| 796 } | |
| 797 | |
| 798 core.int buildCounterCommentActorImage = 0; | |
| 799 buildCommentActorImage() { | |
| 800 var o = new api.CommentActorImage(); | |
| 801 buildCounterCommentActorImage++; | |
| 802 if (buildCounterCommentActorImage < 3) { | |
| 803 o.url = "foo"; | |
| 804 } | |
| 805 buildCounterCommentActorImage--; | |
| 806 return o; | |
| 807 } | |
| 808 | |
| 809 checkCommentActorImage(api.CommentActorImage o) { | |
| 810 buildCounterCommentActorImage++; | |
| 811 if (buildCounterCommentActorImage < 3) { | |
| 812 unittest.expect(o.url, unittest.equals('foo')); | |
| 813 } | |
| 814 buildCounterCommentActorImage--; | |
| 815 } | |
| 816 | |
| 817 core.int buildCounterCommentActor = 0; | |
| 818 buildCommentActor() { | |
| 819 var o = new api.CommentActor(); | |
| 820 buildCounterCommentActor++; | |
| 821 if (buildCounterCommentActor < 3) { | |
| 822 o.displayName = "foo"; | |
| 823 o.id = "foo"; | |
| 824 o.image = buildCommentActorImage(); | |
| 825 o.url = "foo"; | |
| 826 } | |
| 827 buildCounterCommentActor--; | |
| 828 return o; | |
| 829 } | |
| 830 | |
| 831 checkCommentActor(api.CommentActor o) { | |
| 832 buildCounterCommentActor++; | |
| 833 if (buildCounterCommentActor < 3) { | |
| 834 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 835 unittest.expect(o.id, unittest.equals('foo')); | |
| 836 checkCommentActorImage(o.image); | |
| 837 unittest.expect(o.url, unittest.equals('foo')); | |
| 838 } | |
| 839 buildCounterCommentActor--; | |
| 840 } | |
| 841 | |
| 842 core.int buildCounterCommentInReplyTo = 0; | |
| 843 buildCommentInReplyTo() { | |
| 844 var o = new api.CommentInReplyTo(); | |
| 845 buildCounterCommentInReplyTo++; | |
| 846 if (buildCounterCommentInReplyTo < 3) { | |
| 847 o.id = "foo"; | |
| 848 o.url = "foo"; | |
| 849 } | |
| 850 buildCounterCommentInReplyTo--; | |
| 851 return o; | |
| 852 } | |
| 853 | |
| 854 checkCommentInReplyTo(api.CommentInReplyTo o) { | |
| 855 buildCounterCommentInReplyTo++; | |
| 856 if (buildCounterCommentInReplyTo < 3) { | |
| 857 unittest.expect(o.id, unittest.equals('foo')); | |
| 858 unittest.expect(o.url, unittest.equals('foo')); | |
| 859 } | |
| 860 buildCounterCommentInReplyTo--; | |
| 861 } | |
| 862 | |
| 863 buildUnnamed644() { | |
| 864 var o = new core.List<api.CommentInReplyTo>(); | |
| 865 o.add(buildCommentInReplyTo()); | |
| 866 o.add(buildCommentInReplyTo()); | |
| 867 return o; | |
| 868 } | |
| 869 | |
| 870 checkUnnamed644(core.List<api.CommentInReplyTo> o) { | |
| 871 unittest.expect(o, unittest.hasLength(2)); | |
| 872 checkCommentInReplyTo(o[0]); | |
| 873 checkCommentInReplyTo(o[1]); | |
| 874 } | |
| 875 | |
| 876 core.int buildCounterCommentObject = 0; | |
| 877 buildCommentObject() { | |
| 878 var o = new api.CommentObject(); | |
| 879 buildCounterCommentObject++; | |
| 880 if (buildCounterCommentObject < 3) { | |
| 881 o.content = "foo"; | |
| 882 o.objectType = "foo"; | |
| 883 o.originalContent = "foo"; | |
| 884 } | |
| 885 buildCounterCommentObject--; | |
| 886 return o; | |
| 887 } | |
| 888 | |
| 889 checkCommentObject(api.CommentObject o) { | |
| 890 buildCounterCommentObject++; | |
| 891 if (buildCounterCommentObject < 3) { | |
| 892 unittest.expect(o.content, unittest.equals('foo')); | |
| 893 unittest.expect(o.objectType, unittest.equals('foo')); | |
| 894 unittest.expect(o.originalContent, unittest.equals('foo')); | |
| 895 } | |
| 896 buildCounterCommentObject--; | |
| 897 } | |
| 898 | |
| 899 core.int buildCounterCommentPlusoners = 0; | |
| 900 buildCommentPlusoners() { | |
| 901 var o = new api.CommentPlusoners(); | |
| 902 buildCounterCommentPlusoners++; | |
| 903 if (buildCounterCommentPlusoners < 3) { | |
| 904 o.totalItems = 42; | |
| 905 } | |
| 906 buildCounterCommentPlusoners--; | |
| 907 return o; | |
| 908 } | |
| 909 | |
| 910 checkCommentPlusoners(api.CommentPlusoners o) { | |
| 911 buildCounterCommentPlusoners++; | |
| 912 if (buildCounterCommentPlusoners < 3) { | |
| 913 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 914 } | |
| 915 buildCounterCommentPlusoners--; | |
| 916 } | |
| 917 | |
| 918 core.int buildCounterComment = 0; | |
| 919 buildComment() { | |
| 920 var o = new api.Comment(); | |
| 921 buildCounterComment++; | |
| 922 if (buildCounterComment < 3) { | |
| 923 o.actor = buildCommentActor(); | |
| 924 o.etag = "foo"; | |
| 925 o.id = "foo"; | |
| 926 o.inReplyTo = buildUnnamed644(); | |
| 927 o.kind = "foo"; | |
| 928 o.object = buildCommentObject(); | |
| 929 o.plusoners = buildCommentPlusoners(); | |
| 930 o.published = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 931 o.selfLink = "foo"; | |
| 932 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 933 o.verb = "foo"; | |
| 934 } | |
| 935 buildCounterComment--; | |
| 936 return o; | |
| 937 } | |
| 938 | |
| 939 checkComment(api.Comment o) { | |
| 940 buildCounterComment++; | |
| 941 if (buildCounterComment < 3) { | |
| 942 checkCommentActor(o.actor); | |
| 943 unittest.expect(o.etag, unittest.equals('foo')); | |
| 944 unittest.expect(o.id, unittest.equals('foo')); | |
| 945 checkUnnamed644(o.inReplyTo); | |
| 946 unittest.expect(o.kind, unittest.equals('foo')); | |
| 947 checkCommentObject(o.object); | |
| 948 checkCommentPlusoners(o.plusoners); | |
| 949 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | |
| 950 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 951 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
| 952 unittest.expect(o.verb, unittest.equals('foo')); | |
| 953 } | |
| 954 buildCounterComment--; | |
| 955 } | |
| 956 | |
| 957 buildUnnamed645() { | |
| 958 var o = new core.List<api.Comment>(); | |
| 959 o.add(buildComment()); | |
| 960 o.add(buildComment()); | |
| 961 return o; | |
| 962 } | |
| 963 | |
| 964 checkUnnamed645(core.List<api.Comment> o) { | |
| 965 unittest.expect(o, unittest.hasLength(2)); | |
| 966 checkComment(o[0]); | |
| 967 checkComment(o[1]); | |
| 968 } | |
| 969 | |
| 970 core.int buildCounterCommentFeed = 0; | |
| 971 buildCommentFeed() { | |
| 972 var o = new api.CommentFeed(); | |
| 973 buildCounterCommentFeed++; | |
| 974 if (buildCounterCommentFeed < 3) { | |
| 975 o.etag = "foo"; | |
| 976 o.id = "foo"; | |
| 977 o.items = buildUnnamed645(); | |
| 978 o.kind = "foo"; | |
| 979 o.nextLink = "foo"; | |
| 980 o.nextPageToken = "foo"; | |
| 981 o.title = "foo"; | |
| 982 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 983 } | |
| 984 buildCounterCommentFeed--; | |
| 985 return o; | |
| 986 } | |
| 987 | |
| 988 checkCommentFeed(api.CommentFeed o) { | |
| 989 buildCounterCommentFeed++; | |
| 990 if (buildCounterCommentFeed < 3) { | |
| 991 unittest.expect(o.etag, unittest.equals('foo')); | |
| 992 unittest.expect(o.id, unittest.equals('foo')); | |
| 993 checkUnnamed645(o.items); | |
| 994 unittest.expect(o.kind, unittest.equals('foo')); | |
| 995 unittest.expect(o.nextLink, unittest.equals('foo')); | |
| 996 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
| 997 unittest.expect(o.title, unittest.equals('foo')); | |
| 998 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
| 999 } | |
| 1000 buildCounterCommentFeed--; | |
| 1001 } | |
| 1002 | |
| 1003 core.int buildCounterMediaAuthorImage = 0; | |
| 1004 buildMediaAuthorImage() { | |
| 1005 var o = new api.MediaAuthorImage(); | |
| 1006 buildCounterMediaAuthorImage++; | |
| 1007 if (buildCounterMediaAuthorImage < 3) { | |
| 1008 o.url = "foo"; | |
| 1009 } | |
| 1010 buildCounterMediaAuthorImage--; | |
| 1011 return o; | |
| 1012 } | |
| 1013 | |
| 1014 checkMediaAuthorImage(api.MediaAuthorImage o) { | |
| 1015 buildCounterMediaAuthorImage++; | |
| 1016 if (buildCounterMediaAuthorImage < 3) { | |
| 1017 unittest.expect(o.url, unittest.equals('foo')); | |
| 1018 } | |
| 1019 buildCounterMediaAuthorImage--; | |
| 1020 } | |
| 1021 | |
| 1022 core.int buildCounterMediaAuthor = 0; | |
| 1023 buildMediaAuthor() { | |
| 1024 var o = new api.MediaAuthor(); | |
| 1025 buildCounterMediaAuthor++; | |
| 1026 if (buildCounterMediaAuthor < 3) { | |
| 1027 o.displayName = "foo"; | |
| 1028 o.id = "foo"; | |
| 1029 o.image = buildMediaAuthorImage(); | |
| 1030 o.url = "foo"; | |
| 1031 } | |
| 1032 buildCounterMediaAuthor--; | |
| 1033 return o; | |
| 1034 } | |
| 1035 | |
| 1036 checkMediaAuthor(api.MediaAuthor o) { | |
| 1037 buildCounterMediaAuthor++; | |
| 1038 if (buildCounterMediaAuthor < 3) { | |
| 1039 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 1040 unittest.expect(o.id, unittest.equals('foo')); | |
| 1041 checkMediaAuthorImage(o.image); | |
| 1042 unittest.expect(o.url, unittest.equals('foo')); | |
| 1043 } | |
| 1044 buildCounterMediaAuthor--; | |
| 1045 } | |
| 1046 | |
| 1047 core.int buildCounterMediaExif = 0; | |
| 1048 buildMediaExif() { | |
| 1049 var o = new api.MediaExif(); | |
| 1050 buildCounterMediaExif++; | |
| 1051 if (buildCounterMediaExif < 3) { | |
| 1052 o.time = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 1053 } | |
| 1054 buildCounterMediaExif--; | |
| 1055 return o; | |
| 1056 } | |
| 1057 | |
| 1058 checkMediaExif(api.MediaExif o) { | |
| 1059 buildCounterMediaExif++; | |
| 1060 if (buildCounterMediaExif < 3) { | |
| 1061 unittest.expect(o.time, unittest.equals(core.DateTime.parse("2002-02-27T14:0
1:02"))); | |
| 1062 } | |
| 1063 buildCounterMediaExif--; | |
| 1064 } | |
| 1065 | |
| 1066 buildUnnamed646() { | |
| 1067 var o = new core.List<api.Videostream>(); | |
| 1068 o.add(buildVideostream()); | |
| 1069 o.add(buildVideostream()); | |
| 1070 return o; | |
| 1071 } | |
| 1072 | |
| 1073 checkUnnamed646(core.List<api.Videostream> o) { | |
| 1074 unittest.expect(o, unittest.hasLength(2)); | |
| 1075 checkVideostream(o[0]); | |
| 1076 checkVideostream(o[1]); | |
| 1077 } | |
| 1078 | |
| 1079 core.int buildCounterMedia = 0; | |
| 1080 buildMedia() { | |
| 1081 var o = new api.Media(); | |
| 1082 buildCounterMedia++; | |
| 1083 if (buildCounterMedia < 3) { | |
| 1084 o.author = buildMediaAuthor(); | |
| 1085 o.displayName = "foo"; | |
| 1086 o.etag = "foo"; | |
| 1087 o.exif = buildMediaExif(); | |
| 1088 o.height = 42; | |
| 1089 o.id = "foo"; | |
| 1090 o.kind = "foo"; | |
| 1091 o.mediaCreatedTime = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 1092 o.mediaUrl = "foo"; | |
| 1093 o.published = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 1094 o.sizeBytes = "foo"; | |
| 1095 o.streams = buildUnnamed646(); | |
| 1096 o.summary = "foo"; | |
| 1097 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | |
| 1098 o.url = "foo"; | |
| 1099 o.videoDuration = "foo"; | |
| 1100 o.videoStatus = "foo"; | |
| 1101 o.width = 42; | |
| 1102 } | |
| 1103 buildCounterMedia--; | |
| 1104 return o; | |
| 1105 } | |
| 1106 | |
| 1107 checkMedia(api.Media o) { | |
| 1108 buildCounterMedia++; | |
| 1109 if (buildCounterMedia < 3) { | |
| 1110 checkMediaAuthor(o.author); | |
| 1111 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 1112 unittest.expect(o.etag, unittest.equals('foo')); | |
| 1113 checkMediaExif(o.exif); | |
| 1114 unittest.expect(o.height, unittest.equals(42)); | |
| 1115 unittest.expect(o.id, unittest.equals('foo')); | |
| 1116 unittest.expect(o.kind, unittest.equals('foo')); | |
| 1117 unittest.expect(o.mediaCreatedTime, unittest.equals(core.DateTime.parse("200
2-02-27T14:01:02"))); | |
| 1118 unittest.expect(o.mediaUrl, unittest.equals('foo')); | |
| 1119 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | |
| 1120 unittest.expect(o.sizeBytes, unittest.equals('foo')); | |
| 1121 checkUnnamed646(o.streams); | |
| 1122 unittest.expect(o.summary, unittest.equals('foo')); | |
| 1123 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | |
| 1124 unittest.expect(o.url, unittest.equals('foo')); | |
| 1125 unittest.expect(o.videoDuration, unittest.equals('foo')); | |
| 1126 unittest.expect(o.videoStatus, unittest.equals('foo')); | |
| 1127 unittest.expect(o.width, unittest.equals(42)); | |
| 1128 } | |
| 1129 buildCounterMedia--; | |
| 1130 } | |
| 1131 | |
| 1132 buildUnnamed647() { | |
| 1133 var o = new core.List<api.Person>(); | |
| 1134 o.add(buildPerson()); | |
| 1135 o.add(buildPerson()); | |
| 1136 return o; | |
| 1137 } | |
| 1138 | |
| 1139 checkUnnamed647(core.List<api.Person> o) { | |
| 1140 unittest.expect(o, unittest.hasLength(2)); | |
| 1141 checkPerson(o[0]); | |
| 1142 checkPerson(o[1]); | |
| 1143 } | |
| 1144 | |
| 1145 core.int buildCounterPeopleFeed = 0; | |
| 1146 buildPeopleFeed() { | |
| 1147 var o = new api.PeopleFeed(); | |
| 1148 buildCounterPeopleFeed++; | |
| 1149 if (buildCounterPeopleFeed < 3) { | |
| 1150 o.etag = "foo"; | |
| 1151 o.items = buildUnnamed647(); | |
| 1152 o.kind = "foo"; | |
| 1153 o.nextPageToken = "foo"; | |
| 1154 o.selfLink = "foo"; | |
| 1155 o.title = "foo"; | |
| 1156 o.totalItems = 42; | |
| 1157 } | |
| 1158 buildCounterPeopleFeed--; | |
| 1159 return o; | |
| 1160 } | |
| 1161 | |
| 1162 checkPeopleFeed(api.PeopleFeed o) { | |
| 1163 buildCounterPeopleFeed++; | |
| 1164 if (buildCounterPeopleFeed < 3) { | |
| 1165 unittest.expect(o.etag, unittest.equals('foo')); | |
| 1166 checkUnnamed647(o.items); | |
| 1167 unittest.expect(o.kind, unittest.equals('foo')); | |
| 1168 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
| 1169 unittest.expect(o.selfLink, unittest.equals('foo')); | |
| 1170 unittest.expect(o.title, unittest.equals('foo')); | |
| 1171 unittest.expect(o.totalItems, unittest.equals(42)); | |
| 1172 } | |
| 1173 buildCounterPeopleFeed--; | |
| 1174 } | |
| 1175 | |
| 1176 core.int buildCounterPersonCoverCoverInfo = 0; | |
| 1177 buildPersonCoverCoverInfo() { | |
| 1178 var o = new api.PersonCoverCoverInfo(); | |
| 1179 buildCounterPersonCoverCoverInfo++; | |
| 1180 if (buildCounterPersonCoverCoverInfo < 3) { | |
| 1181 o.leftImageOffset = 42; | |
| 1182 o.topImageOffset = 42; | |
| 1183 } | |
| 1184 buildCounterPersonCoverCoverInfo--; | |
| 1185 return o; | |
| 1186 } | |
| 1187 | |
| 1188 checkPersonCoverCoverInfo(api.PersonCoverCoverInfo o) { | |
| 1189 buildCounterPersonCoverCoverInfo++; | |
| 1190 if (buildCounterPersonCoverCoverInfo < 3) { | |
| 1191 unittest.expect(o.leftImageOffset, unittest.equals(42)); | |
| 1192 unittest.expect(o.topImageOffset, unittest.equals(42)); | |
| 1193 } | |
| 1194 buildCounterPersonCoverCoverInfo--; | |
| 1195 } | |
| 1196 | |
| 1197 core.int buildCounterPersonCoverCoverPhoto = 0; | |
| 1198 buildPersonCoverCoverPhoto() { | |
| 1199 var o = new api.PersonCoverCoverPhoto(); | |
| 1200 buildCounterPersonCoverCoverPhoto++; | |
| 1201 if (buildCounterPersonCoverCoverPhoto < 3) { | |
| 1202 o.height = 42; | |
| 1203 o.url = "foo"; | |
| 1204 o.width = 42; | |
| 1205 } | |
| 1206 buildCounterPersonCoverCoverPhoto--; | |
| 1207 return o; | |
| 1208 } | |
| 1209 | |
| 1210 checkPersonCoverCoverPhoto(api.PersonCoverCoverPhoto o) { | |
| 1211 buildCounterPersonCoverCoverPhoto++; | |
| 1212 if (buildCounterPersonCoverCoverPhoto < 3) { | |
| 1213 unittest.expect(o.height, unittest.equals(42)); | |
| 1214 unittest.expect(o.url, unittest.equals('foo')); | |
| 1215 unittest.expect(o.width, unittest.equals(42)); | |
| 1216 } | |
| 1217 buildCounterPersonCoverCoverPhoto--; | |
| 1218 } | |
| 1219 | |
| 1220 core.int buildCounterPersonCover = 0; | |
| 1221 buildPersonCover() { | |
| 1222 var o = new api.PersonCover(); | |
| 1223 buildCounterPersonCover++; | |
| 1224 if (buildCounterPersonCover < 3) { | |
| 1225 o.coverInfo = buildPersonCoverCoverInfo(); | |
| 1226 o.coverPhoto = buildPersonCoverCoverPhoto(); | |
| 1227 o.layout = "foo"; | |
| 1228 } | |
| 1229 buildCounterPersonCover--; | |
| 1230 return o; | |
| 1231 } | |
| 1232 | |
| 1233 checkPersonCover(api.PersonCover o) { | |
| 1234 buildCounterPersonCover++; | |
| 1235 if (buildCounterPersonCover < 3) { | |
| 1236 checkPersonCoverCoverInfo(o.coverInfo); | |
| 1237 checkPersonCoverCoverPhoto(o.coverPhoto); | |
| 1238 unittest.expect(o.layout, unittest.equals('foo')); | |
| 1239 } | |
| 1240 buildCounterPersonCover--; | |
| 1241 } | |
| 1242 | |
| 1243 core.int buildCounterPersonEmails = 0; | |
| 1244 buildPersonEmails() { | |
| 1245 var o = new api.PersonEmails(); | |
| 1246 buildCounterPersonEmails++; | |
| 1247 if (buildCounterPersonEmails < 3) { | |
| 1248 o.type = "foo"; | |
| 1249 o.value = "foo"; | |
| 1250 } | |
| 1251 buildCounterPersonEmails--; | |
| 1252 return o; | |
| 1253 } | |
| 1254 | |
| 1255 checkPersonEmails(api.PersonEmails o) { | |
| 1256 buildCounterPersonEmails++; | |
| 1257 if (buildCounterPersonEmails < 3) { | |
| 1258 unittest.expect(o.type, unittest.equals('foo')); | |
| 1259 unittest.expect(o.value, unittest.equals('foo')); | |
| 1260 } | |
| 1261 buildCounterPersonEmails--; | |
| 1262 } | |
| 1263 | |
| 1264 buildUnnamed648() { | |
| 1265 var o = new core.List<api.PersonEmails>(); | |
| 1266 o.add(buildPersonEmails()); | |
| 1267 o.add(buildPersonEmails()); | |
| 1268 return o; | |
| 1269 } | |
| 1270 | |
| 1271 checkUnnamed648(core.List<api.PersonEmails> o) { | |
| 1272 unittest.expect(o, unittest.hasLength(2)); | |
| 1273 checkPersonEmails(o[0]); | |
| 1274 checkPersonEmails(o[1]); | |
| 1275 } | |
| 1276 | |
| 1277 core.int buildCounterPersonImage = 0; | |
| 1278 buildPersonImage() { | |
| 1279 var o = new api.PersonImage(); | |
| 1280 buildCounterPersonImage++; | |
| 1281 if (buildCounterPersonImage < 3) { | |
| 1282 o.isDefault = true; | |
| 1283 o.url = "foo"; | |
| 1284 } | |
| 1285 buildCounterPersonImage--; | |
| 1286 return o; | |
| 1287 } | |
| 1288 | |
| 1289 checkPersonImage(api.PersonImage o) { | |
| 1290 buildCounterPersonImage++; | |
| 1291 if (buildCounterPersonImage < 3) { | |
| 1292 unittest.expect(o.isDefault, unittest.isTrue); | |
| 1293 unittest.expect(o.url, unittest.equals('foo')); | |
| 1294 } | |
| 1295 buildCounterPersonImage--; | |
| 1296 } | |
| 1297 | |
| 1298 core.int buildCounterPersonName = 0; | |
| 1299 buildPersonName() { | |
| 1300 var o = new api.PersonName(); | |
| 1301 buildCounterPersonName++; | |
| 1302 if (buildCounterPersonName < 3) { | |
| 1303 o.familyName = "foo"; | |
| 1304 o.formatted = "foo"; | |
| 1305 o.givenName = "foo"; | |
| 1306 o.honorificPrefix = "foo"; | |
| 1307 o.honorificSuffix = "foo"; | |
| 1308 o.middleName = "foo"; | |
| 1309 } | |
| 1310 buildCounterPersonName--; | |
| 1311 return o; | |
| 1312 } | |
| 1313 | |
| 1314 checkPersonName(api.PersonName o) { | |
| 1315 buildCounterPersonName++; | |
| 1316 if (buildCounterPersonName < 3) { | |
| 1317 unittest.expect(o.familyName, unittest.equals('foo')); | |
| 1318 unittest.expect(o.formatted, unittest.equals('foo')); | |
| 1319 unittest.expect(o.givenName, unittest.equals('foo')); | |
| 1320 unittest.expect(o.honorificPrefix, unittest.equals('foo')); | |
| 1321 unittest.expect(o.honorificSuffix, unittest.equals('foo')); | |
| 1322 unittest.expect(o.middleName, unittest.equals('foo')); | |
| 1323 } | |
| 1324 buildCounterPersonName--; | |
| 1325 } | |
| 1326 | |
| 1327 core.int buildCounterPersonOrganizations = 0; | |
| 1328 buildPersonOrganizations() { | |
| 1329 var o = new api.PersonOrganizations(); | |
| 1330 buildCounterPersonOrganizations++; | |
| 1331 if (buildCounterPersonOrganizations < 3) { | |
| 1332 o.department = "foo"; | |
| 1333 o.description = "foo"; | |
| 1334 o.endDate = "foo"; | |
| 1335 o.location = "foo"; | |
| 1336 o.name = "foo"; | |
| 1337 o.primary = true; | |
| 1338 o.startDate = "foo"; | |
| 1339 o.title = "foo"; | |
| 1340 o.type = "foo"; | |
| 1341 } | |
| 1342 buildCounterPersonOrganizations--; | |
| 1343 return o; | |
| 1344 } | |
| 1345 | |
| 1346 checkPersonOrganizations(api.PersonOrganizations o) { | |
| 1347 buildCounterPersonOrganizations++; | |
| 1348 if (buildCounterPersonOrganizations < 3) { | |
| 1349 unittest.expect(o.department, unittest.equals('foo')); | |
| 1350 unittest.expect(o.description, unittest.equals('foo')); | |
| 1351 unittest.expect(o.endDate, unittest.equals('foo')); | |
| 1352 unittest.expect(o.location, unittest.equals('foo')); | |
| 1353 unittest.expect(o.name, unittest.equals('foo')); | |
| 1354 unittest.expect(o.primary, unittest.isTrue); | |
| 1355 unittest.expect(o.startDate, unittest.equals('foo')); | |
| 1356 unittest.expect(o.title, unittest.equals('foo')); | |
| 1357 unittest.expect(o.type, unittest.equals('foo')); | |
| 1358 } | |
| 1359 buildCounterPersonOrganizations--; | |
| 1360 } | |
| 1361 | |
| 1362 buildUnnamed649() { | |
| 1363 var o = new core.List<api.PersonOrganizations>(); | |
| 1364 o.add(buildPersonOrganizations()); | |
| 1365 o.add(buildPersonOrganizations()); | |
| 1366 return o; | |
| 1367 } | |
| 1368 | |
| 1369 checkUnnamed649(core.List<api.PersonOrganizations> o) { | |
| 1370 unittest.expect(o, unittest.hasLength(2)); | |
| 1371 checkPersonOrganizations(o[0]); | |
| 1372 checkPersonOrganizations(o[1]); | |
| 1373 } | |
| 1374 | |
| 1375 core.int buildCounterPersonPlacesLived = 0; | |
| 1376 buildPersonPlacesLived() { | |
| 1377 var o = new api.PersonPlacesLived(); | |
| 1378 buildCounterPersonPlacesLived++; | |
| 1379 if (buildCounterPersonPlacesLived < 3) { | |
| 1380 o.primary = true; | |
| 1381 o.value = "foo"; | |
| 1382 } | |
| 1383 buildCounterPersonPlacesLived--; | |
| 1384 return o; | |
| 1385 } | |
| 1386 | |
| 1387 checkPersonPlacesLived(api.PersonPlacesLived o) { | |
| 1388 buildCounterPersonPlacesLived++; | |
| 1389 if (buildCounterPersonPlacesLived < 3) { | |
| 1390 unittest.expect(o.primary, unittest.isTrue); | |
| 1391 unittest.expect(o.value, unittest.equals('foo')); | |
| 1392 } | |
| 1393 buildCounterPersonPlacesLived--; | |
| 1394 } | |
| 1395 | |
| 1396 buildUnnamed650() { | |
| 1397 var o = new core.List<api.PersonPlacesLived>(); | |
| 1398 o.add(buildPersonPlacesLived()); | |
| 1399 o.add(buildPersonPlacesLived()); | |
| 1400 return o; | |
| 1401 } | |
| 1402 | |
| 1403 checkUnnamed650(core.List<api.PersonPlacesLived> o) { | |
| 1404 unittest.expect(o, unittest.hasLength(2)); | |
| 1405 checkPersonPlacesLived(o[0]); | |
| 1406 checkPersonPlacesLived(o[1]); | |
| 1407 } | |
| 1408 | |
| 1409 core.int buildCounterPersonUrls = 0; | |
| 1410 buildPersonUrls() { | |
| 1411 var o = new api.PersonUrls(); | |
| 1412 buildCounterPersonUrls++; | |
| 1413 if (buildCounterPersonUrls < 3) { | |
| 1414 o.label = "foo"; | |
| 1415 o.type = "foo"; | |
| 1416 o.value = "foo"; | |
| 1417 } | |
| 1418 buildCounterPersonUrls--; | |
| 1419 return o; | |
| 1420 } | |
| 1421 | |
| 1422 checkPersonUrls(api.PersonUrls o) { | |
| 1423 buildCounterPersonUrls++; | |
| 1424 if (buildCounterPersonUrls < 3) { | |
| 1425 unittest.expect(o.label, unittest.equals('foo')); | |
| 1426 unittest.expect(o.type, unittest.equals('foo')); | |
| 1427 unittest.expect(o.value, unittest.equals('foo')); | |
| 1428 } | |
| 1429 buildCounterPersonUrls--; | |
| 1430 } | |
| 1431 | |
| 1432 buildUnnamed651() { | |
| 1433 var o = new core.List<api.PersonUrls>(); | |
| 1434 o.add(buildPersonUrls()); | |
| 1435 o.add(buildPersonUrls()); | |
| 1436 return o; | |
| 1437 } | |
| 1438 | |
| 1439 checkUnnamed651(core.List<api.PersonUrls> o) { | |
| 1440 unittest.expect(o, unittest.hasLength(2)); | |
| 1441 checkPersonUrls(o[0]); | |
| 1442 checkPersonUrls(o[1]); | |
| 1443 } | |
| 1444 | |
| 1445 core.int buildCounterPerson = 0; | |
| 1446 buildPerson() { | |
| 1447 var o = new api.Person(); | |
| 1448 buildCounterPerson++; | |
| 1449 if (buildCounterPerson < 3) { | |
| 1450 o.aboutMe = "foo"; | |
| 1451 o.birthday = "foo"; | |
| 1452 o.braggingRights = "foo"; | |
| 1453 o.circledByCount = 42; | |
| 1454 o.cover = buildPersonCover(); | |
| 1455 o.currentLocation = "foo"; | |
| 1456 o.displayName = "foo"; | |
| 1457 o.domain = "foo"; | |
| 1458 o.emails = buildUnnamed648(); | |
| 1459 o.etag = "foo"; | |
| 1460 o.gender = "foo"; | |
| 1461 o.id = "foo"; | |
| 1462 o.image = buildPersonImage(); | |
| 1463 o.isPlusUser = true; | |
| 1464 o.kind = "foo"; | |
| 1465 o.name = buildPersonName(); | |
| 1466 o.nickname = "foo"; | |
| 1467 o.objectType = "foo"; | |
| 1468 o.occupation = "foo"; | |
| 1469 o.organizations = buildUnnamed649(); | |
| 1470 o.placesLived = buildUnnamed650(); | |
| 1471 o.plusOneCount = 42; | |
| 1472 o.relationshipStatus = "foo"; | |
| 1473 o.skills = "foo"; | |
| 1474 o.tagline = "foo"; | |
| 1475 o.url = "foo"; | |
| 1476 o.urls = buildUnnamed651(); | |
| 1477 o.verified = true; | |
| 1478 } | |
| 1479 buildCounterPerson--; | |
| 1480 return o; | |
| 1481 } | |
| 1482 | |
| 1483 checkPerson(api.Person o) { | |
| 1484 buildCounterPerson++; | |
| 1485 if (buildCounterPerson < 3) { | |
| 1486 unittest.expect(o.aboutMe, unittest.equals('foo')); | |
| 1487 unittest.expect(o.birthday, unittest.equals('foo')); | |
| 1488 unittest.expect(o.braggingRights, unittest.equals('foo')); | |
| 1489 unittest.expect(o.circledByCount, unittest.equals(42)); | |
| 1490 checkPersonCover(o.cover); | |
| 1491 unittest.expect(o.currentLocation, unittest.equals('foo')); | |
| 1492 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 1493 unittest.expect(o.domain, unittest.equals('foo')); | |
| 1494 checkUnnamed648(o.emails); | |
| 1495 unittest.expect(o.etag, unittest.equals('foo')); | |
| 1496 unittest.expect(o.gender, unittest.equals('foo')); | |
| 1497 unittest.expect(o.id, unittest.equals('foo')); | |
| 1498 checkPersonImage(o.image); | |
| 1499 unittest.expect(o.isPlusUser, unittest.isTrue); | |
| 1500 unittest.expect(o.kind, unittest.equals('foo')); | |
| 1501 checkPersonName(o.name); | |
| 1502 unittest.expect(o.nickname, unittest.equals('foo')); | |
| 1503 unittest.expect(o.objectType, unittest.equals('foo')); | |
| 1504 unittest.expect(o.occupation, unittest.equals('foo')); | |
| 1505 checkUnnamed649(o.organizations); | |
| 1506 checkUnnamed650(o.placesLived); | |
| 1507 unittest.expect(o.plusOneCount, unittest.equals(42)); | |
| 1508 unittest.expect(o.relationshipStatus, unittest.equals('foo')); | |
| 1509 unittest.expect(o.skills, unittest.equals('foo')); | |
| 1510 unittest.expect(o.tagline, unittest.equals('foo')); | |
| 1511 unittest.expect(o.url, unittest.equals('foo')); | |
| 1512 checkUnnamed651(o.urls); | |
| 1513 unittest.expect(o.verified, unittest.isTrue); | |
| 1514 } | |
| 1515 buildCounterPerson--; | |
| 1516 } | |
| 1517 | |
| 1518 core.int buildCounterPlaceAddress = 0; | |
| 1519 buildPlaceAddress() { | |
| 1520 var o = new api.PlaceAddress(); | |
| 1521 buildCounterPlaceAddress++; | |
| 1522 if (buildCounterPlaceAddress < 3) { | |
| 1523 o.formatted = "foo"; | |
| 1524 } | |
| 1525 buildCounterPlaceAddress--; | |
| 1526 return o; | |
| 1527 } | |
| 1528 | |
| 1529 checkPlaceAddress(api.PlaceAddress o) { | |
| 1530 buildCounterPlaceAddress++; | |
| 1531 if (buildCounterPlaceAddress < 3) { | |
| 1532 unittest.expect(o.formatted, unittest.equals('foo')); | |
| 1533 } | |
| 1534 buildCounterPlaceAddress--; | |
| 1535 } | |
| 1536 | |
| 1537 core.int buildCounterPlacePosition = 0; | |
| 1538 buildPlacePosition() { | |
| 1539 var o = new api.PlacePosition(); | |
| 1540 buildCounterPlacePosition++; | |
| 1541 if (buildCounterPlacePosition < 3) { | |
| 1542 o.latitude = 42.0; | |
| 1543 o.longitude = 42.0; | |
| 1544 } | |
| 1545 buildCounterPlacePosition--; | |
| 1546 return o; | |
| 1547 } | |
| 1548 | |
| 1549 checkPlacePosition(api.PlacePosition o) { | |
| 1550 buildCounterPlacePosition++; | |
| 1551 if (buildCounterPlacePosition < 3) { | |
| 1552 unittest.expect(o.latitude, unittest.equals(42.0)); | |
| 1553 unittest.expect(o.longitude, unittest.equals(42.0)); | |
| 1554 } | |
| 1555 buildCounterPlacePosition--; | |
| 1556 } | |
| 1557 | |
| 1558 core.int buildCounterPlace = 0; | |
| 1559 buildPlace() { | |
| 1560 var o = new api.Place(); | |
| 1561 buildCounterPlace++; | |
| 1562 if (buildCounterPlace < 3) { | |
| 1563 o.address = buildPlaceAddress(); | |
| 1564 o.displayName = "foo"; | |
| 1565 o.id = "foo"; | |
| 1566 o.kind = "foo"; | |
| 1567 o.position = buildPlacePosition(); | |
| 1568 } | |
| 1569 buildCounterPlace--; | |
| 1570 return o; | |
| 1571 } | |
| 1572 | |
| 1573 checkPlace(api.Place o) { | |
| 1574 buildCounterPlace++; | |
| 1575 if (buildCounterPlace < 3) { | |
| 1576 checkPlaceAddress(o.address); | |
| 1577 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 1578 unittest.expect(o.id, unittest.equals('foo')); | |
| 1579 unittest.expect(o.kind, unittest.equals('foo')); | |
| 1580 checkPlacePosition(o.position); | |
| 1581 } | |
| 1582 buildCounterPlace--; | |
| 1583 } | |
| 1584 | |
| 1585 core.int buildCounterPlusDomainsAclentryResource = 0; | |
| 1586 buildPlusDomainsAclentryResource() { | |
| 1587 var o = new api.PlusDomainsAclentryResource(); | |
| 1588 buildCounterPlusDomainsAclentryResource++; | |
| 1589 if (buildCounterPlusDomainsAclentryResource < 3) { | |
| 1590 o.displayName = "foo"; | |
| 1591 o.id = "foo"; | |
| 1592 o.type = "foo"; | |
| 1593 } | |
| 1594 buildCounterPlusDomainsAclentryResource--; | |
| 1595 return o; | |
| 1596 } | |
| 1597 | |
| 1598 checkPlusDomainsAclentryResource(api.PlusDomainsAclentryResource o) { | |
| 1599 buildCounterPlusDomainsAclentryResource++; | |
| 1600 if (buildCounterPlusDomainsAclentryResource < 3) { | |
| 1601 unittest.expect(o.displayName, unittest.equals('foo')); | |
| 1602 unittest.expect(o.id, unittest.equals('foo')); | |
| 1603 unittest.expect(o.type, unittest.equals('foo')); | |
| 1604 } | |
| 1605 buildCounterPlusDomainsAclentryResource--; | |
| 1606 } | |
| 1607 | |
| 1608 core.int buildCounterVideostream = 0; | |
| 1609 buildVideostream() { | |
| 1610 var o = new api.Videostream(); | |
| 1611 buildCounterVideostream++; | |
| 1612 if (buildCounterVideostream < 3) { | |
| 1613 o.height = 42; | |
| 1614 o.type = "foo"; | |
| 1615 o.url = "foo"; | |
| 1616 o.width = 42; | |
| 1617 } | |
| 1618 buildCounterVideostream--; | |
| 1619 return o; | |
| 1620 } | |
| 1621 | |
| 1622 checkVideostream(api.Videostream o) { | |
| 1623 buildCounterVideostream++; | |
| 1624 if (buildCounterVideostream < 3) { | |
| 1625 unittest.expect(o.height, unittest.equals(42)); | |
| 1626 unittest.expect(o.type, unittest.equals('foo')); | |
| 1627 unittest.expect(o.url, unittest.equals('foo')); | |
| 1628 unittest.expect(o.width, unittest.equals(42)); | |
| 1629 } | |
| 1630 buildCounterVideostream--; | |
| 1631 } | |
| 1632 | |
| 1633 buildUnnamed652() { | |
| 1634 var o = new core.List<core.String>(); | |
| 1635 o.add("foo"); | |
| 1636 o.add("foo"); | |
| 1637 return o; | |
| 1638 } | |
| 1639 | |
| 1640 checkUnnamed652(core.List<core.String> o) { | |
| 1641 unittest.expect(o, unittest.hasLength(2)); | |
| 1642 unittest.expect(o[0], unittest.equals('foo')); | |
| 1643 unittest.expect(o[1], unittest.equals('foo')); | |
| 1644 } | |
| 1645 | |
| 1646 buildUnnamed653() { | |
| 1647 var o = new core.List<core.String>(); | |
| 1648 o.add("foo"); | |
| 1649 o.add("foo"); | |
| 1650 return o; | |
| 1651 } | |
| 1652 | |
| 1653 checkUnnamed653(core.List<core.String> o) { | |
| 1654 unittest.expect(o, unittest.hasLength(2)); | |
| 1655 unittest.expect(o[0], unittest.equals('foo')); | |
| 1656 unittest.expect(o[1], unittest.equals('foo')); | |
| 1657 } | |
| 1658 | |
| 1659 buildUnnamed654() { | |
| 1660 var o = new core.List<core.String>(); | |
| 1661 o.add("foo"); | |
| 1662 o.add("foo"); | |
| 1663 return o; | |
| 1664 } | |
| 1665 | |
| 1666 checkUnnamed654(core.List<core.String> o) { | |
| 1667 unittest.expect(o, unittest.hasLength(2)); | |
| 1668 unittest.expect(o[0], unittest.equals('foo')); | |
| 1669 unittest.expect(o[1], unittest.equals('foo')); | |
| 1670 } | |
| 1671 | |
| 1672 buildUnnamed655() { | |
| 1673 var o = new core.List<core.String>(); | |
| 1674 o.add("foo"); | |
| 1675 o.add("foo"); | |
| 1676 return o; | |
| 1677 } | |
| 1678 | |
| 1679 checkUnnamed655(core.List<core.String> o) { | |
| 1680 unittest.expect(o, unittest.hasLength(2)); | |
| 1681 unittest.expect(o[0], unittest.equals('foo')); | |
| 1682 unittest.expect(o[1], unittest.equals('foo')); | |
| 1683 } | |
| 1684 | |
| 1685 | |
| 1686 main() { | |
| 1687 unittest.group("obj-schema-Acl", () { | |
| 1688 unittest.test("to-json--from-json", () { | |
| 1689 var o = buildAcl(); | |
| 1690 var od = new api.Acl.fromJson(o.toJson()); | |
| 1691 checkAcl(od); | |
| 1692 }); | |
| 1693 }); | |
| 1694 | |
| 1695 | |
| 1696 unittest.group("obj-schema-ActivityActorImage", () { | |
| 1697 unittest.test("to-json--from-json", () { | |
| 1698 var o = buildActivityActorImage(); | |
| 1699 var od = new api.ActivityActorImage.fromJson(o.toJson()); | |
| 1700 checkActivityActorImage(od); | |
| 1701 }); | |
| 1702 }); | |
| 1703 | |
| 1704 | |
| 1705 unittest.group("obj-schema-ActivityActorName", () { | |
| 1706 unittest.test("to-json--from-json", () { | |
| 1707 var o = buildActivityActorName(); | |
| 1708 var od = new api.ActivityActorName.fromJson(o.toJson()); | |
| 1709 checkActivityActorName(od); | |
| 1710 }); | |
| 1711 }); | |
| 1712 | |
| 1713 | |
| 1714 unittest.group("obj-schema-ActivityActor", () { | |
| 1715 unittest.test("to-json--from-json", () { | |
| 1716 var o = buildActivityActor(); | |
| 1717 var od = new api.ActivityActor.fromJson(o.toJson()); | |
| 1718 checkActivityActor(od); | |
| 1719 }); | |
| 1720 }); | |
| 1721 | |
| 1722 | |
| 1723 unittest.group("obj-schema-ActivityObjectActorImage", () { | |
| 1724 unittest.test("to-json--from-json", () { | |
| 1725 var o = buildActivityObjectActorImage(); | |
| 1726 var od = new api.ActivityObjectActorImage.fromJson(o.toJson()); | |
| 1727 checkActivityObjectActorImage(od); | |
| 1728 }); | |
| 1729 }); | |
| 1730 | |
| 1731 | |
| 1732 unittest.group("obj-schema-ActivityObjectActor", () { | |
| 1733 unittest.test("to-json--from-json", () { | |
| 1734 var o = buildActivityObjectActor(); | |
| 1735 var od = new api.ActivityObjectActor.fromJson(o.toJson()); | |
| 1736 checkActivityObjectActor(od); | |
| 1737 }); | |
| 1738 }); | |
| 1739 | |
| 1740 | |
| 1741 unittest.group("obj-schema-ActivityObjectAttachmentsEmbed", () { | |
| 1742 unittest.test("to-json--from-json", () { | |
| 1743 var o = buildActivityObjectAttachmentsEmbed(); | |
| 1744 var od = new api.ActivityObjectAttachmentsEmbed.fromJson(o.toJson()); | |
| 1745 checkActivityObjectAttachmentsEmbed(od); | |
| 1746 }); | |
| 1747 }); | |
| 1748 | |
| 1749 | |
| 1750 unittest.group("obj-schema-ActivityObjectAttachmentsFullImage", () { | |
| 1751 unittest.test("to-json--from-json", () { | |
| 1752 var o = buildActivityObjectAttachmentsFullImage(); | |
| 1753 var od = new api.ActivityObjectAttachmentsFullImage.fromJson(o.toJson()); | |
| 1754 checkActivityObjectAttachmentsFullImage(od); | |
| 1755 }); | |
| 1756 }); | |
| 1757 | |
| 1758 | |
| 1759 unittest.group("obj-schema-ActivityObjectAttachmentsImage", () { | |
| 1760 unittest.test("to-json--from-json", () { | |
| 1761 var o = buildActivityObjectAttachmentsImage(); | |
| 1762 var od = new api.ActivityObjectAttachmentsImage.fromJson(o.toJson()); | |
| 1763 checkActivityObjectAttachmentsImage(od); | |
| 1764 }); | |
| 1765 }); | |
| 1766 | |
| 1767 | |
| 1768 unittest.group("obj-schema-ActivityObjectAttachmentsPreviewThumbnails", () { | |
| 1769 unittest.test("to-json--from-json", () { | |
| 1770 var o = buildActivityObjectAttachmentsPreviewThumbnails(); | |
| 1771 var od = new api.ActivityObjectAttachmentsPreviewThumbnails.fromJson(o.toJ
son()); | |
| 1772 checkActivityObjectAttachmentsPreviewThumbnails(od); | |
| 1773 }); | |
| 1774 }); | |
| 1775 | |
| 1776 | |
| 1777 unittest.group("obj-schema-ActivityObjectAttachmentsThumbnailsImage", () { | |
| 1778 unittest.test("to-json--from-json", () { | |
| 1779 var o = buildActivityObjectAttachmentsThumbnailsImage(); | |
| 1780 var od = new api.ActivityObjectAttachmentsThumbnailsImage.fromJson(o.toJso
n()); | |
| 1781 checkActivityObjectAttachmentsThumbnailsImage(od); | |
| 1782 }); | |
| 1783 }); | |
| 1784 | |
| 1785 | |
| 1786 unittest.group("obj-schema-ActivityObjectAttachmentsThumbnails", () { | |
| 1787 unittest.test("to-json--from-json", () { | |
| 1788 var o = buildActivityObjectAttachmentsThumbnails(); | |
| 1789 var od = new api.ActivityObjectAttachmentsThumbnails.fromJson(o.toJson()); | |
| 1790 checkActivityObjectAttachmentsThumbnails(od); | |
| 1791 }); | |
| 1792 }); | |
| 1793 | |
| 1794 | |
| 1795 unittest.group("obj-schema-ActivityObjectAttachments", () { | |
| 1796 unittest.test("to-json--from-json", () { | |
| 1797 var o = buildActivityObjectAttachments(); | |
| 1798 var od = new api.ActivityObjectAttachments.fromJson(o.toJson()); | |
| 1799 checkActivityObjectAttachments(od); | |
| 1800 }); | |
| 1801 }); | |
| 1802 | |
| 1803 | |
| 1804 unittest.group("obj-schema-ActivityObjectPlusoners", () { | |
| 1805 unittest.test("to-json--from-json", () { | |
| 1806 var o = buildActivityObjectPlusoners(); | |
| 1807 var od = new api.ActivityObjectPlusoners.fromJson(o.toJson()); | |
| 1808 checkActivityObjectPlusoners(od); | |
| 1809 }); | |
| 1810 }); | |
| 1811 | |
| 1812 | |
| 1813 unittest.group("obj-schema-ActivityObjectReplies", () { | |
| 1814 unittest.test("to-json--from-json", () { | |
| 1815 var o = buildActivityObjectReplies(); | |
| 1816 var od = new api.ActivityObjectReplies.fromJson(o.toJson()); | |
| 1817 checkActivityObjectReplies(od); | |
| 1818 }); | |
| 1819 }); | |
| 1820 | |
| 1821 | |
| 1822 unittest.group("obj-schema-ActivityObjectResharers", () { | |
| 1823 unittest.test("to-json--from-json", () { | |
| 1824 var o = buildActivityObjectResharers(); | |
| 1825 var od = new api.ActivityObjectResharers.fromJson(o.toJson()); | |
| 1826 checkActivityObjectResharers(od); | |
| 1827 }); | |
| 1828 }); | |
| 1829 | |
| 1830 | |
| 1831 unittest.group("obj-schema-ActivityObjectStatusForViewer", () { | |
| 1832 unittest.test("to-json--from-json", () { | |
| 1833 var o = buildActivityObjectStatusForViewer(); | |
| 1834 var od = new api.ActivityObjectStatusForViewer.fromJson(o.toJson()); | |
| 1835 checkActivityObjectStatusForViewer(od); | |
| 1836 }); | |
| 1837 }); | |
| 1838 | |
| 1839 | |
| 1840 unittest.group("obj-schema-ActivityObject", () { | |
| 1841 unittest.test("to-json--from-json", () { | |
| 1842 var o = buildActivityObject(); | |
| 1843 var od = new api.ActivityObject.fromJson(o.toJson()); | |
| 1844 checkActivityObject(od); | |
| 1845 }); | |
| 1846 }); | |
| 1847 | |
| 1848 | |
| 1849 unittest.group("obj-schema-ActivityProvider", () { | |
| 1850 unittest.test("to-json--from-json", () { | |
| 1851 var o = buildActivityProvider(); | |
| 1852 var od = new api.ActivityProvider.fromJson(o.toJson()); | |
| 1853 checkActivityProvider(od); | |
| 1854 }); | |
| 1855 }); | |
| 1856 | |
| 1857 | |
| 1858 unittest.group("obj-schema-Activity", () { | |
| 1859 unittest.test("to-json--from-json", () { | |
| 1860 var o = buildActivity(); | |
| 1861 var od = new api.Activity.fromJson(o.toJson()); | |
| 1862 checkActivity(od); | |
| 1863 }); | |
| 1864 }); | |
| 1865 | |
| 1866 | |
| 1867 unittest.group("obj-schema-ActivityFeed", () { | |
| 1868 unittest.test("to-json--from-json", () { | |
| 1869 var o = buildActivityFeed(); | |
| 1870 var od = new api.ActivityFeed.fromJson(o.toJson()); | |
| 1871 checkActivityFeed(od); | |
| 1872 }); | |
| 1873 }); | |
| 1874 | |
| 1875 | |
| 1876 unittest.group("obj-schema-Audience", () { | |
| 1877 unittest.test("to-json--from-json", () { | |
| 1878 var o = buildAudience(); | |
| 1879 var od = new api.Audience.fromJson(o.toJson()); | |
| 1880 checkAudience(od); | |
| 1881 }); | |
| 1882 }); | |
| 1883 | |
| 1884 | |
| 1885 unittest.group("obj-schema-AudiencesFeed", () { | |
| 1886 unittest.test("to-json--from-json", () { | |
| 1887 var o = buildAudiencesFeed(); | |
| 1888 var od = new api.AudiencesFeed.fromJson(o.toJson()); | |
| 1889 checkAudiencesFeed(od); | |
| 1890 }); | |
| 1891 }); | |
| 1892 | |
| 1893 | |
| 1894 unittest.group("obj-schema-CirclePeople", () { | |
| 1895 unittest.test("to-json--from-json", () { | |
| 1896 var o = buildCirclePeople(); | |
| 1897 var od = new api.CirclePeople.fromJson(o.toJson()); | |
| 1898 checkCirclePeople(od); | |
| 1899 }); | |
| 1900 }); | |
| 1901 | |
| 1902 | |
| 1903 unittest.group("obj-schema-Circle", () { | |
| 1904 unittest.test("to-json--from-json", () { | |
| 1905 var o = buildCircle(); | |
| 1906 var od = new api.Circle.fromJson(o.toJson()); | |
| 1907 checkCircle(od); | |
| 1908 }); | |
| 1909 }); | |
| 1910 | |
| 1911 | |
| 1912 unittest.group("obj-schema-CircleFeed", () { | |
| 1913 unittest.test("to-json--from-json", () { | |
| 1914 var o = buildCircleFeed(); | |
| 1915 var od = new api.CircleFeed.fromJson(o.toJson()); | |
| 1916 checkCircleFeed(od); | |
| 1917 }); | |
| 1918 }); | |
| 1919 | |
| 1920 | |
| 1921 unittest.group("obj-schema-CommentActorImage", () { | |
| 1922 unittest.test("to-json--from-json", () { | |
| 1923 var o = buildCommentActorImage(); | |
| 1924 var od = new api.CommentActorImage.fromJson(o.toJson()); | |
| 1925 checkCommentActorImage(od); | |
| 1926 }); | |
| 1927 }); | |
| 1928 | |
| 1929 | |
| 1930 unittest.group("obj-schema-CommentActor", () { | |
| 1931 unittest.test("to-json--from-json", () { | |
| 1932 var o = buildCommentActor(); | |
| 1933 var od = new api.CommentActor.fromJson(o.toJson()); | |
| 1934 checkCommentActor(od); | |
| 1935 }); | |
| 1936 }); | |
| 1937 | |
| 1938 | |
| 1939 unittest.group("obj-schema-CommentInReplyTo", () { | |
| 1940 unittest.test("to-json--from-json", () { | |
| 1941 var o = buildCommentInReplyTo(); | |
| 1942 var od = new api.CommentInReplyTo.fromJson(o.toJson()); | |
| 1943 checkCommentInReplyTo(od); | |
| 1944 }); | |
| 1945 }); | |
| 1946 | |
| 1947 | |
| 1948 unittest.group("obj-schema-CommentObject", () { | |
| 1949 unittest.test("to-json--from-json", () { | |
| 1950 var o = buildCommentObject(); | |
| 1951 var od = new api.CommentObject.fromJson(o.toJson()); | |
| 1952 checkCommentObject(od); | |
| 1953 }); | |
| 1954 }); | |
| 1955 | |
| 1956 | |
| 1957 unittest.group("obj-schema-CommentPlusoners", () { | |
| 1958 unittest.test("to-json--from-json", () { | |
| 1959 var o = buildCommentPlusoners(); | |
| 1960 var od = new api.CommentPlusoners.fromJson(o.toJson()); | |
| 1961 checkCommentPlusoners(od); | |
| 1962 }); | |
| 1963 }); | |
| 1964 | |
| 1965 | |
| 1966 unittest.group("obj-schema-Comment", () { | |
| 1967 unittest.test("to-json--from-json", () { | |
| 1968 var o = buildComment(); | |
| 1969 var od = new api.Comment.fromJson(o.toJson()); | |
| 1970 checkComment(od); | |
| 1971 }); | |
| 1972 }); | |
| 1973 | |
| 1974 | |
| 1975 unittest.group("obj-schema-CommentFeed", () { | |
| 1976 unittest.test("to-json--from-json", () { | |
| 1977 var o = buildCommentFeed(); | |
| 1978 var od = new api.CommentFeed.fromJson(o.toJson()); | |
| 1979 checkCommentFeed(od); | |
| 1980 }); | |
| 1981 }); | |
| 1982 | |
| 1983 | |
| 1984 unittest.group("obj-schema-MediaAuthorImage", () { | |
| 1985 unittest.test("to-json--from-json", () { | |
| 1986 var o = buildMediaAuthorImage(); | |
| 1987 var od = new api.MediaAuthorImage.fromJson(o.toJson()); | |
| 1988 checkMediaAuthorImage(od); | |
| 1989 }); | |
| 1990 }); | |
| 1991 | |
| 1992 | |
| 1993 unittest.group("obj-schema-MediaAuthor", () { | |
| 1994 unittest.test("to-json--from-json", () { | |
| 1995 var o = buildMediaAuthor(); | |
| 1996 var od = new api.MediaAuthor.fromJson(o.toJson()); | |
| 1997 checkMediaAuthor(od); | |
| 1998 }); | |
| 1999 }); | |
| 2000 | |
| 2001 | |
| 2002 unittest.group("obj-schema-MediaExif", () { | |
| 2003 unittest.test("to-json--from-json", () { | |
| 2004 var o = buildMediaExif(); | |
| 2005 var od = new api.MediaExif.fromJson(o.toJson()); | |
| 2006 checkMediaExif(od); | |
| 2007 }); | |
| 2008 }); | |
| 2009 | |
| 2010 | |
| 2011 unittest.group("obj-schema-Media", () { | |
| 2012 unittest.test("to-json--from-json", () { | |
| 2013 var o = buildMedia(); | |
| 2014 var od = new api.Media.fromJson(o.toJson()); | |
| 2015 checkMedia(od); | |
| 2016 }); | |
| 2017 }); | |
| 2018 | |
| 2019 | |
| 2020 unittest.group("obj-schema-PeopleFeed", () { | |
| 2021 unittest.test("to-json--from-json", () { | |
| 2022 var o = buildPeopleFeed(); | |
| 2023 var od = new api.PeopleFeed.fromJson(o.toJson()); | |
| 2024 checkPeopleFeed(od); | |
| 2025 }); | |
| 2026 }); | |
| 2027 | |
| 2028 | |
| 2029 unittest.group("obj-schema-PersonCoverCoverInfo", () { | |
| 2030 unittest.test("to-json--from-json", () { | |
| 2031 var o = buildPersonCoverCoverInfo(); | |
| 2032 var od = new api.PersonCoverCoverInfo.fromJson(o.toJson()); | |
| 2033 checkPersonCoverCoverInfo(od); | |
| 2034 }); | |
| 2035 }); | |
| 2036 | |
| 2037 | |
| 2038 unittest.group("obj-schema-PersonCoverCoverPhoto", () { | |
| 2039 unittest.test("to-json--from-json", () { | |
| 2040 var o = buildPersonCoverCoverPhoto(); | |
| 2041 var od = new api.PersonCoverCoverPhoto.fromJson(o.toJson()); | |
| 2042 checkPersonCoverCoverPhoto(od); | |
| 2043 }); | |
| 2044 }); | |
| 2045 | |
| 2046 | |
| 2047 unittest.group("obj-schema-PersonCover", () { | |
| 2048 unittest.test("to-json--from-json", () { | |
| 2049 var o = buildPersonCover(); | |
| 2050 var od = new api.PersonCover.fromJson(o.toJson()); | |
| 2051 checkPersonCover(od); | |
| 2052 }); | |
| 2053 }); | |
| 2054 | |
| 2055 | |
| 2056 unittest.group("obj-schema-PersonEmails", () { | |
| 2057 unittest.test("to-json--from-json", () { | |
| 2058 var o = buildPersonEmails(); | |
| 2059 var od = new api.PersonEmails.fromJson(o.toJson()); | |
| 2060 checkPersonEmails(od); | |
| 2061 }); | |
| 2062 }); | |
| 2063 | |
| 2064 | |
| 2065 unittest.group("obj-schema-PersonImage", () { | |
| 2066 unittest.test("to-json--from-json", () { | |
| 2067 var o = buildPersonImage(); | |
| 2068 var od = new api.PersonImage.fromJson(o.toJson()); | |
| 2069 checkPersonImage(od); | |
| 2070 }); | |
| 2071 }); | |
| 2072 | |
| 2073 | |
| 2074 unittest.group("obj-schema-PersonName", () { | |
| 2075 unittest.test("to-json--from-json", () { | |
| 2076 var o = buildPersonName(); | |
| 2077 var od = new api.PersonName.fromJson(o.toJson()); | |
| 2078 checkPersonName(od); | |
| 2079 }); | |
| 2080 }); | |
| 2081 | |
| 2082 | |
| 2083 unittest.group("obj-schema-PersonOrganizations", () { | |
| 2084 unittest.test("to-json--from-json", () { | |
| 2085 var o = buildPersonOrganizations(); | |
| 2086 var od = new api.PersonOrganizations.fromJson(o.toJson()); | |
| 2087 checkPersonOrganizations(od); | |
| 2088 }); | |
| 2089 }); | |
| 2090 | |
| 2091 | |
| 2092 unittest.group("obj-schema-PersonPlacesLived", () { | |
| 2093 unittest.test("to-json--from-json", () { | |
| 2094 var o = buildPersonPlacesLived(); | |
| 2095 var od = new api.PersonPlacesLived.fromJson(o.toJson()); | |
| 2096 checkPersonPlacesLived(od); | |
| 2097 }); | |
| 2098 }); | |
| 2099 | |
| 2100 | |
| 2101 unittest.group("obj-schema-PersonUrls", () { | |
| 2102 unittest.test("to-json--from-json", () { | |
| 2103 var o = buildPersonUrls(); | |
| 2104 var od = new api.PersonUrls.fromJson(o.toJson()); | |
| 2105 checkPersonUrls(od); | |
| 2106 }); | |
| 2107 }); | |
| 2108 | |
| 2109 | |
| 2110 unittest.group("obj-schema-Person", () { | |
| 2111 unittest.test("to-json--from-json", () { | |
| 2112 var o = buildPerson(); | |
| 2113 var od = new api.Person.fromJson(o.toJson()); | |
| 2114 checkPerson(od); | |
| 2115 }); | |
| 2116 }); | |
| 2117 | |
| 2118 | |
| 2119 unittest.group("obj-schema-PlaceAddress", () { | |
| 2120 unittest.test("to-json--from-json", () { | |
| 2121 var o = buildPlaceAddress(); | |
| 2122 var od = new api.PlaceAddress.fromJson(o.toJson()); | |
| 2123 checkPlaceAddress(od); | |
| 2124 }); | |
| 2125 }); | |
| 2126 | |
| 2127 | |
| 2128 unittest.group("obj-schema-PlacePosition", () { | |
| 2129 unittest.test("to-json--from-json", () { | |
| 2130 var o = buildPlacePosition(); | |
| 2131 var od = new api.PlacePosition.fromJson(o.toJson()); | |
| 2132 checkPlacePosition(od); | |
| 2133 }); | |
| 2134 }); | |
| 2135 | |
| 2136 | |
| 2137 unittest.group("obj-schema-Place", () { | |
| 2138 unittest.test("to-json--from-json", () { | |
| 2139 var o = buildPlace(); | |
| 2140 var od = new api.Place.fromJson(o.toJson()); | |
| 2141 checkPlace(od); | |
| 2142 }); | |
| 2143 }); | |
| 2144 | |
| 2145 | |
| 2146 unittest.group("obj-schema-PlusDomainsAclentryResource", () { | |
| 2147 unittest.test("to-json--from-json", () { | |
| 2148 var o = buildPlusDomainsAclentryResource(); | |
| 2149 var od = new api.PlusDomainsAclentryResource.fromJson(o.toJson()); | |
| 2150 checkPlusDomainsAclentryResource(od); | |
| 2151 }); | |
| 2152 }); | |
| 2153 | |
| 2154 | |
| 2155 unittest.group("obj-schema-Videostream", () { | |
| 2156 unittest.test("to-json--from-json", () { | |
| 2157 var o = buildVideostream(); | |
| 2158 var od = new api.Videostream.fromJson(o.toJson()); | |
| 2159 checkVideostream(od); | |
| 2160 }); | |
| 2161 }); | |
| 2162 | |
| 2163 | |
| 2164 unittest.group("resource-ActivitiesResourceApi", () { | |
| 2165 unittest.test("method--get", () { | |
| 2166 | |
| 2167 var mock = new common_test.HttpServerMock(); | |
| 2168 api.ActivitiesResourceApi res = new api.PlusDomainsApi(mock).activities; | |
| 2169 var arg_activityId = "foo"; | |
| 2170 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2171 var path = (req.url).path; | |
| 2172 var pathOffset = 0; | |
| 2173 var index; | |
| 2174 var subPart; | |
| 2175 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2176 pathOffset += 16; | |
| 2177 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("activities/")); | |
| 2178 pathOffset += 11; | |
| 2179 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2180 pathOffset = path.length; | |
| 2181 unittest.expect(subPart, unittest.equals("$arg_activityId")); | |
| 2182 | |
| 2183 var query = (req.url).query; | |
| 2184 var queryOffset = 0; | |
| 2185 var queryMap = {}; | |
| 2186 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2187 parseBool(n) { | |
| 2188 if (n == "true") return true; | |
| 2189 if (n == "false") return false; | |
| 2190 if (n == null) return null; | |
| 2191 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2192 } | |
| 2193 if (query.length > 0) { | |
| 2194 for (var part in query.split("&")) { | |
| 2195 var keyvalue = part.split("="); | |
| 2196 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2197 } | |
| 2198 } | |
| 2199 | |
| 2200 | |
| 2201 var h = { | |
| 2202 "content-type" : "application/json; charset=utf-8", | |
| 2203 }; | |
| 2204 var resp = convert.JSON.encode(buildActivity()); | |
| 2205 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2206 }), true); | |
| 2207 res.get(arg_activityId).then(unittest.expectAsync(((api.Activity response)
{ | |
| 2208 checkActivity(response); | |
| 2209 }))); | |
| 2210 }); | |
| 2211 | |
| 2212 unittest.test("method--insert", () { | |
| 2213 | |
| 2214 var mock = new common_test.HttpServerMock(); | |
| 2215 api.ActivitiesResourceApi res = new api.PlusDomainsApi(mock).activities; | |
| 2216 var arg_request = buildActivity(); | |
| 2217 var arg_userId = "foo"; | |
| 2218 var arg_preview = true; | |
| 2219 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2220 var obj = new api.Activity.fromJson(json); | |
| 2221 checkActivity(obj); | |
| 2222 | |
| 2223 var path = (req.url).path; | |
| 2224 var pathOffset = 0; | |
| 2225 var index; | |
| 2226 var subPart; | |
| 2227 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2228 pathOffset += 16; | |
| 2229 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 2230 pathOffset += 7; | |
| 2231 index = path.indexOf("/activities", pathOffset); | |
| 2232 unittest.expect(index >= 0, unittest.isTrue); | |
| 2233 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2234 pathOffset = index; | |
| 2235 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 2236 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/activities")); | |
| 2237 pathOffset += 11; | |
| 2238 | |
| 2239 var query = (req.url).query; | |
| 2240 var queryOffset = 0; | |
| 2241 var queryMap = {}; | |
| 2242 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2243 parseBool(n) { | |
| 2244 if (n == "true") return true; | |
| 2245 if (n == "false") return false; | |
| 2246 if (n == null) return null; | |
| 2247 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2248 } | |
| 2249 if (query.length > 0) { | |
| 2250 for (var part in query.split("&")) { | |
| 2251 var keyvalue = part.split("="); | |
| 2252 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2253 } | |
| 2254 } | |
| 2255 unittest.expect(queryMap["preview"].first, unittest.equals("$arg_preview
")); | |
| 2256 | |
| 2257 | |
| 2258 var h = { | |
| 2259 "content-type" : "application/json; charset=utf-8", | |
| 2260 }; | |
| 2261 var resp = convert.JSON.encode(buildActivity()); | |
| 2262 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2263 }), true); | |
| 2264 res.insert(arg_request, arg_userId, preview: arg_preview).then(unittest.ex
pectAsync(((api.Activity response) { | |
| 2265 checkActivity(response); | |
| 2266 }))); | |
| 2267 }); | |
| 2268 | |
| 2269 unittest.test("method--list", () { | |
| 2270 | |
| 2271 var mock = new common_test.HttpServerMock(); | |
| 2272 api.ActivitiesResourceApi res = new api.PlusDomainsApi(mock).activities; | |
| 2273 var arg_userId = "foo"; | |
| 2274 var arg_collection = "foo"; | |
| 2275 var arg_maxResults = 42; | |
| 2276 var arg_pageToken = "foo"; | |
| 2277 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2278 var path = (req.url).path; | |
| 2279 var pathOffset = 0; | |
| 2280 var index; | |
| 2281 var subPart; | |
| 2282 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2283 pathOffset += 16; | |
| 2284 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 2285 pathOffset += 7; | |
| 2286 index = path.indexOf("/activities/", pathOffset); | |
| 2287 unittest.expect(index >= 0, unittest.isTrue); | |
| 2288 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2289 pathOffset = index; | |
| 2290 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 2291 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/activities/")); | |
| 2292 pathOffset += 12; | |
| 2293 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2294 pathOffset = path.length; | |
| 2295 unittest.expect(subPart, unittest.equals("$arg_collection")); | |
| 2296 | |
| 2297 var query = (req.url).query; | |
| 2298 var queryOffset = 0; | |
| 2299 var queryMap = {}; | |
| 2300 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2301 parseBool(n) { | |
| 2302 if (n == "true") return true; | |
| 2303 if (n == "false") return false; | |
| 2304 if (n == null) return null; | |
| 2305 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2306 } | |
| 2307 if (query.length > 0) { | |
| 2308 for (var part in query.split("&")) { | |
| 2309 var keyvalue = part.split("="); | |
| 2310 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2311 } | |
| 2312 } | |
| 2313 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 2314 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 2315 | |
| 2316 | |
| 2317 var h = { | |
| 2318 "content-type" : "application/json; charset=utf-8", | |
| 2319 }; | |
| 2320 var resp = convert.JSON.encode(buildActivityFeed()); | |
| 2321 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2322 }), true); | |
| 2323 res.list(arg_userId, arg_collection, maxResults: arg_maxResults, pageToken
: arg_pageToken).then(unittest.expectAsync(((api.ActivityFeed response) { | |
| 2324 checkActivityFeed(response); | |
| 2325 }))); | |
| 2326 }); | |
| 2327 | |
| 2328 }); | |
| 2329 | |
| 2330 | |
| 2331 unittest.group("resource-AudiencesResourceApi", () { | |
| 2332 unittest.test("method--list", () { | |
| 2333 | |
| 2334 var mock = new common_test.HttpServerMock(); | |
| 2335 api.AudiencesResourceApi res = new api.PlusDomainsApi(mock).audiences; | |
| 2336 var arg_userId = "foo"; | |
| 2337 var arg_maxResults = 42; | |
| 2338 var arg_pageToken = "foo"; | |
| 2339 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2340 var path = (req.url).path; | |
| 2341 var pathOffset = 0; | |
| 2342 var index; | |
| 2343 var subPart; | |
| 2344 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2345 pathOffset += 16; | |
| 2346 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 2347 pathOffset += 7; | |
| 2348 index = path.indexOf("/audiences", pathOffset); | |
| 2349 unittest.expect(index >= 0, unittest.isTrue); | |
| 2350 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2351 pathOffset = index; | |
| 2352 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 2353 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/audiences")); | |
| 2354 pathOffset += 10; | |
| 2355 | |
| 2356 var query = (req.url).query; | |
| 2357 var queryOffset = 0; | |
| 2358 var queryMap = {}; | |
| 2359 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2360 parseBool(n) { | |
| 2361 if (n == "true") return true; | |
| 2362 if (n == "false") return false; | |
| 2363 if (n == null) return null; | |
| 2364 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2365 } | |
| 2366 if (query.length > 0) { | |
| 2367 for (var part in query.split("&")) { | |
| 2368 var keyvalue = part.split("="); | |
| 2369 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2370 } | |
| 2371 } | |
| 2372 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 2373 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 2374 | |
| 2375 | |
| 2376 var h = { | |
| 2377 "content-type" : "application/json; charset=utf-8", | |
| 2378 }; | |
| 2379 var resp = convert.JSON.encode(buildAudiencesFeed()); | |
| 2380 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2381 }), true); | |
| 2382 res.list(arg_userId, maxResults: arg_maxResults, pageToken: arg_pageToken)
.then(unittest.expectAsync(((api.AudiencesFeed response) { | |
| 2383 checkAudiencesFeed(response); | |
| 2384 }))); | |
| 2385 }); | |
| 2386 | |
| 2387 }); | |
| 2388 | |
| 2389 | |
| 2390 unittest.group("resource-CirclesResourceApi", () { | |
| 2391 unittest.test("method--addPeople", () { | |
| 2392 | |
| 2393 var mock = new common_test.HttpServerMock(); | |
| 2394 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2395 var arg_circleId = "foo"; | |
| 2396 var arg_email = buildUnnamed652(); | |
| 2397 var arg_userId = buildUnnamed653(); | |
| 2398 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2399 var path = (req.url).path; | |
| 2400 var pathOffset = 0; | |
| 2401 var index; | |
| 2402 var subPart; | |
| 2403 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2404 pathOffset += 16; | |
| 2405 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 2406 pathOffset += 8; | |
| 2407 index = path.indexOf("/people", pathOffset); | |
| 2408 unittest.expect(index >= 0, unittest.isTrue); | |
| 2409 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2410 pathOffset = index; | |
| 2411 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 2412 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/people")); | |
| 2413 pathOffset += 7; | |
| 2414 | |
| 2415 var query = (req.url).query; | |
| 2416 var queryOffset = 0; | |
| 2417 var queryMap = {}; | |
| 2418 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2419 parseBool(n) { | |
| 2420 if (n == "true") return true; | |
| 2421 if (n == "false") return false; | |
| 2422 if (n == null) return null; | |
| 2423 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2424 } | |
| 2425 if (query.length > 0) { | |
| 2426 for (var part in query.split("&")) { | |
| 2427 var keyvalue = part.split("="); | |
| 2428 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2429 } | |
| 2430 } | |
| 2431 unittest.expect(queryMap["email"], unittest.equals(arg_email)); | |
| 2432 unittest.expect(queryMap["userId"], unittest.equals(arg_userId)); | |
| 2433 | |
| 2434 | |
| 2435 var h = { | |
| 2436 "content-type" : "application/json; charset=utf-8", | |
| 2437 }; | |
| 2438 var resp = convert.JSON.encode(buildCircle()); | |
| 2439 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2440 }), true); | |
| 2441 res.addPeople(arg_circleId, email: arg_email, userId: arg_userId).then(uni
ttest.expectAsync(((api.Circle response) { | |
| 2442 checkCircle(response); | |
| 2443 }))); | |
| 2444 }); | |
| 2445 | |
| 2446 unittest.test("method--get", () { | |
| 2447 | |
| 2448 var mock = new common_test.HttpServerMock(); | |
| 2449 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2450 var arg_circleId = "foo"; | |
| 2451 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2452 var path = (req.url).path; | |
| 2453 var pathOffset = 0; | |
| 2454 var index; | |
| 2455 var subPart; | |
| 2456 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2457 pathOffset += 16; | |
| 2458 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 2459 pathOffset += 8; | |
| 2460 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2461 pathOffset = path.length; | |
| 2462 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 2463 | |
| 2464 var query = (req.url).query; | |
| 2465 var queryOffset = 0; | |
| 2466 var queryMap = {}; | |
| 2467 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2468 parseBool(n) { | |
| 2469 if (n == "true") return true; | |
| 2470 if (n == "false") return false; | |
| 2471 if (n == null) return null; | |
| 2472 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2473 } | |
| 2474 if (query.length > 0) { | |
| 2475 for (var part in query.split("&")) { | |
| 2476 var keyvalue = part.split("="); | |
| 2477 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2478 } | |
| 2479 } | |
| 2480 | |
| 2481 | |
| 2482 var h = { | |
| 2483 "content-type" : "application/json; charset=utf-8", | |
| 2484 }; | |
| 2485 var resp = convert.JSON.encode(buildCircle()); | |
| 2486 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2487 }), true); | |
| 2488 res.get(arg_circleId).then(unittest.expectAsync(((api.Circle response) { | |
| 2489 checkCircle(response); | |
| 2490 }))); | |
| 2491 }); | |
| 2492 | |
| 2493 unittest.test("method--insert", () { | |
| 2494 | |
| 2495 var mock = new common_test.HttpServerMock(); | |
| 2496 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2497 var arg_request = buildCircle(); | |
| 2498 var arg_userId = "foo"; | |
| 2499 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2500 var obj = new api.Circle.fromJson(json); | |
| 2501 checkCircle(obj); | |
| 2502 | |
| 2503 var path = (req.url).path; | |
| 2504 var pathOffset = 0; | |
| 2505 var index; | |
| 2506 var subPart; | |
| 2507 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2508 pathOffset += 16; | |
| 2509 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 2510 pathOffset += 7; | |
| 2511 index = path.indexOf("/circles", pathOffset); | |
| 2512 unittest.expect(index >= 0, unittest.isTrue); | |
| 2513 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2514 pathOffset = index; | |
| 2515 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 2516 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/circles")); | |
| 2517 pathOffset += 8; | |
| 2518 | |
| 2519 var query = (req.url).query; | |
| 2520 var queryOffset = 0; | |
| 2521 var queryMap = {}; | |
| 2522 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2523 parseBool(n) { | |
| 2524 if (n == "true") return true; | |
| 2525 if (n == "false") return false; | |
| 2526 if (n == null) return null; | |
| 2527 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2528 } | |
| 2529 if (query.length > 0) { | |
| 2530 for (var part in query.split("&")) { | |
| 2531 var keyvalue = part.split("="); | |
| 2532 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2533 } | |
| 2534 } | |
| 2535 | |
| 2536 | |
| 2537 var h = { | |
| 2538 "content-type" : "application/json; charset=utf-8", | |
| 2539 }; | |
| 2540 var resp = convert.JSON.encode(buildCircle()); | |
| 2541 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2542 }), true); | |
| 2543 res.insert(arg_request, arg_userId).then(unittest.expectAsync(((api.Circle
response) { | |
| 2544 checkCircle(response); | |
| 2545 }))); | |
| 2546 }); | |
| 2547 | |
| 2548 unittest.test("method--list", () { | |
| 2549 | |
| 2550 var mock = new common_test.HttpServerMock(); | |
| 2551 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2552 var arg_userId = "foo"; | |
| 2553 var arg_maxResults = 42; | |
| 2554 var arg_pageToken = "foo"; | |
| 2555 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2556 var path = (req.url).path; | |
| 2557 var pathOffset = 0; | |
| 2558 var index; | |
| 2559 var subPart; | |
| 2560 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2561 pathOffset += 16; | |
| 2562 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 2563 pathOffset += 7; | |
| 2564 index = path.indexOf("/circles", pathOffset); | |
| 2565 unittest.expect(index >= 0, unittest.isTrue); | |
| 2566 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2567 pathOffset = index; | |
| 2568 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 2569 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/circles")); | |
| 2570 pathOffset += 8; | |
| 2571 | |
| 2572 var query = (req.url).query; | |
| 2573 var queryOffset = 0; | |
| 2574 var queryMap = {}; | |
| 2575 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2576 parseBool(n) { | |
| 2577 if (n == "true") return true; | |
| 2578 if (n == "false") return false; | |
| 2579 if (n == null) return null; | |
| 2580 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2581 } | |
| 2582 if (query.length > 0) { | |
| 2583 for (var part in query.split("&")) { | |
| 2584 var keyvalue = part.split("="); | |
| 2585 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2586 } | |
| 2587 } | |
| 2588 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 2589 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 2590 | |
| 2591 | |
| 2592 var h = { | |
| 2593 "content-type" : "application/json; charset=utf-8", | |
| 2594 }; | |
| 2595 var resp = convert.JSON.encode(buildCircleFeed()); | |
| 2596 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2597 }), true); | |
| 2598 res.list(arg_userId, maxResults: arg_maxResults, pageToken: arg_pageToken)
.then(unittest.expectAsync(((api.CircleFeed response) { | |
| 2599 checkCircleFeed(response); | |
| 2600 }))); | |
| 2601 }); | |
| 2602 | |
| 2603 unittest.test("method--patch", () { | |
| 2604 | |
| 2605 var mock = new common_test.HttpServerMock(); | |
| 2606 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2607 var arg_request = buildCircle(); | |
| 2608 var arg_circleId = "foo"; | |
| 2609 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2610 var obj = new api.Circle.fromJson(json); | |
| 2611 checkCircle(obj); | |
| 2612 | |
| 2613 var path = (req.url).path; | |
| 2614 var pathOffset = 0; | |
| 2615 var index; | |
| 2616 var subPart; | |
| 2617 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2618 pathOffset += 16; | |
| 2619 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 2620 pathOffset += 8; | |
| 2621 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2622 pathOffset = path.length; | |
| 2623 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 2624 | |
| 2625 var query = (req.url).query; | |
| 2626 var queryOffset = 0; | |
| 2627 var queryMap = {}; | |
| 2628 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2629 parseBool(n) { | |
| 2630 if (n == "true") return true; | |
| 2631 if (n == "false") return false; | |
| 2632 if (n == null) return null; | |
| 2633 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2634 } | |
| 2635 if (query.length > 0) { | |
| 2636 for (var part in query.split("&")) { | |
| 2637 var keyvalue = part.split("="); | |
| 2638 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2639 } | |
| 2640 } | |
| 2641 | |
| 2642 | |
| 2643 var h = { | |
| 2644 "content-type" : "application/json; charset=utf-8", | |
| 2645 }; | |
| 2646 var resp = convert.JSON.encode(buildCircle()); | |
| 2647 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2648 }), true); | |
| 2649 res.patch(arg_request, arg_circleId).then(unittest.expectAsync(((api.Circl
e response) { | |
| 2650 checkCircle(response); | |
| 2651 }))); | |
| 2652 }); | |
| 2653 | |
| 2654 unittest.test("method--remove", () { | |
| 2655 | |
| 2656 var mock = new common_test.HttpServerMock(); | |
| 2657 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2658 var arg_circleId = "foo"; | |
| 2659 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2660 var path = (req.url).path; | |
| 2661 var pathOffset = 0; | |
| 2662 var index; | |
| 2663 var subPart; | |
| 2664 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2665 pathOffset += 16; | |
| 2666 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 2667 pathOffset += 8; | |
| 2668 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2669 pathOffset = path.length; | |
| 2670 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 2671 | |
| 2672 var query = (req.url).query; | |
| 2673 var queryOffset = 0; | |
| 2674 var queryMap = {}; | |
| 2675 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2676 parseBool(n) { | |
| 2677 if (n == "true") return true; | |
| 2678 if (n == "false") return false; | |
| 2679 if (n == null) return null; | |
| 2680 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2681 } | |
| 2682 if (query.length > 0) { | |
| 2683 for (var part in query.split("&")) { | |
| 2684 var keyvalue = part.split("="); | |
| 2685 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2686 } | |
| 2687 } | |
| 2688 | |
| 2689 | |
| 2690 var h = { | |
| 2691 "content-type" : "application/json; charset=utf-8", | |
| 2692 }; | |
| 2693 var resp = ""; | |
| 2694 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2695 }), true); | |
| 2696 res.remove(arg_circleId).then(unittest.expectAsync((_) {})); | |
| 2697 }); | |
| 2698 | |
| 2699 unittest.test("method--removePeople", () { | |
| 2700 | |
| 2701 var mock = new common_test.HttpServerMock(); | |
| 2702 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2703 var arg_circleId = "foo"; | |
| 2704 var arg_email = buildUnnamed654(); | |
| 2705 var arg_userId = buildUnnamed655(); | |
| 2706 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2707 var path = (req.url).path; | |
| 2708 var pathOffset = 0; | |
| 2709 var index; | |
| 2710 var subPart; | |
| 2711 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2712 pathOffset += 16; | |
| 2713 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 2714 pathOffset += 8; | |
| 2715 index = path.indexOf("/people", pathOffset); | |
| 2716 unittest.expect(index >= 0, unittest.isTrue); | |
| 2717 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2718 pathOffset = index; | |
| 2719 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 2720 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/people")); | |
| 2721 pathOffset += 7; | |
| 2722 | |
| 2723 var query = (req.url).query; | |
| 2724 var queryOffset = 0; | |
| 2725 var queryMap = {}; | |
| 2726 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2727 parseBool(n) { | |
| 2728 if (n == "true") return true; | |
| 2729 if (n == "false") return false; | |
| 2730 if (n == null) return null; | |
| 2731 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2732 } | |
| 2733 if (query.length > 0) { | |
| 2734 for (var part in query.split("&")) { | |
| 2735 var keyvalue = part.split("="); | |
| 2736 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2737 } | |
| 2738 } | |
| 2739 unittest.expect(queryMap["email"], unittest.equals(arg_email)); | |
| 2740 unittest.expect(queryMap["userId"], unittest.equals(arg_userId)); | |
| 2741 | |
| 2742 | |
| 2743 var h = { | |
| 2744 "content-type" : "application/json; charset=utf-8", | |
| 2745 }; | |
| 2746 var resp = ""; | |
| 2747 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2748 }), true); | |
| 2749 res.removePeople(arg_circleId, email: arg_email, userId: arg_userId).then(
unittest.expectAsync((_) {})); | |
| 2750 }); | |
| 2751 | |
| 2752 unittest.test("method--update", () { | |
| 2753 | |
| 2754 var mock = new common_test.HttpServerMock(); | |
| 2755 api.CirclesResourceApi res = new api.PlusDomainsApi(mock).circles; | |
| 2756 var arg_request = buildCircle(); | |
| 2757 var arg_circleId = "foo"; | |
| 2758 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2759 var obj = new api.Circle.fromJson(json); | |
| 2760 checkCircle(obj); | |
| 2761 | |
| 2762 var path = (req.url).path; | |
| 2763 var pathOffset = 0; | |
| 2764 var index; | |
| 2765 var subPart; | |
| 2766 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2767 pathOffset += 16; | |
| 2768 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 2769 pathOffset += 8; | |
| 2770 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2771 pathOffset = path.length; | |
| 2772 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 2773 | |
| 2774 var query = (req.url).query; | |
| 2775 var queryOffset = 0; | |
| 2776 var queryMap = {}; | |
| 2777 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2778 parseBool(n) { | |
| 2779 if (n == "true") return true; | |
| 2780 if (n == "false") return false; | |
| 2781 if (n == null) return null; | |
| 2782 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2783 } | |
| 2784 if (query.length > 0) { | |
| 2785 for (var part in query.split("&")) { | |
| 2786 var keyvalue = part.split("="); | |
| 2787 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2788 } | |
| 2789 } | |
| 2790 | |
| 2791 | |
| 2792 var h = { | |
| 2793 "content-type" : "application/json; charset=utf-8", | |
| 2794 }; | |
| 2795 var resp = convert.JSON.encode(buildCircle()); | |
| 2796 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2797 }), true); | |
| 2798 res.update(arg_request, arg_circleId).then(unittest.expectAsync(((api.Circ
le response) { | |
| 2799 checkCircle(response); | |
| 2800 }))); | |
| 2801 }); | |
| 2802 | |
| 2803 }); | |
| 2804 | |
| 2805 | |
| 2806 unittest.group("resource-CommentsResourceApi", () { | |
| 2807 unittest.test("method--get", () { | |
| 2808 | |
| 2809 var mock = new common_test.HttpServerMock(); | |
| 2810 api.CommentsResourceApi res = new api.PlusDomainsApi(mock).comments; | |
| 2811 var arg_commentId = "foo"; | |
| 2812 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2813 var path = (req.url).path; | |
| 2814 var pathOffset = 0; | |
| 2815 var index; | |
| 2816 var subPart; | |
| 2817 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2818 pathOffset += 16; | |
| 2819 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("comments/")); | |
| 2820 pathOffset += 9; | |
| 2821 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2822 pathOffset = path.length; | |
| 2823 unittest.expect(subPart, unittest.equals("$arg_commentId")); | |
| 2824 | |
| 2825 var query = (req.url).query; | |
| 2826 var queryOffset = 0; | |
| 2827 var queryMap = {}; | |
| 2828 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2829 parseBool(n) { | |
| 2830 if (n == "true") return true; | |
| 2831 if (n == "false") return false; | |
| 2832 if (n == null) return null; | |
| 2833 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2834 } | |
| 2835 if (query.length > 0) { | |
| 2836 for (var part in query.split("&")) { | |
| 2837 var keyvalue = part.split("="); | |
| 2838 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2839 } | |
| 2840 } | |
| 2841 | |
| 2842 | |
| 2843 var h = { | |
| 2844 "content-type" : "application/json; charset=utf-8", | |
| 2845 }; | |
| 2846 var resp = convert.JSON.encode(buildComment()); | |
| 2847 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2848 }), true); | |
| 2849 res.get(arg_commentId).then(unittest.expectAsync(((api.Comment response) { | |
| 2850 checkComment(response); | |
| 2851 }))); | |
| 2852 }); | |
| 2853 | |
| 2854 unittest.test("method--insert", () { | |
| 2855 | |
| 2856 var mock = new common_test.HttpServerMock(); | |
| 2857 api.CommentsResourceApi res = new api.PlusDomainsApi(mock).comments; | |
| 2858 var arg_request = buildComment(); | |
| 2859 var arg_activityId = "foo"; | |
| 2860 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2861 var obj = new api.Comment.fromJson(json); | |
| 2862 checkComment(obj); | |
| 2863 | |
| 2864 var path = (req.url).path; | |
| 2865 var pathOffset = 0; | |
| 2866 var index; | |
| 2867 var subPart; | |
| 2868 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2869 pathOffset += 16; | |
| 2870 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("activities/")); | |
| 2871 pathOffset += 11; | |
| 2872 index = path.indexOf("/comments", pathOffset); | |
| 2873 unittest.expect(index >= 0, unittest.isTrue); | |
| 2874 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2875 pathOffset = index; | |
| 2876 unittest.expect(subPart, unittest.equals("$arg_activityId")); | |
| 2877 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/comments")); | |
| 2878 pathOffset += 9; | |
| 2879 | |
| 2880 var query = (req.url).query; | |
| 2881 var queryOffset = 0; | |
| 2882 var queryMap = {}; | |
| 2883 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2884 parseBool(n) { | |
| 2885 if (n == "true") return true; | |
| 2886 if (n == "false") return false; | |
| 2887 if (n == null) return null; | |
| 2888 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2889 } | |
| 2890 if (query.length > 0) { | |
| 2891 for (var part in query.split("&")) { | |
| 2892 var keyvalue = part.split("="); | |
| 2893 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2894 } | |
| 2895 } | |
| 2896 | |
| 2897 | |
| 2898 var h = { | |
| 2899 "content-type" : "application/json; charset=utf-8", | |
| 2900 }; | |
| 2901 var resp = convert.JSON.encode(buildComment()); | |
| 2902 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2903 }), true); | |
| 2904 res.insert(arg_request, arg_activityId).then(unittest.expectAsync(((api.Co
mment response) { | |
| 2905 checkComment(response); | |
| 2906 }))); | |
| 2907 }); | |
| 2908 | |
| 2909 unittest.test("method--list", () { | |
| 2910 | |
| 2911 var mock = new common_test.HttpServerMock(); | |
| 2912 api.CommentsResourceApi res = new api.PlusDomainsApi(mock).comments; | |
| 2913 var arg_activityId = "foo"; | |
| 2914 var arg_maxResults = 42; | |
| 2915 var arg_pageToken = "foo"; | |
| 2916 var arg_sortOrder = "foo"; | |
| 2917 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2918 var path = (req.url).path; | |
| 2919 var pathOffset = 0; | |
| 2920 var index; | |
| 2921 var subPart; | |
| 2922 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2923 pathOffset += 16; | |
| 2924 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("activities/")); | |
| 2925 pathOffset += 11; | |
| 2926 index = path.indexOf("/comments", pathOffset); | |
| 2927 unittest.expect(index >= 0, unittest.isTrue); | |
| 2928 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2929 pathOffset = index; | |
| 2930 unittest.expect(subPart, unittest.equals("$arg_activityId")); | |
| 2931 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/comments")); | |
| 2932 pathOffset += 9; | |
| 2933 | |
| 2934 var query = (req.url).query; | |
| 2935 var queryOffset = 0; | |
| 2936 var queryMap = {}; | |
| 2937 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 2938 parseBool(n) { | |
| 2939 if (n == "true") return true; | |
| 2940 if (n == "false") return false; | |
| 2941 if (n == null) return null; | |
| 2942 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 2943 } | |
| 2944 if (query.length > 0) { | |
| 2945 for (var part in query.split("&")) { | |
| 2946 var keyvalue = part.split("="); | |
| 2947 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 2948 } | |
| 2949 } | |
| 2950 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 2951 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 2952 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); | |
| 2953 | |
| 2954 | |
| 2955 var h = { | |
| 2956 "content-type" : "application/json; charset=utf-8", | |
| 2957 }; | |
| 2958 var resp = convert.JSON.encode(buildCommentFeed()); | |
| 2959 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 2960 }), true); | |
| 2961 res.list(arg_activityId, maxResults: arg_maxResults, pageToken: arg_pageTo
ken, sortOrder: arg_sortOrder).then(unittest.expectAsync(((api.CommentFeed respo
nse) { | |
| 2962 checkCommentFeed(response); | |
| 2963 }))); | |
| 2964 }); | |
| 2965 | |
| 2966 }); | |
| 2967 | |
| 2968 | |
| 2969 unittest.group("resource-MediaResourceApi", () { | |
| 2970 unittest.test("method--insert", () { | |
| 2971 // TODO: Implement tests for media upload; | |
| 2972 // TODO: Implement tests for media download; | |
| 2973 | |
| 2974 var mock = new common_test.HttpServerMock(); | |
| 2975 api.MediaResourceApi res = new api.PlusDomainsApi(mock).media; | |
| 2976 var arg_request = buildMedia(); | |
| 2977 var arg_userId = "foo"; | |
| 2978 var arg_collection = "foo"; | |
| 2979 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 2980 var obj = new api.Media.fromJson(json); | |
| 2981 checkMedia(obj); | |
| 2982 | |
| 2983 var path = (req.url).path; | |
| 2984 var pathOffset = 0; | |
| 2985 var index; | |
| 2986 var subPart; | |
| 2987 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 2988 pathOffset += 16; | |
| 2989 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 2990 pathOffset += 7; | |
| 2991 index = path.indexOf("/media/", pathOffset); | |
| 2992 unittest.expect(index >= 0, unittest.isTrue); | |
| 2993 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 2994 pathOffset = index; | |
| 2995 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 2996 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/media/")); | |
| 2997 pathOffset += 7; | |
| 2998 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 2999 pathOffset = path.length; | |
| 3000 unittest.expect(subPart, unittest.equals("$arg_collection")); | |
| 3001 | |
| 3002 var query = (req.url).query; | |
| 3003 var queryOffset = 0; | |
| 3004 var queryMap = {}; | |
| 3005 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 3006 parseBool(n) { | |
| 3007 if (n == "true") return true; | |
| 3008 if (n == "false") return false; | |
| 3009 if (n == null) return null; | |
| 3010 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 3011 } | |
| 3012 if (query.length > 0) { | |
| 3013 for (var part in query.split("&")) { | |
| 3014 var keyvalue = part.split("="); | |
| 3015 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 3016 } | |
| 3017 } | |
| 3018 | |
| 3019 | |
| 3020 var h = { | |
| 3021 "content-type" : "application/json; charset=utf-8", | |
| 3022 }; | |
| 3023 var resp = convert.JSON.encode(buildMedia()); | |
| 3024 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 3025 }), true); | |
| 3026 res.insert(arg_request, arg_userId, arg_collection).then(unittest.expectAs
ync(((api.Media response) { | |
| 3027 checkMedia(response); | |
| 3028 }))); | |
| 3029 }); | |
| 3030 | |
| 3031 }); | |
| 3032 | |
| 3033 | |
| 3034 unittest.group("resource-PeopleResourceApi", () { | |
| 3035 unittest.test("method--get", () { | |
| 3036 | |
| 3037 var mock = new common_test.HttpServerMock(); | |
| 3038 api.PeopleResourceApi res = new api.PlusDomainsApi(mock).people; | |
| 3039 var arg_userId = "foo"; | |
| 3040 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 3041 var path = (req.url).path; | |
| 3042 var pathOffset = 0; | |
| 3043 var index; | |
| 3044 var subPart; | |
| 3045 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 3046 pathOffset += 16; | |
| 3047 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 3048 pathOffset += 7; | |
| 3049 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 3050 pathOffset = path.length; | |
| 3051 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 3052 | |
| 3053 var query = (req.url).query; | |
| 3054 var queryOffset = 0; | |
| 3055 var queryMap = {}; | |
| 3056 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 3057 parseBool(n) { | |
| 3058 if (n == "true") return true; | |
| 3059 if (n == "false") return false; | |
| 3060 if (n == null) return null; | |
| 3061 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 3062 } | |
| 3063 if (query.length > 0) { | |
| 3064 for (var part in query.split("&")) { | |
| 3065 var keyvalue = part.split("="); | |
| 3066 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 3067 } | |
| 3068 } | |
| 3069 | |
| 3070 | |
| 3071 var h = { | |
| 3072 "content-type" : "application/json; charset=utf-8", | |
| 3073 }; | |
| 3074 var resp = convert.JSON.encode(buildPerson()); | |
| 3075 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 3076 }), true); | |
| 3077 res.get(arg_userId).then(unittest.expectAsync(((api.Person response) { | |
| 3078 checkPerson(response); | |
| 3079 }))); | |
| 3080 }); | |
| 3081 | |
| 3082 unittest.test("method--list", () { | |
| 3083 | |
| 3084 var mock = new common_test.HttpServerMock(); | |
| 3085 api.PeopleResourceApi res = new api.PlusDomainsApi(mock).people; | |
| 3086 var arg_userId = "foo"; | |
| 3087 var arg_collection = "foo"; | |
| 3088 var arg_maxResults = 42; | |
| 3089 var arg_orderBy = "foo"; | |
| 3090 var arg_pageToken = "foo"; | |
| 3091 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 3092 var path = (req.url).path; | |
| 3093 var pathOffset = 0; | |
| 3094 var index; | |
| 3095 var subPart; | |
| 3096 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 3097 pathOffset += 16; | |
| 3098 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("people/")); | |
| 3099 pathOffset += 7; | |
| 3100 index = path.indexOf("/people/", pathOffset); | |
| 3101 unittest.expect(index >= 0, unittest.isTrue); | |
| 3102 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 3103 pathOffset = index; | |
| 3104 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 3105 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/people/")); | |
| 3106 pathOffset += 8; | |
| 3107 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 3108 pathOffset = path.length; | |
| 3109 unittest.expect(subPart, unittest.equals("$arg_collection")); | |
| 3110 | |
| 3111 var query = (req.url).query; | |
| 3112 var queryOffset = 0; | |
| 3113 var queryMap = {}; | |
| 3114 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 3115 parseBool(n) { | |
| 3116 if (n == "true") return true; | |
| 3117 if (n == "false") return false; | |
| 3118 if (n == null) return null; | |
| 3119 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 3120 } | |
| 3121 if (query.length > 0) { | |
| 3122 for (var part in query.split("&")) { | |
| 3123 var keyvalue = part.split("="); | |
| 3124 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 3125 } | |
| 3126 } | |
| 3127 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 3128 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | |
| 3129 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 3130 | |
| 3131 | |
| 3132 var h = { | |
| 3133 "content-type" : "application/json; charset=utf-8", | |
| 3134 }; | |
| 3135 var resp = convert.JSON.encode(buildPeopleFeed()); | |
| 3136 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 3137 }), true); | |
| 3138 res.list(arg_userId, arg_collection, maxResults: arg_maxResults, orderBy:
arg_orderBy, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PeopleFee
d response) { | |
| 3139 checkPeopleFeed(response); | |
| 3140 }))); | |
| 3141 }); | |
| 3142 | |
| 3143 unittest.test("method--listByActivity", () { | |
| 3144 | |
| 3145 var mock = new common_test.HttpServerMock(); | |
| 3146 api.PeopleResourceApi res = new api.PlusDomainsApi(mock).people; | |
| 3147 var arg_activityId = "foo"; | |
| 3148 var arg_collection = "foo"; | |
| 3149 var arg_maxResults = 42; | |
| 3150 var arg_pageToken = "foo"; | |
| 3151 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 3152 var path = (req.url).path; | |
| 3153 var pathOffset = 0; | |
| 3154 var index; | |
| 3155 var subPart; | |
| 3156 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 3157 pathOffset += 16; | |
| 3158 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("activities/")); | |
| 3159 pathOffset += 11; | |
| 3160 index = path.indexOf("/people/", pathOffset); | |
| 3161 unittest.expect(index >= 0, unittest.isTrue); | |
| 3162 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 3163 pathOffset = index; | |
| 3164 unittest.expect(subPart, unittest.equals("$arg_activityId")); | |
| 3165 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/people/")); | |
| 3166 pathOffset += 8; | |
| 3167 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 3168 pathOffset = path.length; | |
| 3169 unittest.expect(subPart, unittest.equals("$arg_collection")); | |
| 3170 | |
| 3171 var query = (req.url).query; | |
| 3172 var queryOffset = 0; | |
| 3173 var queryMap = {}; | |
| 3174 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 3175 parseBool(n) { | |
| 3176 if (n == "true") return true; | |
| 3177 if (n == "false") return false; | |
| 3178 if (n == null) return null; | |
| 3179 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 3180 } | |
| 3181 if (query.length > 0) { | |
| 3182 for (var part in query.split("&")) { | |
| 3183 var keyvalue = part.split("="); | |
| 3184 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 3185 } | |
| 3186 } | |
| 3187 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 3188 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 3189 | |
| 3190 | |
| 3191 var h = { | |
| 3192 "content-type" : "application/json; charset=utf-8", | |
| 3193 }; | |
| 3194 var resp = convert.JSON.encode(buildPeopleFeed()); | |
| 3195 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 3196 }), true); | |
| 3197 res.listByActivity(arg_activityId, arg_collection, maxResults: arg_maxResu
lts, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PeopleFeed respon
se) { | |
| 3198 checkPeopleFeed(response); | |
| 3199 }))); | |
| 3200 }); | |
| 3201 | |
| 3202 unittest.test("method--listByCircle", () { | |
| 3203 | |
| 3204 var mock = new common_test.HttpServerMock(); | |
| 3205 api.PeopleResourceApi res = new api.PlusDomainsApi(mock).people; | |
| 3206 var arg_circleId = "foo"; | |
| 3207 var arg_maxResults = 42; | |
| 3208 var arg_pageToken = "foo"; | |
| 3209 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
| 3210 var path = (req.url).path; | |
| 3211 var pathOffset = 0; | |
| 3212 var index; | |
| 3213 var subPart; | |
| 3214 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/plusDomains/v1/")); | |
| 3215 pathOffset += 16; | |
| 3216 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("circles/")); | |
| 3217 pathOffset += 8; | |
| 3218 index = path.indexOf("/people", pathOffset); | |
| 3219 unittest.expect(index >= 0, unittest.isTrue); | |
| 3220 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 3221 pathOffset = index; | |
| 3222 unittest.expect(subPart, unittest.equals("$arg_circleId")); | |
| 3223 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/people")); | |
| 3224 pathOffset += 7; | |
| 3225 | |
| 3226 var query = (req.url).query; | |
| 3227 var queryOffset = 0; | |
| 3228 var queryMap = {}; | |
| 3229 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
| 3230 parseBool(n) { | |
| 3231 if (n == "true") return true; | |
| 3232 if (n == "false") return false; | |
| 3233 if (n == null) return null; | |
| 3234 throw new core.ArgumentError("Invalid boolean: $n"); | |
| 3235 } | |
| 3236 if (query.length > 0) { | |
| 3237 for (var part in query.split("&")) { | |
| 3238 var keyvalue = part.split("="); | |
| 3239 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
| 3240 } | |
| 3241 } | |
| 3242 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
| 3243 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 3244 | |
| 3245 | |
| 3246 var h = { | |
| 3247 "content-type" : "application/json; charset=utf-8", | |
| 3248 }; | |
| 3249 var resp = convert.JSON.encode(buildPeopleFeed()); | |
| 3250 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
| 3251 }), true); | |
| 3252 res.listByCircle(arg_circleId, maxResults: arg_maxResults, pageToken: arg_
pageToken).then(unittest.expectAsync(((api.PeopleFeed response) { | |
| 3253 checkPeopleFeed(response); | |
| 3254 }))); | |
| 3255 }); | |
| 3256 | |
| 3257 }); | |
| 3258 | |
| 3259 | |
| 3260 } | |
| 3261 | |
| OLD | NEW |