Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1 | library googleapis.youtube.v3.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/youtube/v3.dart' as api; |
| 16 | |
| 17 | |
| 18 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 19 | buildUnnamed337() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 20 | var o = new core.List<core.String>(); |
| 21 | o.add("foo"); |
| 22 | o.add("foo"); |
| 23 | return o; |
| 24 | } |
| 25 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 26 | checkUnnamed337(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 27 | unittest.expect(o, unittest.hasLength(2)); |
| 28 | unittest.expect(o[0], unittest.equals('foo')); |
| 29 | unittest.expect(o[1], unittest.equals('foo')); |
| 30 | } |
| 31 | |
| 32 | core.int buildCounterAccessPolicy = 0; |
| 33 | buildAccessPolicy() { |
| 34 | var o = new api.AccessPolicy(); |
| 35 | buildCounterAccessPolicy++; |
| 36 | if (buildCounterAccessPolicy < 3) { |
| 37 | o.allowed = true; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 38 | o.exception = buildUnnamed337(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 39 | } |
| 40 | buildCounterAccessPolicy--; |
| 41 | return o; |
| 42 | } |
| 43 | |
| 44 | checkAccessPolicy(api.AccessPolicy o) { |
| 45 | buildCounterAccessPolicy++; |
| 46 | if (buildCounterAccessPolicy < 3) { |
| 47 | unittest.expect(o.allowed, unittest.isTrue); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 48 | checkUnnamed337(o.exception); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 49 | } |
| 50 | buildCounterAccessPolicy--; |
| 51 | } |
| 52 | |
| 53 | core.int buildCounterActivity = 0; |
| 54 | buildActivity() { |
| 55 | var o = new api.Activity(); |
| 56 | buildCounterActivity++; |
| 57 | if (buildCounterActivity < 3) { |
| 58 | o.contentDetails = buildActivityContentDetails(); |
| 59 | o.etag = "foo"; |
| 60 | o.id = "foo"; |
| 61 | o.kind = "foo"; |
| 62 | o.snippet = buildActivitySnippet(); |
| 63 | } |
| 64 | buildCounterActivity--; |
| 65 | return o; |
| 66 | } |
| 67 | |
| 68 | checkActivity(api.Activity o) { |
| 69 | buildCounterActivity++; |
| 70 | if (buildCounterActivity < 3) { |
| 71 | checkActivityContentDetails(o.contentDetails); |
| 72 | unittest.expect(o.etag, unittest.equals('foo')); |
| 73 | unittest.expect(o.id, unittest.equals('foo')); |
| 74 | unittest.expect(o.kind, unittest.equals('foo')); |
| 75 | checkActivitySnippet(o.snippet); |
| 76 | } |
| 77 | buildCounterActivity--; |
| 78 | } |
| 79 | |
| 80 | core.int buildCounterActivityContentDetails = 0; |
| 81 | buildActivityContentDetails() { |
| 82 | var o = new api.ActivityContentDetails(); |
| 83 | buildCounterActivityContentDetails++; |
| 84 | if (buildCounterActivityContentDetails < 3) { |
| 85 | o.bulletin = buildActivityContentDetailsBulletin(); |
| 86 | o.channelItem = buildActivityContentDetailsChannelItem(); |
| 87 | o.comment = buildActivityContentDetailsComment(); |
| 88 | o.favorite = buildActivityContentDetailsFavorite(); |
| 89 | o.like = buildActivityContentDetailsLike(); |
| 90 | o.playlistItem = buildActivityContentDetailsPlaylistItem(); |
| 91 | o.promotedItem = buildActivityContentDetailsPromotedItem(); |
| 92 | o.recommendation = buildActivityContentDetailsRecommendation(); |
| 93 | o.social = buildActivityContentDetailsSocial(); |
| 94 | o.subscription = buildActivityContentDetailsSubscription(); |
| 95 | o.upload = buildActivityContentDetailsUpload(); |
| 96 | } |
| 97 | buildCounterActivityContentDetails--; |
| 98 | return o; |
| 99 | } |
| 100 | |
| 101 | checkActivityContentDetails(api.ActivityContentDetails o) { |
| 102 | buildCounterActivityContentDetails++; |
| 103 | if (buildCounterActivityContentDetails < 3) { |
| 104 | checkActivityContentDetailsBulletin(o.bulletin); |
| 105 | checkActivityContentDetailsChannelItem(o.channelItem); |
| 106 | checkActivityContentDetailsComment(o.comment); |
| 107 | checkActivityContentDetailsFavorite(o.favorite); |
| 108 | checkActivityContentDetailsLike(o.like); |
| 109 | checkActivityContentDetailsPlaylistItem(o.playlistItem); |
| 110 | checkActivityContentDetailsPromotedItem(o.promotedItem); |
| 111 | checkActivityContentDetailsRecommendation(o.recommendation); |
| 112 | checkActivityContentDetailsSocial(o.social); |
| 113 | checkActivityContentDetailsSubscription(o.subscription); |
| 114 | checkActivityContentDetailsUpload(o.upload); |
| 115 | } |
| 116 | buildCounterActivityContentDetails--; |
| 117 | } |
| 118 | |
| 119 | core.int buildCounterActivityContentDetailsBulletin = 0; |
| 120 | buildActivityContentDetailsBulletin() { |
| 121 | var o = new api.ActivityContentDetailsBulletin(); |
| 122 | buildCounterActivityContentDetailsBulletin++; |
| 123 | if (buildCounterActivityContentDetailsBulletin < 3) { |
| 124 | o.resourceId = buildResourceId(); |
| 125 | } |
| 126 | buildCounterActivityContentDetailsBulletin--; |
| 127 | return o; |
| 128 | } |
| 129 | |
| 130 | checkActivityContentDetailsBulletin(api.ActivityContentDetailsBulletin o) { |
| 131 | buildCounterActivityContentDetailsBulletin++; |
| 132 | if (buildCounterActivityContentDetailsBulletin < 3) { |
| 133 | checkResourceId(o.resourceId); |
| 134 | } |
| 135 | buildCounterActivityContentDetailsBulletin--; |
| 136 | } |
| 137 | |
| 138 | core.int buildCounterActivityContentDetailsChannelItem = 0; |
| 139 | buildActivityContentDetailsChannelItem() { |
| 140 | var o = new api.ActivityContentDetailsChannelItem(); |
| 141 | buildCounterActivityContentDetailsChannelItem++; |
| 142 | if (buildCounterActivityContentDetailsChannelItem < 3) { |
| 143 | o.resourceId = buildResourceId(); |
| 144 | } |
| 145 | buildCounterActivityContentDetailsChannelItem--; |
| 146 | return o; |
| 147 | } |
| 148 | |
| 149 | checkActivityContentDetailsChannelItem(api.ActivityContentDetailsChannelItem o) { |
| 150 | buildCounterActivityContentDetailsChannelItem++; |
| 151 | if (buildCounterActivityContentDetailsChannelItem < 3) { |
| 152 | checkResourceId(o.resourceId); |
| 153 | } |
| 154 | buildCounterActivityContentDetailsChannelItem--; |
| 155 | } |
| 156 | |
| 157 | core.int buildCounterActivityContentDetailsComment = 0; |
| 158 | buildActivityContentDetailsComment() { |
| 159 | var o = new api.ActivityContentDetailsComment(); |
| 160 | buildCounterActivityContentDetailsComment++; |
| 161 | if (buildCounterActivityContentDetailsComment < 3) { |
| 162 | o.resourceId = buildResourceId(); |
| 163 | } |
| 164 | buildCounterActivityContentDetailsComment--; |
| 165 | return o; |
| 166 | } |
| 167 | |
| 168 | checkActivityContentDetailsComment(api.ActivityContentDetailsComment o) { |
| 169 | buildCounterActivityContentDetailsComment++; |
| 170 | if (buildCounterActivityContentDetailsComment < 3) { |
| 171 | checkResourceId(o.resourceId); |
| 172 | } |
| 173 | buildCounterActivityContentDetailsComment--; |
| 174 | } |
| 175 | |
| 176 | core.int buildCounterActivityContentDetailsFavorite = 0; |
| 177 | buildActivityContentDetailsFavorite() { |
| 178 | var o = new api.ActivityContentDetailsFavorite(); |
| 179 | buildCounterActivityContentDetailsFavorite++; |
| 180 | if (buildCounterActivityContentDetailsFavorite < 3) { |
| 181 | o.resourceId = buildResourceId(); |
| 182 | } |
| 183 | buildCounterActivityContentDetailsFavorite--; |
| 184 | return o; |
| 185 | } |
| 186 | |
| 187 | checkActivityContentDetailsFavorite(api.ActivityContentDetailsFavorite o) { |
| 188 | buildCounterActivityContentDetailsFavorite++; |
| 189 | if (buildCounterActivityContentDetailsFavorite < 3) { |
| 190 | checkResourceId(o.resourceId); |
| 191 | } |
| 192 | buildCounterActivityContentDetailsFavorite--; |
| 193 | } |
| 194 | |
| 195 | core.int buildCounterActivityContentDetailsLike = 0; |
| 196 | buildActivityContentDetailsLike() { |
| 197 | var o = new api.ActivityContentDetailsLike(); |
| 198 | buildCounterActivityContentDetailsLike++; |
| 199 | if (buildCounterActivityContentDetailsLike < 3) { |
| 200 | o.resourceId = buildResourceId(); |
| 201 | } |
| 202 | buildCounterActivityContentDetailsLike--; |
| 203 | return o; |
| 204 | } |
| 205 | |
| 206 | checkActivityContentDetailsLike(api.ActivityContentDetailsLike o) { |
| 207 | buildCounterActivityContentDetailsLike++; |
| 208 | if (buildCounterActivityContentDetailsLike < 3) { |
| 209 | checkResourceId(o.resourceId); |
| 210 | } |
| 211 | buildCounterActivityContentDetailsLike--; |
| 212 | } |
| 213 | |
| 214 | core.int buildCounterActivityContentDetailsPlaylistItem = 0; |
| 215 | buildActivityContentDetailsPlaylistItem() { |
| 216 | var o = new api.ActivityContentDetailsPlaylistItem(); |
| 217 | buildCounterActivityContentDetailsPlaylistItem++; |
| 218 | if (buildCounterActivityContentDetailsPlaylistItem < 3) { |
| 219 | o.playlistId = "foo"; |
| 220 | o.playlistItemId = "foo"; |
| 221 | o.resourceId = buildResourceId(); |
| 222 | } |
| 223 | buildCounterActivityContentDetailsPlaylistItem--; |
| 224 | return o; |
| 225 | } |
| 226 | |
| 227 | checkActivityContentDetailsPlaylistItem(api.ActivityContentDetailsPlaylistItem o) { |
| 228 | buildCounterActivityContentDetailsPlaylistItem++; |
| 229 | if (buildCounterActivityContentDetailsPlaylistItem < 3) { |
| 230 | unittest.expect(o.playlistId, unittest.equals('foo')); |
| 231 | unittest.expect(o.playlistItemId, unittest.equals('foo')); |
| 232 | checkResourceId(o.resourceId); |
| 233 | } |
| 234 | buildCounterActivityContentDetailsPlaylistItem--; |
| 235 | } |
| 236 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 237 | buildUnnamed338() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 238 | var o = new core.List<core.String>(); |
| 239 | o.add("foo"); |
| 240 | o.add("foo"); |
| 241 | return o; |
| 242 | } |
| 243 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 244 | checkUnnamed338(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 245 | unittest.expect(o, unittest.hasLength(2)); |
| 246 | unittest.expect(o[0], unittest.equals('foo')); |
| 247 | unittest.expect(o[1], unittest.equals('foo')); |
| 248 | } |
| 249 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 250 | buildUnnamed339() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 251 | var o = new core.List<core.String>(); |
| 252 | o.add("foo"); |
| 253 | o.add("foo"); |
| 254 | return o; |
| 255 | } |
| 256 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 257 | checkUnnamed339(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 258 | unittest.expect(o, unittest.hasLength(2)); |
| 259 | unittest.expect(o[0], unittest.equals('foo')); |
| 260 | unittest.expect(o[1], unittest.equals('foo')); |
| 261 | } |
| 262 | |
| 263 | core.int buildCounterActivityContentDetailsPromotedItem = 0; |
| 264 | buildActivityContentDetailsPromotedItem() { |
| 265 | var o = new api.ActivityContentDetailsPromotedItem(); |
| 266 | buildCounterActivityContentDetailsPromotedItem++; |
| 267 | if (buildCounterActivityContentDetailsPromotedItem < 3) { |
| 268 | o.adTag = "foo"; |
| 269 | o.clickTrackingUrl = "foo"; |
| 270 | o.creativeViewUrl = "foo"; |
| 271 | o.ctaType = "foo"; |
| 272 | o.customCtaButtonText = "foo"; |
| 273 | o.descriptionText = "foo"; |
| 274 | o.destinationUrl = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 275 | o.forecastingUrl = buildUnnamed338(); |
| 276 | o.impressionUrl = buildUnnamed339(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 277 | o.videoId = "foo"; |
| 278 | } |
| 279 | buildCounterActivityContentDetailsPromotedItem--; |
| 280 | return o; |
| 281 | } |
| 282 | |
| 283 | checkActivityContentDetailsPromotedItem(api.ActivityContentDetailsPromotedItem o) { |
| 284 | buildCounterActivityContentDetailsPromotedItem++; |
| 285 | if (buildCounterActivityContentDetailsPromotedItem < 3) { |
| 286 | unittest.expect(o.adTag, unittest.equals('foo')); |
| 287 | unittest.expect(o.clickTrackingUrl, unittest.equals('foo')); |
| 288 | unittest.expect(o.creativeViewUrl, unittest.equals('foo')); |
| 289 | unittest.expect(o.ctaType, unittest.equals('foo')); |
| 290 | unittest.expect(o.customCtaButtonText, unittest.equals('foo')); |
| 291 | unittest.expect(o.descriptionText, unittest.equals('foo')); |
| 292 | unittest.expect(o.destinationUrl, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 293 | checkUnnamed338(o.forecastingUrl); |
| 294 | checkUnnamed339(o.impressionUrl); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 295 | unittest.expect(o.videoId, unittest.equals('foo')); |
| 296 | } |
| 297 | buildCounterActivityContentDetailsPromotedItem--; |
| 298 | } |
| 299 | |
| 300 | core.int buildCounterActivityContentDetailsRecommendation = 0; |
| 301 | buildActivityContentDetailsRecommendation() { |
| 302 | var o = new api.ActivityContentDetailsRecommendation(); |
| 303 | buildCounterActivityContentDetailsRecommendation++; |
| 304 | if (buildCounterActivityContentDetailsRecommendation < 3) { |
| 305 | o.reason = "foo"; |
| 306 | o.resourceId = buildResourceId(); |
| 307 | o.seedResourceId = buildResourceId(); |
| 308 | } |
| 309 | buildCounterActivityContentDetailsRecommendation--; |
| 310 | return o; |
| 311 | } |
| 312 | |
| 313 | checkActivityContentDetailsRecommendation(api.ActivityContentDetailsRecommendation o) { |
| 314 | buildCounterActivityContentDetailsRecommendation++; |
| 315 | if (buildCounterActivityContentDetailsRecommendation < 3) { |
| 316 | unittest.expect(o.reason, unittest.equals('foo')); |
| 317 | checkResourceId(o.resourceId); |
| 318 | checkResourceId(o.seedResourceId); |
| 319 | } |
| 320 | buildCounterActivityContentDetailsRecommendation--; |
| 321 | } |
| 322 | |
| 323 | core.int buildCounterActivityContentDetailsSocial = 0; |
| 324 | buildActivityContentDetailsSocial() { |
| 325 | var o = new api.ActivityContentDetailsSocial(); |
| 326 | buildCounterActivityContentDetailsSocial++; |
| 327 | if (buildCounterActivityContentDetailsSocial < 3) { |
| 328 | o.author = "foo"; |
| 329 | o.imageUrl = "foo"; |
| 330 | o.referenceUrl = "foo"; |
| 331 | o.resourceId = buildResourceId(); |
| 332 | o.type = "foo"; |
| 333 | } |
| 334 | buildCounterActivityContentDetailsSocial--; |
| 335 | return o; |
| 336 | } |
| 337 | |
| 338 | checkActivityContentDetailsSocial(api.ActivityContentDetailsSocial o) { |
| 339 | buildCounterActivityContentDetailsSocial++; |
| 340 | if (buildCounterActivityContentDetailsSocial < 3) { |
| 341 | unittest.expect(o.author, unittest.equals('foo')); |
| 342 | unittest.expect(o.imageUrl, unittest.equals('foo')); |
| 343 | unittest.expect(o.referenceUrl, unittest.equals('foo')); |
| 344 | checkResourceId(o.resourceId); |
| 345 | unittest.expect(o.type, unittest.equals('foo')); |
| 346 | } |
| 347 | buildCounterActivityContentDetailsSocial--; |
| 348 | } |
| 349 | |
| 350 | core.int buildCounterActivityContentDetailsSubscription = 0; |
| 351 | buildActivityContentDetailsSubscription() { |
| 352 | var o = new api.ActivityContentDetailsSubscription(); |
| 353 | buildCounterActivityContentDetailsSubscription++; |
| 354 | if (buildCounterActivityContentDetailsSubscription < 3) { |
| 355 | o.resourceId = buildResourceId(); |
| 356 | } |
| 357 | buildCounterActivityContentDetailsSubscription--; |
| 358 | return o; |
| 359 | } |
| 360 | |
| 361 | checkActivityContentDetailsSubscription(api.ActivityContentDetailsSubscription o) { |
| 362 | buildCounterActivityContentDetailsSubscription++; |
| 363 | if (buildCounterActivityContentDetailsSubscription < 3) { |
| 364 | checkResourceId(o.resourceId); |
| 365 | } |
| 366 | buildCounterActivityContentDetailsSubscription--; |
| 367 | } |
| 368 | |
| 369 | core.int buildCounterActivityContentDetailsUpload = 0; |
| 370 | buildActivityContentDetailsUpload() { |
| 371 | var o = new api.ActivityContentDetailsUpload(); |
| 372 | buildCounterActivityContentDetailsUpload++; |
| 373 | if (buildCounterActivityContentDetailsUpload < 3) { |
| 374 | o.videoId = "foo"; |
| 375 | } |
| 376 | buildCounterActivityContentDetailsUpload--; |
| 377 | return o; |
| 378 | } |
| 379 | |
| 380 | checkActivityContentDetailsUpload(api.ActivityContentDetailsUpload o) { |
| 381 | buildCounterActivityContentDetailsUpload++; |
| 382 | if (buildCounterActivityContentDetailsUpload < 3) { |
| 383 | unittest.expect(o.videoId, unittest.equals('foo')); |
| 384 | } |
| 385 | buildCounterActivityContentDetailsUpload--; |
| 386 | } |
| 387 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 388 | buildUnnamed340() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 389 | var o = new core.List<api.Activity>(); |
| 390 | o.add(buildActivity()); |
| 391 | o.add(buildActivity()); |
| 392 | return o; |
| 393 | } |
| 394 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 395 | checkUnnamed340(core.List<api.Activity> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 396 | unittest.expect(o, unittest.hasLength(2)); |
| 397 | checkActivity(o[0]); |
| 398 | checkActivity(o[1]); |
| 399 | } |
| 400 | |
| 401 | core.int buildCounterActivityListResponse = 0; |
| 402 | buildActivityListResponse() { |
| 403 | var o = new api.ActivityListResponse(); |
| 404 | buildCounterActivityListResponse++; |
| 405 | if (buildCounterActivityListResponse < 3) { |
| 406 | o.etag = "foo"; |
| 407 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 408 | o.items = buildUnnamed340(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 409 | o.kind = "foo"; |
| 410 | o.nextPageToken = "foo"; |
| 411 | o.pageInfo = buildPageInfo(); |
| 412 | o.prevPageToken = "foo"; |
| 413 | o.tokenPagination = buildTokenPagination(); |
| 414 | o.visitorId = "foo"; |
| 415 | } |
| 416 | buildCounterActivityListResponse--; |
| 417 | return o; |
| 418 | } |
| 419 | |
| 420 | checkActivityListResponse(api.ActivityListResponse o) { |
| 421 | buildCounterActivityListResponse++; |
| 422 | if (buildCounterActivityListResponse < 3) { |
| 423 | unittest.expect(o.etag, unittest.equals('foo')); |
| 424 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 425 | checkUnnamed340(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 426 | unittest.expect(o.kind, unittest.equals('foo')); |
| 427 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 428 | checkPageInfo(o.pageInfo); |
| 429 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 430 | checkTokenPagination(o.tokenPagination); |
| 431 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 432 | } |
| 433 | buildCounterActivityListResponse--; |
| 434 | } |
| 435 | |
| 436 | core.int buildCounterActivitySnippet = 0; |
| 437 | buildActivitySnippet() { |
| 438 | var o = new api.ActivitySnippet(); |
| 439 | buildCounterActivitySnippet++; |
| 440 | if (buildCounterActivitySnippet < 3) { |
| 441 | o.channelId = "foo"; |
| 442 | o.channelTitle = "foo"; |
| 443 | o.description = "foo"; |
| 444 | o.groupId = "foo"; |
| 445 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 446 | o.thumbnails = buildThumbnailDetails(); |
| 447 | o.title = "foo"; |
| 448 | o.type = "foo"; |
| 449 | } |
| 450 | buildCounterActivitySnippet--; |
| 451 | return o; |
| 452 | } |
| 453 | |
| 454 | checkActivitySnippet(api.ActivitySnippet o) { |
| 455 | buildCounterActivitySnippet++; |
| 456 | if (buildCounterActivitySnippet < 3) { |
| 457 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 458 | unittest.expect(o.channelTitle, unittest.equals('foo')); |
| 459 | unittest.expect(o.description, unittest.equals('foo')); |
| 460 | unittest.expect(o.groupId, unittest.equals('foo')); |
| 461 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 462 | checkThumbnailDetails(o.thumbnails); |
| 463 | unittest.expect(o.title, unittest.equals('foo')); |
| 464 | unittest.expect(o.type, unittest.equals('foo')); |
| 465 | } |
| 466 | buildCounterActivitySnippet--; |
| 467 | } |
| 468 | |
| 469 | core.int buildCounterCdnSettings = 0; |
| 470 | buildCdnSettings() { |
| 471 | var o = new api.CdnSettings(); |
| 472 | buildCounterCdnSettings++; |
| 473 | if (buildCounterCdnSettings < 3) { |
| 474 | o.format = "foo"; |
| 475 | o.ingestionInfo = buildIngestionInfo(); |
| 476 | o.ingestionType = "foo"; |
| 477 | } |
| 478 | buildCounterCdnSettings--; |
| 479 | return o; |
| 480 | } |
| 481 | |
| 482 | checkCdnSettings(api.CdnSettings o) { |
| 483 | buildCounterCdnSettings++; |
| 484 | if (buildCounterCdnSettings < 3) { |
| 485 | unittest.expect(o.format, unittest.equals('foo')); |
| 486 | checkIngestionInfo(o.ingestionInfo); |
| 487 | unittest.expect(o.ingestionType, unittest.equals('foo')); |
| 488 | } |
| 489 | buildCounterCdnSettings--; |
| 490 | } |
| 491 | |
| 492 | core.int buildCounterChannel = 0; |
| 493 | buildChannel() { |
| 494 | var o = new api.Channel(); |
| 495 | buildCounterChannel++; |
| 496 | if (buildCounterChannel < 3) { |
| 497 | o.auditDetails = buildChannelAuditDetails(); |
| 498 | o.brandingSettings = buildChannelBrandingSettings(); |
| 499 | o.contentDetails = buildChannelContentDetails(); |
| 500 | o.contentOwnerDetails = buildChannelContentOwnerDetails(); |
| 501 | o.conversionPings = buildChannelConversionPings(); |
| 502 | o.etag = "foo"; |
| 503 | o.id = "foo"; |
| 504 | o.invideoPromotion = buildInvideoPromotion(); |
| 505 | o.kind = "foo"; |
| 506 | o.snippet = buildChannelSnippet(); |
| 507 | o.statistics = buildChannelStatistics(); |
| 508 | o.status = buildChannelStatus(); |
| 509 | o.topicDetails = buildChannelTopicDetails(); |
| 510 | } |
| 511 | buildCounterChannel--; |
| 512 | return o; |
| 513 | } |
| 514 | |
| 515 | checkChannel(api.Channel o) { |
| 516 | buildCounterChannel++; |
| 517 | if (buildCounterChannel < 3) { |
| 518 | checkChannelAuditDetails(o.auditDetails); |
| 519 | checkChannelBrandingSettings(o.brandingSettings); |
| 520 | checkChannelContentDetails(o.contentDetails); |
| 521 | checkChannelContentOwnerDetails(o.contentOwnerDetails); |
| 522 | checkChannelConversionPings(o.conversionPings); |
| 523 | unittest.expect(o.etag, unittest.equals('foo')); |
| 524 | unittest.expect(o.id, unittest.equals('foo')); |
| 525 | checkInvideoPromotion(o.invideoPromotion); |
| 526 | unittest.expect(o.kind, unittest.equals('foo')); |
| 527 | checkChannelSnippet(o.snippet); |
| 528 | checkChannelStatistics(o.statistics); |
| 529 | checkChannelStatus(o.status); |
| 530 | checkChannelTopicDetails(o.topicDetails); |
| 531 | } |
| 532 | buildCounterChannel--; |
| 533 | } |
| 534 | |
| 535 | core.int buildCounterChannelAuditDetails = 0; |
| 536 | buildChannelAuditDetails() { |
| 537 | var o = new api.ChannelAuditDetails(); |
| 538 | buildCounterChannelAuditDetails++; |
| 539 | if (buildCounterChannelAuditDetails < 3) { |
| 540 | o.communityGuidelinesGoodStanding = true; |
| 541 | o.contentIdClaimsGoodStanding = true; |
| 542 | o.copyrightStrikesGoodStanding = true; |
| 543 | o.overallGoodStanding = true; |
| 544 | } |
| 545 | buildCounterChannelAuditDetails--; |
| 546 | return o; |
| 547 | } |
| 548 | |
| 549 | checkChannelAuditDetails(api.ChannelAuditDetails o) { |
| 550 | buildCounterChannelAuditDetails++; |
| 551 | if (buildCounterChannelAuditDetails < 3) { |
| 552 | unittest.expect(o.communityGuidelinesGoodStanding, unittest.isTrue); |
| 553 | unittest.expect(o.contentIdClaimsGoodStanding, unittest.isTrue); |
| 554 | unittest.expect(o.copyrightStrikesGoodStanding, unittest.isTrue); |
| 555 | unittest.expect(o.overallGoodStanding, unittest.isTrue); |
| 556 | } |
| 557 | buildCounterChannelAuditDetails--; |
| 558 | } |
| 559 | |
| 560 | core.int buildCounterChannelBannerResource = 0; |
| 561 | buildChannelBannerResource() { |
| 562 | var o = new api.ChannelBannerResource(); |
| 563 | buildCounterChannelBannerResource++; |
| 564 | if (buildCounterChannelBannerResource < 3) { |
| 565 | o.etag = "foo"; |
| 566 | o.kind = "foo"; |
| 567 | o.url = "foo"; |
| 568 | } |
| 569 | buildCounterChannelBannerResource--; |
| 570 | return o; |
| 571 | } |
| 572 | |
| 573 | checkChannelBannerResource(api.ChannelBannerResource o) { |
| 574 | buildCounterChannelBannerResource++; |
| 575 | if (buildCounterChannelBannerResource < 3) { |
| 576 | unittest.expect(o.etag, unittest.equals('foo')); |
| 577 | unittest.expect(o.kind, unittest.equals('foo')); |
| 578 | unittest.expect(o.url, unittest.equals('foo')); |
| 579 | } |
| 580 | buildCounterChannelBannerResource--; |
| 581 | } |
| 582 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 583 | buildUnnamed341() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 584 | var o = new core.List<api.PropertyValue>(); |
| 585 | o.add(buildPropertyValue()); |
| 586 | o.add(buildPropertyValue()); |
| 587 | return o; |
| 588 | } |
| 589 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 590 | checkUnnamed341(core.List<api.PropertyValue> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 591 | unittest.expect(o, unittest.hasLength(2)); |
| 592 | checkPropertyValue(o[0]); |
| 593 | checkPropertyValue(o[1]); |
| 594 | } |
| 595 | |
| 596 | core.int buildCounterChannelBrandingSettings = 0; |
| 597 | buildChannelBrandingSettings() { |
| 598 | var o = new api.ChannelBrandingSettings(); |
| 599 | buildCounterChannelBrandingSettings++; |
| 600 | if (buildCounterChannelBrandingSettings < 3) { |
| 601 | o.channel = buildChannelSettings(); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 602 | o.hints = buildUnnamed341(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 603 | o.image = buildImageSettings(); |
| 604 | o.watch = buildWatchSettings(); |
| 605 | } |
| 606 | buildCounterChannelBrandingSettings--; |
| 607 | return o; |
| 608 | } |
| 609 | |
| 610 | checkChannelBrandingSettings(api.ChannelBrandingSettings o) { |
| 611 | buildCounterChannelBrandingSettings++; |
| 612 | if (buildCounterChannelBrandingSettings < 3) { |
| 613 | checkChannelSettings(o.channel); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 614 | checkUnnamed341(o.hints); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 615 | checkImageSettings(o.image); |
| 616 | checkWatchSettings(o.watch); |
| 617 | } |
| 618 | buildCounterChannelBrandingSettings--; |
| 619 | } |
| 620 | |
| 621 | core.int buildCounterChannelContentDetailsRelatedPlaylists = 0; |
| 622 | buildChannelContentDetailsRelatedPlaylists() { |
| 623 | var o = new api.ChannelContentDetailsRelatedPlaylists(); |
| 624 | buildCounterChannelContentDetailsRelatedPlaylists++; |
| 625 | if (buildCounterChannelContentDetailsRelatedPlaylists < 3) { |
| 626 | o.favorites = "foo"; |
| 627 | o.likes = "foo"; |
| 628 | o.uploads = "foo"; |
| 629 | o.watchHistory = "foo"; |
| 630 | o.watchLater = "foo"; |
| 631 | } |
| 632 | buildCounterChannelContentDetailsRelatedPlaylists--; |
| 633 | return o; |
| 634 | } |
| 635 | |
| 636 | checkChannelContentDetailsRelatedPlaylists(api.ChannelContentDetailsRelatedPlaylists o) { |
| 637 | buildCounterChannelContentDetailsRelatedPlaylists++; |
| 638 | if (buildCounterChannelContentDetailsRelatedPlaylists < 3) { |
| 639 | unittest.expect(o.favorites, unittest.equals('foo')); |
| 640 | unittest.expect(o.likes, unittest.equals('foo')); |
| 641 | unittest.expect(o.uploads, unittest.equals('foo')); |
| 642 | unittest.expect(o.watchHistory, unittest.equals('foo')); |
| 643 | unittest.expect(o.watchLater, unittest.equals('foo')); |
| 644 | } |
| 645 | buildCounterChannelContentDetailsRelatedPlaylists--; |
| 646 | } |
| 647 | |
| 648 | core.int buildCounterChannelContentDetails = 0; |
| 649 | buildChannelContentDetails() { |
| 650 | var o = new api.ChannelContentDetails(); |
| 651 | buildCounterChannelContentDetails++; |
| 652 | if (buildCounterChannelContentDetails < 3) { |
| 653 | o.googlePlusUserId = "foo"; |
| 654 | o.relatedPlaylists = buildChannelContentDetailsRelatedPlaylists(); |
| 655 | } |
| 656 | buildCounterChannelContentDetails--; |
| 657 | return o; |
| 658 | } |
| 659 | |
| 660 | checkChannelContentDetails(api.ChannelContentDetails o) { |
| 661 | buildCounterChannelContentDetails++; |
| 662 | if (buildCounterChannelContentDetails < 3) { |
| 663 | unittest.expect(o.googlePlusUserId, unittest.equals('foo')); |
| 664 | checkChannelContentDetailsRelatedPlaylists(o.relatedPlaylists); |
| 665 | } |
| 666 | buildCounterChannelContentDetails--; |
| 667 | } |
| 668 | |
| 669 | core.int buildCounterChannelContentOwnerDetails = 0; |
| 670 | buildChannelContentOwnerDetails() { |
| 671 | var o = new api.ChannelContentOwnerDetails(); |
| 672 | buildCounterChannelContentOwnerDetails++; |
| 673 | if (buildCounterChannelContentOwnerDetails < 3) { |
| 674 | o.contentOwner = "foo"; |
| 675 | o.timeLinked = core.DateTime.parse("2002-02-27T14:01:02"); |
| 676 | } |
| 677 | buildCounterChannelContentOwnerDetails--; |
| 678 | return o; |
| 679 | } |
| 680 | |
| 681 | checkChannelContentOwnerDetails(api.ChannelContentOwnerDetails o) { |
| 682 | buildCounterChannelContentOwnerDetails++; |
| 683 | if (buildCounterChannelContentOwnerDetails < 3) { |
| 684 | unittest.expect(o.contentOwner, unittest.equals('foo')); |
| 685 | unittest.expect(o.timeLinked, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 686 | } |
| 687 | buildCounterChannelContentOwnerDetails--; |
| 688 | } |
| 689 | |
| 690 | core.int buildCounterChannelConversionPing = 0; |
| 691 | buildChannelConversionPing() { |
| 692 | var o = new api.ChannelConversionPing(); |
| 693 | buildCounterChannelConversionPing++; |
| 694 | if (buildCounterChannelConversionPing < 3) { |
| 695 | o.context = "foo"; |
| 696 | o.conversionUrl = "foo"; |
| 697 | } |
| 698 | buildCounterChannelConversionPing--; |
| 699 | return o; |
| 700 | } |
| 701 | |
| 702 | checkChannelConversionPing(api.ChannelConversionPing o) { |
| 703 | buildCounterChannelConversionPing++; |
| 704 | if (buildCounterChannelConversionPing < 3) { |
| 705 | unittest.expect(o.context, unittest.equals('foo')); |
| 706 | unittest.expect(o.conversionUrl, unittest.equals('foo')); |
| 707 | } |
| 708 | buildCounterChannelConversionPing--; |
| 709 | } |
| 710 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 711 | buildUnnamed342() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 712 | var o = new core.List<api.ChannelConversionPing>(); |
| 713 | o.add(buildChannelConversionPing()); |
| 714 | o.add(buildChannelConversionPing()); |
| 715 | return o; |
| 716 | } |
| 717 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 718 | checkUnnamed342(core.List<api.ChannelConversionPing> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 719 | unittest.expect(o, unittest.hasLength(2)); |
| 720 | checkChannelConversionPing(o[0]); |
| 721 | checkChannelConversionPing(o[1]); |
| 722 | } |
| 723 | |
| 724 | core.int buildCounterChannelConversionPings = 0; |
| 725 | buildChannelConversionPings() { |
| 726 | var o = new api.ChannelConversionPings(); |
| 727 | buildCounterChannelConversionPings++; |
| 728 | if (buildCounterChannelConversionPings < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 729 | o.pings = buildUnnamed342(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 730 | } |
| 731 | buildCounterChannelConversionPings--; |
| 732 | return o; |
| 733 | } |
| 734 | |
| 735 | checkChannelConversionPings(api.ChannelConversionPings o) { |
| 736 | buildCounterChannelConversionPings++; |
| 737 | if (buildCounterChannelConversionPings < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 738 | checkUnnamed342(o.pings); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 739 | } |
| 740 | buildCounterChannelConversionPings--; |
| 741 | } |
| 742 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 743 | buildUnnamed343() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 744 | var o = new core.List<api.Channel>(); |
| 745 | o.add(buildChannel()); |
| 746 | o.add(buildChannel()); |
| 747 | return o; |
| 748 | } |
| 749 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 750 | checkUnnamed343(core.List<api.Channel> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 751 | unittest.expect(o, unittest.hasLength(2)); |
| 752 | checkChannel(o[0]); |
| 753 | checkChannel(o[1]); |
| 754 | } |
| 755 | |
| 756 | core.int buildCounterChannelListResponse = 0; |
| 757 | buildChannelListResponse() { |
| 758 | var o = new api.ChannelListResponse(); |
| 759 | buildCounterChannelListResponse++; |
| 760 | if (buildCounterChannelListResponse < 3) { |
| 761 | o.etag = "foo"; |
| 762 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 763 | o.items = buildUnnamed343(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 764 | o.kind = "foo"; |
| 765 | o.nextPageToken = "foo"; |
| 766 | o.pageInfo = buildPageInfo(); |
| 767 | o.prevPageToken = "foo"; |
| 768 | o.tokenPagination = buildTokenPagination(); |
| 769 | o.visitorId = "foo"; |
| 770 | } |
| 771 | buildCounterChannelListResponse--; |
| 772 | return o; |
| 773 | } |
| 774 | |
| 775 | checkChannelListResponse(api.ChannelListResponse o) { |
| 776 | buildCounterChannelListResponse++; |
| 777 | if (buildCounterChannelListResponse < 3) { |
| 778 | unittest.expect(o.etag, unittest.equals('foo')); |
| 779 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 780 | checkUnnamed343(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 781 | unittest.expect(o.kind, unittest.equals('foo')); |
| 782 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 783 | checkPageInfo(o.pageInfo); |
| 784 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 785 | checkTokenPagination(o.tokenPagination); |
| 786 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 787 | } |
| 788 | buildCounterChannelListResponse--; |
| 789 | } |
| 790 | |
| 791 | core.int buildCounterChannelSection = 0; |
| 792 | buildChannelSection() { |
| 793 | var o = new api.ChannelSection(); |
| 794 | buildCounterChannelSection++; |
| 795 | if (buildCounterChannelSection < 3) { |
| 796 | o.contentDetails = buildChannelSectionContentDetails(); |
| 797 | o.etag = "foo"; |
| 798 | o.id = "foo"; |
| 799 | o.kind = "foo"; |
| 800 | o.snippet = buildChannelSectionSnippet(); |
| 801 | } |
| 802 | buildCounterChannelSection--; |
| 803 | return o; |
| 804 | } |
| 805 | |
| 806 | checkChannelSection(api.ChannelSection o) { |
| 807 | buildCounterChannelSection++; |
| 808 | if (buildCounterChannelSection < 3) { |
| 809 | checkChannelSectionContentDetails(o.contentDetails); |
| 810 | unittest.expect(o.etag, unittest.equals('foo')); |
| 811 | unittest.expect(o.id, unittest.equals('foo')); |
| 812 | unittest.expect(o.kind, unittest.equals('foo')); |
| 813 | checkChannelSectionSnippet(o.snippet); |
| 814 | } |
| 815 | buildCounterChannelSection--; |
| 816 | } |
| 817 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 818 | buildUnnamed344() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 819 | var o = new core.List<core.String>(); |
| 820 | o.add("foo"); |
| 821 | o.add("foo"); |
| 822 | return o; |
| 823 | } |
| 824 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 825 | checkUnnamed344(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 826 | unittest.expect(o, unittest.hasLength(2)); |
| 827 | unittest.expect(o[0], unittest.equals('foo')); |
| 828 | unittest.expect(o[1], unittest.equals('foo')); |
| 829 | } |
| 830 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 831 | buildUnnamed345() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 832 | var o = new core.List<core.String>(); |
| 833 | o.add("foo"); |
| 834 | o.add("foo"); |
| 835 | return o; |
| 836 | } |
| 837 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 838 | checkUnnamed345(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 839 | unittest.expect(o, unittest.hasLength(2)); |
| 840 | unittest.expect(o[0], unittest.equals('foo')); |
| 841 | unittest.expect(o[1], unittest.equals('foo')); |
| 842 | } |
| 843 | |
| 844 | core.int buildCounterChannelSectionContentDetails = 0; |
| 845 | buildChannelSectionContentDetails() { |
| 846 | var o = new api.ChannelSectionContentDetails(); |
| 847 | buildCounterChannelSectionContentDetails++; |
| 848 | if (buildCounterChannelSectionContentDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 849 | o.channels = buildUnnamed344(); |
| 850 | o.playlists = buildUnnamed345(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 851 | } |
| 852 | buildCounterChannelSectionContentDetails--; |
| 853 | return o; |
| 854 | } |
| 855 | |
| 856 | checkChannelSectionContentDetails(api.ChannelSectionContentDetails o) { |
| 857 | buildCounterChannelSectionContentDetails++; |
| 858 | if (buildCounterChannelSectionContentDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 859 | checkUnnamed344(o.channels); |
| 860 | checkUnnamed345(o.playlists); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 861 | } |
| 862 | buildCounterChannelSectionContentDetails--; |
| 863 | } |
| 864 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 865 | buildUnnamed346() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 866 | var o = new core.List<api.ChannelSection>(); |
| 867 | o.add(buildChannelSection()); |
| 868 | o.add(buildChannelSection()); |
| 869 | return o; |
| 870 | } |
| 871 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 872 | checkUnnamed346(core.List<api.ChannelSection> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 873 | unittest.expect(o, unittest.hasLength(2)); |
| 874 | checkChannelSection(o[0]); |
| 875 | checkChannelSection(o[1]); |
| 876 | } |
| 877 | |
| 878 | core.int buildCounterChannelSectionListResponse = 0; |
| 879 | buildChannelSectionListResponse() { |
| 880 | var o = new api.ChannelSectionListResponse(); |
| 881 | buildCounterChannelSectionListResponse++; |
| 882 | if (buildCounterChannelSectionListResponse < 3) { |
| 883 | o.etag = "foo"; |
| 884 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 885 | o.items = buildUnnamed346(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 886 | o.kind = "foo"; |
| 887 | o.visitorId = "foo"; |
| 888 | } |
| 889 | buildCounterChannelSectionListResponse--; |
| 890 | return o; |
| 891 | } |
| 892 | |
| 893 | checkChannelSectionListResponse(api.ChannelSectionListResponse o) { |
| 894 | buildCounterChannelSectionListResponse++; |
| 895 | if (buildCounterChannelSectionListResponse < 3) { |
| 896 | unittest.expect(o.etag, unittest.equals('foo')); |
| 897 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 898 | checkUnnamed346(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 899 | unittest.expect(o.kind, unittest.equals('foo')); |
| 900 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 901 | } |
| 902 | buildCounterChannelSectionListResponse--; |
| 903 | } |
| 904 | |
| 905 | core.int buildCounterChannelSectionSnippet = 0; |
| 906 | buildChannelSectionSnippet() { |
| 907 | var o = new api.ChannelSectionSnippet(); |
| 908 | buildCounterChannelSectionSnippet++; |
| 909 | if (buildCounterChannelSectionSnippet < 3) { |
| 910 | o.channelId = "foo"; |
| 911 | o.position = 42; |
| 912 | o.style = "foo"; |
| 913 | o.title = "foo"; |
| 914 | o.type = "foo"; |
| 915 | } |
| 916 | buildCounterChannelSectionSnippet--; |
| 917 | return o; |
| 918 | } |
| 919 | |
| 920 | checkChannelSectionSnippet(api.ChannelSectionSnippet o) { |
| 921 | buildCounterChannelSectionSnippet++; |
| 922 | if (buildCounterChannelSectionSnippet < 3) { |
| 923 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 924 | unittest.expect(o.position, unittest.equals(42)); |
| 925 | unittest.expect(o.style, unittest.equals('foo')); |
| 926 | unittest.expect(o.title, unittest.equals('foo')); |
| 927 | unittest.expect(o.type, unittest.equals('foo')); |
| 928 | } |
| 929 | buildCounterChannelSectionSnippet--; |
| 930 | } |
| 931 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 932 | buildUnnamed347() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 933 | var o = new core.List<core.String>(); |
| 934 | o.add("foo"); |
| 935 | o.add("foo"); |
| 936 | return o; |
| 937 | } |
| 938 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 939 | checkUnnamed347(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 940 | unittest.expect(o, unittest.hasLength(2)); |
| 941 | unittest.expect(o[0], unittest.equals('foo')); |
| 942 | unittest.expect(o[1], unittest.equals('foo')); |
| 943 | } |
| 944 | |
| 945 | core.int buildCounterChannelSettings = 0; |
| 946 | buildChannelSettings() { |
| 947 | var o = new api.ChannelSettings(); |
| 948 | buildCounterChannelSettings++; |
| 949 | if (buildCounterChannelSettings < 3) { |
| 950 | o.defaultTab = "foo"; |
| 951 | o.description = "foo"; |
| 952 | o.featuredChannelsTitle = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 953 | o.featuredChannelsUrls = buildUnnamed347(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 954 | o.keywords = "foo"; |
| 955 | o.moderateComments = true; |
| 956 | o.profileColor = "foo"; |
| 957 | o.showBrowseView = true; |
| 958 | o.showRelatedChannels = true; |
| 959 | o.title = "foo"; |
| 960 | o.trackingAnalyticsAccountId = "foo"; |
| 961 | o.unsubscribedTrailer = "foo"; |
| 962 | } |
| 963 | buildCounterChannelSettings--; |
| 964 | return o; |
| 965 | } |
| 966 | |
| 967 | checkChannelSettings(api.ChannelSettings o) { |
| 968 | buildCounterChannelSettings++; |
| 969 | if (buildCounterChannelSettings < 3) { |
| 970 | unittest.expect(o.defaultTab, unittest.equals('foo')); |
| 971 | unittest.expect(o.description, unittest.equals('foo')); |
| 972 | unittest.expect(o.featuredChannelsTitle, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 973 | checkUnnamed347(o.featuredChannelsUrls); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 974 | unittest.expect(o.keywords, unittest.equals('foo')); |
| 975 | unittest.expect(o.moderateComments, unittest.isTrue); |
| 976 | unittest.expect(o.profileColor, unittest.equals('foo')); |
| 977 | unittest.expect(o.showBrowseView, unittest.isTrue); |
| 978 | unittest.expect(o.showRelatedChannels, unittest.isTrue); |
| 979 | unittest.expect(o.title, unittest.equals('foo')); |
| 980 | unittest.expect(o.trackingAnalyticsAccountId, unittest.equals('foo')); |
| 981 | unittest.expect(o.unsubscribedTrailer, unittest.equals('foo')); |
| 982 | } |
| 983 | buildCounterChannelSettings--; |
| 984 | } |
| 985 | |
| 986 | core.int buildCounterChannelSnippet = 0; |
| 987 | buildChannelSnippet() { |
| 988 | var o = new api.ChannelSnippet(); |
| 989 | buildCounterChannelSnippet++; |
| 990 | if (buildCounterChannelSnippet < 3) { |
| 991 | o.description = "foo"; |
| 992 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 993 | o.thumbnails = buildThumbnailDetails(); |
| 994 | o.title = "foo"; |
| 995 | } |
| 996 | buildCounterChannelSnippet--; |
| 997 | return o; |
| 998 | } |
| 999 | |
| 1000 | checkChannelSnippet(api.ChannelSnippet o) { |
| 1001 | buildCounterChannelSnippet++; |
| 1002 | if (buildCounterChannelSnippet < 3) { |
| 1003 | unittest.expect(o.description, unittest.equals('foo')); |
| 1004 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1005 | checkThumbnailDetails(o.thumbnails); |
| 1006 | unittest.expect(o.title, unittest.equals('foo')); |
| 1007 | } |
| 1008 | buildCounterChannelSnippet--; |
| 1009 | } |
| 1010 | |
| 1011 | core.int buildCounterChannelStatistics = 0; |
| 1012 | buildChannelStatistics() { |
| 1013 | var o = new api.ChannelStatistics(); |
| 1014 | buildCounterChannelStatistics++; |
| 1015 | if (buildCounterChannelStatistics < 3) { |
| 1016 | o.commentCount = "foo"; |
| 1017 | o.hiddenSubscriberCount = true; |
| 1018 | o.subscriberCount = "foo"; |
| 1019 | o.videoCount = "foo"; |
| 1020 | o.viewCount = "foo"; |
| 1021 | } |
| 1022 | buildCounterChannelStatistics--; |
| 1023 | return o; |
| 1024 | } |
| 1025 | |
| 1026 | checkChannelStatistics(api.ChannelStatistics o) { |
| 1027 | buildCounterChannelStatistics++; |
| 1028 | if (buildCounterChannelStatistics < 3) { |
| 1029 | unittest.expect(o.commentCount, unittest.equals('foo')); |
| 1030 | unittest.expect(o.hiddenSubscriberCount, unittest.isTrue); |
| 1031 | unittest.expect(o.subscriberCount, unittest.equals('foo')); |
| 1032 | unittest.expect(o.videoCount, unittest.equals('foo')); |
| 1033 | unittest.expect(o.viewCount, unittest.equals('foo')); |
| 1034 | } |
| 1035 | buildCounterChannelStatistics--; |
| 1036 | } |
| 1037 | |
| 1038 | core.int buildCounterChannelStatus = 0; |
| 1039 | buildChannelStatus() { |
| 1040 | var o = new api.ChannelStatus(); |
| 1041 | buildCounterChannelStatus++; |
| 1042 | if (buildCounterChannelStatus < 3) { |
| 1043 | o.isLinked = true; |
Søren Gjesse | a7d1bd0 | 2014-09-29 17:56:55 +0200 | [diff] [blame] | 1044 | o.longUploadsStatus = "foo"; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1045 | o.privacyStatus = "foo"; |
| 1046 | } |
| 1047 | buildCounterChannelStatus--; |
| 1048 | return o; |
| 1049 | } |
| 1050 | |
| 1051 | checkChannelStatus(api.ChannelStatus o) { |
| 1052 | buildCounterChannelStatus++; |
| 1053 | if (buildCounterChannelStatus < 3) { |
| 1054 | unittest.expect(o.isLinked, unittest.isTrue); |
Søren Gjesse | a7d1bd0 | 2014-09-29 17:56:55 +0200 | [diff] [blame] | 1055 | unittest.expect(o.longUploadsStatus, unittest.equals('foo')); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1056 | unittest.expect(o.privacyStatus, unittest.equals('foo')); |
| 1057 | } |
| 1058 | buildCounterChannelStatus--; |
| 1059 | } |
| 1060 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1061 | buildUnnamed348() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1062 | var o = new core.List<core.String>(); |
| 1063 | o.add("foo"); |
| 1064 | o.add("foo"); |
| 1065 | return o; |
| 1066 | } |
| 1067 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1068 | checkUnnamed348(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1069 | unittest.expect(o, unittest.hasLength(2)); |
| 1070 | unittest.expect(o[0], unittest.equals('foo')); |
| 1071 | unittest.expect(o[1], unittest.equals('foo')); |
| 1072 | } |
| 1073 | |
| 1074 | core.int buildCounterChannelTopicDetails = 0; |
| 1075 | buildChannelTopicDetails() { |
| 1076 | var o = new api.ChannelTopicDetails(); |
| 1077 | buildCounterChannelTopicDetails++; |
| 1078 | if (buildCounterChannelTopicDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1079 | o.topicIds = buildUnnamed348(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1080 | } |
| 1081 | buildCounterChannelTopicDetails--; |
| 1082 | return o; |
| 1083 | } |
| 1084 | |
| 1085 | checkChannelTopicDetails(api.ChannelTopicDetails o) { |
| 1086 | buildCounterChannelTopicDetails++; |
| 1087 | if (buildCounterChannelTopicDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1088 | checkUnnamed348(o.topicIds); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1089 | } |
| 1090 | buildCounterChannelTopicDetails--; |
| 1091 | } |
| 1092 | |
| 1093 | core.int buildCounterContentRating = 0; |
| 1094 | buildContentRating() { |
| 1095 | var o = new api.ContentRating(); |
| 1096 | buildCounterContentRating++; |
| 1097 | if (buildCounterContentRating < 3) { |
| 1098 | o.acbRating = "foo"; |
| 1099 | o.agcomRating = "foo"; |
| 1100 | o.anatelRating = "foo"; |
| 1101 | o.bbfcRating = "foo"; |
| 1102 | o.bfvcRating = "foo"; |
| 1103 | o.bmukkRating = "foo"; |
| 1104 | o.catvRating = "foo"; |
| 1105 | o.catvfrRating = "foo"; |
| 1106 | o.cbfcRating = "foo"; |
| 1107 | o.cccRating = "foo"; |
| 1108 | o.cceRating = "foo"; |
| 1109 | o.chfilmRating = "foo"; |
| 1110 | o.chvrsRating = "foo"; |
| 1111 | o.cicfRating = "foo"; |
| 1112 | o.cnaRating = "foo"; |
| 1113 | o.csaRating = "foo"; |
| 1114 | o.cscfRating = "foo"; |
| 1115 | o.czfilmRating = "foo"; |
| 1116 | o.djctqRating = "foo"; |
| 1117 | o.eefilmRating = "foo"; |
| 1118 | o.egfilmRating = "foo"; |
| 1119 | o.eirinRating = "foo"; |
| 1120 | o.fcbmRating = "foo"; |
| 1121 | o.fcoRating = "foo"; |
| 1122 | o.fmocRating = "foo"; |
| 1123 | o.fpbRating = "foo"; |
| 1124 | o.fskRating = "foo"; |
| 1125 | o.grfilmRating = "foo"; |
| 1126 | o.icaaRating = "foo"; |
| 1127 | o.ifcoRating = "foo"; |
| 1128 | o.ilfilmRating = "foo"; |
| 1129 | o.incaaRating = "foo"; |
| 1130 | o.kfcbRating = "foo"; |
| 1131 | o.kijkwijzerRating = "foo"; |
| 1132 | o.kmrbRating = "foo"; |
| 1133 | o.lsfRating = "foo"; |
| 1134 | o.mccaaRating = "foo"; |
| 1135 | o.mccypRating = "foo"; |
| 1136 | o.mdaRating = "foo"; |
| 1137 | o.medietilsynetRating = "foo"; |
| 1138 | o.mekuRating = "foo"; |
| 1139 | o.mibacRating = "foo"; |
| 1140 | o.mocRating = "foo"; |
| 1141 | o.moctwRating = "foo"; |
| 1142 | o.mpaaRating = "foo"; |
| 1143 | o.mtrcbRating = "foo"; |
| 1144 | o.nbcRating = "foo"; |
| 1145 | o.nbcplRating = "foo"; |
| 1146 | o.nfrcRating = "foo"; |
| 1147 | o.nfvcbRating = "foo"; |
| 1148 | o.nkclvRating = "foo"; |
| 1149 | o.oflcRating = "foo"; |
| 1150 | o.pefilmRating = "foo"; |
| 1151 | o.rcnofRating = "foo"; |
| 1152 | o.resorteviolenciaRating = "foo"; |
| 1153 | o.rtcRating = "foo"; |
| 1154 | o.rteRating = "foo"; |
| 1155 | o.russiaRating = "foo"; |
| 1156 | o.skfilmRating = "foo"; |
| 1157 | o.smaisRating = "foo"; |
| 1158 | o.smsaRating = "foo"; |
| 1159 | o.tvpgRating = "foo"; |
| 1160 | o.ytRating = "foo"; |
| 1161 | } |
| 1162 | buildCounterContentRating--; |
| 1163 | return o; |
| 1164 | } |
| 1165 | |
| 1166 | checkContentRating(api.ContentRating o) { |
| 1167 | buildCounterContentRating++; |
| 1168 | if (buildCounterContentRating < 3) { |
| 1169 | unittest.expect(o.acbRating, unittest.equals('foo')); |
| 1170 | unittest.expect(o.agcomRating, unittest.equals('foo')); |
| 1171 | unittest.expect(o.anatelRating, unittest.equals('foo')); |
| 1172 | unittest.expect(o.bbfcRating, unittest.equals('foo')); |
| 1173 | unittest.expect(o.bfvcRating, unittest.equals('foo')); |
| 1174 | unittest.expect(o.bmukkRating, unittest.equals('foo')); |
| 1175 | unittest.expect(o.catvRating, unittest.equals('foo')); |
| 1176 | unittest.expect(o.catvfrRating, unittest.equals('foo')); |
| 1177 | unittest.expect(o.cbfcRating, unittest.equals('foo')); |
| 1178 | unittest.expect(o.cccRating, unittest.equals('foo')); |
| 1179 | unittest.expect(o.cceRating, unittest.equals('foo')); |
| 1180 | unittest.expect(o.chfilmRating, unittest.equals('foo')); |
| 1181 | unittest.expect(o.chvrsRating, unittest.equals('foo')); |
| 1182 | unittest.expect(o.cicfRating, unittest.equals('foo')); |
| 1183 | unittest.expect(o.cnaRating, unittest.equals('foo')); |
| 1184 | unittest.expect(o.csaRating, unittest.equals('foo')); |
| 1185 | unittest.expect(o.cscfRating, unittest.equals('foo')); |
| 1186 | unittest.expect(o.czfilmRating, unittest.equals('foo')); |
| 1187 | unittest.expect(o.djctqRating, unittest.equals('foo')); |
| 1188 | unittest.expect(o.eefilmRating, unittest.equals('foo')); |
| 1189 | unittest.expect(o.egfilmRating, unittest.equals('foo')); |
| 1190 | unittest.expect(o.eirinRating, unittest.equals('foo')); |
| 1191 | unittest.expect(o.fcbmRating, unittest.equals('foo')); |
| 1192 | unittest.expect(o.fcoRating, unittest.equals('foo')); |
| 1193 | unittest.expect(o.fmocRating, unittest.equals('foo')); |
| 1194 | unittest.expect(o.fpbRating, unittest.equals('foo')); |
| 1195 | unittest.expect(o.fskRating, unittest.equals('foo')); |
| 1196 | unittest.expect(o.grfilmRating, unittest.equals('foo')); |
| 1197 | unittest.expect(o.icaaRating, unittest.equals('foo')); |
| 1198 | unittest.expect(o.ifcoRating, unittest.equals('foo')); |
| 1199 | unittest.expect(o.ilfilmRating, unittest.equals('foo')); |
| 1200 | unittest.expect(o.incaaRating, unittest.equals('foo')); |
| 1201 | unittest.expect(o.kfcbRating, unittest.equals('foo')); |
| 1202 | unittest.expect(o.kijkwijzerRating, unittest.equals('foo')); |
| 1203 | unittest.expect(o.kmrbRating, unittest.equals('foo')); |
| 1204 | unittest.expect(o.lsfRating, unittest.equals('foo')); |
| 1205 | unittest.expect(o.mccaaRating, unittest.equals('foo')); |
| 1206 | unittest.expect(o.mccypRating, unittest.equals('foo')); |
| 1207 | unittest.expect(o.mdaRating, unittest.equals('foo')); |
| 1208 | unittest.expect(o.medietilsynetRating, unittest.equals('foo')); |
| 1209 | unittest.expect(o.mekuRating, unittest.equals('foo')); |
| 1210 | unittest.expect(o.mibacRating, unittest.equals('foo')); |
| 1211 | unittest.expect(o.mocRating, unittest.equals('foo')); |
| 1212 | unittest.expect(o.moctwRating, unittest.equals('foo')); |
| 1213 | unittest.expect(o.mpaaRating, unittest.equals('foo')); |
| 1214 | unittest.expect(o.mtrcbRating, unittest.equals('foo')); |
| 1215 | unittest.expect(o.nbcRating, unittest.equals('foo')); |
| 1216 | unittest.expect(o.nbcplRating, unittest.equals('foo')); |
| 1217 | unittest.expect(o.nfrcRating, unittest.equals('foo')); |
| 1218 | unittest.expect(o.nfvcbRating, unittest.equals('foo')); |
| 1219 | unittest.expect(o.nkclvRating, unittest.equals('foo')); |
| 1220 | unittest.expect(o.oflcRating, unittest.equals('foo')); |
| 1221 | unittest.expect(o.pefilmRating, unittest.equals('foo')); |
| 1222 | unittest.expect(o.rcnofRating, unittest.equals('foo')); |
| 1223 | unittest.expect(o.resorteviolenciaRating, unittest.equals('foo')); |
| 1224 | unittest.expect(o.rtcRating, unittest.equals('foo')); |
| 1225 | unittest.expect(o.rteRating, unittest.equals('foo')); |
| 1226 | unittest.expect(o.russiaRating, unittest.equals('foo')); |
| 1227 | unittest.expect(o.skfilmRating, unittest.equals('foo')); |
| 1228 | unittest.expect(o.smaisRating, unittest.equals('foo')); |
| 1229 | unittest.expect(o.smsaRating, unittest.equals('foo')); |
| 1230 | unittest.expect(o.tvpgRating, unittest.equals('foo')); |
| 1231 | unittest.expect(o.ytRating, unittest.equals('foo')); |
| 1232 | } |
| 1233 | buildCounterContentRating--; |
| 1234 | } |
| 1235 | |
| 1236 | core.int buildCounterGeoPoint = 0; |
| 1237 | buildGeoPoint() { |
| 1238 | var o = new api.GeoPoint(); |
| 1239 | buildCounterGeoPoint++; |
| 1240 | if (buildCounterGeoPoint < 3) { |
| 1241 | o.altitude = 42.0; |
| 1242 | o.latitude = 42.0; |
| 1243 | o.longitude = 42.0; |
| 1244 | } |
| 1245 | buildCounterGeoPoint--; |
| 1246 | return o; |
| 1247 | } |
| 1248 | |
| 1249 | checkGeoPoint(api.GeoPoint o) { |
| 1250 | buildCounterGeoPoint++; |
| 1251 | if (buildCounterGeoPoint < 3) { |
| 1252 | unittest.expect(o.altitude, unittest.equals(42.0)); |
| 1253 | unittest.expect(o.latitude, unittest.equals(42.0)); |
| 1254 | unittest.expect(o.longitude, unittest.equals(42.0)); |
| 1255 | } |
| 1256 | buildCounterGeoPoint--; |
| 1257 | } |
| 1258 | |
| 1259 | core.int buildCounterGuideCategory = 0; |
| 1260 | buildGuideCategory() { |
| 1261 | var o = new api.GuideCategory(); |
| 1262 | buildCounterGuideCategory++; |
| 1263 | if (buildCounterGuideCategory < 3) { |
| 1264 | o.etag = "foo"; |
| 1265 | o.id = "foo"; |
| 1266 | o.kind = "foo"; |
| 1267 | o.snippet = buildGuideCategorySnippet(); |
| 1268 | } |
| 1269 | buildCounterGuideCategory--; |
| 1270 | return o; |
| 1271 | } |
| 1272 | |
| 1273 | checkGuideCategory(api.GuideCategory o) { |
| 1274 | buildCounterGuideCategory++; |
| 1275 | if (buildCounterGuideCategory < 3) { |
| 1276 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1277 | unittest.expect(o.id, unittest.equals('foo')); |
| 1278 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1279 | checkGuideCategorySnippet(o.snippet); |
| 1280 | } |
| 1281 | buildCounterGuideCategory--; |
| 1282 | } |
| 1283 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1284 | buildUnnamed349() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1285 | var o = new core.List<api.GuideCategory>(); |
| 1286 | o.add(buildGuideCategory()); |
| 1287 | o.add(buildGuideCategory()); |
| 1288 | return o; |
| 1289 | } |
| 1290 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1291 | checkUnnamed349(core.List<api.GuideCategory> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1292 | unittest.expect(o, unittest.hasLength(2)); |
| 1293 | checkGuideCategory(o[0]); |
| 1294 | checkGuideCategory(o[1]); |
| 1295 | } |
| 1296 | |
| 1297 | core.int buildCounterGuideCategoryListResponse = 0; |
| 1298 | buildGuideCategoryListResponse() { |
| 1299 | var o = new api.GuideCategoryListResponse(); |
| 1300 | buildCounterGuideCategoryListResponse++; |
| 1301 | if (buildCounterGuideCategoryListResponse < 3) { |
| 1302 | o.etag = "foo"; |
| 1303 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1304 | o.items = buildUnnamed349(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1305 | o.kind = "foo"; |
| 1306 | o.nextPageToken = "foo"; |
| 1307 | o.pageInfo = buildPageInfo(); |
| 1308 | o.prevPageToken = "foo"; |
| 1309 | o.tokenPagination = buildTokenPagination(); |
| 1310 | o.visitorId = "foo"; |
| 1311 | } |
| 1312 | buildCounterGuideCategoryListResponse--; |
| 1313 | return o; |
| 1314 | } |
| 1315 | |
| 1316 | checkGuideCategoryListResponse(api.GuideCategoryListResponse o) { |
| 1317 | buildCounterGuideCategoryListResponse++; |
| 1318 | if (buildCounterGuideCategoryListResponse < 3) { |
| 1319 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1320 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1321 | checkUnnamed349(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1322 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1323 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1324 | checkPageInfo(o.pageInfo); |
| 1325 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 1326 | checkTokenPagination(o.tokenPagination); |
| 1327 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 1328 | } |
| 1329 | buildCounterGuideCategoryListResponse--; |
| 1330 | } |
| 1331 | |
| 1332 | core.int buildCounterGuideCategorySnippet = 0; |
| 1333 | buildGuideCategorySnippet() { |
| 1334 | var o = new api.GuideCategorySnippet(); |
| 1335 | buildCounterGuideCategorySnippet++; |
| 1336 | if (buildCounterGuideCategorySnippet < 3) { |
| 1337 | o.channelId = "foo"; |
| 1338 | o.title = "foo"; |
| 1339 | } |
| 1340 | buildCounterGuideCategorySnippet--; |
| 1341 | return o; |
| 1342 | } |
| 1343 | |
| 1344 | checkGuideCategorySnippet(api.GuideCategorySnippet o) { |
| 1345 | buildCounterGuideCategorySnippet++; |
| 1346 | if (buildCounterGuideCategorySnippet < 3) { |
| 1347 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 1348 | unittest.expect(o.title, unittest.equals('foo')); |
| 1349 | } |
| 1350 | buildCounterGuideCategorySnippet--; |
| 1351 | } |
| 1352 | |
| 1353 | core.int buildCounterI18nLanguage = 0; |
| 1354 | buildI18nLanguage() { |
| 1355 | var o = new api.I18nLanguage(); |
| 1356 | buildCounterI18nLanguage++; |
| 1357 | if (buildCounterI18nLanguage < 3) { |
| 1358 | o.etag = "foo"; |
| 1359 | o.id = "foo"; |
| 1360 | o.kind = "foo"; |
| 1361 | o.snippet = buildI18nLanguageSnippet(); |
| 1362 | } |
| 1363 | buildCounterI18nLanguage--; |
| 1364 | return o; |
| 1365 | } |
| 1366 | |
| 1367 | checkI18nLanguage(api.I18nLanguage o) { |
| 1368 | buildCounterI18nLanguage++; |
| 1369 | if (buildCounterI18nLanguage < 3) { |
| 1370 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1371 | unittest.expect(o.id, unittest.equals('foo')); |
| 1372 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1373 | checkI18nLanguageSnippet(o.snippet); |
| 1374 | } |
| 1375 | buildCounterI18nLanguage--; |
| 1376 | } |
| 1377 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1378 | buildUnnamed350() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1379 | var o = new core.List<api.I18nLanguage>(); |
| 1380 | o.add(buildI18nLanguage()); |
| 1381 | o.add(buildI18nLanguage()); |
| 1382 | return o; |
| 1383 | } |
| 1384 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1385 | checkUnnamed350(core.List<api.I18nLanguage> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1386 | unittest.expect(o, unittest.hasLength(2)); |
| 1387 | checkI18nLanguage(o[0]); |
| 1388 | checkI18nLanguage(o[1]); |
| 1389 | } |
| 1390 | |
| 1391 | core.int buildCounterI18nLanguageListResponse = 0; |
| 1392 | buildI18nLanguageListResponse() { |
| 1393 | var o = new api.I18nLanguageListResponse(); |
| 1394 | buildCounterI18nLanguageListResponse++; |
| 1395 | if (buildCounterI18nLanguageListResponse < 3) { |
| 1396 | o.etag = "foo"; |
| 1397 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1398 | o.items = buildUnnamed350(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1399 | o.kind = "foo"; |
| 1400 | o.visitorId = "foo"; |
| 1401 | } |
| 1402 | buildCounterI18nLanguageListResponse--; |
| 1403 | return o; |
| 1404 | } |
| 1405 | |
| 1406 | checkI18nLanguageListResponse(api.I18nLanguageListResponse o) { |
| 1407 | buildCounterI18nLanguageListResponse++; |
| 1408 | if (buildCounterI18nLanguageListResponse < 3) { |
| 1409 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1410 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1411 | checkUnnamed350(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1412 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1413 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 1414 | } |
| 1415 | buildCounterI18nLanguageListResponse--; |
| 1416 | } |
| 1417 | |
| 1418 | core.int buildCounterI18nLanguageSnippet = 0; |
| 1419 | buildI18nLanguageSnippet() { |
| 1420 | var o = new api.I18nLanguageSnippet(); |
| 1421 | buildCounterI18nLanguageSnippet++; |
| 1422 | if (buildCounterI18nLanguageSnippet < 3) { |
| 1423 | o.hl = "foo"; |
| 1424 | o.name = "foo"; |
| 1425 | } |
| 1426 | buildCounterI18nLanguageSnippet--; |
| 1427 | return o; |
| 1428 | } |
| 1429 | |
| 1430 | checkI18nLanguageSnippet(api.I18nLanguageSnippet o) { |
| 1431 | buildCounterI18nLanguageSnippet++; |
| 1432 | if (buildCounterI18nLanguageSnippet < 3) { |
| 1433 | unittest.expect(o.hl, unittest.equals('foo')); |
| 1434 | unittest.expect(o.name, unittest.equals('foo')); |
| 1435 | } |
| 1436 | buildCounterI18nLanguageSnippet--; |
| 1437 | } |
| 1438 | |
| 1439 | core.int buildCounterI18nRegion = 0; |
| 1440 | buildI18nRegion() { |
| 1441 | var o = new api.I18nRegion(); |
| 1442 | buildCounterI18nRegion++; |
| 1443 | if (buildCounterI18nRegion < 3) { |
| 1444 | o.etag = "foo"; |
| 1445 | o.id = "foo"; |
| 1446 | o.kind = "foo"; |
| 1447 | o.snippet = buildI18nRegionSnippet(); |
| 1448 | } |
| 1449 | buildCounterI18nRegion--; |
| 1450 | return o; |
| 1451 | } |
| 1452 | |
| 1453 | checkI18nRegion(api.I18nRegion o) { |
| 1454 | buildCounterI18nRegion++; |
| 1455 | if (buildCounterI18nRegion < 3) { |
| 1456 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1457 | unittest.expect(o.id, unittest.equals('foo')); |
| 1458 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1459 | checkI18nRegionSnippet(o.snippet); |
| 1460 | } |
| 1461 | buildCounterI18nRegion--; |
| 1462 | } |
| 1463 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1464 | buildUnnamed351() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1465 | var o = new core.List<api.I18nRegion>(); |
| 1466 | o.add(buildI18nRegion()); |
| 1467 | o.add(buildI18nRegion()); |
| 1468 | return o; |
| 1469 | } |
| 1470 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1471 | checkUnnamed351(core.List<api.I18nRegion> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1472 | unittest.expect(o, unittest.hasLength(2)); |
| 1473 | checkI18nRegion(o[0]); |
| 1474 | checkI18nRegion(o[1]); |
| 1475 | } |
| 1476 | |
| 1477 | core.int buildCounterI18nRegionListResponse = 0; |
| 1478 | buildI18nRegionListResponse() { |
| 1479 | var o = new api.I18nRegionListResponse(); |
| 1480 | buildCounterI18nRegionListResponse++; |
| 1481 | if (buildCounterI18nRegionListResponse < 3) { |
| 1482 | o.etag = "foo"; |
| 1483 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1484 | o.items = buildUnnamed351(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1485 | o.kind = "foo"; |
| 1486 | o.visitorId = "foo"; |
| 1487 | } |
| 1488 | buildCounterI18nRegionListResponse--; |
| 1489 | return o; |
| 1490 | } |
| 1491 | |
| 1492 | checkI18nRegionListResponse(api.I18nRegionListResponse o) { |
| 1493 | buildCounterI18nRegionListResponse++; |
| 1494 | if (buildCounterI18nRegionListResponse < 3) { |
| 1495 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1496 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1497 | checkUnnamed351(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1498 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1499 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 1500 | } |
| 1501 | buildCounterI18nRegionListResponse--; |
| 1502 | } |
| 1503 | |
| 1504 | core.int buildCounterI18nRegionSnippet = 0; |
| 1505 | buildI18nRegionSnippet() { |
| 1506 | var o = new api.I18nRegionSnippet(); |
| 1507 | buildCounterI18nRegionSnippet++; |
| 1508 | if (buildCounterI18nRegionSnippet < 3) { |
| 1509 | o.gl = "foo"; |
| 1510 | o.name = "foo"; |
| 1511 | } |
| 1512 | buildCounterI18nRegionSnippet--; |
| 1513 | return o; |
| 1514 | } |
| 1515 | |
| 1516 | checkI18nRegionSnippet(api.I18nRegionSnippet o) { |
| 1517 | buildCounterI18nRegionSnippet++; |
| 1518 | if (buildCounterI18nRegionSnippet < 3) { |
| 1519 | unittest.expect(o.gl, unittest.equals('foo')); |
| 1520 | unittest.expect(o.name, unittest.equals('foo')); |
| 1521 | } |
| 1522 | buildCounterI18nRegionSnippet--; |
| 1523 | } |
| 1524 | |
| 1525 | core.int buildCounterImageSettings = 0; |
| 1526 | buildImageSettings() { |
| 1527 | var o = new api.ImageSettings(); |
| 1528 | buildCounterImageSettings++; |
| 1529 | if (buildCounterImageSettings < 3) { |
| 1530 | o.backgroundImageUrl = buildLocalizedProperty(); |
| 1531 | o.bannerExternalUrl = "foo"; |
| 1532 | o.bannerImageUrl = "foo"; |
| 1533 | o.bannerMobileExtraHdImageUrl = "foo"; |
| 1534 | o.bannerMobileHdImageUrl = "foo"; |
| 1535 | o.bannerMobileImageUrl = "foo"; |
| 1536 | o.bannerMobileLowImageUrl = "foo"; |
| 1537 | o.bannerMobileMediumHdImageUrl = "foo"; |
| 1538 | o.bannerTabletExtraHdImageUrl = "foo"; |
| 1539 | o.bannerTabletHdImageUrl = "foo"; |
| 1540 | o.bannerTabletImageUrl = "foo"; |
| 1541 | o.bannerTabletLowImageUrl = "foo"; |
| 1542 | o.bannerTvHighImageUrl = "foo"; |
| 1543 | o.bannerTvImageUrl = "foo"; |
| 1544 | o.bannerTvLowImageUrl = "foo"; |
| 1545 | o.bannerTvMediumImageUrl = "foo"; |
| 1546 | o.largeBrandedBannerImageImapScript = buildLocalizedProperty(); |
| 1547 | o.largeBrandedBannerImageUrl = buildLocalizedProperty(); |
| 1548 | o.smallBrandedBannerImageImapScript = buildLocalizedProperty(); |
| 1549 | o.smallBrandedBannerImageUrl = buildLocalizedProperty(); |
| 1550 | o.trackingImageUrl = "foo"; |
| 1551 | o.watchIconImageUrl = "foo"; |
| 1552 | } |
| 1553 | buildCounterImageSettings--; |
| 1554 | return o; |
| 1555 | } |
| 1556 | |
| 1557 | checkImageSettings(api.ImageSettings o) { |
| 1558 | buildCounterImageSettings++; |
| 1559 | if (buildCounterImageSettings < 3) { |
| 1560 | checkLocalizedProperty(o.backgroundImageUrl); |
| 1561 | unittest.expect(o.bannerExternalUrl, unittest.equals('foo')); |
| 1562 | unittest.expect(o.bannerImageUrl, unittest.equals('foo')); |
| 1563 | unittest.expect(o.bannerMobileExtraHdImageUrl, unittest.equals('foo')); |
| 1564 | unittest.expect(o.bannerMobileHdImageUrl, unittest.equals('foo')); |
| 1565 | unittest.expect(o.bannerMobileImageUrl, unittest.equals('foo')); |
| 1566 | unittest.expect(o.bannerMobileLowImageUrl, unittest.equals('foo')); |
| 1567 | unittest.expect(o.bannerMobileMediumHdImageUrl, unittest.equals('foo')); |
| 1568 | unittest.expect(o.bannerTabletExtraHdImageUrl, unittest.equals('foo')); |
| 1569 | unittest.expect(o.bannerTabletHdImageUrl, unittest.equals('foo')); |
| 1570 | unittest.expect(o.bannerTabletImageUrl, unittest.equals('foo')); |
| 1571 | unittest.expect(o.bannerTabletLowImageUrl, unittest.equals('foo')); |
| 1572 | unittest.expect(o.bannerTvHighImageUrl, unittest.equals('foo')); |
| 1573 | unittest.expect(o.bannerTvImageUrl, unittest.equals('foo')); |
| 1574 | unittest.expect(o.bannerTvLowImageUrl, unittest.equals('foo')); |
| 1575 | unittest.expect(o.bannerTvMediumImageUrl, unittest.equals('foo')); |
| 1576 | checkLocalizedProperty(o.largeBrandedBannerImageImapScript); |
| 1577 | checkLocalizedProperty(o.largeBrandedBannerImageUrl); |
| 1578 | checkLocalizedProperty(o.smallBrandedBannerImageImapScript); |
| 1579 | checkLocalizedProperty(o.smallBrandedBannerImageUrl); |
| 1580 | unittest.expect(o.trackingImageUrl, unittest.equals('foo')); |
| 1581 | unittest.expect(o.watchIconImageUrl, unittest.equals('foo')); |
| 1582 | } |
| 1583 | buildCounterImageSettings--; |
| 1584 | } |
| 1585 | |
| 1586 | core.int buildCounterIngestionInfo = 0; |
| 1587 | buildIngestionInfo() { |
| 1588 | var o = new api.IngestionInfo(); |
| 1589 | buildCounterIngestionInfo++; |
| 1590 | if (buildCounterIngestionInfo < 3) { |
| 1591 | o.backupIngestionAddress = "foo"; |
| 1592 | o.ingestionAddress = "foo"; |
| 1593 | o.streamName = "foo"; |
| 1594 | } |
| 1595 | buildCounterIngestionInfo--; |
| 1596 | return o; |
| 1597 | } |
| 1598 | |
| 1599 | checkIngestionInfo(api.IngestionInfo o) { |
| 1600 | buildCounterIngestionInfo++; |
| 1601 | if (buildCounterIngestionInfo < 3) { |
| 1602 | unittest.expect(o.backupIngestionAddress, unittest.equals('foo')); |
| 1603 | unittest.expect(o.ingestionAddress, unittest.equals('foo')); |
| 1604 | unittest.expect(o.streamName, unittest.equals('foo')); |
| 1605 | } |
| 1606 | buildCounterIngestionInfo--; |
| 1607 | } |
| 1608 | |
| 1609 | core.int buildCounterInvideoBranding = 0; |
| 1610 | buildInvideoBranding() { |
| 1611 | var o = new api.InvideoBranding(); |
| 1612 | buildCounterInvideoBranding++; |
| 1613 | if (buildCounterInvideoBranding < 3) { |
| 1614 | o.imageBytes = "foo"; |
| 1615 | o.imageUrl = "foo"; |
| 1616 | o.position = buildInvideoPosition(); |
| 1617 | o.targetChannelId = "foo"; |
| 1618 | o.timing = buildInvideoTiming(); |
| 1619 | } |
| 1620 | buildCounterInvideoBranding--; |
| 1621 | return o; |
| 1622 | } |
| 1623 | |
| 1624 | checkInvideoBranding(api.InvideoBranding o) { |
| 1625 | buildCounterInvideoBranding++; |
| 1626 | if (buildCounterInvideoBranding < 3) { |
| 1627 | unittest.expect(o.imageBytes, unittest.equals('foo')); |
| 1628 | unittest.expect(o.imageUrl, unittest.equals('foo')); |
| 1629 | checkInvideoPosition(o.position); |
| 1630 | unittest.expect(o.targetChannelId, unittest.equals('foo')); |
| 1631 | checkInvideoTiming(o.timing); |
| 1632 | } |
| 1633 | buildCounterInvideoBranding--; |
| 1634 | } |
| 1635 | |
| 1636 | core.int buildCounterInvideoPosition = 0; |
| 1637 | buildInvideoPosition() { |
| 1638 | var o = new api.InvideoPosition(); |
| 1639 | buildCounterInvideoPosition++; |
| 1640 | if (buildCounterInvideoPosition < 3) { |
| 1641 | o.cornerPosition = "foo"; |
| 1642 | o.type = "foo"; |
| 1643 | } |
| 1644 | buildCounterInvideoPosition--; |
| 1645 | return o; |
| 1646 | } |
| 1647 | |
| 1648 | checkInvideoPosition(api.InvideoPosition o) { |
| 1649 | buildCounterInvideoPosition++; |
| 1650 | if (buildCounterInvideoPosition < 3) { |
| 1651 | unittest.expect(o.cornerPosition, unittest.equals('foo')); |
| 1652 | unittest.expect(o.type, unittest.equals('foo')); |
| 1653 | } |
| 1654 | buildCounterInvideoPosition--; |
| 1655 | } |
| 1656 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1657 | buildUnnamed352() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1658 | var o = new core.List<api.PromotedItem>(); |
| 1659 | o.add(buildPromotedItem()); |
| 1660 | o.add(buildPromotedItem()); |
| 1661 | return o; |
| 1662 | } |
| 1663 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1664 | checkUnnamed352(core.List<api.PromotedItem> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1665 | unittest.expect(o, unittest.hasLength(2)); |
| 1666 | checkPromotedItem(o[0]); |
| 1667 | checkPromotedItem(o[1]); |
| 1668 | } |
| 1669 | |
| 1670 | core.int buildCounterInvideoPromotion = 0; |
| 1671 | buildInvideoPromotion() { |
| 1672 | var o = new api.InvideoPromotion(); |
| 1673 | buildCounterInvideoPromotion++; |
| 1674 | if (buildCounterInvideoPromotion < 3) { |
| 1675 | o.defaultTiming = buildInvideoTiming(); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1676 | o.items = buildUnnamed352(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1677 | o.position = buildInvideoPosition(); |
Søren Gjesse | a7d1bd0 | 2014-09-29 17:56:55 +0200 | [diff] [blame] | 1678 | o.useSmartTiming = true; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1679 | } |
| 1680 | buildCounterInvideoPromotion--; |
| 1681 | return o; |
| 1682 | } |
| 1683 | |
| 1684 | checkInvideoPromotion(api.InvideoPromotion o) { |
| 1685 | buildCounterInvideoPromotion++; |
| 1686 | if (buildCounterInvideoPromotion < 3) { |
| 1687 | checkInvideoTiming(o.defaultTiming); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1688 | checkUnnamed352(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1689 | checkInvideoPosition(o.position); |
Søren Gjesse | a7d1bd0 | 2014-09-29 17:56:55 +0200 | [diff] [blame] | 1690 | unittest.expect(o.useSmartTiming, unittest.isTrue); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1691 | } |
| 1692 | buildCounterInvideoPromotion--; |
| 1693 | } |
| 1694 | |
| 1695 | core.int buildCounterInvideoTiming = 0; |
| 1696 | buildInvideoTiming() { |
| 1697 | var o = new api.InvideoTiming(); |
| 1698 | buildCounterInvideoTiming++; |
| 1699 | if (buildCounterInvideoTiming < 3) { |
| 1700 | o.durationMs = "foo"; |
| 1701 | o.offsetMs = "foo"; |
| 1702 | o.type = "foo"; |
| 1703 | } |
| 1704 | buildCounterInvideoTiming--; |
| 1705 | return o; |
| 1706 | } |
| 1707 | |
| 1708 | checkInvideoTiming(api.InvideoTiming o) { |
| 1709 | buildCounterInvideoTiming++; |
| 1710 | if (buildCounterInvideoTiming < 3) { |
| 1711 | unittest.expect(o.durationMs, unittest.equals('foo')); |
| 1712 | unittest.expect(o.offsetMs, unittest.equals('foo')); |
| 1713 | unittest.expect(o.type, unittest.equals('foo')); |
| 1714 | } |
| 1715 | buildCounterInvideoTiming--; |
| 1716 | } |
| 1717 | |
| 1718 | core.int buildCounterLiveBroadcast = 0; |
| 1719 | buildLiveBroadcast() { |
| 1720 | var o = new api.LiveBroadcast(); |
| 1721 | buildCounterLiveBroadcast++; |
| 1722 | if (buildCounterLiveBroadcast < 3) { |
| 1723 | o.contentDetails = buildLiveBroadcastContentDetails(); |
| 1724 | o.etag = "foo"; |
| 1725 | o.id = "foo"; |
| 1726 | o.kind = "foo"; |
| 1727 | o.snippet = buildLiveBroadcastSnippet(); |
| 1728 | o.status = buildLiveBroadcastStatus(); |
| 1729 | } |
| 1730 | buildCounterLiveBroadcast--; |
| 1731 | return o; |
| 1732 | } |
| 1733 | |
| 1734 | checkLiveBroadcast(api.LiveBroadcast o) { |
| 1735 | buildCounterLiveBroadcast++; |
| 1736 | if (buildCounterLiveBroadcast < 3) { |
| 1737 | checkLiveBroadcastContentDetails(o.contentDetails); |
| 1738 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1739 | unittest.expect(o.id, unittest.equals('foo')); |
| 1740 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1741 | checkLiveBroadcastSnippet(o.snippet); |
| 1742 | checkLiveBroadcastStatus(o.status); |
| 1743 | } |
| 1744 | buildCounterLiveBroadcast--; |
| 1745 | } |
| 1746 | |
| 1747 | core.int buildCounterLiveBroadcastContentDetails = 0; |
| 1748 | buildLiveBroadcastContentDetails() { |
| 1749 | var o = new api.LiveBroadcastContentDetails(); |
| 1750 | buildCounterLiveBroadcastContentDetails++; |
| 1751 | if (buildCounterLiveBroadcastContentDetails < 3) { |
| 1752 | o.boundStreamId = "foo"; |
| 1753 | o.enableClosedCaptions = true; |
| 1754 | o.enableContentEncryption = true; |
| 1755 | o.enableDvr = true; |
| 1756 | o.enableEmbed = true; |
| 1757 | o.monitorStream = buildMonitorStreamInfo(); |
| 1758 | o.recordFromStart = true; |
| 1759 | o.startWithSlate = true; |
| 1760 | } |
| 1761 | buildCounterLiveBroadcastContentDetails--; |
| 1762 | return o; |
| 1763 | } |
| 1764 | |
| 1765 | checkLiveBroadcastContentDetails(api.LiveBroadcastContentDetails o) { |
| 1766 | buildCounterLiveBroadcastContentDetails++; |
| 1767 | if (buildCounterLiveBroadcastContentDetails < 3) { |
| 1768 | unittest.expect(o.boundStreamId, unittest.equals('foo')); |
| 1769 | unittest.expect(o.enableClosedCaptions, unittest.isTrue); |
| 1770 | unittest.expect(o.enableContentEncryption, unittest.isTrue); |
| 1771 | unittest.expect(o.enableDvr, unittest.isTrue); |
| 1772 | unittest.expect(o.enableEmbed, unittest.isTrue); |
| 1773 | checkMonitorStreamInfo(o.monitorStream); |
| 1774 | unittest.expect(o.recordFromStart, unittest.isTrue); |
| 1775 | unittest.expect(o.startWithSlate, unittest.isTrue); |
| 1776 | } |
| 1777 | buildCounterLiveBroadcastContentDetails--; |
| 1778 | } |
| 1779 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1780 | buildUnnamed353() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1781 | var o = new core.List<api.LiveBroadcast>(); |
| 1782 | o.add(buildLiveBroadcast()); |
| 1783 | o.add(buildLiveBroadcast()); |
| 1784 | return o; |
| 1785 | } |
| 1786 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1787 | checkUnnamed353(core.List<api.LiveBroadcast> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1788 | unittest.expect(o, unittest.hasLength(2)); |
| 1789 | checkLiveBroadcast(o[0]); |
| 1790 | checkLiveBroadcast(o[1]); |
| 1791 | } |
| 1792 | |
| 1793 | core.int buildCounterLiveBroadcastListResponse = 0; |
| 1794 | buildLiveBroadcastListResponse() { |
| 1795 | var o = new api.LiveBroadcastListResponse(); |
| 1796 | buildCounterLiveBroadcastListResponse++; |
| 1797 | if (buildCounterLiveBroadcastListResponse < 3) { |
| 1798 | o.etag = "foo"; |
| 1799 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1800 | o.items = buildUnnamed353(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1801 | o.kind = "foo"; |
| 1802 | o.nextPageToken = "foo"; |
| 1803 | o.pageInfo = buildPageInfo(); |
| 1804 | o.prevPageToken = "foo"; |
| 1805 | o.tokenPagination = buildTokenPagination(); |
| 1806 | o.visitorId = "foo"; |
| 1807 | } |
| 1808 | buildCounterLiveBroadcastListResponse--; |
| 1809 | return o; |
| 1810 | } |
| 1811 | |
| 1812 | checkLiveBroadcastListResponse(api.LiveBroadcastListResponse o) { |
| 1813 | buildCounterLiveBroadcastListResponse++; |
| 1814 | if (buildCounterLiveBroadcastListResponse < 3) { |
| 1815 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1816 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1817 | checkUnnamed353(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1818 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1819 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1820 | checkPageInfo(o.pageInfo); |
| 1821 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 1822 | checkTokenPagination(o.tokenPagination); |
| 1823 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 1824 | } |
| 1825 | buildCounterLiveBroadcastListResponse--; |
| 1826 | } |
| 1827 | |
| 1828 | core.int buildCounterLiveBroadcastSnippet = 0; |
| 1829 | buildLiveBroadcastSnippet() { |
| 1830 | var o = new api.LiveBroadcastSnippet(); |
| 1831 | buildCounterLiveBroadcastSnippet++; |
| 1832 | if (buildCounterLiveBroadcastSnippet < 3) { |
| 1833 | o.actualEndTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1834 | o.actualStartTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1835 | o.channelId = "foo"; |
| 1836 | o.description = "foo"; |
| 1837 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1838 | o.scheduledEndTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1839 | o.scheduledStartTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1840 | o.thumbnails = buildThumbnailDetails(); |
| 1841 | o.title = "foo"; |
| 1842 | } |
| 1843 | buildCounterLiveBroadcastSnippet--; |
| 1844 | return o; |
| 1845 | } |
| 1846 | |
| 1847 | checkLiveBroadcastSnippet(api.LiveBroadcastSnippet o) { |
| 1848 | buildCounterLiveBroadcastSnippet++; |
| 1849 | if (buildCounterLiveBroadcastSnippet < 3) { |
| 1850 | unittest.expect(o.actualEndTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1851 | unittest.expect(o.actualStartTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1852 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 1853 | unittest.expect(o.description, unittest.equals('foo')); |
| 1854 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1855 | unittest.expect(o.scheduledEndTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1856 | unittest.expect(o.scheduledStartTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1857 | checkThumbnailDetails(o.thumbnails); |
| 1858 | unittest.expect(o.title, unittest.equals('foo')); |
| 1859 | } |
| 1860 | buildCounterLiveBroadcastSnippet--; |
| 1861 | } |
| 1862 | |
| 1863 | core.int buildCounterLiveBroadcastStatus = 0; |
| 1864 | buildLiveBroadcastStatus() { |
| 1865 | var o = new api.LiveBroadcastStatus(); |
| 1866 | buildCounterLiveBroadcastStatus++; |
| 1867 | if (buildCounterLiveBroadcastStatus < 3) { |
| 1868 | o.lifeCycleStatus = "foo"; |
| 1869 | o.liveBroadcastPriority = "foo"; |
| 1870 | o.privacyStatus = "foo"; |
| 1871 | o.recordingStatus = "foo"; |
| 1872 | } |
| 1873 | buildCounterLiveBroadcastStatus--; |
| 1874 | return o; |
| 1875 | } |
| 1876 | |
| 1877 | checkLiveBroadcastStatus(api.LiveBroadcastStatus o) { |
| 1878 | buildCounterLiveBroadcastStatus++; |
| 1879 | if (buildCounterLiveBroadcastStatus < 3) { |
| 1880 | unittest.expect(o.lifeCycleStatus, unittest.equals('foo')); |
| 1881 | unittest.expect(o.liveBroadcastPriority, unittest.equals('foo')); |
| 1882 | unittest.expect(o.privacyStatus, unittest.equals('foo')); |
| 1883 | unittest.expect(o.recordingStatus, unittest.equals('foo')); |
| 1884 | } |
| 1885 | buildCounterLiveBroadcastStatus--; |
| 1886 | } |
| 1887 | |
| 1888 | core.int buildCounterLiveStream = 0; |
| 1889 | buildLiveStream() { |
| 1890 | var o = new api.LiveStream(); |
| 1891 | buildCounterLiveStream++; |
| 1892 | if (buildCounterLiveStream < 3) { |
| 1893 | o.cdn = buildCdnSettings(); |
| 1894 | o.contentDetails = buildLiveStreamContentDetails(); |
| 1895 | o.etag = "foo"; |
| 1896 | o.id = "foo"; |
| 1897 | o.kind = "foo"; |
| 1898 | o.snippet = buildLiveStreamSnippet(); |
| 1899 | o.status = buildLiveStreamStatus(); |
| 1900 | } |
| 1901 | buildCounterLiveStream--; |
| 1902 | return o; |
| 1903 | } |
| 1904 | |
| 1905 | checkLiveStream(api.LiveStream o) { |
| 1906 | buildCounterLiveStream++; |
| 1907 | if (buildCounterLiveStream < 3) { |
| 1908 | checkCdnSettings(o.cdn); |
| 1909 | checkLiveStreamContentDetails(o.contentDetails); |
| 1910 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1911 | unittest.expect(o.id, unittest.equals('foo')); |
| 1912 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1913 | checkLiveStreamSnippet(o.snippet); |
| 1914 | checkLiveStreamStatus(o.status); |
| 1915 | } |
| 1916 | buildCounterLiveStream--; |
| 1917 | } |
| 1918 | |
| 1919 | core.int buildCounterLiveStreamContentDetails = 0; |
| 1920 | buildLiveStreamContentDetails() { |
| 1921 | var o = new api.LiveStreamContentDetails(); |
| 1922 | buildCounterLiveStreamContentDetails++; |
| 1923 | if (buildCounterLiveStreamContentDetails < 3) { |
| 1924 | o.closedCaptionsIngestionUrl = "foo"; |
Søren Gjesse | a7d1bd0 | 2014-09-29 17:56:55 +0200 | [diff] [blame] | 1925 | o.isReusable = true; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1926 | } |
| 1927 | buildCounterLiveStreamContentDetails--; |
| 1928 | return o; |
| 1929 | } |
| 1930 | |
| 1931 | checkLiveStreamContentDetails(api.LiveStreamContentDetails o) { |
| 1932 | buildCounterLiveStreamContentDetails++; |
| 1933 | if (buildCounterLiveStreamContentDetails < 3) { |
| 1934 | unittest.expect(o.closedCaptionsIngestionUrl, unittest.equals('foo')); |
Søren Gjesse | a7d1bd0 | 2014-09-29 17:56:55 +0200 | [diff] [blame] | 1935 | unittest.expect(o.isReusable, unittest.isTrue); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1936 | } |
| 1937 | buildCounterLiveStreamContentDetails--; |
| 1938 | } |
| 1939 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1940 | buildUnnamed354() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1941 | var o = new core.List<api.LiveStream>(); |
| 1942 | o.add(buildLiveStream()); |
| 1943 | o.add(buildLiveStream()); |
| 1944 | return o; |
| 1945 | } |
| 1946 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1947 | checkUnnamed354(core.List<api.LiveStream> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1948 | unittest.expect(o, unittest.hasLength(2)); |
| 1949 | checkLiveStream(o[0]); |
| 1950 | checkLiveStream(o[1]); |
| 1951 | } |
| 1952 | |
| 1953 | core.int buildCounterLiveStreamListResponse = 0; |
| 1954 | buildLiveStreamListResponse() { |
| 1955 | var o = new api.LiveStreamListResponse(); |
| 1956 | buildCounterLiveStreamListResponse++; |
| 1957 | if (buildCounterLiveStreamListResponse < 3) { |
| 1958 | o.etag = "foo"; |
| 1959 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1960 | o.items = buildUnnamed354(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1961 | o.kind = "foo"; |
| 1962 | o.nextPageToken = "foo"; |
| 1963 | o.pageInfo = buildPageInfo(); |
| 1964 | o.prevPageToken = "foo"; |
| 1965 | o.tokenPagination = buildTokenPagination(); |
| 1966 | o.visitorId = "foo"; |
| 1967 | } |
| 1968 | buildCounterLiveStreamListResponse--; |
| 1969 | return o; |
| 1970 | } |
| 1971 | |
| 1972 | checkLiveStreamListResponse(api.LiveStreamListResponse o) { |
| 1973 | buildCounterLiveStreamListResponse++; |
| 1974 | if (buildCounterLiveStreamListResponse < 3) { |
| 1975 | unittest.expect(o.etag, unittest.equals('foo')); |
| 1976 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 1977 | checkUnnamed354(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1978 | unittest.expect(o.kind, unittest.equals('foo')); |
| 1979 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1980 | checkPageInfo(o.pageInfo); |
| 1981 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 1982 | checkTokenPagination(o.tokenPagination); |
| 1983 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 1984 | } |
| 1985 | buildCounterLiveStreamListResponse--; |
| 1986 | } |
| 1987 | |
| 1988 | core.int buildCounterLiveStreamSnippet = 0; |
| 1989 | buildLiveStreamSnippet() { |
| 1990 | var o = new api.LiveStreamSnippet(); |
| 1991 | buildCounterLiveStreamSnippet++; |
| 1992 | if (buildCounterLiveStreamSnippet < 3) { |
| 1993 | o.channelId = "foo"; |
| 1994 | o.description = "foo"; |
| 1995 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1996 | o.title = "foo"; |
| 1997 | } |
| 1998 | buildCounterLiveStreamSnippet--; |
| 1999 | return o; |
| 2000 | } |
| 2001 | |
| 2002 | checkLiveStreamSnippet(api.LiveStreamSnippet o) { |
| 2003 | buildCounterLiveStreamSnippet++; |
| 2004 | if (buildCounterLiveStreamSnippet < 3) { |
| 2005 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2006 | unittest.expect(o.description, unittest.equals('foo')); |
| 2007 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 2008 | unittest.expect(o.title, unittest.equals('foo')); |
| 2009 | } |
| 2010 | buildCounterLiveStreamSnippet--; |
| 2011 | } |
| 2012 | |
| 2013 | core.int buildCounterLiveStreamStatus = 0; |
| 2014 | buildLiveStreamStatus() { |
| 2015 | var o = new api.LiveStreamStatus(); |
| 2016 | buildCounterLiveStreamStatus++; |
| 2017 | if (buildCounterLiveStreamStatus < 3) { |
| 2018 | o.streamStatus = "foo"; |
| 2019 | } |
| 2020 | buildCounterLiveStreamStatus--; |
| 2021 | return o; |
| 2022 | } |
| 2023 | |
| 2024 | checkLiveStreamStatus(api.LiveStreamStatus o) { |
| 2025 | buildCounterLiveStreamStatus++; |
| 2026 | if (buildCounterLiveStreamStatus < 3) { |
| 2027 | unittest.expect(o.streamStatus, unittest.equals('foo')); |
| 2028 | } |
| 2029 | buildCounterLiveStreamStatus--; |
| 2030 | } |
| 2031 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2032 | buildUnnamed355() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2033 | var o = new core.List<api.LocalizedString>(); |
| 2034 | o.add(buildLocalizedString()); |
| 2035 | o.add(buildLocalizedString()); |
| 2036 | return o; |
| 2037 | } |
| 2038 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2039 | checkUnnamed355(core.List<api.LocalizedString> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2040 | unittest.expect(o, unittest.hasLength(2)); |
| 2041 | checkLocalizedString(o[0]); |
| 2042 | checkLocalizedString(o[1]); |
| 2043 | } |
| 2044 | |
| 2045 | core.int buildCounterLocalizedProperty = 0; |
| 2046 | buildLocalizedProperty() { |
| 2047 | var o = new api.LocalizedProperty(); |
| 2048 | buildCounterLocalizedProperty++; |
| 2049 | if (buildCounterLocalizedProperty < 3) { |
| 2050 | o.default_ = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2051 | o.localized = buildUnnamed355(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2052 | } |
| 2053 | buildCounterLocalizedProperty--; |
| 2054 | return o; |
| 2055 | } |
| 2056 | |
| 2057 | checkLocalizedProperty(api.LocalizedProperty o) { |
| 2058 | buildCounterLocalizedProperty++; |
| 2059 | if (buildCounterLocalizedProperty < 3) { |
| 2060 | unittest.expect(o.default_, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2061 | checkUnnamed355(o.localized); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2062 | } |
| 2063 | buildCounterLocalizedProperty--; |
| 2064 | } |
| 2065 | |
| 2066 | core.int buildCounterLocalizedString = 0; |
| 2067 | buildLocalizedString() { |
| 2068 | var o = new api.LocalizedString(); |
| 2069 | buildCounterLocalizedString++; |
| 2070 | if (buildCounterLocalizedString < 3) { |
| 2071 | o.language = "foo"; |
| 2072 | o.value = "foo"; |
| 2073 | } |
| 2074 | buildCounterLocalizedString--; |
| 2075 | return o; |
| 2076 | } |
| 2077 | |
| 2078 | checkLocalizedString(api.LocalizedString o) { |
| 2079 | buildCounterLocalizedString++; |
| 2080 | if (buildCounterLocalizedString < 3) { |
| 2081 | unittest.expect(o.language, unittest.equals('foo')); |
| 2082 | unittest.expect(o.value, unittest.equals('foo')); |
| 2083 | } |
| 2084 | buildCounterLocalizedString--; |
| 2085 | } |
| 2086 | |
| 2087 | core.int buildCounterMonitorStreamInfo = 0; |
| 2088 | buildMonitorStreamInfo() { |
| 2089 | var o = new api.MonitorStreamInfo(); |
| 2090 | buildCounterMonitorStreamInfo++; |
| 2091 | if (buildCounterMonitorStreamInfo < 3) { |
| 2092 | o.broadcastStreamDelayMs = 42; |
| 2093 | o.embedHtml = "foo"; |
| 2094 | o.enableMonitorStream = true; |
| 2095 | } |
| 2096 | buildCounterMonitorStreamInfo--; |
| 2097 | return o; |
| 2098 | } |
| 2099 | |
| 2100 | checkMonitorStreamInfo(api.MonitorStreamInfo o) { |
| 2101 | buildCounterMonitorStreamInfo++; |
| 2102 | if (buildCounterMonitorStreamInfo < 3) { |
| 2103 | unittest.expect(o.broadcastStreamDelayMs, unittest.equals(42)); |
| 2104 | unittest.expect(o.embedHtml, unittest.equals('foo')); |
| 2105 | unittest.expect(o.enableMonitorStream, unittest.isTrue); |
| 2106 | } |
| 2107 | buildCounterMonitorStreamInfo--; |
| 2108 | } |
| 2109 | |
| 2110 | core.int buildCounterPageInfo = 0; |
| 2111 | buildPageInfo() { |
| 2112 | var o = new api.PageInfo(); |
| 2113 | buildCounterPageInfo++; |
| 2114 | if (buildCounterPageInfo < 3) { |
| 2115 | o.resultsPerPage = 42; |
| 2116 | o.totalResults = 42; |
| 2117 | } |
| 2118 | buildCounterPageInfo--; |
| 2119 | return o; |
| 2120 | } |
| 2121 | |
| 2122 | checkPageInfo(api.PageInfo o) { |
| 2123 | buildCounterPageInfo++; |
| 2124 | if (buildCounterPageInfo < 3) { |
| 2125 | unittest.expect(o.resultsPerPage, unittest.equals(42)); |
| 2126 | unittest.expect(o.totalResults, unittest.equals(42)); |
| 2127 | } |
| 2128 | buildCounterPageInfo--; |
| 2129 | } |
| 2130 | |
| 2131 | core.int buildCounterPlaylist = 0; |
| 2132 | buildPlaylist() { |
| 2133 | var o = new api.Playlist(); |
| 2134 | buildCounterPlaylist++; |
| 2135 | if (buildCounterPlaylist < 3) { |
| 2136 | o.contentDetails = buildPlaylistContentDetails(); |
| 2137 | o.etag = "foo"; |
| 2138 | o.id = "foo"; |
| 2139 | o.kind = "foo"; |
| 2140 | o.player = buildPlaylistPlayer(); |
| 2141 | o.snippet = buildPlaylistSnippet(); |
| 2142 | o.status = buildPlaylistStatus(); |
| 2143 | } |
| 2144 | buildCounterPlaylist--; |
| 2145 | return o; |
| 2146 | } |
| 2147 | |
| 2148 | checkPlaylist(api.Playlist o) { |
| 2149 | buildCounterPlaylist++; |
| 2150 | if (buildCounterPlaylist < 3) { |
| 2151 | checkPlaylistContentDetails(o.contentDetails); |
| 2152 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2153 | unittest.expect(o.id, unittest.equals('foo')); |
| 2154 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2155 | checkPlaylistPlayer(o.player); |
| 2156 | checkPlaylistSnippet(o.snippet); |
| 2157 | checkPlaylistStatus(o.status); |
| 2158 | } |
| 2159 | buildCounterPlaylist--; |
| 2160 | } |
| 2161 | |
| 2162 | core.int buildCounterPlaylistContentDetails = 0; |
| 2163 | buildPlaylistContentDetails() { |
| 2164 | var o = new api.PlaylistContentDetails(); |
| 2165 | buildCounterPlaylistContentDetails++; |
| 2166 | if (buildCounterPlaylistContentDetails < 3) { |
| 2167 | o.itemCount = 42; |
| 2168 | } |
| 2169 | buildCounterPlaylistContentDetails--; |
| 2170 | return o; |
| 2171 | } |
| 2172 | |
| 2173 | checkPlaylistContentDetails(api.PlaylistContentDetails o) { |
| 2174 | buildCounterPlaylistContentDetails++; |
| 2175 | if (buildCounterPlaylistContentDetails < 3) { |
| 2176 | unittest.expect(o.itemCount, unittest.equals(42)); |
| 2177 | } |
| 2178 | buildCounterPlaylistContentDetails--; |
| 2179 | } |
| 2180 | |
| 2181 | core.int buildCounterPlaylistItem = 0; |
| 2182 | buildPlaylistItem() { |
| 2183 | var o = new api.PlaylistItem(); |
| 2184 | buildCounterPlaylistItem++; |
| 2185 | if (buildCounterPlaylistItem < 3) { |
| 2186 | o.contentDetails = buildPlaylistItemContentDetails(); |
| 2187 | o.etag = "foo"; |
| 2188 | o.id = "foo"; |
| 2189 | o.kind = "foo"; |
| 2190 | o.snippet = buildPlaylistItemSnippet(); |
| 2191 | o.status = buildPlaylistItemStatus(); |
| 2192 | } |
| 2193 | buildCounterPlaylistItem--; |
| 2194 | return o; |
| 2195 | } |
| 2196 | |
| 2197 | checkPlaylistItem(api.PlaylistItem o) { |
| 2198 | buildCounterPlaylistItem++; |
| 2199 | if (buildCounterPlaylistItem < 3) { |
| 2200 | checkPlaylistItemContentDetails(o.contentDetails); |
| 2201 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2202 | unittest.expect(o.id, unittest.equals('foo')); |
| 2203 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2204 | checkPlaylistItemSnippet(o.snippet); |
| 2205 | checkPlaylistItemStatus(o.status); |
| 2206 | } |
| 2207 | buildCounterPlaylistItem--; |
| 2208 | } |
| 2209 | |
| 2210 | core.int buildCounterPlaylistItemContentDetails = 0; |
| 2211 | buildPlaylistItemContentDetails() { |
| 2212 | var o = new api.PlaylistItemContentDetails(); |
| 2213 | buildCounterPlaylistItemContentDetails++; |
| 2214 | if (buildCounterPlaylistItemContentDetails < 3) { |
| 2215 | o.endAt = "foo"; |
| 2216 | o.note = "foo"; |
| 2217 | o.startAt = "foo"; |
| 2218 | o.videoId = "foo"; |
| 2219 | } |
| 2220 | buildCounterPlaylistItemContentDetails--; |
| 2221 | return o; |
| 2222 | } |
| 2223 | |
| 2224 | checkPlaylistItemContentDetails(api.PlaylistItemContentDetails o) { |
| 2225 | buildCounterPlaylistItemContentDetails++; |
| 2226 | if (buildCounterPlaylistItemContentDetails < 3) { |
| 2227 | unittest.expect(o.endAt, unittest.equals('foo')); |
| 2228 | unittest.expect(o.note, unittest.equals('foo')); |
| 2229 | unittest.expect(o.startAt, unittest.equals('foo')); |
| 2230 | unittest.expect(o.videoId, unittest.equals('foo')); |
| 2231 | } |
| 2232 | buildCounterPlaylistItemContentDetails--; |
| 2233 | } |
| 2234 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2235 | buildUnnamed356() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2236 | var o = new core.List<api.PlaylistItem>(); |
| 2237 | o.add(buildPlaylistItem()); |
| 2238 | o.add(buildPlaylistItem()); |
| 2239 | return o; |
| 2240 | } |
| 2241 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2242 | checkUnnamed356(core.List<api.PlaylistItem> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2243 | unittest.expect(o, unittest.hasLength(2)); |
| 2244 | checkPlaylistItem(o[0]); |
| 2245 | checkPlaylistItem(o[1]); |
| 2246 | } |
| 2247 | |
| 2248 | core.int buildCounterPlaylistItemListResponse = 0; |
| 2249 | buildPlaylistItemListResponse() { |
| 2250 | var o = new api.PlaylistItemListResponse(); |
| 2251 | buildCounterPlaylistItemListResponse++; |
| 2252 | if (buildCounterPlaylistItemListResponse < 3) { |
| 2253 | o.etag = "foo"; |
| 2254 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2255 | o.items = buildUnnamed356(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2256 | o.kind = "foo"; |
| 2257 | o.nextPageToken = "foo"; |
| 2258 | o.pageInfo = buildPageInfo(); |
| 2259 | o.prevPageToken = "foo"; |
| 2260 | o.tokenPagination = buildTokenPagination(); |
| 2261 | o.visitorId = "foo"; |
| 2262 | } |
| 2263 | buildCounterPlaylistItemListResponse--; |
| 2264 | return o; |
| 2265 | } |
| 2266 | |
| 2267 | checkPlaylistItemListResponse(api.PlaylistItemListResponse o) { |
| 2268 | buildCounterPlaylistItemListResponse++; |
| 2269 | if (buildCounterPlaylistItemListResponse < 3) { |
| 2270 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2271 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2272 | checkUnnamed356(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2273 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2274 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 2275 | checkPageInfo(o.pageInfo); |
| 2276 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 2277 | checkTokenPagination(o.tokenPagination); |
| 2278 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 2279 | } |
| 2280 | buildCounterPlaylistItemListResponse--; |
| 2281 | } |
| 2282 | |
| 2283 | core.int buildCounterPlaylistItemSnippet = 0; |
| 2284 | buildPlaylistItemSnippet() { |
| 2285 | var o = new api.PlaylistItemSnippet(); |
| 2286 | buildCounterPlaylistItemSnippet++; |
| 2287 | if (buildCounterPlaylistItemSnippet < 3) { |
| 2288 | o.channelId = "foo"; |
| 2289 | o.channelTitle = "foo"; |
| 2290 | o.description = "foo"; |
| 2291 | o.playlistId = "foo"; |
| 2292 | o.position = 42; |
| 2293 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2294 | o.resourceId = buildResourceId(); |
| 2295 | o.thumbnails = buildThumbnailDetails(); |
| 2296 | o.title = "foo"; |
| 2297 | } |
| 2298 | buildCounterPlaylistItemSnippet--; |
| 2299 | return o; |
| 2300 | } |
| 2301 | |
| 2302 | checkPlaylistItemSnippet(api.PlaylistItemSnippet o) { |
| 2303 | buildCounterPlaylistItemSnippet++; |
| 2304 | if (buildCounterPlaylistItemSnippet < 3) { |
| 2305 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2306 | unittest.expect(o.channelTitle, unittest.equals('foo')); |
| 2307 | unittest.expect(o.description, unittest.equals('foo')); |
| 2308 | unittest.expect(o.playlistId, unittest.equals('foo')); |
| 2309 | unittest.expect(o.position, unittest.equals(42)); |
| 2310 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 2311 | checkResourceId(o.resourceId); |
| 2312 | checkThumbnailDetails(o.thumbnails); |
| 2313 | unittest.expect(o.title, unittest.equals('foo')); |
| 2314 | } |
| 2315 | buildCounterPlaylistItemSnippet--; |
| 2316 | } |
| 2317 | |
| 2318 | core.int buildCounterPlaylistItemStatus = 0; |
| 2319 | buildPlaylistItemStatus() { |
| 2320 | var o = new api.PlaylistItemStatus(); |
| 2321 | buildCounterPlaylistItemStatus++; |
| 2322 | if (buildCounterPlaylistItemStatus < 3) { |
| 2323 | o.privacyStatus = "foo"; |
| 2324 | } |
| 2325 | buildCounterPlaylistItemStatus--; |
| 2326 | return o; |
| 2327 | } |
| 2328 | |
| 2329 | checkPlaylistItemStatus(api.PlaylistItemStatus o) { |
| 2330 | buildCounterPlaylistItemStatus++; |
| 2331 | if (buildCounterPlaylistItemStatus < 3) { |
| 2332 | unittest.expect(o.privacyStatus, unittest.equals('foo')); |
| 2333 | } |
| 2334 | buildCounterPlaylistItemStatus--; |
| 2335 | } |
| 2336 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2337 | buildUnnamed357() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2338 | var o = new core.List<api.Playlist>(); |
| 2339 | o.add(buildPlaylist()); |
| 2340 | o.add(buildPlaylist()); |
| 2341 | return o; |
| 2342 | } |
| 2343 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2344 | checkUnnamed357(core.List<api.Playlist> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2345 | unittest.expect(o, unittest.hasLength(2)); |
| 2346 | checkPlaylist(o[0]); |
| 2347 | checkPlaylist(o[1]); |
| 2348 | } |
| 2349 | |
| 2350 | core.int buildCounterPlaylistListResponse = 0; |
| 2351 | buildPlaylistListResponse() { |
| 2352 | var o = new api.PlaylistListResponse(); |
| 2353 | buildCounterPlaylistListResponse++; |
| 2354 | if (buildCounterPlaylistListResponse < 3) { |
| 2355 | o.etag = "foo"; |
| 2356 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2357 | o.items = buildUnnamed357(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2358 | o.kind = "foo"; |
| 2359 | o.nextPageToken = "foo"; |
| 2360 | o.pageInfo = buildPageInfo(); |
| 2361 | o.prevPageToken = "foo"; |
| 2362 | o.tokenPagination = buildTokenPagination(); |
| 2363 | o.visitorId = "foo"; |
| 2364 | } |
| 2365 | buildCounterPlaylistListResponse--; |
| 2366 | return o; |
| 2367 | } |
| 2368 | |
| 2369 | checkPlaylistListResponse(api.PlaylistListResponse o) { |
| 2370 | buildCounterPlaylistListResponse++; |
| 2371 | if (buildCounterPlaylistListResponse < 3) { |
| 2372 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2373 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2374 | checkUnnamed357(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2375 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2376 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 2377 | checkPageInfo(o.pageInfo); |
| 2378 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 2379 | checkTokenPagination(o.tokenPagination); |
| 2380 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 2381 | } |
| 2382 | buildCounterPlaylistListResponse--; |
| 2383 | } |
| 2384 | |
| 2385 | core.int buildCounterPlaylistPlayer = 0; |
| 2386 | buildPlaylistPlayer() { |
| 2387 | var o = new api.PlaylistPlayer(); |
| 2388 | buildCounterPlaylistPlayer++; |
| 2389 | if (buildCounterPlaylistPlayer < 3) { |
| 2390 | o.embedHtml = "foo"; |
| 2391 | } |
| 2392 | buildCounterPlaylistPlayer--; |
| 2393 | return o; |
| 2394 | } |
| 2395 | |
| 2396 | checkPlaylistPlayer(api.PlaylistPlayer o) { |
| 2397 | buildCounterPlaylistPlayer++; |
| 2398 | if (buildCounterPlaylistPlayer < 3) { |
| 2399 | unittest.expect(o.embedHtml, unittest.equals('foo')); |
| 2400 | } |
| 2401 | buildCounterPlaylistPlayer--; |
| 2402 | } |
| 2403 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2404 | buildUnnamed358() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2405 | var o = new core.List<core.String>(); |
| 2406 | o.add("foo"); |
| 2407 | o.add("foo"); |
| 2408 | return o; |
| 2409 | } |
| 2410 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2411 | checkUnnamed358(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2412 | unittest.expect(o, unittest.hasLength(2)); |
| 2413 | unittest.expect(o[0], unittest.equals('foo')); |
| 2414 | unittest.expect(o[1], unittest.equals('foo')); |
| 2415 | } |
| 2416 | |
| 2417 | core.int buildCounterPlaylistSnippet = 0; |
| 2418 | buildPlaylistSnippet() { |
| 2419 | var o = new api.PlaylistSnippet(); |
| 2420 | buildCounterPlaylistSnippet++; |
| 2421 | if (buildCounterPlaylistSnippet < 3) { |
| 2422 | o.channelId = "foo"; |
| 2423 | o.channelTitle = "foo"; |
| 2424 | o.description = "foo"; |
| 2425 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2426 | o.tags = buildUnnamed358(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2427 | o.thumbnails = buildThumbnailDetails(); |
| 2428 | o.title = "foo"; |
| 2429 | } |
| 2430 | buildCounterPlaylistSnippet--; |
| 2431 | return o; |
| 2432 | } |
| 2433 | |
| 2434 | checkPlaylistSnippet(api.PlaylistSnippet o) { |
| 2435 | buildCounterPlaylistSnippet++; |
| 2436 | if (buildCounterPlaylistSnippet < 3) { |
| 2437 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2438 | unittest.expect(o.channelTitle, unittest.equals('foo')); |
| 2439 | unittest.expect(o.description, unittest.equals('foo')); |
| 2440 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2441 | checkUnnamed358(o.tags); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2442 | checkThumbnailDetails(o.thumbnails); |
| 2443 | unittest.expect(o.title, unittest.equals('foo')); |
| 2444 | } |
| 2445 | buildCounterPlaylistSnippet--; |
| 2446 | } |
| 2447 | |
| 2448 | core.int buildCounterPlaylistStatus = 0; |
| 2449 | buildPlaylistStatus() { |
| 2450 | var o = new api.PlaylistStatus(); |
| 2451 | buildCounterPlaylistStatus++; |
| 2452 | if (buildCounterPlaylistStatus < 3) { |
| 2453 | o.privacyStatus = "foo"; |
| 2454 | } |
| 2455 | buildCounterPlaylistStatus--; |
| 2456 | return o; |
| 2457 | } |
| 2458 | |
| 2459 | checkPlaylistStatus(api.PlaylistStatus o) { |
| 2460 | buildCounterPlaylistStatus++; |
| 2461 | if (buildCounterPlaylistStatus < 3) { |
| 2462 | unittest.expect(o.privacyStatus, unittest.equals('foo')); |
| 2463 | } |
| 2464 | buildCounterPlaylistStatus--; |
| 2465 | } |
| 2466 | |
| 2467 | core.int buildCounterPromotedItem = 0; |
| 2468 | buildPromotedItem() { |
| 2469 | var o = new api.PromotedItem(); |
| 2470 | buildCounterPromotedItem++; |
| 2471 | if (buildCounterPromotedItem < 3) { |
| 2472 | o.customMessage = "foo"; |
| 2473 | o.id = buildPromotedItemId(); |
| 2474 | o.promotedByContentOwner = true; |
| 2475 | o.timing = buildInvideoTiming(); |
| 2476 | } |
| 2477 | buildCounterPromotedItem--; |
| 2478 | return o; |
| 2479 | } |
| 2480 | |
| 2481 | checkPromotedItem(api.PromotedItem o) { |
| 2482 | buildCounterPromotedItem++; |
| 2483 | if (buildCounterPromotedItem < 3) { |
| 2484 | unittest.expect(o.customMessage, unittest.equals('foo')); |
| 2485 | checkPromotedItemId(o.id); |
| 2486 | unittest.expect(o.promotedByContentOwner, unittest.isTrue); |
| 2487 | checkInvideoTiming(o.timing); |
| 2488 | } |
| 2489 | buildCounterPromotedItem--; |
| 2490 | } |
| 2491 | |
| 2492 | core.int buildCounterPromotedItemId = 0; |
| 2493 | buildPromotedItemId() { |
| 2494 | var o = new api.PromotedItemId(); |
| 2495 | buildCounterPromotedItemId++; |
| 2496 | if (buildCounterPromotedItemId < 3) { |
| 2497 | o.recentlyUploadedBy = "foo"; |
| 2498 | o.type = "foo"; |
| 2499 | o.videoId = "foo"; |
| 2500 | o.websiteUrl = "foo"; |
| 2501 | } |
| 2502 | buildCounterPromotedItemId--; |
| 2503 | return o; |
| 2504 | } |
| 2505 | |
| 2506 | checkPromotedItemId(api.PromotedItemId o) { |
| 2507 | buildCounterPromotedItemId++; |
| 2508 | if (buildCounterPromotedItemId < 3) { |
| 2509 | unittest.expect(o.recentlyUploadedBy, unittest.equals('foo')); |
| 2510 | unittest.expect(o.type, unittest.equals('foo')); |
| 2511 | unittest.expect(o.videoId, unittest.equals('foo')); |
| 2512 | unittest.expect(o.websiteUrl, unittest.equals('foo')); |
| 2513 | } |
| 2514 | buildCounterPromotedItemId--; |
| 2515 | } |
| 2516 | |
| 2517 | core.int buildCounterPropertyValue = 0; |
| 2518 | buildPropertyValue() { |
| 2519 | var o = new api.PropertyValue(); |
| 2520 | buildCounterPropertyValue++; |
| 2521 | if (buildCounterPropertyValue < 3) { |
| 2522 | o.property = "foo"; |
| 2523 | o.value = "foo"; |
| 2524 | } |
| 2525 | buildCounterPropertyValue--; |
| 2526 | return o; |
| 2527 | } |
| 2528 | |
| 2529 | checkPropertyValue(api.PropertyValue o) { |
| 2530 | buildCounterPropertyValue++; |
| 2531 | if (buildCounterPropertyValue < 3) { |
| 2532 | unittest.expect(o.property, unittest.equals('foo')); |
| 2533 | unittest.expect(o.value, unittest.equals('foo')); |
| 2534 | } |
| 2535 | buildCounterPropertyValue--; |
| 2536 | } |
| 2537 | |
| 2538 | core.int buildCounterResourceId = 0; |
| 2539 | buildResourceId() { |
| 2540 | var o = new api.ResourceId(); |
| 2541 | buildCounterResourceId++; |
| 2542 | if (buildCounterResourceId < 3) { |
| 2543 | o.channelId = "foo"; |
| 2544 | o.kind = "foo"; |
| 2545 | o.playlistId = "foo"; |
| 2546 | o.videoId = "foo"; |
| 2547 | } |
| 2548 | buildCounterResourceId--; |
| 2549 | return o; |
| 2550 | } |
| 2551 | |
| 2552 | checkResourceId(api.ResourceId o) { |
| 2553 | buildCounterResourceId++; |
| 2554 | if (buildCounterResourceId < 3) { |
| 2555 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2556 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2557 | unittest.expect(o.playlistId, unittest.equals('foo')); |
| 2558 | unittest.expect(o.videoId, unittest.equals('foo')); |
| 2559 | } |
| 2560 | buildCounterResourceId--; |
| 2561 | } |
| 2562 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2563 | buildUnnamed359() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2564 | var o = new core.List<api.SearchResult>(); |
| 2565 | o.add(buildSearchResult()); |
| 2566 | o.add(buildSearchResult()); |
| 2567 | return o; |
| 2568 | } |
| 2569 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2570 | checkUnnamed359(core.List<api.SearchResult> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2571 | unittest.expect(o, unittest.hasLength(2)); |
| 2572 | checkSearchResult(o[0]); |
| 2573 | checkSearchResult(o[1]); |
| 2574 | } |
| 2575 | |
| 2576 | core.int buildCounterSearchListResponse = 0; |
| 2577 | buildSearchListResponse() { |
| 2578 | var o = new api.SearchListResponse(); |
| 2579 | buildCounterSearchListResponse++; |
| 2580 | if (buildCounterSearchListResponse < 3) { |
| 2581 | o.etag = "foo"; |
| 2582 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2583 | o.items = buildUnnamed359(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2584 | o.kind = "foo"; |
| 2585 | o.nextPageToken = "foo"; |
| 2586 | o.pageInfo = buildPageInfo(); |
| 2587 | o.prevPageToken = "foo"; |
| 2588 | o.tokenPagination = buildTokenPagination(); |
| 2589 | o.visitorId = "foo"; |
| 2590 | } |
| 2591 | buildCounterSearchListResponse--; |
| 2592 | return o; |
| 2593 | } |
| 2594 | |
| 2595 | checkSearchListResponse(api.SearchListResponse o) { |
| 2596 | buildCounterSearchListResponse++; |
| 2597 | if (buildCounterSearchListResponse < 3) { |
| 2598 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2599 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2600 | checkUnnamed359(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2601 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2602 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 2603 | checkPageInfo(o.pageInfo); |
| 2604 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 2605 | checkTokenPagination(o.tokenPagination); |
| 2606 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 2607 | } |
| 2608 | buildCounterSearchListResponse--; |
| 2609 | } |
| 2610 | |
| 2611 | core.int buildCounterSearchResult = 0; |
| 2612 | buildSearchResult() { |
| 2613 | var o = new api.SearchResult(); |
| 2614 | buildCounterSearchResult++; |
| 2615 | if (buildCounterSearchResult < 3) { |
| 2616 | o.etag = "foo"; |
| 2617 | o.id = buildResourceId(); |
| 2618 | o.kind = "foo"; |
| 2619 | o.snippet = buildSearchResultSnippet(); |
| 2620 | } |
| 2621 | buildCounterSearchResult--; |
| 2622 | return o; |
| 2623 | } |
| 2624 | |
| 2625 | checkSearchResult(api.SearchResult o) { |
| 2626 | buildCounterSearchResult++; |
| 2627 | if (buildCounterSearchResult < 3) { |
| 2628 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2629 | checkResourceId(o.id); |
| 2630 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2631 | checkSearchResultSnippet(o.snippet); |
| 2632 | } |
| 2633 | buildCounterSearchResult--; |
| 2634 | } |
| 2635 | |
| 2636 | core.int buildCounterSearchResultSnippet = 0; |
| 2637 | buildSearchResultSnippet() { |
| 2638 | var o = new api.SearchResultSnippet(); |
| 2639 | buildCounterSearchResultSnippet++; |
| 2640 | if (buildCounterSearchResultSnippet < 3) { |
| 2641 | o.channelId = "foo"; |
| 2642 | o.channelTitle = "foo"; |
| 2643 | o.description = "foo"; |
| 2644 | o.liveBroadcastContent = "foo"; |
| 2645 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2646 | o.thumbnails = buildThumbnailDetails(); |
| 2647 | o.title = "foo"; |
| 2648 | } |
| 2649 | buildCounterSearchResultSnippet--; |
| 2650 | return o; |
| 2651 | } |
| 2652 | |
| 2653 | checkSearchResultSnippet(api.SearchResultSnippet o) { |
| 2654 | buildCounterSearchResultSnippet++; |
| 2655 | if (buildCounterSearchResultSnippet < 3) { |
| 2656 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2657 | unittest.expect(o.channelTitle, unittest.equals('foo')); |
| 2658 | unittest.expect(o.description, unittest.equals('foo')); |
| 2659 | unittest.expect(o.liveBroadcastContent, unittest.equals('foo')); |
| 2660 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 2661 | checkThumbnailDetails(o.thumbnails); |
| 2662 | unittest.expect(o.title, unittest.equals('foo')); |
| 2663 | } |
| 2664 | buildCounterSearchResultSnippet--; |
| 2665 | } |
| 2666 | |
| 2667 | core.int buildCounterSubscription = 0; |
| 2668 | buildSubscription() { |
| 2669 | var o = new api.Subscription(); |
| 2670 | buildCounterSubscription++; |
| 2671 | if (buildCounterSubscription < 3) { |
| 2672 | o.contentDetails = buildSubscriptionContentDetails(); |
| 2673 | o.etag = "foo"; |
| 2674 | o.id = "foo"; |
| 2675 | o.kind = "foo"; |
| 2676 | o.snippet = buildSubscriptionSnippet(); |
| 2677 | o.subscriberSnippet = buildSubscriptionSubscriberSnippet(); |
| 2678 | } |
| 2679 | buildCounterSubscription--; |
| 2680 | return o; |
| 2681 | } |
| 2682 | |
| 2683 | checkSubscription(api.Subscription o) { |
| 2684 | buildCounterSubscription++; |
| 2685 | if (buildCounterSubscription < 3) { |
| 2686 | checkSubscriptionContentDetails(o.contentDetails); |
| 2687 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2688 | unittest.expect(o.id, unittest.equals('foo')); |
| 2689 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2690 | checkSubscriptionSnippet(o.snippet); |
| 2691 | checkSubscriptionSubscriberSnippet(o.subscriberSnippet); |
| 2692 | } |
| 2693 | buildCounterSubscription--; |
| 2694 | } |
| 2695 | |
| 2696 | core.int buildCounterSubscriptionContentDetails = 0; |
| 2697 | buildSubscriptionContentDetails() { |
| 2698 | var o = new api.SubscriptionContentDetails(); |
| 2699 | buildCounterSubscriptionContentDetails++; |
| 2700 | if (buildCounterSubscriptionContentDetails < 3) { |
| 2701 | o.activityType = "foo"; |
| 2702 | o.newItemCount = 42; |
| 2703 | o.totalItemCount = 42; |
| 2704 | } |
| 2705 | buildCounterSubscriptionContentDetails--; |
| 2706 | return o; |
| 2707 | } |
| 2708 | |
| 2709 | checkSubscriptionContentDetails(api.SubscriptionContentDetails o) { |
| 2710 | buildCounterSubscriptionContentDetails++; |
| 2711 | if (buildCounterSubscriptionContentDetails < 3) { |
| 2712 | unittest.expect(o.activityType, unittest.equals('foo')); |
| 2713 | unittest.expect(o.newItemCount, unittest.equals(42)); |
| 2714 | unittest.expect(o.totalItemCount, unittest.equals(42)); |
| 2715 | } |
| 2716 | buildCounterSubscriptionContentDetails--; |
| 2717 | } |
| 2718 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2719 | buildUnnamed360() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2720 | var o = new core.List<api.Subscription>(); |
| 2721 | o.add(buildSubscription()); |
| 2722 | o.add(buildSubscription()); |
| 2723 | return o; |
| 2724 | } |
| 2725 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2726 | checkUnnamed360(core.List<api.Subscription> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2727 | unittest.expect(o, unittest.hasLength(2)); |
| 2728 | checkSubscription(o[0]); |
| 2729 | checkSubscription(o[1]); |
| 2730 | } |
| 2731 | |
| 2732 | core.int buildCounterSubscriptionListResponse = 0; |
| 2733 | buildSubscriptionListResponse() { |
| 2734 | var o = new api.SubscriptionListResponse(); |
| 2735 | buildCounterSubscriptionListResponse++; |
| 2736 | if (buildCounterSubscriptionListResponse < 3) { |
| 2737 | o.etag = "foo"; |
| 2738 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2739 | o.items = buildUnnamed360(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2740 | o.kind = "foo"; |
| 2741 | o.nextPageToken = "foo"; |
| 2742 | o.pageInfo = buildPageInfo(); |
| 2743 | o.prevPageToken = "foo"; |
| 2744 | o.tokenPagination = buildTokenPagination(); |
| 2745 | o.visitorId = "foo"; |
| 2746 | } |
| 2747 | buildCounterSubscriptionListResponse--; |
| 2748 | return o; |
| 2749 | } |
| 2750 | |
| 2751 | checkSubscriptionListResponse(api.SubscriptionListResponse o) { |
| 2752 | buildCounterSubscriptionListResponse++; |
| 2753 | if (buildCounterSubscriptionListResponse < 3) { |
| 2754 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2755 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2756 | checkUnnamed360(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2757 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2758 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 2759 | checkPageInfo(o.pageInfo); |
| 2760 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 2761 | checkTokenPagination(o.tokenPagination); |
| 2762 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 2763 | } |
| 2764 | buildCounterSubscriptionListResponse--; |
| 2765 | } |
| 2766 | |
| 2767 | core.int buildCounterSubscriptionSnippet = 0; |
| 2768 | buildSubscriptionSnippet() { |
| 2769 | var o = new api.SubscriptionSnippet(); |
| 2770 | buildCounterSubscriptionSnippet++; |
| 2771 | if (buildCounterSubscriptionSnippet < 3) { |
| 2772 | o.channelId = "foo"; |
| 2773 | o.channelTitle = "foo"; |
| 2774 | o.description = "foo"; |
| 2775 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2776 | o.resourceId = buildResourceId(); |
| 2777 | o.thumbnails = buildThumbnailDetails(); |
| 2778 | o.title = "foo"; |
| 2779 | } |
| 2780 | buildCounterSubscriptionSnippet--; |
| 2781 | return o; |
| 2782 | } |
| 2783 | |
| 2784 | checkSubscriptionSnippet(api.SubscriptionSnippet o) { |
| 2785 | buildCounterSubscriptionSnippet++; |
| 2786 | if (buildCounterSubscriptionSnippet < 3) { |
| 2787 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2788 | unittest.expect(o.channelTitle, unittest.equals('foo')); |
| 2789 | unittest.expect(o.description, unittest.equals('foo')); |
| 2790 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 2791 | checkResourceId(o.resourceId); |
| 2792 | checkThumbnailDetails(o.thumbnails); |
| 2793 | unittest.expect(o.title, unittest.equals('foo')); |
| 2794 | } |
| 2795 | buildCounterSubscriptionSnippet--; |
| 2796 | } |
| 2797 | |
| 2798 | core.int buildCounterSubscriptionSubscriberSnippet = 0; |
| 2799 | buildSubscriptionSubscriberSnippet() { |
| 2800 | var o = new api.SubscriptionSubscriberSnippet(); |
| 2801 | buildCounterSubscriptionSubscriberSnippet++; |
| 2802 | if (buildCounterSubscriptionSubscriberSnippet < 3) { |
| 2803 | o.channelId = "foo"; |
| 2804 | o.description = "foo"; |
| 2805 | o.thumbnails = buildThumbnailDetails(); |
| 2806 | o.title = "foo"; |
| 2807 | } |
| 2808 | buildCounterSubscriptionSubscriberSnippet--; |
| 2809 | return o; |
| 2810 | } |
| 2811 | |
| 2812 | checkSubscriptionSubscriberSnippet(api.SubscriptionSubscriberSnippet o) { |
| 2813 | buildCounterSubscriptionSubscriberSnippet++; |
| 2814 | if (buildCounterSubscriptionSubscriberSnippet < 3) { |
| 2815 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 2816 | unittest.expect(o.description, unittest.equals('foo')); |
| 2817 | checkThumbnailDetails(o.thumbnails); |
| 2818 | unittest.expect(o.title, unittest.equals('foo')); |
| 2819 | } |
| 2820 | buildCounterSubscriptionSubscriberSnippet--; |
| 2821 | } |
| 2822 | |
| 2823 | core.int buildCounterThumbnail = 0; |
| 2824 | buildThumbnail() { |
| 2825 | var o = new api.Thumbnail(); |
| 2826 | buildCounterThumbnail++; |
| 2827 | if (buildCounterThumbnail < 3) { |
| 2828 | o.height = 42; |
| 2829 | o.url = "foo"; |
| 2830 | o.width = 42; |
| 2831 | } |
| 2832 | buildCounterThumbnail--; |
| 2833 | return o; |
| 2834 | } |
| 2835 | |
| 2836 | checkThumbnail(api.Thumbnail o) { |
| 2837 | buildCounterThumbnail++; |
| 2838 | if (buildCounterThumbnail < 3) { |
| 2839 | unittest.expect(o.height, unittest.equals(42)); |
| 2840 | unittest.expect(o.url, unittest.equals('foo')); |
| 2841 | unittest.expect(o.width, unittest.equals(42)); |
| 2842 | } |
| 2843 | buildCounterThumbnail--; |
| 2844 | } |
| 2845 | |
| 2846 | core.int buildCounterThumbnailDetails = 0; |
| 2847 | buildThumbnailDetails() { |
| 2848 | var o = new api.ThumbnailDetails(); |
| 2849 | buildCounterThumbnailDetails++; |
| 2850 | if (buildCounterThumbnailDetails < 3) { |
| 2851 | o.default_ = buildThumbnail(); |
| 2852 | o.high = buildThumbnail(); |
| 2853 | o.maxres = buildThumbnail(); |
| 2854 | o.medium = buildThumbnail(); |
| 2855 | o.standard = buildThumbnail(); |
| 2856 | } |
| 2857 | buildCounterThumbnailDetails--; |
| 2858 | return o; |
| 2859 | } |
| 2860 | |
| 2861 | checkThumbnailDetails(api.ThumbnailDetails o) { |
| 2862 | buildCounterThumbnailDetails++; |
| 2863 | if (buildCounterThumbnailDetails < 3) { |
| 2864 | checkThumbnail(o.default_); |
| 2865 | checkThumbnail(o.high); |
| 2866 | checkThumbnail(o.maxres); |
| 2867 | checkThumbnail(o.medium); |
| 2868 | checkThumbnail(o.standard); |
| 2869 | } |
| 2870 | buildCounterThumbnailDetails--; |
| 2871 | } |
| 2872 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2873 | buildUnnamed361() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2874 | var o = new core.List<api.ThumbnailDetails>(); |
| 2875 | o.add(buildThumbnailDetails()); |
| 2876 | o.add(buildThumbnailDetails()); |
| 2877 | return o; |
| 2878 | } |
| 2879 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2880 | checkUnnamed361(core.List<api.ThumbnailDetails> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2881 | unittest.expect(o, unittest.hasLength(2)); |
| 2882 | checkThumbnailDetails(o[0]); |
| 2883 | checkThumbnailDetails(o[1]); |
| 2884 | } |
| 2885 | |
| 2886 | core.int buildCounterThumbnailSetResponse = 0; |
| 2887 | buildThumbnailSetResponse() { |
| 2888 | var o = new api.ThumbnailSetResponse(); |
| 2889 | buildCounterThumbnailSetResponse++; |
| 2890 | if (buildCounterThumbnailSetResponse < 3) { |
| 2891 | o.etag = "foo"; |
| 2892 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2893 | o.items = buildUnnamed361(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2894 | o.kind = "foo"; |
| 2895 | o.visitorId = "foo"; |
| 2896 | } |
| 2897 | buildCounterThumbnailSetResponse--; |
| 2898 | return o; |
| 2899 | } |
| 2900 | |
| 2901 | checkThumbnailSetResponse(api.ThumbnailSetResponse o) { |
| 2902 | buildCounterThumbnailSetResponse++; |
| 2903 | if (buildCounterThumbnailSetResponse < 3) { |
| 2904 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2905 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 2906 | checkUnnamed361(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 2907 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2908 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 2909 | } |
| 2910 | buildCounterThumbnailSetResponse--; |
| 2911 | } |
| 2912 | |
| 2913 | core.int buildCounterTokenPagination = 0; |
| 2914 | buildTokenPagination() { |
| 2915 | var o = new api.TokenPagination(); |
| 2916 | buildCounterTokenPagination++; |
| 2917 | if (buildCounterTokenPagination < 3) { |
| 2918 | } |
| 2919 | buildCounterTokenPagination--; |
| 2920 | return o; |
| 2921 | } |
| 2922 | |
| 2923 | checkTokenPagination(api.TokenPagination o) { |
| 2924 | buildCounterTokenPagination++; |
| 2925 | if (buildCounterTokenPagination < 3) { |
| 2926 | } |
| 2927 | buildCounterTokenPagination--; |
| 2928 | } |
| 2929 | |
| 2930 | core.int buildCounterVideo = 0; |
| 2931 | buildVideo() { |
| 2932 | var o = new api.Video(); |
| 2933 | buildCounterVideo++; |
| 2934 | if (buildCounterVideo < 3) { |
| 2935 | o.ageGating = buildVideoAgeGating(); |
| 2936 | o.contentDetails = buildVideoContentDetails(); |
| 2937 | o.conversionPings = buildVideoConversionPings(); |
| 2938 | o.etag = "foo"; |
| 2939 | o.fileDetails = buildVideoFileDetails(); |
| 2940 | o.id = "foo"; |
| 2941 | o.kind = "foo"; |
| 2942 | o.liveStreamingDetails = buildVideoLiveStreamingDetails(); |
| 2943 | o.monetizationDetails = buildVideoMonetizationDetails(); |
| 2944 | o.player = buildVideoPlayer(); |
| 2945 | o.processingDetails = buildVideoProcessingDetails(); |
| 2946 | o.projectDetails = buildVideoProjectDetails(); |
| 2947 | o.recordingDetails = buildVideoRecordingDetails(); |
| 2948 | o.snippet = buildVideoSnippet(); |
| 2949 | o.statistics = buildVideoStatistics(); |
| 2950 | o.status = buildVideoStatus(); |
| 2951 | o.suggestions = buildVideoSuggestions(); |
| 2952 | o.topicDetails = buildVideoTopicDetails(); |
| 2953 | } |
| 2954 | buildCounterVideo--; |
| 2955 | return o; |
| 2956 | } |
| 2957 | |
| 2958 | checkVideo(api.Video o) { |
| 2959 | buildCounterVideo++; |
| 2960 | if (buildCounterVideo < 3) { |
| 2961 | checkVideoAgeGating(o.ageGating); |
| 2962 | checkVideoContentDetails(o.contentDetails); |
| 2963 | checkVideoConversionPings(o.conversionPings); |
| 2964 | unittest.expect(o.etag, unittest.equals('foo')); |
| 2965 | checkVideoFileDetails(o.fileDetails); |
| 2966 | unittest.expect(o.id, unittest.equals('foo')); |
| 2967 | unittest.expect(o.kind, unittest.equals('foo')); |
| 2968 | checkVideoLiveStreamingDetails(o.liveStreamingDetails); |
| 2969 | checkVideoMonetizationDetails(o.monetizationDetails); |
| 2970 | checkVideoPlayer(o.player); |
| 2971 | checkVideoProcessingDetails(o.processingDetails); |
| 2972 | checkVideoProjectDetails(o.projectDetails); |
| 2973 | checkVideoRecordingDetails(o.recordingDetails); |
| 2974 | checkVideoSnippet(o.snippet); |
| 2975 | checkVideoStatistics(o.statistics); |
| 2976 | checkVideoStatus(o.status); |
| 2977 | checkVideoSuggestions(o.suggestions); |
| 2978 | checkVideoTopicDetails(o.topicDetails); |
| 2979 | } |
| 2980 | buildCounterVideo--; |
| 2981 | } |
| 2982 | |
| 2983 | core.int buildCounterVideoAgeGating = 0; |
| 2984 | buildVideoAgeGating() { |
| 2985 | var o = new api.VideoAgeGating(); |
| 2986 | buildCounterVideoAgeGating++; |
| 2987 | if (buildCounterVideoAgeGating < 3) { |
| 2988 | o.alcoholContent = true; |
| 2989 | o.restricted = true; |
| 2990 | o.videoGameRating = "foo"; |
| 2991 | } |
| 2992 | buildCounterVideoAgeGating--; |
| 2993 | return o; |
| 2994 | } |
| 2995 | |
| 2996 | checkVideoAgeGating(api.VideoAgeGating o) { |
| 2997 | buildCounterVideoAgeGating++; |
| 2998 | if (buildCounterVideoAgeGating < 3) { |
| 2999 | unittest.expect(o.alcoholContent, unittest.isTrue); |
| 3000 | unittest.expect(o.restricted, unittest.isTrue); |
| 3001 | unittest.expect(o.videoGameRating, unittest.equals('foo')); |
| 3002 | } |
| 3003 | buildCounterVideoAgeGating--; |
| 3004 | } |
| 3005 | |
| 3006 | core.int buildCounterVideoCategory = 0; |
| 3007 | buildVideoCategory() { |
| 3008 | var o = new api.VideoCategory(); |
| 3009 | buildCounterVideoCategory++; |
| 3010 | if (buildCounterVideoCategory < 3) { |
| 3011 | o.etag = "foo"; |
| 3012 | o.id = "foo"; |
| 3013 | o.kind = "foo"; |
| 3014 | o.snippet = buildVideoCategorySnippet(); |
| 3015 | } |
| 3016 | buildCounterVideoCategory--; |
| 3017 | return o; |
| 3018 | } |
| 3019 | |
| 3020 | checkVideoCategory(api.VideoCategory o) { |
| 3021 | buildCounterVideoCategory++; |
| 3022 | if (buildCounterVideoCategory < 3) { |
| 3023 | unittest.expect(o.etag, unittest.equals('foo')); |
| 3024 | unittest.expect(o.id, unittest.equals('foo')); |
| 3025 | unittest.expect(o.kind, unittest.equals('foo')); |
| 3026 | checkVideoCategorySnippet(o.snippet); |
| 3027 | } |
| 3028 | buildCounterVideoCategory--; |
| 3029 | } |
| 3030 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3031 | buildUnnamed362() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3032 | var o = new core.List<api.VideoCategory>(); |
| 3033 | o.add(buildVideoCategory()); |
| 3034 | o.add(buildVideoCategory()); |
| 3035 | return o; |
| 3036 | } |
| 3037 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3038 | checkUnnamed362(core.List<api.VideoCategory> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3039 | unittest.expect(o, unittest.hasLength(2)); |
| 3040 | checkVideoCategory(o[0]); |
| 3041 | checkVideoCategory(o[1]); |
| 3042 | } |
| 3043 | |
| 3044 | core.int buildCounterVideoCategoryListResponse = 0; |
| 3045 | buildVideoCategoryListResponse() { |
| 3046 | var o = new api.VideoCategoryListResponse(); |
| 3047 | buildCounterVideoCategoryListResponse++; |
| 3048 | if (buildCounterVideoCategoryListResponse < 3) { |
| 3049 | o.etag = "foo"; |
| 3050 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3051 | o.items = buildUnnamed362(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3052 | o.kind = "foo"; |
| 3053 | o.nextPageToken = "foo"; |
| 3054 | o.pageInfo = buildPageInfo(); |
| 3055 | o.prevPageToken = "foo"; |
| 3056 | o.tokenPagination = buildTokenPagination(); |
| 3057 | o.visitorId = "foo"; |
| 3058 | } |
| 3059 | buildCounterVideoCategoryListResponse--; |
| 3060 | return o; |
| 3061 | } |
| 3062 | |
| 3063 | checkVideoCategoryListResponse(api.VideoCategoryListResponse o) { |
| 3064 | buildCounterVideoCategoryListResponse++; |
| 3065 | if (buildCounterVideoCategoryListResponse < 3) { |
| 3066 | unittest.expect(o.etag, unittest.equals('foo')); |
| 3067 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3068 | checkUnnamed362(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3069 | unittest.expect(o.kind, unittest.equals('foo')); |
| 3070 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 3071 | checkPageInfo(o.pageInfo); |
| 3072 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 3073 | checkTokenPagination(o.tokenPagination); |
| 3074 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 3075 | } |
| 3076 | buildCounterVideoCategoryListResponse--; |
| 3077 | } |
| 3078 | |
| 3079 | core.int buildCounterVideoCategorySnippet = 0; |
| 3080 | buildVideoCategorySnippet() { |
| 3081 | var o = new api.VideoCategorySnippet(); |
| 3082 | buildCounterVideoCategorySnippet++; |
| 3083 | if (buildCounterVideoCategorySnippet < 3) { |
| 3084 | o.assignable = true; |
| 3085 | o.channelId = "foo"; |
| 3086 | o.title = "foo"; |
| 3087 | } |
| 3088 | buildCounterVideoCategorySnippet--; |
| 3089 | return o; |
| 3090 | } |
| 3091 | |
| 3092 | checkVideoCategorySnippet(api.VideoCategorySnippet o) { |
| 3093 | buildCounterVideoCategorySnippet++; |
| 3094 | if (buildCounterVideoCategorySnippet < 3) { |
| 3095 | unittest.expect(o.assignable, unittest.isTrue); |
| 3096 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 3097 | unittest.expect(o.title, unittest.equals('foo')); |
| 3098 | } |
| 3099 | buildCounterVideoCategorySnippet--; |
| 3100 | } |
| 3101 | |
| 3102 | core.int buildCounterVideoContentDetails = 0; |
| 3103 | buildVideoContentDetails() { |
| 3104 | var o = new api.VideoContentDetails(); |
| 3105 | buildCounterVideoContentDetails++; |
| 3106 | if (buildCounterVideoContentDetails < 3) { |
| 3107 | o.caption = "foo"; |
| 3108 | o.contentRating = buildContentRating(); |
| 3109 | o.countryRestriction = buildAccessPolicy(); |
| 3110 | o.definition = "foo"; |
| 3111 | o.dimension = "foo"; |
| 3112 | o.duration = "foo"; |
| 3113 | o.licensedContent = true; |
| 3114 | o.regionRestriction = buildVideoContentDetailsRegionRestriction(); |
| 3115 | } |
| 3116 | buildCounterVideoContentDetails--; |
| 3117 | return o; |
| 3118 | } |
| 3119 | |
| 3120 | checkVideoContentDetails(api.VideoContentDetails o) { |
| 3121 | buildCounterVideoContentDetails++; |
| 3122 | if (buildCounterVideoContentDetails < 3) { |
| 3123 | unittest.expect(o.caption, unittest.equals('foo')); |
| 3124 | checkContentRating(o.contentRating); |
| 3125 | checkAccessPolicy(o.countryRestriction); |
| 3126 | unittest.expect(o.definition, unittest.equals('foo')); |
| 3127 | unittest.expect(o.dimension, unittest.equals('foo')); |
| 3128 | unittest.expect(o.duration, unittest.equals('foo')); |
| 3129 | unittest.expect(o.licensedContent, unittest.isTrue); |
| 3130 | checkVideoContentDetailsRegionRestriction(o.regionRestriction); |
| 3131 | } |
| 3132 | buildCounterVideoContentDetails--; |
| 3133 | } |
| 3134 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3135 | buildUnnamed363() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3136 | var o = new core.List<core.String>(); |
| 3137 | o.add("foo"); |
| 3138 | o.add("foo"); |
| 3139 | return o; |
| 3140 | } |
| 3141 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3142 | checkUnnamed363(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3143 | unittest.expect(o, unittest.hasLength(2)); |
| 3144 | unittest.expect(o[0], unittest.equals('foo')); |
| 3145 | unittest.expect(o[1], unittest.equals('foo')); |
| 3146 | } |
| 3147 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3148 | buildUnnamed364() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3149 | var o = new core.List<core.String>(); |
| 3150 | o.add("foo"); |
| 3151 | o.add("foo"); |
| 3152 | return o; |
| 3153 | } |
| 3154 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3155 | checkUnnamed364(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3156 | unittest.expect(o, unittest.hasLength(2)); |
| 3157 | unittest.expect(o[0], unittest.equals('foo')); |
| 3158 | unittest.expect(o[1], unittest.equals('foo')); |
| 3159 | } |
| 3160 | |
| 3161 | core.int buildCounterVideoContentDetailsRegionRestriction = 0; |
| 3162 | buildVideoContentDetailsRegionRestriction() { |
| 3163 | var o = new api.VideoContentDetailsRegionRestriction(); |
| 3164 | buildCounterVideoContentDetailsRegionRestriction++; |
| 3165 | if (buildCounterVideoContentDetailsRegionRestriction < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3166 | o.allowed = buildUnnamed363(); |
| 3167 | o.blocked = buildUnnamed364(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3168 | } |
| 3169 | buildCounterVideoContentDetailsRegionRestriction--; |
| 3170 | return o; |
| 3171 | } |
| 3172 | |
| 3173 | checkVideoContentDetailsRegionRestriction(api.VideoContentDetailsRegionRestriction o) { |
| 3174 | buildCounterVideoContentDetailsRegionRestriction++; |
| 3175 | if (buildCounterVideoContentDetailsRegionRestriction < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3176 | checkUnnamed363(o.allowed); |
| 3177 | checkUnnamed364(o.blocked); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3178 | } |
| 3179 | buildCounterVideoContentDetailsRegionRestriction--; |
| 3180 | } |
| 3181 | |
| 3182 | core.int buildCounterVideoConversionPing = 0; |
| 3183 | buildVideoConversionPing() { |
| 3184 | var o = new api.VideoConversionPing(); |
| 3185 | buildCounterVideoConversionPing++; |
| 3186 | if (buildCounterVideoConversionPing < 3) { |
| 3187 | o.context = "foo"; |
| 3188 | o.conversionUrl = "foo"; |
| 3189 | } |
| 3190 | buildCounterVideoConversionPing--; |
| 3191 | return o; |
| 3192 | } |
| 3193 | |
| 3194 | checkVideoConversionPing(api.VideoConversionPing o) { |
| 3195 | buildCounterVideoConversionPing++; |
| 3196 | if (buildCounterVideoConversionPing < 3) { |
| 3197 | unittest.expect(o.context, unittest.equals('foo')); |
| 3198 | unittest.expect(o.conversionUrl, unittest.equals('foo')); |
| 3199 | } |
| 3200 | buildCounterVideoConversionPing--; |
| 3201 | } |
| 3202 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3203 | buildUnnamed365() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3204 | var o = new core.List<api.VideoConversionPing>(); |
| 3205 | o.add(buildVideoConversionPing()); |
| 3206 | o.add(buildVideoConversionPing()); |
| 3207 | return o; |
| 3208 | } |
| 3209 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3210 | checkUnnamed365(core.List<api.VideoConversionPing> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3211 | unittest.expect(o, unittest.hasLength(2)); |
| 3212 | checkVideoConversionPing(o[0]); |
| 3213 | checkVideoConversionPing(o[1]); |
| 3214 | } |
| 3215 | |
| 3216 | core.int buildCounterVideoConversionPings = 0; |
| 3217 | buildVideoConversionPings() { |
| 3218 | var o = new api.VideoConversionPings(); |
| 3219 | buildCounterVideoConversionPings++; |
| 3220 | if (buildCounterVideoConversionPings < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3221 | o.pings = buildUnnamed365(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3222 | } |
| 3223 | buildCounterVideoConversionPings--; |
| 3224 | return o; |
| 3225 | } |
| 3226 | |
| 3227 | checkVideoConversionPings(api.VideoConversionPings o) { |
| 3228 | buildCounterVideoConversionPings++; |
| 3229 | if (buildCounterVideoConversionPings < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3230 | checkUnnamed365(o.pings); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3231 | } |
| 3232 | buildCounterVideoConversionPings--; |
| 3233 | } |
| 3234 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3235 | buildUnnamed366() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3236 | var o = new core.List<api.VideoFileDetailsAudioStream>(); |
| 3237 | o.add(buildVideoFileDetailsAudioStream()); |
| 3238 | o.add(buildVideoFileDetailsAudioStream()); |
| 3239 | return o; |
| 3240 | } |
| 3241 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3242 | checkUnnamed366(core.List<api.VideoFileDetailsAudioStream> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3243 | unittest.expect(o, unittest.hasLength(2)); |
| 3244 | checkVideoFileDetailsAudioStream(o[0]); |
| 3245 | checkVideoFileDetailsAudioStream(o[1]); |
| 3246 | } |
| 3247 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3248 | buildUnnamed367() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3249 | var o = new core.List<api.VideoFileDetailsVideoStream>(); |
| 3250 | o.add(buildVideoFileDetailsVideoStream()); |
| 3251 | o.add(buildVideoFileDetailsVideoStream()); |
| 3252 | return o; |
| 3253 | } |
| 3254 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3255 | checkUnnamed367(core.List<api.VideoFileDetailsVideoStream> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3256 | unittest.expect(o, unittest.hasLength(2)); |
| 3257 | checkVideoFileDetailsVideoStream(o[0]); |
| 3258 | checkVideoFileDetailsVideoStream(o[1]); |
| 3259 | } |
| 3260 | |
| 3261 | core.int buildCounterVideoFileDetails = 0; |
| 3262 | buildVideoFileDetails() { |
| 3263 | var o = new api.VideoFileDetails(); |
| 3264 | buildCounterVideoFileDetails++; |
| 3265 | if (buildCounterVideoFileDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3266 | o.audioStreams = buildUnnamed366(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3267 | o.bitrateBps = "foo"; |
| 3268 | o.container = "foo"; |
| 3269 | o.creationTime = "foo"; |
| 3270 | o.durationMs = "foo"; |
| 3271 | o.fileName = "foo"; |
| 3272 | o.fileSize = "foo"; |
| 3273 | o.fileType = "foo"; |
| 3274 | o.recordingLocation = buildGeoPoint(); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3275 | o.videoStreams = buildUnnamed367(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3276 | } |
| 3277 | buildCounterVideoFileDetails--; |
| 3278 | return o; |
| 3279 | } |
| 3280 | |
| 3281 | checkVideoFileDetails(api.VideoFileDetails o) { |
| 3282 | buildCounterVideoFileDetails++; |
| 3283 | if (buildCounterVideoFileDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3284 | checkUnnamed366(o.audioStreams); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3285 | unittest.expect(o.bitrateBps, unittest.equals('foo')); |
| 3286 | unittest.expect(o.container, unittest.equals('foo')); |
| 3287 | unittest.expect(o.creationTime, unittest.equals('foo')); |
| 3288 | unittest.expect(o.durationMs, unittest.equals('foo')); |
| 3289 | unittest.expect(o.fileName, unittest.equals('foo')); |
| 3290 | unittest.expect(o.fileSize, unittest.equals('foo')); |
| 3291 | unittest.expect(o.fileType, unittest.equals('foo')); |
| 3292 | checkGeoPoint(o.recordingLocation); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3293 | checkUnnamed367(o.videoStreams); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3294 | } |
| 3295 | buildCounterVideoFileDetails--; |
| 3296 | } |
| 3297 | |
| 3298 | core.int buildCounterVideoFileDetailsAudioStream = 0; |
| 3299 | buildVideoFileDetailsAudioStream() { |
| 3300 | var o = new api.VideoFileDetailsAudioStream(); |
| 3301 | buildCounterVideoFileDetailsAudioStream++; |
| 3302 | if (buildCounterVideoFileDetailsAudioStream < 3) { |
| 3303 | o.bitrateBps = "foo"; |
| 3304 | o.channelCount = 42; |
| 3305 | o.codec = "foo"; |
| 3306 | o.vendor = "foo"; |
| 3307 | } |
| 3308 | buildCounterVideoFileDetailsAudioStream--; |
| 3309 | return o; |
| 3310 | } |
| 3311 | |
| 3312 | checkVideoFileDetailsAudioStream(api.VideoFileDetailsAudioStream o) { |
| 3313 | buildCounterVideoFileDetailsAudioStream++; |
| 3314 | if (buildCounterVideoFileDetailsAudioStream < 3) { |
| 3315 | unittest.expect(o.bitrateBps, unittest.equals('foo')); |
| 3316 | unittest.expect(o.channelCount, unittest.equals(42)); |
| 3317 | unittest.expect(o.codec, unittest.equals('foo')); |
| 3318 | unittest.expect(o.vendor, unittest.equals('foo')); |
| 3319 | } |
| 3320 | buildCounterVideoFileDetailsAudioStream--; |
| 3321 | } |
| 3322 | |
| 3323 | core.int buildCounterVideoFileDetailsVideoStream = 0; |
| 3324 | buildVideoFileDetailsVideoStream() { |
| 3325 | var o = new api.VideoFileDetailsVideoStream(); |
| 3326 | buildCounterVideoFileDetailsVideoStream++; |
| 3327 | if (buildCounterVideoFileDetailsVideoStream < 3) { |
| 3328 | o.aspectRatio = 42.0; |
| 3329 | o.bitrateBps = "foo"; |
| 3330 | o.codec = "foo"; |
| 3331 | o.frameRateFps = 42.0; |
| 3332 | o.heightPixels = 42; |
| 3333 | o.rotation = "foo"; |
| 3334 | o.vendor = "foo"; |
| 3335 | o.widthPixels = 42; |
| 3336 | } |
| 3337 | buildCounterVideoFileDetailsVideoStream--; |
| 3338 | return o; |
| 3339 | } |
| 3340 | |
| 3341 | checkVideoFileDetailsVideoStream(api.VideoFileDetailsVideoStream o) { |
| 3342 | buildCounterVideoFileDetailsVideoStream++; |
| 3343 | if (buildCounterVideoFileDetailsVideoStream < 3) { |
| 3344 | unittest.expect(o.aspectRatio, unittest.equals(42.0)); |
| 3345 | unittest.expect(o.bitrateBps, unittest.equals('foo')); |
| 3346 | unittest.expect(o.codec, unittest.equals('foo')); |
| 3347 | unittest.expect(o.frameRateFps, unittest.equals(42.0)); |
| 3348 | unittest.expect(o.heightPixels, unittest.equals(42)); |
| 3349 | unittest.expect(o.rotation, unittest.equals('foo')); |
| 3350 | unittest.expect(o.vendor, unittest.equals('foo')); |
| 3351 | unittest.expect(o.widthPixels, unittest.equals(42)); |
| 3352 | } |
| 3353 | buildCounterVideoFileDetailsVideoStream--; |
| 3354 | } |
| 3355 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3356 | buildUnnamed368() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3357 | var o = new core.List<api.VideoRating>(); |
| 3358 | o.add(buildVideoRating()); |
| 3359 | o.add(buildVideoRating()); |
| 3360 | return o; |
| 3361 | } |
| 3362 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3363 | checkUnnamed368(core.List<api.VideoRating> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3364 | unittest.expect(o, unittest.hasLength(2)); |
| 3365 | checkVideoRating(o[0]); |
| 3366 | checkVideoRating(o[1]); |
| 3367 | } |
| 3368 | |
| 3369 | core.int buildCounterVideoGetRatingResponse = 0; |
| 3370 | buildVideoGetRatingResponse() { |
| 3371 | var o = new api.VideoGetRatingResponse(); |
| 3372 | buildCounterVideoGetRatingResponse++; |
| 3373 | if (buildCounterVideoGetRatingResponse < 3) { |
| 3374 | o.etag = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3375 | o.items = buildUnnamed368(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3376 | o.kind = "foo"; |
| 3377 | } |
| 3378 | buildCounterVideoGetRatingResponse--; |
| 3379 | return o; |
| 3380 | } |
| 3381 | |
| 3382 | checkVideoGetRatingResponse(api.VideoGetRatingResponse o) { |
| 3383 | buildCounterVideoGetRatingResponse++; |
| 3384 | if (buildCounterVideoGetRatingResponse < 3) { |
| 3385 | unittest.expect(o.etag, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3386 | checkUnnamed368(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3387 | unittest.expect(o.kind, unittest.equals('foo')); |
| 3388 | } |
| 3389 | buildCounterVideoGetRatingResponse--; |
| 3390 | } |
| 3391 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3392 | buildUnnamed369() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3393 | var o = new core.List<api.Video>(); |
| 3394 | o.add(buildVideo()); |
| 3395 | o.add(buildVideo()); |
| 3396 | return o; |
| 3397 | } |
| 3398 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3399 | checkUnnamed369(core.List<api.Video> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3400 | unittest.expect(o, unittest.hasLength(2)); |
| 3401 | checkVideo(o[0]); |
| 3402 | checkVideo(o[1]); |
| 3403 | } |
| 3404 | |
| 3405 | core.int buildCounterVideoListResponse = 0; |
| 3406 | buildVideoListResponse() { |
| 3407 | var o = new api.VideoListResponse(); |
| 3408 | buildCounterVideoListResponse++; |
| 3409 | if (buildCounterVideoListResponse < 3) { |
| 3410 | o.etag = "foo"; |
| 3411 | o.eventId = "foo"; |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3412 | o.items = buildUnnamed369(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3413 | o.kind = "foo"; |
| 3414 | o.nextPageToken = "foo"; |
| 3415 | o.pageInfo = buildPageInfo(); |
| 3416 | o.prevPageToken = "foo"; |
| 3417 | o.tokenPagination = buildTokenPagination(); |
| 3418 | o.visitorId = "foo"; |
| 3419 | } |
| 3420 | buildCounterVideoListResponse--; |
| 3421 | return o; |
| 3422 | } |
| 3423 | |
| 3424 | checkVideoListResponse(api.VideoListResponse o) { |
| 3425 | buildCounterVideoListResponse++; |
| 3426 | if (buildCounterVideoListResponse < 3) { |
| 3427 | unittest.expect(o.etag, unittest.equals('foo')); |
| 3428 | unittest.expect(o.eventId, unittest.equals('foo')); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3429 | checkUnnamed369(o.items); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3430 | unittest.expect(o.kind, unittest.equals('foo')); |
| 3431 | unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 3432 | checkPageInfo(o.pageInfo); |
| 3433 | unittest.expect(o.prevPageToken, unittest.equals('foo')); |
| 3434 | checkTokenPagination(o.tokenPagination); |
| 3435 | unittest.expect(o.visitorId, unittest.equals('foo')); |
| 3436 | } |
| 3437 | buildCounterVideoListResponse--; |
| 3438 | } |
| 3439 | |
| 3440 | core.int buildCounterVideoLiveStreamingDetails = 0; |
| 3441 | buildVideoLiveStreamingDetails() { |
| 3442 | var o = new api.VideoLiveStreamingDetails(); |
| 3443 | buildCounterVideoLiveStreamingDetails++; |
| 3444 | if (buildCounterVideoLiveStreamingDetails < 3) { |
| 3445 | o.actualEndTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3446 | o.actualStartTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3447 | o.concurrentViewers = "foo"; |
| 3448 | o.scheduledEndTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3449 | o.scheduledStartTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3450 | } |
| 3451 | buildCounterVideoLiveStreamingDetails--; |
| 3452 | return o; |
| 3453 | } |
| 3454 | |
| 3455 | checkVideoLiveStreamingDetails(api.VideoLiveStreamingDetails o) { |
| 3456 | buildCounterVideoLiveStreamingDetails++; |
| 3457 | if (buildCounterVideoLiveStreamingDetails < 3) { |
| 3458 | unittest.expect(o.actualEndTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 3459 | unittest.expect(o.actualStartTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 3460 | unittest.expect(o.concurrentViewers, unittest.equals('foo')); |
| 3461 | unittest.expect(o.scheduledEndTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 3462 | unittest.expect(o.scheduledStartTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 3463 | } |
| 3464 | buildCounterVideoLiveStreamingDetails--; |
| 3465 | } |
| 3466 | |
| 3467 | core.int buildCounterVideoMonetizationDetails = 0; |
| 3468 | buildVideoMonetizationDetails() { |
| 3469 | var o = new api.VideoMonetizationDetails(); |
| 3470 | buildCounterVideoMonetizationDetails++; |
| 3471 | if (buildCounterVideoMonetizationDetails < 3) { |
| 3472 | o.access = buildAccessPolicy(); |
| 3473 | } |
| 3474 | buildCounterVideoMonetizationDetails--; |
| 3475 | return o; |
| 3476 | } |
| 3477 | |
| 3478 | checkVideoMonetizationDetails(api.VideoMonetizationDetails o) { |
| 3479 | buildCounterVideoMonetizationDetails++; |
| 3480 | if (buildCounterVideoMonetizationDetails < 3) { |
| 3481 | checkAccessPolicy(o.access); |
| 3482 | } |
| 3483 | buildCounterVideoMonetizationDetails--; |
| 3484 | } |
| 3485 | |
| 3486 | core.int buildCounterVideoPlayer = 0; |
| 3487 | buildVideoPlayer() { |
| 3488 | var o = new api.VideoPlayer(); |
| 3489 | buildCounterVideoPlayer++; |
| 3490 | if (buildCounterVideoPlayer < 3) { |
| 3491 | o.embedHtml = "foo"; |
| 3492 | } |
| 3493 | buildCounterVideoPlayer--; |
| 3494 | return o; |
| 3495 | } |
| 3496 | |
| 3497 | checkVideoPlayer(api.VideoPlayer o) { |
| 3498 | buildCounterVideoPlayer++; |
| 3499 | if (buildCounterVideoPlayer < 3) { |
| 3500 | unittest.expect(o.embedHtml, unittest.equals('foo')); |
| 3501 | } |
| 3502 | buildCounterVideoPlayer--; |
| 3503 | } |
| 3504 | |
| 3505 | core.int buildCounterVideoProcessingDetails = 0; |
| 3506 | buildVideoProcessingDetails() { |
| 3507 | var o = new api.VideoProcessingDetails(); |
| 3508 | buildCounterVideoProcessingDetails++; |
| 3509 | if (buildCounterVideoProcessingDetails < 3) { |
| 3510 | o.editorSuggestionsAvailability = "foo"; |
| 3511 | o.fileDetailsAvailability = "foo"; |
| 3512 | o.processingFailureReason = "foo"; |
| 3513 | o.processingIssuesAvailability = "foo"; |
| 3514 | o.processingProgress = buildVideoProcessingDetailsProcessingProgress(); |
| 3515 | o.processingStatus = "foo"; |
| 3516 | o.tagSuggestionsAvailability = "foo"; |
| 3517 | o.thumbnailsAvailability = "foo"; |
| 3518 | } |
| 3519 | buildCounterVideoProcessingDetails--; |
| 3520 | return o; |
| 3521 | } |
| 3522 | |
| 3523 | checkVideoProcessingDetails(api.VideoProcessingDetails o) { |
| 3524 | buildCounterVideoProcessingDetails++; |
| 3525 | if (buildCounterVideoProcessingDetails < 3) { |
| 3526 | unittest.expect(o.editorSuggestionsAvailability, unittest.equals('foo')); |
| 3527 | unittest.expect(o.fileDetailsAvailability, unittest.equals('foo')); |
| 3528 | unittest.expect(o.processingFailureReason, unittest.equals('foo')); |
| 3529 | unittest.expect(o.processingIssuesAvailability, unittest.equals('foo')); |
| 3530 | checkVideoProcessingDetailsProcessingProgress(o.processingProgress); |
| 3531 | unittest.expect(o.processingStatus, unittest.equals('foo')); |
| 3532 | unittest.expect(o.tagSuggestionsAvailability, unittest.equals('foo')); |
| 3533 | unittest.expect(o.thumbnailsAvailability, unittest.equals('foo')); |
| 3534 | } |
| 3535 | buildCounterVideoProcessingDetails--; |
| 3536 | } |
| 3537 | |
| 3538 | core.int buildCounterVideoProcessingDetailsProcessingProgress = 0; |
| 3539 | buildVideoProcessingDetailsProcessingProgress() { |
| 3540 | var o = new api.VideoProcessingDetailsProcessingProgress(); |
| 3541 | buildCounterVideoProcessingDetailsProcessingProgress++; |
| 3542 | if (buildCounterVideoProcessingDetailsProcessingProgress < 3) { |
| 3543 | o.partsProcessed = "foo"; |
| 3544 | o.partsTotal = "foo"; |
| 3545 | o.timeLeftMs = "foo"; |
| 3546 | } |
| 3547 | buildCounterVideoProcessingDetailsProcessingProgress--; |
| 3548 | return o; |
| 3549 | } |
| 3550 | |
| 3551 | checkVideoProcessingDetailsProcessingProgress(api.VideoProcessingDetailsProcessingProgress o) { |
| 3552 | buildCounterVideoProcessingDetailsProcessingProgress++; |
| 3553 | if (buildCounterVideoProcessingDetailsProcessingProgress < 3) { |
| 3554 | unittest.expect(o.partsProcessed, unittest.equals('foo')); |
| 3555 | unittest.expect(o.partsTotal, unittest.equals('foo')); |
| 3556 | unittest.expect(o.timeLeftMs, unittest.equals('foo')); |
| 3557 | } |
| 3558 | buildCounterVideoProcessingDetailsProcessingProgress--; |
| 3559 | } |
| 3560 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3561 | buildUnnamed370() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3562 | var o = new core.List<core.String>(); |
| 3563 | o.add("foo"); |
| 3564 | o.add("foo"); |
| 3565 | return o; |
| 3566 | } |
| 3567 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3568 | checkUnnamed370(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3569 | unittest.expect(o, unittest.hasLength(2)); |
| 3570 | unittest.expect(o[0], unittest.equals('foo')); |
| 3571 | unittest.expect(o[1], unittest.equals('foo')); |
| 3572 | } |
| 3573 | |
| 3574 | core.int buildCounterVideoProjectDetails = 0; |
| 3575 | buildVideoProjectDetails() { |
| 3576 | var o = new api.VideoProjectDetails(); |
| 3577 | buildCounterVideoProjectDetails++; |
| 3578 | if (buildCounterVideoProjectDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3579 | o.tags = buildUnnamed370(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3580 | } |
| 3581 | buildCounterVideoProjectDetails--; |
| 3582 | return o; |
| 3583 | } |
| 3584 | |
| 3585 | checkVideoProjectDetails(api.VideoProjectDetails o) { |
| 3586 | buildCounterVideoProjectDetails++; |
| 3587 | if (buildCounterVideoProjectDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3588 | checkUnnamed370(o.tags); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3589 | } |
| 3590 | buildCounterVideoProjectDetails--; |
| 3591 | } |
| 3592 | |
| 3593 | core.int buildCounterVideoRating = 0; |
| 3594 | buildVideoRating() { |
| 3595 | var o = new api.VideoRating(); |
| 3596 | buildCounterVideoRating++; |
| 3597 | if (buildCounterVideoRating < 3) { |
| 3598 | o.rating = "foo"; |
| 3599 | o.videoId = "foo"; |
| 3600 | } |
| 3601 | buildCounterVideoRating--; |
| 3602 | return o; |
| 3603 | } |
| 3604 | |
| 3605 | checkVideoRating(api.VideoRating o) { |
| 3606 | buildCounterVideoRating++; |
| 3607 | if (buildCounterVideoRating < 3) { |
| 3608 | unittest.expect(o.rating, unittest.equals('foo')); |
| 3609 | unittest.expect(o.videoId, unittest.equals('foo')); |
| 3610 | } |
| 3611 | buildCounterVideoRating--; |
| 3612 | } |
| 3613 | |
| 3614 | core.int buildCounterVideoRecordingDetails = 0; |
| 3615 | buildVideoRecordingDetails() { |
| 3616 | var o = new api.VideoRecordingDetails(); |
| 3617 | buildCounterVideoRecordingDetails++; |
| 3618 | if (buildCounterVideoRecordingDetails < 3) { |
| 3619 | o.location = buildGeoPoint(); |
| 3620 | o.locationDescription = "foo"; |
| 3621 | o.recordingDate = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3622 | } |
| 3623 | buildCounterVideoRecordingDetails--; |
| 3624 | return o; |
| 3625 | } |
| 3626 | |
| 3627 | checkVideoRecordingDetails(api.VideoRecordingDetails o) { |
| 3628 | buildCounterVideoRecordingDetails++; |
| 3629 | if (buildCounterVideoRecordingDetails < 3) { |
| 3630 | checkGeoPoint(o.location); |
| 3631 | unittest.expect(o.locationDescription, unittest.equals('foo')); |
| 3632 | unittest.expect(o.recordingDate, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 3633 | } |
| 3634 | buildCounterVideoRecordingDetails--; |
| 3635 | } |
| 3636 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3637 | buildUnnamed371() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3638 | var o = new core.List<core.String>(); |
| 3639 | o.add("foo"); |
| 3640 | o.add("foo"); |
| 3641 | return o; |
| 3642 | } |
| 3643 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3644 | checkUnnamed371(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3645 | unittest.expect(o, unittest.hasLength(2)); |
| 3646 | unittest.expect(o[0], unittest.equals('foo')); |
| 3647 | unittest.expect(o[1], unittest.equals('foo')); |
| 3648 | } |
| 3649 | |
| 3650 | core.int buildCounterVideoSnippet = 0; |
| 3651 | buildVideoSnippet() { |
| 3652 | var o = new api.VideoSnippet(); |
| 3653 | buildCounterVideoSnippet++; |
| 3654 | if (buildCounterVideoSnippet < 3) { |
| 3655 | o.categoryId = "foo"; |
| 3656 | o.channelId = "foo"; |
| 3657 | o.channelTitle = "foo"; |
| 3658 | o.description = "foo"; |
| 3659 | o.liveBroadcastContent = "foo"; |
| 3660 | o.publishedAt = core.DateTime.parse("2002-02-27T14:01:02"); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3661 | o.tags = buildUnnamed371(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3662 | o.thumbnails = buildThumbnailDetails(); |
| 3663 | o.title = "foo"; |
| 3664 | } |
| 3665 | buildCounterVideoSnippet--; |
| 3666 | return o; |
| 3667 | } |
| 3668 | |
| 3669 | checkVideoSnippet(api.VideoSnippet o) { |
| 3670 | buildCounterVideoSnippet++; |
| 3671 | if (buildCounterVideoSnippet < 3) { |
| 3672 | unittest.expect(o.categoryId, unittest.equals('foo')); |
| 3673 | unittest.expect(o.channelId, unittest.equals('foo')); |
| 3674 | unittest.expect(o.channelTitle, unittest.equals('foo')); |
| 3675 | unittest.expect(o.description, unittest.equals('foo')); |
| 3676 | unittest.expect(o.liveBroadcastContent, unittest.equals('foo')); |
| 3677 | unittest.expect(o.publishedAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3678 | checkUnnamed371(o.tags); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3679 | checkThumbnailDetails(o.thumbnails); |
| 3680 | unittest.expect(o.title, unittest.equals('foo')); |
| 3681 | } |
| 3682 | buildCounterVideoSnippet--; |
| 3683 | } |
| 3684 | |
| 3685 | core.int buildCounterVideoStatistics = 0; |
| 3686 | buildVideoStatistics() { |
| 3687 | var o = new api.VideoStatistics(); |
| 3688 | buildCounterVideoStatistics++; |
| 3689 | if (buildCounterVideoStatistics < 3) { |
| 3690 | o.commentCount = "foo"; |
| 3691 | o.dislikeCount = "foo"; |
| 3692 | o.favoriteCount = "foo"; |
| 3693 | o.likeCount = "foo"; |
| 3694 | o.viewCount = "foo"; |
| 3695 | } |
| 3696 | buildCounterVideoStatistics--; |
| 3697 | return o; |
| 3698 | } |
| 3699 | |
| 3700 | checkVideoStatistics(api.VideoStatistics o) { |
| 3701 | buildCounterVideoStatistics++; |
| 3702 | if (buildCounterVideoStatistics < 3) { |
| 3703 | unittest.expect(o.commentCount, unittest.equals('foo')); |
| 3704 | unittest.expect(o.dislikeCount, unittest.equals('foo')); |
| 3705 | unittest.expect(o.favoriteCount, unittest.equals('foo')); |
| 3706 | unittest.expect(o.likeCount, unittest.equals('foo')); |
| 3707 | unittest.expect(o.viewCount, unittest.equals('foo')); |
| 3708 | } |
| 3709 | buildCounterVideoStatistics--; |
| 3710 | } |
| 3711 | |
| 3712 | core.int buildCounterVideoStatus = 0; |
| 3713 | buildVideoStatus() { |
| 3714 | var o = new api.VideoStatus(); |
| 3715 | buildCounterVideoStatus++; |
| 3716 | if (buildCounterVideoStatus < 3) { |
| 3717 | o.embeddable = true; |
| 3718 | o.failureReason = "foo"; |
| 3719 | o.license = "foo"; |
| 3720 | o.privacyStatus = "foo"; |
| 3721 | o.publicStatsViewable = true; |
| 3722 | o.publishAt = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3723 | o.rejectionReason = "foo"; |
| 3724 | o.uploadStatus = "foo"; |
| 3725 | } |
| 3726 | buildCounterVideoStatus--; |
| 3727 | return o; |
| 3728 | } |
| 3729 | |
| 3730 | checkVideoStatus(api.VideoStatus o) { |
| 3731 | buildCounterVideoStatus++; |
| 3732 | if (buildCounterVideoStatus < 3) { |
| 3733 | unittest.expect(o.embeddable, unittest.isTrue); |
| 3734 | unittest.expect(o.failureReason, unittest.equals('foo')); |
| 3735 | unittest.expect(o.license, unittest.equals('foo')); |
| 3736 | unittest.expect(o.privacyStatus, unittest.equals('foo')); |
| 3737 | unittest.expect(o.publicStatsViewable, unittest.isTrue); |
| 3738 | unittest.expect(o.publishAt, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 3739 | unittest.expect(o.rejectionReason, unittest.equals('foo')); |
| 3740 | unittest.expect(o.uploadStatus, unittest.equals('foo')); |
| 3741 | } |
| 3742 | buildCounterVideoStatus--; |
| 3743 | } |
| 3744 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3745 | buildUnnamed372() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3746 | var o = new core.List<core.String>(); |
| 3747 | o.add("foo"); |
| 3748 | o.add("foo"); |
| 3749 | return o; |
| 3750 | } |
| 3751 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3752 | checkUnnamed372(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3753 | unittest.expect(o, unittest.hasLength(2)); |
| 3754 | unittest.expect(o[0], unittest.equals('foo')); |
| 3755 | unittest.expect(o[1], unittest.equals('foo')); |
| 3756 | } |
| 3757 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3758 | buildUnnamed373() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3759 | var o = new core.List<core.String>(); |
| 3760 | o.add("foo"); |
| 3761 | o.add("foo"); |
| 3762 | return o; |
| 3763 | } |
| 3764 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3765 | checkUnnamed373(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3766 | unittest.expect(o, unittest.hasLength(2)); |
| 3767 | unittest.expect(o[0], unittest.equals('foo')); |
| 3768 | unittest.expect(o[1], unittest.equals('foo')); |
| 3769 | } |
| 3770 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3771 | buildUnnamed374() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3772 | var o = new core.List<core.String>(); |
| 3773 | o.add("foo"); |
| 3774 | o.add("foo"); |
| 3775 | return o; |
| 3776 | } |
| 3777 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3778 | checkUnnamed374(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3779 | unittest.expect(o, unittest.hasLength(2)); |
| 3780 | unittest.expect(o[0], unittest.equals('foo')); |
| 3781 | unittest.expect(o[1], unittest.equals('foo')); |
| 3782 | } |
| 3783 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3784 | buildUnnamed375() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3785 | var o = new core.List<core.String>(); |
| 3786 | o.add("foo"); |
| 3787 | o.add("foo"); |
| 3788 | return o; |
| 3789 | } |
| 3790 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3791 | checkUnnamed375(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3792 | unittest.expect(o, unittest.hasLength(2)); |
| 3793 | unittest.expect(o[0], unittest.equals('foo')); |
| 3794 | unittest.expect(o[1], unittest.equals('foo')); |
| 3795 | } |
| 3796 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3797 | buildUnnamed376() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3798 | var o = new core.List<api.VideoSuggestionsTagSuggestion>(); |
| 3799 | o.add(buildVideoSuggestionsTagSuggestion()); |
| 3800 | o.add(buildVideoSuggestionsTagSuggestion()); |
| 3801 | return o; |
| 3802 | } |
| 3803 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3804 | checkUnnamed376(core.List<api.VideoSuggestionsTagSuggestion> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3805 | unittest.expect(o, unittest.hasLength(2)); |
| 3806 | checkVideoSuggestionsTagSuggestion(o[0]); |
| 3807 | checkVideoSuggestionsTagSuggestion(o[1]); |
| 3808 | } |
| 3809 | |
| 3810 | core.int buildCounterVideoSuggestions = 0; |
| 3811 | buildVideoSuggestions() { |
| 3812 | var o = new api.VideoSuggestions(); |
| 3813 | buildCounterVideoSuggestions++; |
| 3814 | if (buildCounterVideoSuggestions < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3815 | o.editorSuggestions = buildUnnamed372(); |
| 3816 | o.processingErrors = buildUnnamed373(); |
| 3817 | o.processingHints = buildUnnamed374(); |
| 3818 | o.processingWarnings = buildUnnamed375(); |
| 3819 | o.tagSuggestions = buildUnnamed376(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3820 | } |
| 3821 | buildCounterVideoSuggestions--; |
| 3822 | return o; |
| 3823 | } |
| 3824 | |
| 3825 | checkVideoSuggestions(api.VideoSuggestions o) { |
| 3826 | buildCounterVideoSuggestions++; |
| 3827 | if (buildCounterVideoSuggestions < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3828 | checkUnnamed372(o.editorSuggestions); |
| 3829 | checkUnnamed373(o.processingErrors); |
| 3830 | checkUnnamed374(o.processingHints); |
| 3831 | checkUnnamed375(o.processingWarnings); |
| 3832 | checkUnnamed376(o.tagSuggestions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3833 | } |
| 3834 | buildCounterVideoSuggestions--; |
| 3835 | } |
| 3836 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3837 | buildUnnamed377() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3838 | var o = new core.List<core.String>(); |
| 3839 | o.add("foo"); |
| 3840 | o.add("foo"); |
| 3841 | return o; |
| 3842 | } |
| 3843 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3844 | checkUnnamed377(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3845 | unittest.expect(o, unittest.hasLength(2)); |
| 3846 | unittest.expect(o[0], unittest.equals('foo')); |
| 3847 | unittest.expect(o[1], unittest.equals('foo')); |
| 3848 | } |
| 3849 | |
| 3850 | core.int buildCounterVideoSuggestionsTagSuggestion = 0; |
| 3851 | buildVideoSuggestionsTagSuggestion() { |
| 3852 | var o = new api.VideoSuggestionsTagSuggestion(); |
| 3853 | buildCounterVideoSuggestionsTagSuggestion++; |
| 3854 | if (buildCounterVideoSuggestionsTagSuggestion < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3855 | o.categoryRestricts = buildUnnamed377(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3856 | o.tag = "foo"; |
| 3857 | } |
| 3858 | buildCounterVideoSuggestionsTagSuggestion--; |
| 3859 | return o; |
| 3860 | } |
| 3861 | |
| 3862 | checkVideoSuggestionsTagSuggestion(api.VideoSuggestionsTagSuggestion o) { |
| 3863 | buildCounterVideoSuggestionsTagSuggestion++; |
| 3864 | if (buildCounterVideoSuggestionsTagSuggestion < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3865 | checkUnnamed377(o.categoryRestricts); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3866 | unittest.expect(o.tag, unittest.equals('foo')); |
| 3867 | } |
| 3868 | buildCounterVideoSuggestionsTagSuggestion--; |
| 3869 | } |
| 3870 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3871 | buildUnnamed378() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3872 | var o = new core.List<core.String>(); |
| 3873 | o.add("foo"); |
| 3874 | o.add("foo"); |
| 3875 | return o; |
| 3876 | } |
| 3877 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3878 | checkUnnamed378(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3879 | unittest.expect(o, unittest.hasLength(2)); |
| 3880 | unittest.expect(o[0], unittest.equals('foo')); |
| 3881 | unittest.expect(o[1], unittest.equals('foo')); |
| 3882 | } |
| 3883 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3884 | buildUnnamed379() { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3885 | var o = new core.List<core.String>(); |
| 3886 | o.add("foo"); |
| 3887 | o.add("foo"); |
| 3888 | return o; |
| 3889 | } |
| 3890 | |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3891 | checkUnnamed379(core.List<core.String> o) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3892 | unittest.expect(o, unittest.hasLength(2)); |
| 3893 | unittest.expect(o[0], unittest.equals('foo')); |
| 3894 | unittest.expect(o[1], unittest.equals('foo')); |
| 3895 | } |
| 3896 | |
| 3897 | core.int buildCounterVideoTopicDetails = 0; |
| 3898 | buildVideoTopicDetails() { |
| 3899 | var o = new api.VideoTopicDetails(); |
| 3900 | buildCounterVideoTopicDetails++; |
| 3901 | if (buildCounterVideoTopicDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3902 | o.relevantTopicIds = buildUnnamed378(); |
| 3903 | o.topicIds = buildUnnamed379(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3904 | } |
| 3905 | buildCounterVideoTopicDetails--; |
| 3906 | return o; |
| 3907 | } |
| 3908 | |
| 3909 | checkVideoTopicDetails(api.VideoTopicDetails o) { |
| 3910 | buildCounterVideoTopicDetails++; |
| 3911 | if (buildCounterVideoTopicDetails < 3) { |
Martin Kustermann | 3242d2e | 2014-10-20 19:17:43 +0200 | [diff] [blame^] | 3912 | checkUnnamed378(o.relevantTopicIds); |
| 3913 | checkUnnamed379(o.topicIds); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 3914 | } |
| 3915 | buildCounterVideoTopicDetails--; |
| 3916 | } |
| 3917 | |
| 3918 | core.int buildCounterWatchSettings = 0; |
| 3919 | buildWatchSettings() { |
| 3920 | var o = new api.WatchSettings(); |
| 3921 | buildCounterWatchSettings++; |
| 3922 | if (buildCounterWatchSettings < 3) { |
| 3923 | o.backgroundColor = "foo"; |
| 3924 | o.featuredPlaylistId = "foo"; |
| 3925 | o.textColor = "foo"; |
| 3926 | } |
| 3927 | buildCounterWatchSettings--; |
| 3928 | return o; |
| 3929 | } |
| 3930 | |
| 3931 | checkWatchSettings(api.WatchSettings o) { |
| 3932 | buildCounterWatchSettings++; |
| 3933 | if (buildCounterWatchSettings < 3) { |
| 3934 | unittest.expect(o.backgroundColor, unittest.equals('foo')); |
| 3935 | unittest.expect(o.featuredPlaylistId, unittest.equals('foo')); |
| 3936 | unittest.expect(o.textColor, unittest.equals('foo')); |
| 3937 | } |
| 3938 | buildCounterWatchSettings--; |
| 3939 | } |
| 3940 | |
| 3941 | |
| 3942 | main() { |
| 3943 | unittest.group("obj-schema-AccessPolicy", () { |
| 3944 | unittest.test("to-json--from-json", () { |
| 3945 | var o = buildAccessPolicy(); |
| 3946 | var od = new api.AccessPolicy.fromJson(o.toJson()); |
| 3947 | checkAccessPolicy(od); |
| 3948 | }); |
| 3949 | }); |
| 3950 | |
| 3951 | |
| 3952 | unittest.group("obj-schema-Activity", () { |
| 3953 | unittest.test("to-json--from-json", () { |
| 3954 | var o = buildActivity(); |
| 3955 | var od = new api.Activity.fromJson(o.toJson()); |
| 3956 | checkActivity(od); |
| 3957 | }); |
| 3958 | }); |
| 3959 | |
| 3960 | |
| 3961 | unittest.group("obj-schema-ActivityContentDetails", () { |
| 3962 | unittest.test("to-json--from-json", () { |
| 3963 | var o = buildActivityContentDetails(); |
| 3964 | var od = new api.ActivityContentDetails.fromJson(o.toJson()); |
| 3965 | checkActivityContentDetails(od); |
| 3966 | }); |
| 3967 | }); |
| 3968 | |
| 3969 | |
| 3970 | unittest.group("obj-schema-ActivityContentDetailsBulletin", () { |
| 3971 | unittest.test("to-json--from-json", () { |
| 3972 | var o = buildActivityContentDetailsBulletin(); |
| 3973 | var od = new api.ActivityContentDetailsBulletin.fromJson(o.toJson()); |
| 3974 | checkActivityContentDetailsBulletin(od); |
| 3975 | }); |
| 3976 | }); |
| 3977 | |
| 3978 | |
| 3979 | unittest.group("obj-schema-ActivityContentDetailsChannelItem", () { |
| 3980 | unittest.test("to-json--from-json", () { |
| 3981 | var o = buildActivityContentDetailsChannelItem(); |
| 3982 | var od = new api.ActivityContentDetailsChannelItem.fromJson(o.toJson()); |
| 3983 | checkActivityContentDetailsChannelItem(od); |
| 3984 | }); |
| 3985 | }); |
| 3986 | |
| 3987 | |
| 3988 | unittest.group("obj-schema-ActivityContentDetailsComment", () { |
| 3989 | unittest.test("to-json--from-json", () { |
| 3990 | var o = buildActivityContentDetailsComment(); |
| 3991 | var od = new api.ActivityContentDetailsComment.fromJson(o.toJson()); |
| 3992 | checkActivityContentDetailsComment(od); |
| 3993 | }); |
| 3994 | }); |
| 3995 | |
| 3996 | |
| 3997 | unittest.group("obj-schema-ActivityContentDetailsFavorite", () { |
| 3998 | unittest.test("to-json--from-json", () { |
| 3999 | var o = buildActivityContentDetailsFavorite(); |
| 4000 | var od = new api.ActivityContentDetailsFavorite.fromJson(o.toJson()); |
| 4001 | checkActivityContentDetailsFavorite(od); |
| 4002 | }); |
| 4003 | }); |
| 4004 | |
| 4005 | |
| 4006 | unittest.group("obj-schema-ActivityContentDetailsLike", () { |
| 4007 | unittest.test("to-json--from-json", () { |
| 4008 | var o = buildActivityContentDetailsLike(); |
| 4009 | var od = new api.ActivityContentDetailsLike.fromJson(o.toJson()); |
| 4010 | checkActivityContentDetailsLike(od); |
| 4011 | }); |
| 4012 | }); |
| 4013 | |
| 4014 | |
| 4015 | unittest.group("obj-schema-ActivityContentDetailsPlaylistItem", () { |
| 4016 | unittest.test("to-json--from-json", () { |
| 4017 | var o = buildActivityContentDetailsPlaylistItem(); |
| 4018 | var od = new api.ActivityContentDetailsPlaylistItem.fromJson(o.toJson()); |
| 4019 | checkActivityContentDetailsPlaylistItem(od); |
| 4020 | }); |
| 4021 | }); |
| 4022 | |
| 4023 | |
| 4024 | unittest.group("obj-schema-ActivityContentDetailsPromotedItem", () { |
| 4025 | unittest.test("to-json--from-json", () { |
| 4026 | var o = buildActivityContentDetailsPromotedItem(); |
| 4027 | var od = new api.ActivityContentDetailsPromotedItem.fromJson(o.toJson()); |
| 4028 | checkActivityContentDetailsPromotedItem(od); |
| 4029 | }); |
| 4030 | }); |
| 4031 | |
| 4032 | |
| 4033 | unittest.group("obj-schema-ActivityContentDetailsRecommendation", () { |
| 4034 | unittest.test("to-json--from-json", () { |
| 4035 | var o = buildActivityContentDetailsRecommendation(); |
| 4036 | var od = new api.ActivityContentDetailsRecommendation.fromJson(o.toJson()); |
| 4037 | checkActivityContentDetailsRecommendation(od); |
| 4038 | }); |
| 4039 | }); |
| 4040 | |
| 4041 | |
| 4042 | unittest.group("obj-schema-ActivityContentDetailsSocial", () { |
| 4043 | unittest.test("to-json--from-json", () { |
| 4044 | var o = buildActivityContentDetailsSocial(); |
| 4045 | var od = new api.ActivityContentDetailsSocial.fromJson(o.toJson()); |
| 4046 | checkActivityContentDetailsSocial(od); |
| 4047 | }); |
| 4048 | }); |
| 4049 | |
| 4050 | |
| 4051 | unittest.group("obj-schema-ActivityContentDetailsSubscription", () { |
| 4052 | unittest.test("to-json--from-json", () { |
| 4053 | var o = buildActivityContentDetailsSubscription(); |
| 4054 | var od = new api.ActivityContentDetailsSubscription.fromJson(o.toJson()); |
| 4055 | checkActivityContentDetailsSubscription(od); |
| 4056 | }); |
| 4057 | }); |
| 4058 | |
| 4059 | |
| 4060 | unittest.group("obj-schema-ActivityContentDetailsUpload", () { |
| 4061 | unittest.test("to-json--from-json", () { |
| 4062 | var o = buildActivityContentDetailsUpload(); |
| 4063 | var od = new api.ActivityContentDetailsUpload.fromJson(o.toJson()); |
| 4064 | checkActivityContentDetailsUpload(od); |
| 4065 | }); |
| 4066 | }); |
| 4067 | |
| 4068 | |
| 4069 | unittest.group("obj-schema-ActivityListResponse", () { |
| 4070 | unittest.test("to-json--from-json", () { |
| 4071 | var o = buildActivityListResponse(); |
| 4072 | var od = new api.ActivityListResponse.fromJson(o.toJson()); |
| 4073 | checkActivityListResponse(od); |
| 4074 | }); |
| 4075 | }); |
| 4076 | |
| 4077 | |
| 4078 | unittest.group("obj-schema-ActivitySnippet", () { |
| 4079 | unittest.test("to-json--from-json", () { |
| 4080 | var o = buildActivitySnippet(); |
| 4081 | var od = new api.ActivitySnippet.fromJson(o.toJson()); |
| 4082 | checkActivitySnippet(od); |
| 4083 | }); |
| 4084 | }); |
| 4085 | |
| 4086 | |
| 4087 | unittest.group("obj-schema-CdnSettings", () { |
| 4088 | unittest.test("to-json--from-json", () { |
| 4089 | var o = buildCdnSettings(); |
| 4090 | var od = new api.CdnSettings.fromJson(o.toJson()); |
| 4091 | checkCdnSettings(od); |
| 4092 | }); |
| 4093 | }); |
| 4094 | |
| 4095 | |
| 4096 | unittest.group("obj-schema-Channel", () { |
| 4097 | unittest.test("to-json--from-json", () { |
| 4098 | var o = buildChannel(); |
| 4099 | var od = new api.Channel.fromJson(o.toJson()); |
| 4100 | checkChannel(od); |
| 4101 | }); |
| 4102 | }); |
| 4103 | |
| 4104 | |
| 4105 | unittest.group("obj-schema-ChannelAuditDetails", () { |
| 4106 | unittest.test("to-json--from-json", () { |
| 4107 | var o = buildChannelAuditDetails(); |
| 4108 | var od = new api.ChannelAuditDetails.fromJson(o.toJson()); |
| 4109 | checkChannelAuditDetails(od); |
| 4110 | }); |
| 4111 | }); |
| 4112 | |
| 4113 | |
| 4114 | unittest.group("obj-schema-ChannelBannerResource", () { |
| 4115 | unittest.test("to-json--from-json", () { |
| 4116 | var o = buildChannelBannerResource(); |
| 4117 | var od = new api.ChannelBannerResource.fromJson(o.toJson()); |
| 4118 | checkChannelBannerResource(od); |
| 4119 | }); |
| 4120 | }); |
| 4121 | |
| 4122 | |
| 4123 | unittest.group("obj-schema-ChannelBrandingSettings", () { |
| 4124 | unittest.test("to-json--from-json", () { |
| 4125 | var o = buildChannelBrandingSettings(); |
| 4126 | var od = new api.ChannelBrandingSettings.fromJson(o.toJson()); |
| 4127 | checkChannelBrandingSettings(od); |
| 4128 | }); |
| 4129 | }); |
| 4130 | |
| 4131 | |
| 4132 | unittest.group("obj-schema-ChannelContentDetailsRelatedPlaylists", () { |
| 4133 | unittest.test("to-json--from-json", () { |
| 4134 | var o = buildChannelContentDetailsRelatedPlaylists(); |
| 4135 | var od = new api.ChannelContentDetailsRelatedPlaylists.fromJson(o.toJson()); |
| 4136 | checkChannelContentDetailsRelatedPlaylists(od); |
| 4137 | }); |
| 4138 | }); |
| 4139 | |
| 4140 | |
| 4141 | unittest.group("obj-schema-ChannelContentDetails", () { |
| 4142 | unittest.test("to-json--from-json", () { |
| 4143 | var o = buildChannelContentDetails(); |
| 4144 | var od = new api.ChannelContentDetails.fromJson(o.toJson()); |
| 4145 | checkChannelContentDetails(od); |
| 4146 | }); |
| 4147 | }); |
| 4148 | |
| 4149 | |
| 4150 | unittest.group("obj-schema-ChannelContentOwnerDetails", () { |
| 4151 | unittest.test("to-json--from-json", () { |
| 4152 | var o = buildChannelContentOwnerDetails(); |
| 4153 | var od = new api.ChannelContentOwnerDetails.fromJson(o.toJson()); |
| 4154 | checkChannelContentOwnerDetails(od); |
| 4155 | }); |
| 4156 | }); |
| 4157 | |
| 4158 | |
| 4159 | unittest.group("obj-schema-ChannelConversionPing", () { |
| 4160 | unittest.test("to-json--from-json", () { |
| 4161 | var o = buildChannelConversionPing(); |
| 4162 | var od = new api.ChannelConversionPing.fromJson(o.toJson()); |
| 4163 | checkChannelConversionPing(od); |
| 4164 | }); |
| 4165 | }); |
| 4166 | |
| 4167 | |
| 4168 | unittest.group("obj-schema-ChannelConversionPings", () { |
| 4169 | unittest.test("to-json--from-json", () { |
| 4170 | var o = buildChannelConversionPings(); |
| 4171 | var od = new api.ChannelConversionPings.fromJson(o.toJson()); |
| 4172 | checkChannelConversionPings(od); |
| 4173 | }); |
| 4174 | }); |
| 4175 | |
| 4176 | |
| 4177 | unittest.group("obj-schema-ChannelListResponse", () { |
| 4178 | unittest.test("to-json--from-json", () { |
| 4179 | var o = buildChannelListResponse(); |
| 4180 | var od = new api.ChannelListResponse.fromJson(o.toJson()); |
| 4181 | checkChannelListResponse(od); |
| 4182 | }); |
| 4183 | }); |
| 4184 | |
| 4185 | |
| 4186 | unittest.group("obj-schema-ChannelSection", () { |
| 4187 | unittest.test("to-json--from-json", () { |
| 4188 | var o = buildChannelSection(); |
| 4189 | var od = new api.ChannelSection.fromJson(o.toJson()); |
| 4190 | checkChannelSection(od); |
| 4191 | }); |
| 4192 | }); |
| 4193 | |
| 4194 | |
| 4195 | unittest.group("obj-schema-ChannelSectionContentDetails", () { |
| 4196 | unittest.test("to-json--from-json", () { |
| 4197 | var o = buildChannelSectionContentDetails(); |
| 4198 | var od = new api.ChannelSectionContentDetails.fromJson(o.toJson()); |
| 4199 | checkChannelSectionContentDetails(od); |
| 4200 | }); |
| 4201 | }); |
| 4202 | |
| 4203 | |
| 4204 | unittest.group("obj-schema-ChannelSectionListResponse", () { |
| 4205 | unittest.test("to-json--from-json", () { |
| 4206 | var o = buildChannelSectionListResponse(); |
| 4207 | var od = new api.ChannelSectionListResponse.fromJson(o.toJson()); |
| 4208 | checkChannelSectionListResponse(od); |
| 4209 | }); |
| 4210 | }); |
| 4211 | |
| 4212 | |
| 4213 | unittest.group("obj-schema-ChannelSectionSnippet", () { |
| 4214 | unittest.test("to-json--from-json", () { |
| 4215 | var o = buildChannelSectionSnippet(); |
| 4216 | var od = new api.ChannelSectionSnippet.fromJson(o.toJson()); |
| 4217 | checkChannelSectionSnippet(od); |
| 4218 | }); |
| 4219 | }); |
| 4220 | |
| 4221 | |
| 4222 | unittest.group("obj-schema-ChannelSettings", () { |
| 4223 | unittest.test("to-json--from-json", () { |
| 4224 | var o = buildChannelSettings(); |
| 4225 | var od = new api.ChannelSettings.fromJson(o.toJson()); |
| 4226 | checkChannelSettings(od); |
| 4227 | }); |
| 4228 | }); |
| 4229 | |
| 4230 | |
| 4231 | unittest.group("obj-schema-ChannelSnippet", () { |
| 4232 | unittest.test("to-json--from-json", () { |
| 4233 | var o = buildChannelSnippet(); |
| 4234 | var od = new api.ChannelSnippet.fromJson(o.toJson()); |
| 4235 | checkChannelSnippet(od); |
| 4236 | }); |
| 4237 | }); |
| 4238 | |
| 4239 | |
| 4240 | unittest.group("obj-schema-ChannelStatistics", () { |
| 4241 | unittest.test("to-json--from-json", () { |
| 4242 | var o = buildChannelStatistics(); |
| 4243 | var od = new api.ChannelStatistics.fromJson(o.toJson()); |
| 4244 | checkChannelStatistics(od); |
| 4245 | }); |
| 4246 | }); |
| 4247 | |
| 4248 | |
| 4249 | unittest.group("obj-schema-ChannelStatus", () { |
| 4250 | unittest.test("to-json--from-json", () { |
| 4251 | var o = buildChannelStatus(); |
| 4252 | var od = new api.ChannelStatus.fromJson(o.toJson()); |
| 4253 | checkChannelStatus(od); |
| 4254 | }); |
| 4255 | }); |
| 4256 | |
| 4257 | |
| 4258 | unittest.group("obj-schema-ChannelTopicDetails", () { |
| 4259 | unittest.test("to-json--from-json", () { |
| 4260 | var o = buildChannelTopicDetails(); |
| 4261 | var od = new api.ChannelTopicDetails.fromJson(o.toJson()); |
| 4262 | checkChannelTopicDetails(od); |
| 4263 | }); |
| 4264 | }); |
| 4265 | |
| 4266 | |
| 4267 | unittest.group("obj-schema-ContentRating", () { |
| 4268 | unittest.test("to-json--from-json", () { |
| 4269 | var o = buildContentRating(); |
| 4270 | var od = new api.ContentRating.fromJson(o.toJson()); |
| 4271 | checkContentRating(od); |
| 4272 | }); |
| 4273 | }); |
| 4274 | |
| 4275 | |
| 4276 | unittest.group("obj-schema-GeoPoint", () { |
| 4277 | unittest.test("to-json--from-json", () { |
| 4278 | var o = buildGeoPoint(); |
| 4279 | var od = new api.GeoPoint.fromJson(o.toJson()); |
| 4280 | checkGeoPoint(od); |
| 4281 | }); |
| 4282 | }); |
| 4283 | |
| 4284 | |
| 4285 | unittest.group("obj-schema-GuideCategory", () { |
| 4286 | unittest.test("to-json--from-json", () { |
| 4287 | var o = buildGuideCategory(); |
| 4288 | var od = new api.GuideCategory.fromJson(o.toJson()); |
| 4289 | checkGuideCategory(od); |
| 4290 | }); |
| 4291 | }); |
| 4292 | |
| 4293 | |
| 4294 | unittest.group("obj-schema-GuideCategoryListResponse", () { |
| 4295 | unittest.test("to-json--from-json", () { |
| 4296 | var o = buildGuideCategoryListResponse(); |
| 4297 | var od = new api.GuideCategoryListResponse.fromJson(o.toJson()); |
| 4298 | checkGuideCategoryListResponse(od); |
| 4299 | }); |
| 4300 | }); |
| 4301 | |
| 4302 | |
| 4303 | unittest.group("obj-schema-GuideCategorySnippet", () { |
| 4304 | unittest.test("to-json--from-json", () { |
| 4305 | var o = buildGuideCategorySnippet(); |
| 4306 | var od = new api.GuideCategorySnippet.fromJson(o.toJson()); |
| 4307 | checkGuideCategorySnippet(od); |
| 4308 | }); |
| 4309 | }); |
| 4310 | |
| 4311 | |
| 4312 | unittest.group("obj-schema-I18nLanguage", () { |
| 4313 | unittest.test("to-json--from-json", () { |
| 4314 | var o = buildI18nLanguage(); |
| 4315 | var od = new api.I18nLanguage.fromJson(o.toJson()); |
| 4316 | checkI18nLanguage(od); |
| 4317 | }); |
| 4318 | }); |
| 4319 | |
| 4320 | |
| 4321 | unittest.group("obj-schema-I18nLanguageListResponse", () { |
| 4322 | unittest.test("to-json--from-json", () { |
| 4323 | var o = buildI18nLanguageListResponse(); |
| 4324 | var od = new api.I18nLanguageListResponse.fromJson(o.toJson()); |
| 4325 | checkI18nLanguageListResponse(od); |
| 4326 | }); |
| 4327 | }); |
| 4328 | |
| 4329 | |
| 4330 | unittest.group("obj-schema-I18nLanguageSnippet", () { |
| 4331 | unittest.test("to-json--from-json", () { |
| 4332 | var o = buildI18nLanguageSnippet(); |
| 4333 | var od = new api.I18nLanguageSnippet.fromJson(o.toJson()); |
| 4334 | checkI18nLanguageSnippet(od); |
| 4335 | }); |
| 4336 | }); |
| 4337 | |
| 4338 | |
| 4339 | unittest.group("obj-schema-I18nRegion", () { |
| 4340 | unittest.test("to-json--from-json", () { |
| 4341 | var o = buildI18nRegion(); |
| 4342 | var od = new api.I18nRegion.fromJson(o.toJson()); |
| 4343 | checkI18nRegion(od); |
| 4344 | }); |
| 4345 | }); |
| 4346 | |
| 4347 | |
| 4348 | unittest.group("obj-schema-I18nRegionListResponse", () { |
| 4349 | unittest.test("to-json--from-json", () { |
| 4350 | var o = buildI18nRegionListResponse(); |
| 4351 | var od = new api.I18nRegionListResponse.fromJson(o.toJson()); |
| 4352 | checkI18nRegionListResponse(od); |
| 4353 | }); |
| 4354 | }); |
| 4355 | |
| 4356 | |
| 4357 | unittest.group("obj-schema-I18nRegionSnippet", () { |
| 4358 | unittest.test("to-json--from-json", () { |
| 4359 | var o = buildI18nRegionSnippet(); |
| 4360 | var od = new api.I18nRegionSnippet.fromJson(o.toJson()); |
| 4361 | checkI18nRegionSnippet(od); |
| 4362 | }); |
| 4363 | }); |
| 4364 | |
| 4365 | |
| 4366 | unittest.group("obj-schema-ImageSettings", () { |
| 4367 | unittest.test("to-json--from-json", () { |
| 4368 | var o = buildImageSettings(); |
| 4369 | var od = new api.ImageSettings.fromJson(o.toJson()); |
| 4370 | checkImageSettings(od); |
| 4371 | }); |
| 4372 | }); |
| 4373 | |
| 4374 | |
| 4375 | unittest.group("obj-schema-IngestionInfo", () { |
| 4376 | unittest.test("to-json--from-json", () { |
| 4377 | var o = buildIngestionInfo(); |
| 4378 | var od = new api.IngestionInfo.fromJson(o.toJson()); |
| 4379 | checkIngestionInfo(od); |
| 4380 | }); |
| 4381 | }); |
| 4382 | |
| 4383 | |
| 4384 | unittest.group("obj-schema-InvideoBranding", () { |
| 4385 | unittest.test("to-json--from-json", () { |
| 4386 | var o = buildInvideoBranding(); |
| 4387 | var od = new api.InvideoBranding.fromJson(o.toJson()); |
| 4388 | checkInvideoBranding(od); |
| 4389 | }); |
| 4390 | }); |
| 4391 | |
| 4392 | |
| 4393 | unittest.group("obj-schema-InvideoPosition", () { |
| 4394 | unittest.test("to-json--from-json", () { |
| 4395 | var o = buildInvideoPosition(); |
| 4396 | var od = new api.InvideoPosition.fromJson(o.toJson()); |
| 4397 | checkInvideoPosition(od); |
| 4398 | }); |
| 4399 | }); |
| 4400 | |
| 4401 | |
| 4402 | unittest.group("obj-schema-InvideoPromotion", () { |
| 4403 | unittest.test("to-json--from-json", () { |
| 4404 | var o = buildInvideoPromotion(); |
| 4405 | var od = new api.InvideoPromotion.fromJson(o.toJson()); |
| 4406 | checkInvideoPromotion(od); |
| 4407 | }); |
| 4408 | }); |
| 4409 | |
| 4410 | |
| 4411 | unittest.group("obj-schema-InvideoTiming", () { |
| 4412 | unittest.test("to-json--from-json", () { |
| 4413 | var o = buildInvideoTiming(); |
| 4414 | var od = new api.InvideoTiming.fromJson(o.toJson()); |
| 4415 | checkInvideoTiming(od); |
| 4416 | }); |
| 4417 | }); |
| 4418 | |
| 4419 | |
| 4420 | unittest.group("obj-schema-LiveBroadcast", () { |
| 4421 | unittest.test("to-json--from-json", () { |
| 4422 | var o = buildLiveBroadcast(); |
| 4423 | var od = new api.LiveBroadcast.fromJson(o.toJson()); |
| 4424 | checkLiveBroadcast(od); |
| 4425 | }); |
| 4426 | }); |
| 4427 | |
| 4428 | |
| 4429 | unittest.group("obj-schema-LiveBroadcastContentDetails", () { |
| 4430 | unittest.test("to-json--from-json", () { |
| 4431 | var o = buildLiveBroadcastContentDetails(); |
| 4432 | var od = new api.LiveBroadcastContentDetails.fromJson(o.toJson()); |
| 4433 | checkLiveBroadcastContentDetails(od); |
| 4434 | }); |
| 4435 | }); |
| 4436 | |
| 4437 | |
| 4438 | unittest.group("obj-schema-LiveBroadcastListResponse", () { |
| 4439 | unittest.test("to-json--from-json", () { |
| 4440 | var o = buildLiveBroadcastListResponse(); |
| 4441 | var od = new api.LiveBroadcastListResponse.fromJson(o.toJson()); |
| 4442 | checkLiveBroadcastListResponse(od); |
| 4443 | }); |
| 4444 | }); |
| 4445 | |
| 4446 | |
| 4447 | unittest.group("obj-schema-LiveBroadcastSnippet", () { |
| 4448 | unittest.test("to-json--from-json", () { |
| 4449 | var o = buildLiveBroadcastSnippet(); |
| 4450 | var od = new api.LiveBroadcastSnippet.fromJson(o.toJson()); |
| 4451 | checkLiveBroadcastSnippet(od); |
| 4452 | }); |
| 4453 | }); |
| 4454 | |
| 4455 | |
| 4456 | unittest.group("obj-schema-LiveBroadcastStatus", () { |
| 4457 | unittest.test("to-json--from-json", () { |
| 4458 | var o = buildLiveBroadcastStatus(); |
| 4459 | var od = new api.LiveBroadcastStatus.fromJson(o.toJson()); |
| 4460 | checkLiveBroadcastStatus(od); |
| 4461 | }); |
| 4462 | }); |
| 4463 | |
| 4464 | |
| 4465 | unittest.group("obj-schema-LiveStream", () { |
| 4466 | unittest.test("to-json--from-json", () { |
| 4467 | var o = buildLiveStream(); |
| 4468 | var od = new api.LiveStream.fromJson(o.toJson()); |
| 4469 | checkLiveStream(od); |
| 4470 | }); |
| 4471 | }); |
| 4472 | |
| 4473 | |
| 4474 | unittest.group("obj-schema-LiveStreamContentDetails", () { |
| 4475 | unittest.test("to-json--from-json", () { |
| 4476 | var o = buildLiveStreamContentDetails(); |
| 4477 | var od = new api.LiveStreamContentDetails.fromJson(o.toJson()); |
| 4478 | checkLiveStreamContentDetails(od); |
| 4479 | }); |
| 4480 | }); |
| 4481 | |
| 4482 | |
| 4483 | unittest.group("obj-schema-LiveStreamListResponse", () { |
| 4484 | unittest.test("to-json--from-json", () { |
| 4485 | var o = buildLiveStreamListResponse(); |
| 4486 | var od = new api.LiveStreamListResponse.fromJson(o.toJson()); |
| 4487 | checkLiveStreamListResponse(od); |
| 4488 | }); |
| 4489 | }); |
| 4490 | |
| 4491 | |
| 4492 | unittest.group("obj-schema-LiveStreamSnippet", () { |
| 4493 | unittest.test("to-json--from-json", () { |
| 4494 | var o = buildLiveStreamSnippet(); |
| 4495 | var od = new api.LiveStreamSnippet.fromJson(o.toJson()); |
| 4496 | checkLiveStreamSnippet(od); |
| 4497 | }); |
| 4498 | }); |
| 4499 | |
| 4500 | |
| 4501 | unittest.group("obj-schema-LiveStreamStatus", () { |
| 4502 | unittest.test("to-json--from-json", () { |
| 4503 | var o = buildLiveStreamStatus(); |
| 4504 | var od = new api.LiveStreamStatus.fromJson(o.toJson()); |
| 4505 | checkLiveStreamStatus(od); |
| 4506 | }); |
| 4507 | }); |
| 4508 | |
| 4509 | |
| 4510 | unittest.group("obj-schema-LocalizedProperty", () { |
| 4511 | unittest.test("to-json--from-json", () { |
| 4512 | var o = buildLocalizedProperty(); |
| 4513 | var od = new api.LocalizedProperty.fromJson(o.toJson()); |
| 4514 | checkLocalizedProperty(od); |
| 4515 | }); |
| 4516 | }); |
| 4517 | |
| 4518 | |
| 4519 | unittest.group("obj-schema-LocalizedString", () { |
| 4520 | unittest.test("to-json--from-json", () { |
| 4521 | var o = buildLocalizedString(); |
| 4522 | var od = new api.LocalizedString.fromJson(o.toJson()); |
| 4523 | checkLocalizedString(od); |
| 4524 | }); |
| 4525 | }); |
| 4526 | |
| 4527 | |
| 4528 | unittest.group("obj-schema-MonitorStreamInfo", () { |
| 4529 | unittest.test("to-json--from-json", () { |
| 4530 | var o = buildMonitorStreamInfo(); |
| 4531 | var od = new api.MonitorStreamInfo.fromJson(o.toJson()); |
| 4532 | checkMonitorStreamInfo(od); |
| 4533 | }); |
| 4534 | }); |
| 4535 | |
| 4536 | |
| 4537 | unittest.group("obj-schema-PageInfo", () { |
| 4538 | unittest.test("to-json--from-json", () { |
| 4539 | var o = buildPageInfo(); |
| 4540 | var od = new api.PageInfo.fromJson(o.toJson()); |
| 4541 | checkPageInfo(od); |
| 4542 | }); |
| 4543 | }); |
| 4544 | |
| 4545 | |
| 4546 | unittest.group("obj-schema-Playlist", () { |
| 4547 | unittest.test("to-json--from-json", () { |
| 4548 | var o = buildPlaylist(); |
| 4549 | var od = new api.Playlist.fromJson(o.toJson()); |
| 4550 | checkPlaylist(od); |
| 4551 | }); |
| 4552 | }); |
| 4553 | |
| 4554 | |
| 4555 | unittest.group("obj-schema-PlaylistContentDetails", () { |
| 4556 | unittest.test("to-json--from-json", () { |
| 4557 | var o = buildPlaylistContentDetails(); |
| 4558 | var od = new api.PlaylistContentDetails.fromJson(o.toJson()); |
| 4559 | checkPlaylistContentDetails(od); |
| 4560 | }); |
| 4561 | }); |
| 4562 | |
| 4563 | |
| 4564 | unittest.group("obj-schema-PlaylistItem", () { |
| 4565 | unittest.test("to-json--from-json", () { |
| 4566 | var o = buildPlaylistItem(); |
| 4567 | var od = new api.PlaylistItem.fromJson(o.toJson()); |
| 4568 | checkPlaylistItem(od); |
| 4569 | }); |
| 4570 | }); |
| 4571 | |
| 4572 | |
| 4573 | unittest.group("obj-schema-PlaylistItemContentDetails", () { |
| 4574 | unittest.test("to-json--from-json", () { |
| 4575 | var o = buildPlaylistItemContentDetails(); |
| 4576 | var od = new api.PlaylistItemContentDetails.fromJson(o.toJson()); |
| 4577 | checkPlaylistItemContentDetails(od); |
| 4578 | }); |
| 4579 | }); |
| 4580 | |
| 4581 | |
| 4582 | unittest.group("obj-schema-PlaylistItemListResponse", () { |
| 4583 | unittest.test("to-json--from-json", () { |
| 4584 | var o = buildPlaylistItemListResponse(); |
| 4585 | var od = new api.PlaylistItemListResponse.fromJson(o.toJson()); |
| 4586 | checkPlaylistItemListResponse(od); |
| 4587 | }); |
| 4588 | }); |
| 4589 | |
| 4590 | |
| 4591 | unittest.group("obj-schema-PlaylistItemSnippet", () { |
| 4592 | unittest.test("to-json--from-json", () { |
| 4593 | var o = buildPlaylistItemSnippet(); |
| 4594 | var od = new api.PlaylistItemSnippet.fromJson(o.toJson()); |
| 4595 | checkPlaylistItemSnippet(od); |
| 4596 | }); |
| 4597 | }); |
| 4598 | |
| 4599 | |
| 4600 | unittest.group("obj-schema-PlaylistItemStatus", () { |
| 4601 | unittest.test("to-json--from-json", () { |
| 4602 | var o = buildPlaylistItemStatus(); |
| 4603 | var od = new api.PlaylistItemStatus.fromJson(o.toJson()); |
| 4604 | checkPlaylistItemStatus(od); |
| 4605 | }); |
| 4606 | }); |
| 4607 | |
| 4608 | |
| 4609 | unittest.group("obj-schema-PlaylistListResponse", () { |
| 4610 | unittest.test("to-json--from-json", () { |
| 4611 | var o = buildPlaylistListResponse(); |
| 4612 | var od = new api.PlaylistListResponse.fromJson(o.toJson()); |
| 4613 | checkPlaylistListResponse(od); |
| 4614 | }); |
| 4615 | }); |
| 4616 | |
| 4617 | |
| 4618 | unittest.group("obj-schema-PlaylistPlayer", () { |
| 4619 | unittest.test("to-json--from-json", () { |
| 4620 | var o = buildPlaylistPlayer(); |
| 4621 | var od = new api.PlaylistPlayer.fromJson(o.toJson()); |
| 4622 | checkPlaylistPlayer(od); |
| 4623 | }); |
| 4624 | }); |
| 4625 | |
| 4626 | |
| 4627 | unittest.group("obj-schema-PlaylistSnippet", () { |
| 4628 | unittest.test("to-json--from-json", () { |
| 4629 | var o = buildPlaylistSnippet(); |
| 4630 | var od = new api.PlaylistSnippet.fromJson(o.toJson()); |
| 4631 | checkPlaylistSnippet(od); |
| 4632 | }); |
| 4633 | }); |
| 4634 | |
| 4635 | |
| 4636 | unittest.group("obj-schema-PlaylistStatus", () { |
| 4637 | unittest.test("to-json--from-json", () { |
| 4638 | var o = buildPlaylistStatus(); |
| 4639 | var od = new api.PlaylistStatus.fromJson(o.toJson()); |
| 4640 | checkPlaylistStatus(od); |
| 4641 | }); |
| 4642 | }); |
| 4643 | |
| 4644 | |
| 4645 | unittest.group("obj-schema-PromotedItem", () { |
| 4646 | unittest.test("to-json--from-json", () { |
| 4647 | var o = buildPromotedItem(); |
| 4648 | var od = new api.PromotedItem.fromJson(o.toJson()); |
| 4649 | checkPromotedItem(od); |
| 4650 | }); |
| 4651 | }); |
| 4652 | |
| 4653 | |
| 4654 | unittest.group("obj-schema-PromotedItemId", () { |
| 4655 | unittest.test("to-json--from-json", () { |
| 4656 | var o = buildPromotedItemId(); |
| 4657 | var od = new api.PromotedItemId.fromJson(o.toJson()); |
| 4658 | checkPromotedItemId(od); |
| 4659 | }); |
| 4660 | }); |
| 4661 | |
| 4662 | |
| 4663 | unittest.group("obj-schema-PropertyValue", () { |
| 4664 | unittest.test("to-json--from-json", () { |
| 4665 | var o = buildPropertyValue(); |
| 4666 | var od = new api.PropertyValue.fromJson(o.toJson()); |
| 4667 | checkPropertyValue(od); |
| 4668 | }); |
| 4669 | }); |
| 4670 | |
| 4671 | |
| 4672 | unittest.group("obj-schema-ResourceId", () { |
| 4673 | unittest.test("to-json--from-json", () { |
| 4674 | var o = buildResourceId(); |
| 4675 | var od = new api.ResourceId.fromJson(o.toJson()); |
| 4676 | checkResourceId(od); |
| 4677 | }); |
| 4678 | }); |
| 4679 | |
| 4680 | |
| 4681 | unittest.group("obj-schema-SearchListResponse", () { |
| 4682 | unittest.test("to-json--from-json", () { |
| 4683 | var o = buildSearchListResponse(); |
| 4684 | var od = new api.SearchListResponse.fromJson(o.toJson()); |
| 4685 | checkSearchListResponse(od); |
| 4686 | }); |
| 4687 | }); |
| 4688 | |
| 4689 | |
| 4690 | unittest.group("obj-schema-SearchResult", () { |
| 4691 | unittest.test("to-json--from-json", () { |
| 4692 | var o = buildSearchResult(); |
| 4693 | var od = new api.SearchResult.fromJson(o.toJson()); |
| 4694 | checkSearchResult(od); |
| 4695 | }); |
| 4696 | }); |
| 4697 | |
| 4698 | |
| 4699 | unittest.group("obj-schema-SearchResultSnippet", () { |
| 4700 | unittest.test("to-json--from-json", () { |
| 4701 | var o = buildSearchResultSnippet(); |
| 4702 | var od = new api.SearchResultSnippet.fromJson(o.toJson()); |
| 4703 | checkSearchResultSnippet(od); |
| 4704 | }); |
| 4705 | }); |
| 4706 | |
| 4707 | |
| 4708 | unittest.group("obj-schema-Subscription", () { |
| 4709 | unittest.test("to-json--from-json", () { |
| 4710 | var o = buildSubscription(); |
| 4711 | var od = new api.Subscription.fromJson(o.toJson()); |
| 4712 | checkSubscription(od); |
| 4713 | }); |
| 4714 | }); |
| 4715 | |
| 4716 | |
| 4717 | unittest.group("obj-schema-SubscriptionContentDetails", () { |
| 4718 | unittest.test("to-json--from-json", () { |
| 4719 | var o = buildSubscriptionContentDetails(); |
| 4720 | var od = new api.SubscriptionContentDetails.fromJson(o.toJson()); |
| 4721 | checkSubscriptionContentDetails(od); |
| 4722 | }); |
| 4723 | }); |
| 4724 | |
| 4725 | |
| 4726 | unittest.group("obj-schema-SubscriptionListResponse", () { |
| 4727 | unittest.test("to-json--from-json", () { |
| 4728 | var o = buildSubscriptionListResponse(); |
| 4729 | var od = new api.SubscriptionListResponse.fromJson(o.toJson()); |
| 4730 | checkSubscriptionListResponse(od); |
| 4731 | }); |
| 4732 | }); |
| 4733 | |
| 4734 | |
| 4735 | unittest.group("obj-schema-SubscriptionSnippet", () { |
| 4736 | unittest.test("to-json--from-json", () { |
| 4737 | var o = buildSubscriptionSnippet(); |
| 4738 | var od = new api.SubscriptionSnippet.fromJson(o.toJson()); |
| 4739 | checkSubscriptionSnippet(od); |
| 4740 | }); |
| 4741 | }); |
| 4742 | |
| 4743 | |
| 4744 | unittest.group("obj-schema-SubscriptionSubscriberSnippet", () { |
| 4745 | unittest.test("to-json--from-json", () { |
| 4746 | var o = buildSubscriptionSubscriberSnippet(); |
| 4747 | var od = new api.SubscriptionSubscriberSnippet.fromJson(o.toJson()); |
| 4748 | checkSubscriptionSubscriberSnippet(od); |
| 4749 | }); |
| 4750 | }); |
| 4751 | |
| 4752 | |
| 4753 | unittest.group("obj-schema-Thumbnail", () { |
| 4754 | unittest.test("to-json--from-json", () { |
| 4755 | var o = buildThumbnail(); |
| 4756 | var od = new api.Thumbnail.fromJson(o.toJson()); |
| 4757 | checkThumbnail(od); |
| 4758 | }); |
| 4759 | }); |
| 4760 | |
| 4761 | |
| 4762 | unittest.group("obj-schema-ThumbnailDetails", () { |
| 4763 | unittest.test("to-json--from-json", () { |
| 4764 | var o = buildThumbnailDetails(); |
| 4765 | var od = new api.ThumbnailDetails.fromJson(o.toJson()); |
| 4766 | checkThumbnailDetails(od); |
| 4767 | }); |
| 4768 | }); |
| 4769 | |
| 4770 | |
| 4771 | unittest.group("obj-schema-ThumbnailSetResponse", () { |
| 4772 | unittest.test("to-json--from-json", () { |
| 4773 | var o = buildThumbnailSetResponse(); |
| 4774 | var od = new api.ThumbnailSetResponse.fromJson(o.toJson()); |
| 4775 | checkThumbnailSetResponse(od); |
| 4776 | }); |
| 4777 | }); |
| 4778 | |
| 4779 | |
| 4780 | unittest.group("obj-schema-TokenPagination", () { |
| 4781 | unittest.test("to-json--from-json", () { |
| 4782 | var o = buildTokenPagination(); |
| 4783 | var od = new api.TokenPagination.fromJson(o.toJson()); |
| 4784 | checkTokenPagination(od); |
| 4785 | }); |
| 4786 | }); |
| 4787 | |
| 4788 | |
| 4789 | unittest.group("obj-schema-Video", () { |
| 4790 | unittest.test("to-json--from-json", () { |
| 4791 | var o = buildVideo(); |
| 4792 | var od = new api.Video.fromJson(o.toJson()); |
| 4793 | checkVideo(od); |
| 4794 | }); |
| 4795 | }); |
| 4796 | |
| 4797 | |
| 4798 | unittest.group("obj-schema-VideoAgeGating", () { |
| 4799 | unittest.test("to-json--from-json", () { |
| 4800 | var o = buildVideoAgeGating(); |
| 4801 | var od = new api.VideoAgeGating.fromJson(o.toJson()); |
| 4802 | checkVideoAgeGating(od); |
| 4803 | }); |
| 4804 | }); |
| 4805 | |
| 4806 | |
| 4807 | unittest.group("obj-schema-VideoCategory", () { |
| 4808 | unittest.test("to-json--from-json", () { |
| 4809 | var o = buildVideoCategory(); |
| 4810 | var od = new api.VideoCategory.fromJson(o.toJson()); |
| 4811 | checkVideoCategory(od); |
| 4812 | }); |
| 4813 | }); |
| 4814 | |
| 4815 | |
| 4816 | unittest.group("obj-schema-VideoCategoryListResponse", () { |
| 4817 | unittest.test("to-json--from-json", () { |
| 4818 | var o = buildVideoCategoryListResponse(); |
| 4819 | var od = new api.VideoCategoryListResponse.fromJson(o.toJson()); |
| 4820 | checkVideoCategoryListResponse(od); |
| 4821 | }); |
| 4822 | }); |
| 4823 | |
| 4824 | |
| 4825 | unittest.group("obj-schema-VideoCategorySnippet", () { |
| 4826 | unittest.test("to-json--from-json", () { |
| 4827 | var o = buildVideoCategorySnippet(); |
| 4828 | var od = new api.VideoCategorySnippet.fromJson(o.toJson()); |
| 4829 | checkVideoCategorySnippet(od); |
| 4830 | }); |
| 4831 | }); |
| 4832 | |
| 4833 | |
| 4834 | unittest.group("obj-schema-VideoContentDetails", () { |
| 4835 | unittest.test("to-json--from-json", () { |
| 4836 | var o = buildVideoContentDetails(); |
| 4837 | var od = new api.VideoContentDetails.fromJson(o.toJson()); |
| 4838 | checkVideoContentDetails(od); |
| 4839 | }); |
| 4840 | }); |
| 4841 | |
| 4842 | |
| 4843 | unittest.group("obj-schema-VideoContentDetailsRegionRestriction", () { |
| 4844 | unittest.test("to-json--from-json", () { |
| 4845 | var o = buildVideoContentDetailsRegionRestriction(); |
| 4846 | var od = new api.VideoContentDetailsRegionRestriction.fromJson(o.toJson()); |
| 4847 | checkVideoContentDetailsRegionRestriction(od); |
| 4848 | }); |
| 4849 | }); |
| 4850 | |
| 4851 | |
| 4852 | unittest.group("obj-schema-VideoConversionPing", () { |
| 4853 | unittest.test("to-json--from-json", () { |
| 4854 | var o = buildVideoConversionPing(); |
| 4855 | var od = new api.VideoConversionPing.fromJson(o.toJson()); |
| 4856 | checkVideoConversionPing(od); |
| 4857 | }); |
| 4858 | }); |
| 4859 | |
| 4860 | |
| 4861 | unittest.group("obj-schema-VideoConversionPings", () { |
| 4862 | unittest.test("to-json--from-json", () { |
| 4863 | var o = buildVideoConversionPings(); |
| 4864 | var od = new api.VideoConversionPings.fromJson(o.toJson()); |
| 4865 | checkVideoConversionPings(od); |
| 4866 | }); |
| 4867 | }); |
| 4868 | |
| 4869 | |
| 4870 | unittest.group("obj-schema-VideoFileDetails", () { |
| 4871 | unittest.test("to-json--from-json", () { |
| 4872 | var o = buildVideoFileDetails(); |
| 4873 | var od = new api.VideoFileDetails.fromJson(o.toJson()); |
| 4874 | checkVideoFileDetails(od); |
| 4875 | }); |
| 4876 | }); |
| 4877 | |
| 4878 | |
| 4879 | unittest.group("obj-schema-VideoFileDetailsAudioStream", () { |
| 4880 | unittest.test("to-json--from-json", () { |
| 4881 | var o = buildVideoFileDetailsAudioStream(); |
| 4882 | var od = new api.VideoFileDetailsAudioStream.fromJson(o.toJson()); |
| 4883 | checkVideoFileDetailsAudioStream(od); |
| 4884 | }); |
| 4885 | }); |
| 4886 | |
| 4887 | |
| 4888 | unittest.group("obj-schema-VideoFileDetailsVideoStream", () { |
| 4889 | unittest.test("to-json--from-json", () { |
| 4890 | var o = buildVideoFileDetailsVideoStream(); |
| 4891 | var od = new api.VideoFileDetailsVideoStream.fromJson(o.toJson()); |
| 4892 | checkVideoFileDetailsVideoStream(od); |
| 4893 | }); |
| 4894 | }); |
| 4895 | |
| 4896 | |
| 4897 | unittest.group("obj-schema-VideoGetRatingResponse", () { |
| 4898 | unittest.test("to-json--from-json", () { |
| 4899 | var o = buildVideoGetRatingResponse(); |
| 4900 | var od = new api.VideoGetRatingResponse.fromJson(o.toJson()); |
| 4901 | checkVideoGetRatingResponse(od); |
| 4902 | }); |
| 4903 | }); |
| 4904 | |
| 4905 | |
| 4906 | unittest.group("obj-schema-VideoListResponse", () { |
| 4907 | unittest.test("to-json--from-json", () { |
| 4908 | var o = buildVideoListResponse(); |
| 4909 | var od = new api.VideoListResponse.fromJson(o.toJson()); |
| 4910 | checkVideoListResponse(od); |
| 4911 | }); |
| 4912 | }); |
| 4913 | |
| 4914 | |
| 4915 | unittest.group("obj-schema-VideoLiveStreamingDetails", () { |
| 4916 | unittest.test("to-json--from-json", () { |
| 4917 | var o = buildVideoLiveStreamingDetails(); |
| 4918 | var od = new api.VideoLiveStreamingDetails.fromJson(o.toJson()); |
| 4919 | checkVideoLiveStreamingDetails(od); |
| 4920 | }); |
| 4921 | }); |
| 4922 | |
| 4923 | |
| 4924 | unittest.group("obj-schema-VideoMonetizationDetails", () { |
| 4925 | unittest.test("to-json--from-json", () { |
| 4926 | var o = buildVideoMonetizationDetails(); |
| 4927 | var od = new api.VideoMonetizationDetails.fromJson(o.toJson()); |
| 4928 | checkVideoMonetizationDetails(od); |
| 4929 | }); |
| 4930 | }); |
| 4931 | |
| 4932 | |
| 4933 | unittest.group("obj-schema-VideoPlayer", () { |
| 4934 | unittest.test("to-json--from-json", () { |
| 4935 | var o = buildVideoPlayer(); |
| 4936 | var od = new api.VideoPlayer.fromJson(o.toJson()); |
| 4937 | checkVideoPlayer(od); |
| 4938 | }); |
| 4939 | }); |
| 4940 | |
| 4941 | |
| 4942 | unittest.group("obj-schema-VideoProcessingDetails", () { |
| 4943 | unittest.test("to-json--from-json", () { |
| 4944 | var o = buildVideoProcessingDetails(); |
| 4945 | var od = new api.VideoProcessingDetails.fromJson(o.toJson()); |
| 4946 | checkVideoProcessingDetails(od); |
| 4947 | }); |
| 4948 | }); |
| 4949 | |
| 4950 | |
| 4951 | unittest.group("obj-schema-VideoProcessingDetailsProcessingProgress", () { |
| 4952 | unittest.test("to-json--from-json", () { |
| 4953 | var o = buildVideoProcessingDetailsProcessingProgress(); |
| 4954 | var od = new api.VideoProcessingDetailsProcessingProgress.fromJson(o.toJson()); |
| 4955 | checkVideoProcessingDetailsProcessingProgress(od); |
| 4956 | }); |
| 4957 | }); |
| 4958 | |
| 4959 | |
| 4960 | unittest.group("obj-schema-VideoProjectDetails", () { |
| 4961 | unittest.test("to-json--from-json", () { |
| 4962 | var o = buildVideoProjectDetails(); |
| 4963 | var od = new api.VideoProjectDetails.fromJson(o.toJson()); |
| 4964 | checkVideoProjectDetails(od); |
| 4965 | }); |
| 4966 | }); |
| 4967 | |
| 4968 | |
| 4969 | unittest.group("obj-schema-VideoRating", () { |
| 4970 | unittest.test("to-json--from-json", () { |
| 4971 | var o = buildVideoRating(); |
| 4972 | var od = new api.VideoRating.fromJson(o.toJson()); |
| 4973 | checkVideoRating(od); |
| 4974 | }); |
| 4975 | }); |
| 4976 | |
| 4977 | |
| 4978 | unittest.group("obj-schema-VideoRecordingDetails", () { |
| 4979 | unittest.test("to-json--from-json", () { |
| 4980 | var o = buildVideoRecordingDetails(); |
| 4981 | var od = new api.VideoRecordingDetails.fromJson(o.toJson()); |
| 4982 | checkVideoRecordingDetails(od); |
| 4983 | }); |
| 4984 | }); |
| 4985 | |
| 4986 | |
| 4987 | unittest.group("obj-schema-VideoSnippet", () { |
| 4988 | unittest.test("to-json--from-json", () { |
| 4989 | var o = buildVideoSnippet(); |
| 4990 | var od = new api.VideoSnippet.fromJson(o.toJson()); |
| 4991 | checkVideoSnippet(od); |
| 4992 | }); |
| 4993 | }); |
| 4994 | |
| 4995 | |
| 4996 | unittest.group("obj-schema-VideoStatistics", () { |
| 4997 | unittest.test("to-json--from-json", () { |
| 4998 | var o = buildVideoStatistics(); |
| 4999 | var od = new api.VideoStatistics.fromJson(o.toJson()); |
| 5000 | checkVideoStatistics(od); |
| 5001 | }); |
| 5002 | }); |
| 5003 | |
| 5004 | |
| 5005 | unittest.group("obj-schema-VideoStatus", () { |
| 5006 | unittest.test("to-json--from-json", () { |
| 5007 | var o = buildVideoStatus(); |
| 5008 | var od = new api.VideoStatus.fromJson(o.toJson()); |
| 5009 | checkVideoStatus(od); |
| 5010 | }); |
| 5011 | }); |
| 5012 | |
| 5013 | |
| 5014 | unittest.group("obj-schema-VideoSuggestions", () { |
| 5015 | unittest.test("to-json--from-json", () { |
| 5016 | var o = buildVideoSuggestions(); |
| 5017 | var od = new api.VideoSuggestions.fromJson(o.toJson()); |
| 5018 | checkVideoSuggestions(od); |
| 5019 | }); |
| 5020 | }); |
| 5021 | |
| 5022 | |
| 5023 | unittest.group("obj-schema-VideoSuggestionsTagSuggestion", () { |
| 5024 | unittest.test("to-json--from-json", () { |
| 5025 | var o = buildVideoSuggestionsTagSuggestion(); |
| 5026 | var od = new api.VideoSuggestionsTagSuggestion.fromJson(o.toJson()); |
| 5027 | checkVideoSuggestionsTagSuggestion(od); |
| 5028 | }); |
| 5029 | }); |
| 5030 | |
| 5031 | |
| 5032 | unittest.group("obj-schema-VideoTopicDetails", () { |
| 5033 | unittest.test("to-json--from-json", () { |
| 5034 | var o = buildVideoTopicDetails(); |
| 5035 | var od = new api.VideoTopicDetails.fromJson(o.toJson()); |
| 5036 | checkVideoTopicDetails(od); |
| 5037 | }); |
| 5038 | }); |
| 5039 | |
| 5040 | |
| 5041 | unittest.group("obj-schema-WatchSettings", () { |
| 5042 | unittest.test("to-json--from-json", () { |
| 5043 | var o = buildWatchSettings(); |
| 5044 | var od = new api.WatchSettings.fromJson(o.toJson()); |
| 5045 | checkWatchSettings(od); |
| 5046 | }); |
| 5047 | }); |
| 5048 | |
| 5049 | |
| 5050 | unittest.group("resource-ActivitiesResourceApi", () { |
| 5051 | unittest.test("method--insert", () { |
| 5052 | |
| 5053 | var mock = new common_test.HttpServerMock(); |
| 5054 | api.ActivitiesResourceApi res = new api.YoutubeApi(mock).activities; |
| 5055 | var arg_request = buildActivity(); |
| 5056 | var arg_part = "foo"; |
| 5057 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5058 | var obj = new api.Activity.fromJson(json); |
| 5059 | checkActivity(obj); |
| 5060 | |
| 5061 | var path = (req.url).path; |
| 5062 | var pathOffset = 0; |
| 5063 | var index; |
| 5064 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5065 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5066 | pathOffset += 1; |
| 5067 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5068 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5069 | unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("activities")); |
| 5070 | pathOffset += 10; |
| 5071 | |
| 5072 | var query = (req.url).query; |
| 5073 | var queryOffset = 0; |
| 5074 | var queryMap = {}; |
| 5075 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5076 | parseBool(n) { |
| 5077 | if (n == "true") return true; |
| 5078 | if (n == "false") return false; |
| 5079 | if (n == null) return null; |
| 5080 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5081 | } |
| 5082 | if (query.length > 0) { |
| 5083 | for (var part in query.split("&")) { |
| 5084 | var keyvalue = part.split("="); |
| 5085 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5086 | } |
| 5087 | } |
| 5088 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5089 | |
| 5090 | |
| 5091 | var h = { |
| 5092 | "content-type" : "application/json; charset=utf-8", |
| 5093 | }; |
| 5094 | var resp = convert.JSON.encode(buildActivity()); |
| 5095 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5096 | }), true); |
| 5097 | res.insert(arg_request, arg_part).then(unittest.expectAsync(((api.Activity response) { |
| 5098 | checkActivity(response); |
| 5099 | }))); |
| 5100 | }); |
| 5101 | |
| 5102 | unittest.test("method--list", () { |
| 5103 | |
| 5104 | var mock = new common_test.HttpServerMock(); |
| 5105 | api.ActivitiesResourceApi res = new api.YoutubeApi(mock).activities; |
| 5106 | var arg_part = "foo"; |
| 5107 | var arg_channelId = "foo"; |
| 5108 | var arg_home = true; |
| 5109 | var arg_maxResults = 42; |
| 5110 | var arg_mine = true; |
| 5111 | var arg_pageToken = "foo"; |
| 5112 | var arg_publishedAfter = core.DateTime.parse("2002-02-27T14:01:02"); |
| 5113 | var arg_publishedBefore = core.DateTime.parse("2002-02-27T14:01:02"); |
| 5114 | var arg_regionCode = "foo"; |
| 5115 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5116 | var path = (req.url).path; |
| 5117 | var pathOffset = 0; |
| 5118 | var index; |
| 5119 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5120 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5121 | pathOffset += 1; |
| 5122 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5123 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5124 | unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("activities")); |
| 5125 | pathOffset += 10; |
| 5126 | |
| 5127 | var query = (req.url).query; |
| 5128 | var queryOffset = 0; |
| 5129 | var queryMap = {}; |
| 5130 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5131 | parseBool(n) { |
| 5132 | if (n == "true") return true; |
| 5133 | if (n == "false") return false; |
| 5134 | if (n == null) return null; |
| 5135 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5136 | } |
| 5137 | if (query.length > 0) { |
| 5138 | for (var part in query.split("&")) { |
| 5139 | var keyvalue = part.split("="); |
| 5140 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5141 | } |
| 5142 | } |
| 5143 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5144 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 5145 | unittest.expect(queryMap["home"].first, unittest.equals("$arg_home")); |
| 5146 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 5147 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 5148 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 5149 | unittest.expect(core.DateTime.parse(queryMap["publishedAfter"].first), unittest.equals(arg_publishedAfter)); |
| 5150 | unittest.expect(core.DateTime.parse(queryMap["publishedBefore"].first), unittest.equals(arg_publishedBefore)); |
| 5151 | unittest.expect(queryMap["regionCode"].first, unittest.equals(arg_regionCode)); |
| 5152 | |
| 5153 | |
| 5154 | var h = { |
| 5155 | "content-type" : "application/json; charset=utf-8", |
| 5156 | }; |
| 5157 | var resp = convert.JSON.encode(buildActivityListResponse()); |
| 5158 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5159 | }), true); |
| 5160 | res.list(arg_part, channelId: arg_channelId, home: arg_home, maxResults: arg_maxResults, mine: arg_mine, pageToken: arg_pageToken, publishedAfter: arg_publishedAfter, publishedBefore: arg_publishedBefore, regionCode: arg_regionCode).then(unittest.expectAsync(((api.ActivityListResponse response) { |
| 5161 | checkActivityListResponse(response); |
| 5162 | }))); |
| 5163 | }); |
| 5164 | |
| 5165 | }); |
| 5166 | |
| 5167 | |
| 5168 | unittest.group("resource-ChannelBannersResourceApi", () { |
| 5169 | unittest.test("method--insert", () { |
| 5170 | // TODO: Implement tests for media upload; |
| 5171 | // TODO: Implement tests for media download; |
| 5172 | |
| 5173 | var mock = new common_test.HttpServerMock(); |
| 5174 | api.ChannelBannersResourceApi res = new api.YoutubeApi(mock).channelBanners; |
| 5175 | var arg_request = buildChannelBannerResource(); |
| 5176 | var arg_onBehalfOfContentOwner = "foo"; |
| 5177 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5178 | var obj = new api.ChannelBannerResource.fromJson(json); |
| 5179 | checkChannelBannerResource(obj); |
| 5180 | |
| 5181 | var path = (req.url).path; |
| 5182 | var pathOffset = 0; |
| 5183 | var index; |
| 5184 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5185 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5186 | pathOffset += 1; |
| 5187 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5188 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5189 | unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.equals("channelBanners/insert")); |
| 5190 | pathOffset += 21; |
| 5191 | |
| 5192 | var query = (req.url).query; |
| 5193 | var queryOffset = 0; |
| 5194 | var queryMap = {}; |
| 5195 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5196 | parseBool(n) { |
| 5197 | if (n == "true") return true; |
| 5198 | if (n == "false") return false; |
| 5199 | if (n == null) return null; |
| 5200 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5201 | } |
| 5202 | if (query.length > 0) { |
| 5203 | for (var part in query.split("&")) { |
| 5204 | var keyvalue = part.split("="); |
| 5205 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5206 | } |
| 5207 | } |
| 5208 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5209 | |
| 5210 | |
| 5211 | var h = { |
| 5212 | "content-type" : "application/json; charset=utf-8", |
| 5213 | }; |
| 5214 | var resp = convert.JSON.encode(buildChannelBannerResource()); |
| 5215 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5216 | }), true); |
| 5217 | res.insert(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.ChannelBannerResource response) { |
| 5218 | checkChannelBannerResource(response); |
| 5219 | }))); |
| 5220 | }); |
| 5221 | |
| 5222 | }); |
| 5223 | |
| 5224 | |
| 5225 | unittest.group("resource-ChannelSectionsResourceApi", () { |
| 5226 | unittest.test("method--delete", () { |
| 5227 | |
| 5228 | var mock = new common_test.HttpServerMock(); |
| 5229 | api.ChannelSectionsResourceApi res = new api.YoutubeApi(mock).channelSections; |
| 5230 | var arg_id = "foo"; |
| 5231 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5232 | var path = (req.url).path; |
| 5233 | var pathOffset = 0; |
| 5234 | var index; |
| 5235 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5236 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5237 | pathOffset += 1; |
| 5238 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5239 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5240 | unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("channelSections")); |
| 5241 | pathOffset += 15; |
| 5242 | |
| 5243 | var query = (req.url).query; |
| 5244 | var queryOffset = 0; |
| 5245 | var queryMap = {}; |
| 5246 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5247 | parseBool(n) { |
| 5248 | if (n == "true") return true; |
| 5249 | if (n == "false") return false; |
| 5250 | if (n == null) return null; |
| 5251 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5252 | } |
| 5253 | if (query.length > 0) { |
| 5254 | for (var part in query.split("&")) { |
| 5255 | var keyvalue = part.split("="); |
| 5256 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5257 | } |
| 5258 | } |
| 5259 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5260 | |
| 5261 | |
| 5262 | var h = { |
| 5263 | "content-type" : "application/json; charset=utf-8", |
| 5264 | }; |
| 5265 | var resp = ""; |
| 5266 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5267 | }), true); |
| 5268 | res.delete(arg_id).then(unittest.expectAsync((_) {})); |
| 5269 | }); |
| 5270 | |
| 5271 | unittest.test("method--insert", () { |
| 5272 | |
| 5273 | var mock = new common_test.HttpServerMock(); |
| 5274 | api.ChannelSectionsResourceApi res = new api.YoutubeApi(mock).channelSections; |
| 5275 | var arg_request = buildChannelSection(); |
| 5276 | var arg_part = "foo"; |
| 5277 | var arg_onBehalfOfContentOwner = "foo"; |
| 5278 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 5279 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5280 | var obj = new api.ChannelSection.fromJson(json); |
| 5281 | checkChannelSection(obj); |
| 5282 | |
| 5283 | var path = (req.url).path; |
| 5284 | var pathOffset = 0; |
| 5285 | var index; |
| 5286 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5287 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5288 | pathOffset += 1; |
| 5289 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5290 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5291 | unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("channelSections")); |
| 5292 | pathOffset += 15; |
| 5293 | |
| 5294 | var query = (req.url).query; |
| 5295 | var queryOffset = 0; |
| 5296 | var queryMap = {}; |
| 5297 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5298 | parseBool(n) { |
| 5299 | if (n == "true") return true; |
| 5300 | if (n == "false") return false; |
| 5301 | if (n == null) return null; |
| 5302 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5303 | } |
| 5304 | if (query.length > 0) { |
| 5305 | for (var part in query.split("&")) { |
| 5306 | var keyvalue = part.split("="); |
| 5307 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5308 | } |
| 5309 | } |
| 5310 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5311 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5312 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 5313 | |
| 5314 | |
| 5315 | var h = { |
| 5316 | "content-type" : "application/json; charset=utf-8", |
| 5317 | }; |
| 5318 | var resp = convert.JSON.encode(buildChannelSection()); |
| 5319 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5320 | }), true); |
| 5321 | res.insert(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.ChannelSection response) { |
| 5322 | checkChannelSection(response); |
| 5323 | }))); |
| 5324 | }); |
| 5325 | |
| 5326 | unittest.test("method--list", () { |
| 5327 | |
| 5328 | var mock = new common_test.HttpServerMock(); |
| 5329 | api.ChannelSectionsResourceApi res = new api.YoutubeApi(mock).channelSections; |
| 5330 | var arg_part = "foo"; |
| 5331 | var arg_channelId = "foo"; |
| 5332 | var arg_id = "foo"; |
| 5333 | var arg_mine = true; |
| 5334 | var arg_onBehalfOfContentOwner = "foo"; |
| 5335 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5336 | var path = (req.url).path; |
| 5337 | var pathOffset = 0; |
| 5338 | var index; |
| 5339 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5340 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5341 | pathOffset += 1; |
| 5342 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5343 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5344 | unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("channelSections")); |
| 5345 | pathOffset += 15; |
| 5346 | |
| 5347 | var query = (req.url).query; |
| 5348 | var queryOffset = 0; |
| 5349 | var queryMap = {}; |
| 5350 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5351 | parseBool(n) { |
| 5352 | if (n == "true") return true; |
| 5353 | if (n == "false") return false; |
| 5354 | if (n == null) return null; |
| 5355 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5356 | } |
| 5357 | if (query.length > 0) { |
| 5358 | for (var part in query.split("&")) { |
| 5359 | var keyvalue = part.split("="); |
| 5360 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5361 | } |
| 5362 | } |
| 5363 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5364 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 5365 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5366 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 5367 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5368 | |
| 5369 | |
| 5370 | var h = { |
| 5371 | "content-type" : "application/json; charset=utf-8", |
| 5372 | }; |
| 5373 | var resp = convert.JSON.encode(buildChannelSectionListResponse()); |
| 5374 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5375 | }), true); |
| 5376 | res.list(arg_part, channelId: arg_channelId, id: arg_id, mine: arg_mine, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.ChannelSectionListResponse response) { |
| 5377 | checkChannelSectionListResponse(response); |
| 5378 | }))); |
| 5379 | }); |
| 5380 | |
| 5381 | unittest.test("method--update", () { |
| 5382 | |
| 5383 | var mock = new common_test.HttpServerMock(); |
| 5384 | api.ChannelSectionsResourceApi res = new api.YoutubeApi(mock).channelSections; |
| 5385 | var arg_request = buildChannelSection(); |
| 5386 | var arg_part = "foo"; |
| 5387 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5388 | var obj = new api.ChannelSection.fromJson(json); |
| 5389 | checkChannelSection(obj); |
| 5390 | |
| 5391 | var path = (req.url).path; |
| 5392 | var pathOffset = 0; |
| 5393 | var index; |
| 5394 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5395 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5396 | pathOffset += 1; |
| 5397 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5398 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5399 | unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("channelSections")); |
| 5400 | pathOffset += 15; |
| 5401 | |
| 5402 | var query = (req.url).query; |
| 5403 | var queryOffset = 0; |
| 5404 | var queryMap = {}; |
| 5405 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5406 | parseBool(n) { |
| 5407 | if (n == "true") return true; |
| 5408 | if (n == "false") return false; |
| 5409 | if (n == null) return null; |
| 5410 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5411 | } |
| 5412 | if (query.length > 0) { |
| 5413 | for (var part in query.split("&")) { |
| 5414 | var keyvalue = part.split("="); |
| 5415 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5416 | } |
| 5417 | } |
| 5418 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5419 | |
| 5420 | |
| 5421 | var h = { |
| 5422 | "content-type" : "application/json; charset=utf-8", |
| 5423 | }; |
| 5424 | var resp = convert.JSON.encode(buildChannelSection()); |
| 5425 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5426 | }), true); |
| 5427 | res.update(arg_request, arg_part).then(unittest.expectAsync(((api.ChannelSection response) { |
| 5428 | checkChannelSection(response); |
| 5429 | }))); |
| 5430 | }); |
| 5431 | |
| 5432 | }); |
| 5433 | |
| 5434 | |
| 5435 | unittest.group("resource-ChannelsResourceApi", () { |
| 5436 | unittest.test("method--list", () { |
| 5437 | |
| 5438 | var mock = new common_test.HttpServerMock(); |
| 5439 | api.ChannelsResourceApi res = new api.YoutubeApi(mock).channels; |
| 5440 | var arg_part = "foo"; |
| 5441 | var arg_categoryId = "foo"; |
| 5442 | var arg_forUsername = "foo"; |
| 5443 | var arg_id = "foo"; |
| 5444 | var arg_managedByMe = true; |
| 5445 | var arg_maxResults = 42; |
| 5446 | var arg_mine = true; |
| 5447 | var arg_mySubscribers = true; |
| 5448 | var arg_onBehalfOfContentOwner = "foo"; |
| 5449 | var arg_pageToken = "foo"; |
| 5450 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5451 | var path = (req.url).path; |
| 5452 | var pathOffset = 0; |
| 5453 | var index; |
| 5454 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5455 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5456 | pathOffset += 1; |
| 5457 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5458 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5459 | unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("channels")); |
| 5460 | pathOffset += 8; |
| 5461 | |
| 5462 | var query = (req.url).query; |
| 5463 | var queryOffset = 0; |
| 5464 | var queryMap = {}; |
| 5465 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5466 | parseBool(n) { |
| 5467 | if (n == "true") return true; |
| 5468 | if (n == "false") return false; |
| 5469 | if (n == null) return null; |
| 5470 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5471 | } |
| 5472 | if (query.length > 0) { |
| 5473 | for (var part in query.split("&")) { |
| 5474 | var keyvalue = part.split("="); |
| 5475 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5476 | } |
| 5477 | } |
| 5478 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5479 | unittest.expect(queryMap["categoryId"].first, unittest.equals(arg_categoryId)); |
| 5480 | unittest.expect(queryMap["forUsername"].first, unittest.equals(arg_forUsername)); |
| 5481 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5482 | unittest.expect(queryMap["managedByMe"].first, unittest.equals("$arg_managedByMe")); |
| 5483 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 5484 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 5485 | unittest.expect(queryMap["mySubscribers"].first, unittest.equals("$arg_mySubscribers")); |
| 5486 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5487 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 5488 | |
| 5489 | |
| 5490 | var h = { |
| 5491 | "content-type" : "application/json; charset=utf-8", |
| 5492 | }; |
| 5493 | var resp = convert.JSON.encode(buildChannelListResponse()); |
| 5494 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5495 | }), true); |
| 5496 | res.list(arg_part, categoryId: arg_categoryId, forUsername: arg_forUsername, id: arg_id, managedByMe: arg_managedByMe, maxResults: arg_maxResults, mine: arg_mine, mySubscribers: arg_mySubscribers, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ChannelListResponse response) { |
| 5497 | checkChannelListResponse(response); |
| 5498 | }))); |
| 5499 | }); |
| 5500 | |
| 5501 | unittest.test("method--update", () { |
| 5502 | |
| 5503 | var mock = new common_test.HttpServerMock(); |
| 5504 | api.ChannelsResourceApi res = new api.YoutubeApi(mock).channels; |
| 5505 | var arg_request = buildChannel(); |
| 5506 | var arg_part = "foo"; |
| 5507 | var arg_onBehalfOfContentOwner = "foo"; |
| 5508 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5509 | var obj = new api.Channel.fromJson(json); |
| 5510 | checkChannel(obj); |
| 5511 | |
| 5512 | var path = (req.url).path; |
| 5513 | var pathOffset = 0; |
| 5514 | var index; |
| 5515 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5516 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5517 | pathOffset += 1; |
| 5518 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5519 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5520 | unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("channels")); |
| 5521 | pathOffset += 8; |
| 5522 | |
| 5523 | var query = (req.url).query; |
| 5524 | var queryOffset = 0; |
| 5525 | var queryMap = {}; |
| 5526 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5527 | parseBool(n) { |
| 5528 | if (n == "true") return true; |
| 5529 | if (n == "false") return false; |
| 5530 | if (n == null) return null; |
| 5531 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5532 | } |
| 5533 | if (query.length > 0) { |
| 5534 | for (var part in query.split("&")) { |
| 5535 | var keyvalue = part.split("="); |
| 5536 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5537 | } |
| 5538 | } |
| 5539 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5540 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5541 | |
| 5542 | |
| 5543 | var h = { |
| 5544 | "content-type" : "application/json; charset=utf-8", |
| 5545 | }; |
| 5546 | var resp = convert.JSON.encode(buildChannel()); |
| 5547 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5548 | }), true); |
| 5549 | res.update(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.Channel response) { |
| 5550 | checkChannel(response); |
| 5551 | }))); |
| 5552 | }); |
| 5553 | |
| 5554 | }); |
| 5555 | |
| 5556 | |
| 5557 | unittest.group("resource-GuideCategoriesResourceApi", () { |
| 5558 | unittest.test("method--list", () { |
| 5559 | |
| 5560 | var mock = new common_test.HttpServerMock(); |
| 5561 | api.GuideCategoriesResourceApi res = new api.YoutubeApi(mock).guideCategories; |
| 5562 | var arg_part = "foo"; |
| 5563 | var arg_hl = "foo"; |
| 5564 | var arg_id = "foo"; |
| 5565 | var arg_regionCode = "foo"; |
| 5566 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5567 | var path = (req.url).path; |
| 5568 | var pathOffset = 0; |
| 5569 | var index; |
| 5570 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5571 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5572 | pathOffset += 1; |
| 5573 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5574 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5575 | unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("guideCategories")); |
| 5576 | pathOffset += 15; |
| 5577 | |
| 5578 | var query = (req.url).query; |
| 5579 | var queryOffset = 0; |
| 5580 | var queryMap = {}; |
| 5581 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5582 | parseBool(n) { |
| 5583 | if (n == "true") return true; |
| 5584 | if (n == "false") return false; |
| 5585 | if (n == null) return null; |
| 5586 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5587 | } |
| 5588 | if (query.length > 0) { |
| 5589 | for (var part in query.split("&")) { |
| 5590 | var keyvalue = part.split("="); |
| 5591 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5592 | } |
| 5593 | } |
| 5594 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5595 | unittest.expect(queryMap["hl"].first, unittest.equals(arg_hl)); |
| 5596 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5597 | unittest.expect(queryMap["regionCode"].first, unittest.equals(arg_regionCode)); |
| 5598 | |
| 5599 | |
| 5600 | var h = { |
| 5601 | "content-type" : "application/json; charset=utf-8", |
| 5602 | }; |
| 5603 | var resp = convert.JSON.encode(buildGuideCategoryListResponse()); |
| 5604 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5605 | }), true); |
| 5606 | res.list(arg_part, hl: arg_hl, id: arg_id, regionCode: arg_regionCode).then(unittest.expectAsync(((api.GuideCategoryListResponse response) { |
| 5607 | checkGuideCategoryListResponse(response); |
| 5608 | }))); |
| 5609 | }); |
| 5610 | |
| 5611 | }); |
| 5612 | |
| 5613 | |
| 5614 | unittest.group("resource-I18nLanguagesResourceApi", () { |
| 5615 | unittest.test("method--list", () { |
| 5616 | |
| 5617 | var mock = new common_test.HttpServerMock(); |
| 5618 | api.I18nLanguagesResourceApi res = new api.YoutubeApi(mock).i18nLanguages; |
| 5619 | var arg_part = "foo"; |
| 5620 | var arg_hl = "foo"; |
| 5621 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5622 | var path = (req.url).path; |
| 5623 | var pathOffset = 0; |
| 5624 | var index; |
| 5625 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5626 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5627 | pathOffset += 1; |
| 5628 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5629 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5630 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("i18nLanguages")); |
| 5631 | pathOffset += 13; |
| 5632 | |
| 5633 | var query = (req.url).query; |
| 5634 | var queryOffset = 0; |
| 5635 | var queryMap = {}; |
| 5636 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5637 | parseBool(n) { |
| 5638 | if (n == "true") return true; |
| 5639 | if (n == "false") return false; |
| 5640 | if (n == null) return null; |
| 5641 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5642 | } |
| 5643 | if (query.length > 0) { |
| 5644 | for (var part in query.split("&")) { |
| 5645 | var keyvalue = part.split("="); |
| 5646 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5647 | } |
| 5648 | } |
| 5649 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5650 | unittest.expect(queryMap["hl"].first, unittest.equals(arg_hl)); |
| 5651 | |
| 5652 | |
| 5653 | var h = { |
| 5654 | "content-type" : "application/json; charset=utf-8", |
| 5655 | }; |
| 5656 | var resp = convert.JSON.encode(buildI18nLanguageListResponse()); |
| 5657 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5658 | }), true); |
| 5659 | res.list(arg_part, hl: arg_hl).then(unittest.expectAsync(((api.I18nLanguageListResponse response) { |
| 5660 | checkI18nLanguageListResponse(response); |
| 5661 | }))); |
| 5662 | }); |
| 5663 | |
| 5664 | }); |
| 5665 | |
| 5666 | |
| 5667 | unittest.group("resource-I18nRegionsResourceApi", () { |
| 5668 | unittest.test("method--list", () { |
| 5669 | |
| 5670 | var mock = new common_test.HttpServerMock(); |
| 5671 | api.I18nRegionsResourceApi res = new api.YoutubeApi(mock).i18nRegions; |
| 5672 | var arg_part = "foo"; |
| 5673 | var arg_hl = "foo"; |
| 5674 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5675 | var path = (req.url).path; |
| 5676 | var pathOffset = 0; |
| 5677 | var index; |
| 5678 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5679 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5680 | pathOffset += 1; |
| 5681 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5682 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5683 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("i18nRegions")); |
| 5684 | pathOffset += 11; |
| 5685 | |
| 5686 | var query = (req.url).query; |
| 5687 | var queryOffset = 0; |
| 5688 | var queryMap = {}; |
| 5689 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5690 | parseBool(n) { |
| 5691 | if (n == "true") return true; |
| 5692 | if (n == "false") return false; |
| 5693 | if (n == null) return null; |
| 5694 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5695 | } |
| 5696 | if (query.length > 0) { |
| 5697 | for (var part in query.split("&")) { |
| 5698 | var keyvalue = part.split("="); |
| 5699 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5700 | } |
| 5701 | } |
| 5702 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5703 | unittest.expect(queryMap["hl"].first, unittest.equals(arg_hl)); |
| 5704 | |
| 5705 | |
| 5706 | var h = { |
| 5707 | "content-type" : "application/json; charset=utf-8", |
| 5708 | }; |
| 5709 | var resp = convert.JSON.encode(buildI18nRegionListResponse()); |
| 5710 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5711 | }), true); |
| 5712 | res.list(arg_part, hl: arg_hl).then(unittest.expectAsync(((api.I18nRegionListResponse response) { |
| 5713 | checkI18nRegionListResponse(response); |
| 5714 | }))); |
| 5715 | }); |
| 5716 | |
| 5717 | }); |
| 5718 | |
| 5719 | |
| 5720 | unittest.group("resource-LiveBroadcastsResourceApi", () { |
| 5721 | unittest.test("method--bind", () { |
| 5722 | |
| 5723 | var mock = new common_test.HttpServerMock(); |
| 5724 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 5725 | var arg_id = "foo"; |
| 5726 | var arg_part = "foo"; |
| 5727 | var arg_onBehalfOfContentOwner = "foo"; |
| 5728 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 5729 | var arg_streamId = "foo"; |
| 5730 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5731 | var path = (req.url).path; |
| 5732 | var pathOffset = 0; |
| 5733 | var index; |
| 5734 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5735 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5736 | pathOffset += 1; |
| 5737 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5738 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5739 | unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("liveBroadcasts/bind")); |
| 5740 | pathOffset += 19; |
| 5741 | |
| 5742 | var query = (req.url).query; |
| 5743 | var queryOffset = 0; |
| 5744 | var queryMap = {}; |
| 5745 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5746 | parseBool(n) { |
| 5747 | if (n == "true") return true; |
| 5748 | if (n == "false") return false; |
| 5749 | if (n == null) return null; |
| 5750 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5751 | } |
| 5752 | if (query.length > 0) { |
| 5753 | for (var part in query.split("&")) { |
| 5754 | var keyvalue = part.split("="); |
| 5755 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5756 | } |
| 5757 | } |
| 5758 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5759 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5760 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5761 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 5762 | unittest.expect(queryMap["streamId"].first, unittest.equals(arg_streamId)); |
| 5763 | |
| 5764 | |
| 5765 | var h = { |
| 5766 | "content-type" : "application/json; charset=utf-8", |
| 5767 | }; |
| 5768 | var resp = convert.JSON.encode(buildLiveBroadcast()); |
| 5769 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5770 | }), true); |
| 5771 | res.bind(arg_id, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, streamId: arg_streamId).then(unittest.expectAsync(((api.LiveBroadcast response) { |
| 5772 | checkLiveBroadcast(response); |
| 5773 | }))); |
| 5774 | }); |
| 5775 | |
| 5776 | unittest.test("method--control", () { |
| 5777 | |
| 5778 | var mock = new common_test.HttpServerMock(); |
| 5779 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 5780 | var arg_id = "foo"; |
| 5781 | var arg_part = "foo"; |
| 5782 | var arg_displaySlate = true; |
| 5783 | var arg_offsetTimeMs = "foo"; |
| 5784 | var arg_onBehalfOfContentOwner = "foo"; |
| 5785 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 5786 | var arg_walltime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 5787 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5788 | var path = (req.url).path; |
| 5789 | var pathOffset = 0; |
| 5790 | var index; |
| 5791 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5792 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5793 | pathOffset += 1; |
| 5794 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5795 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5796 | unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("liveBroadcasts/control")); |
| 5797 | pathOffset += 22; |
| 5798 | |
| 5799 | var query = (req.url).query; |
| 5800 | var queryOffset = 0; |
| 5801 | var queryMap = {}; |
| 5802 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5803 | parseBool(n) { |
| 5804 | if (n == "true") return true; |
| 5805 | if (n == "false") return false; |
| 5806 | if (n == null) return null; |
| 5807 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5808 | } |
| 5809 | if (query.length > 0) { |
| 5810 | for (var part in query.split("&")) { |
| 5811 | var keyvalue = part.split("="); |
| 5812 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5813 | } |
| 5814 | } |
| 5815 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5816 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5817 | unittest.expect(queryMap["displaySlate"].first, unittest.equals("$arg_displaySlate")); |
| 5818 | unittest.expect(queryMap["offsetTimeMs"].first, unittest.equals(arg_offsetTimeMs)); |
| 5819 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5820 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 5821 | unittest.expect(core.DateTime.parse(queryMap["walltime"].first), unittest.equals(arg_walltime)); |
| 5822 | |
| 5823 | |
| 5824 | var h = { |
| 5825 | "content-type" : "application/json; charset=utf-8", |
| 5826 | }; |
| 5827 | var resp = convert.JSON.encode(buildLiveBroadcast()); |
| 5828 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5829 | }), true); |
| 5830 | res.control(arg_id, arg_part, displaySlate: arg_displaySlate, offsetTimeMs: arg_offsetTimeMs, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, walltime: arg_walltime).then(unittest.expectAsync(((api.LiveBroadcast response) { |
| 5831 | checkLiveBroadcast(response); |
| 5832 | }))); |
| 5833 | }); |
| 5834 | |
| 5835 | unittest.test("method--delete", () { |
| 5836 | |
| 5837 | var mock = new common_test.HttpServerMock(); |
| 5838 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 5839 | var arg_id = "foo"; |
| 5840 | var arg_onBehalfOfContentOwner = "foo"; |
| 5841 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 5842 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5843 | var path = (req.url).path; |
| 5844 | var pathOffset = 0; |
| 5845 | var index; |
| 5846 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5847 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5848 | pathOffset += 1; |
| 5849 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5850 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5851 | unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("liveBroadcasts")); |
| 5852 | pathOffset += 14; |
| 5853 | |
| 5854 | var query = (req.url).query; |
| 5855 | var queryOffset = 0; |
| 5856 | var queryMap = {}; |
| 5857 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5858 | parseBool(n) { |
| 5859 | if (n == "true") return true; |
| 5860 | if (n == "false") return false; |
| 5861 | if (n == null) return null; |
| 5862 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5863 | } |
| 5864 | if (query.length > 0) { |
| 5865 | for (var part in query.split("&")) { |
| 5866 | var keyvalue = part.split("="); |
| 5867 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5868 | } |
| 5869 | } |
| 5870 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5871 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5872 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 5873 | |
| 5874 | |
| 5875 | var h = { |
| 5876 | "content-type" : "application/json; charset=utf-8", |
| 5877 | }; |
| 5878 | var resp = ""; |
| 5879 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5880 | }), true); |
| 5881 | res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync((_) {})); |
| 5882 | }); |
| 5883 | |
| 5884 | unittest.test("method--insert", () { |
| 5885 | |
| 5886 | var mock = new common_test.HttpServerMock(); |
| 5887 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 5888 | var arg_request = buildLiveBroadcast(); |
| 5889 | var arg_part = "foo"; |
| 5890 | var arg_onBehalfOfContentOwner = "foo"; |
| 5891 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 5892 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5893 | var obj = new api.LiveBroadcast.fromJson(json); |
| 5894 | checkLiveBroadcast(obj); |
| 5895 | |
| 5896 | var path = (req.url).path; |
| 5897 | var pathOffset = 0; |
| 5898 | var index; |
| 5899 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5900 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5901 | pathOffset += 1; |
| 5902 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5903 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5904 | unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("liveBroadcasts")); |
| 5905 | pathOffset += 14; |
| 5906 | |
| 5907 | var query = (req.url).query; |
| 5908 | var queryOffset = 0; |
| 5909 | var queryMap = {}; |
| 5910 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5911 | parseBool(n) { |
| 5912 | if (n == "true") return true; |
| 5913 | if (n == "false") return false; |
| 5914 | if (n == null) return null; |
| 5915 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5916 | } |
| 5917 | if (query.length > 0) { |
| 5918 | for (var part in query.split("&")) { |
| 5919 | var keyvalue = part.split("="); |
| 5920 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5921 | } |
| 5922 | } |
| 5923 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5924 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5925 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 5926 | |
| 5927 | |
| 5928 | var h = { |
| 5929 | "content-type" : "application/json; charset=utf-8", |
| 5930 | }; |
| 5931 | var resp = convert.JSON.encode(buildLiveBroadcast()); |
| 5932 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5933 | }), true); |
| 5934 | res.insert(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.LiveBroadcast response) { |
| 5935 | checkLiveBroadcast(response); |
| 5936 | }))); |
| 5937 | }); |
| 5938 | |
| 5939 | unittest.test("method--list", () { |
| 5940 | |
| 5941 | var mock = new common_test.HttpServerMock(); |
| 5942 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 5943 | var arg_part = "foo"; |
| 5944 | var arg_broadcastStatus = "foo"; |
| 5945 | var arg_id = "foo"; |
| 5946 | var arg_maxResults = 42; |
| 5947 | var arg_mine = true; |
| 5948 | var arg_onBehalfOfContentOwner = "foo"; |
| 5949 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 5950 | var arg_pageToken = "foo"; |
| 5951 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5952 | var path = (req.url).path; |
| 5953 | var pathOffset = 0; |
| 5954 | var index; |
| 5955 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 5956 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 5957 | pathOffset += 1; |
| 5958 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 5959 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5960 | unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("liveBroadcasts")); |
| 5961 | pathOffset += 14; |
| 5962 | |
| 5963 | var query = (req.url).query; |
| 5964 | var queryOffset = 0; |
| 5965 | var queryMap = {}; |
| 5966 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5967 | parseBool(n) { |
| 5968 | if (n == "true") return true; |
| 5969 | if (n == "false") return false; |
| 5970 | if (n == null) return null; |
| 5971 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 5972 | } |
| 5973 | if (query.length > 0) { |
| 5974 | for (var part in query.split("&")) { |
| 5975 | var keyvalue = part.split("="); |
| 5976 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 5977 | } |
| 5978 | } |
| 5979 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 5980 | unittest.expect(queryMap["broadcastStatus"].first, unittest.equals(arg_broadcastStatus)); |
| 5981 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 5982 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 5983 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 5984 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 5985 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 5986 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 5987 | |
| 5988 | |
| 5989 | var h = { |
| 5990 | "content-type" : "application/json; charset=utf-8", |
| 5991 | }; |
| 5992 | var resp = convert.JSON.encode(buildLiveBroadcastListResponse()); |
| 5993 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5994 | }), true); |
| 5995 | res.list(arg_part, broadcastStatus: arg_broadcastStatus, id: arg_id, maxResults: arg_maxResults, mine: arg_mine, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, pageToken: arg_pageToken).then(unittest.expectAsync(((api.LiveBroadcastListResponse response) { |
| 5996 | checkLiveBroadcastListResponse(response); |
| 5997 | }))); |
| 5998 | }); |
| 5999 | |
| 6000 | unittest.test("method--transition", () { |
| 6001 | |
| 6002 | var mock = new common_test.HttpServerMock(); |
| 6003 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 6004 | var arg_broadcastStatus = "foo"; |
| 6005 | var arg_id = "foo"; |
| 6006 | var arg_part = "foo"; |
| 6007 | var arg_onBehalfOfContentOwner = "foo"; |
| 6008 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6009 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6010 | var path = (req.url).path; |
| 6011 | var pathOffset = 0; |
| 6012 | var index; |
| 6013 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6014 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6015 | pathOffset += 1; |
| 6016 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6017 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6018 | unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.equals("liveBroadcasts/transition")); |
| 6019 | pathOffset += 25; |
| 6020 | |
| 6021 | var query = (req.url).query; |
| 6022 | var queryOffset = 0; |
| 6023 | var queryMap = {}; |
| 6024 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6025 | parseBool(n) { |
| 6026 | if (n == "true") return true; |
| 6027 | if (n == "false") return false; |
| 6028 | if (n == null) return null; |
| 6029 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6030 | } |
| 6031 | if (query.length > 0) { |
| 6032 | for (var part in query.split("&")) { |
| 6033 | var keyvalue = part.split("="); |
| 6034 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6035 | } |
| 6036 | } |
| 6037 | unittest.expect(queryMap["broadcastStatus"].first, unittest.equals(arg_broadcastStatus)); |
| 6038 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6039 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6040 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6041 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6042 | |
| 6043 | |
| 6044 | var h = { |
| 6045 | "content-type" : "application/json; charset=utf-8", |
| 6046 | }; |
| 6047 | var resp = convert.JSON.encode(buildLiveBroadcast()); |
| 6048 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6049 | }), true); |
| 6050 | res.transition(arg_broadcastStatus, arg_id, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.LiveBroadcast response) { |
| 6051 | checkLiveBroadcast(response); |
| 6052 | }))); |
| 6053 | }); |
| 6054 | |
| 6055 | unittest.test("method--update", () { |
| 6056 | |
| 6057 | var mock = new common_test.HttpServerMock(); |
| 6058 | api.LiveBroadcastsResourceApi res = new api.YoutubeApi(mock).liveBroadcasts; |
| 6059 | var arg_request = buildLiveBroadcast(); |
| 6060 | var arg_part = "foo"; |
| 6061 | var arg_onBehalfOfContentOwner = "foo"; |
| 6062 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6063 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6064 | var obj = new api.LiveBroadcast.fromJson(json); |
| 6065 | checkLiveBroadcast(obj); |
| 6066 | |
| 6067 | var path = (req.url).path; |
| 6068 | var pathOffset = 0; |
| 6069 | var index; |
| 6070 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6071 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6072 | pathOffset += 1; |
| 6073 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6074 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6075 | unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("liveBroadcasts")); |
| 6076 | pathOffset += 14; |
| 6077 | |
| 6078 | var query = (req.url).query; |
| 6079 | var queryOffset = 0; |
| 6080 | var queryMap = {}; |
| 6081 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6082 | parseBool(n) { |
| 6083 | if (n == "true") return true; |
| 6084 | if (n == "false") return false; |
| 6085 | if (n == null) return null; |
| 6086 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6087 | } |
| 6088 | if (query.length > 0) { |
| 6089 | for (var part in query.split("&")) { |
| 6090 | var keyvalue = part.split("="); |
| 6091 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6092 | } |
| 6093 | } |
| 6094 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6095 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6096 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6097 | |
| 6098 | |
| 6099 | var h = { |
| 6100 | "content-type" : "application/json; charset=utf-8", |
| 6101 | }; |
| 6102 | var resp = convert.JSON.encode(buildLiveBroadcast()); |
| 6103 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6104 | }), true); |
| 6105 | res.update(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.LiveBroadcast response) { |
| 6106 | checkLiveBroadcast(response); |
| 6107 | }))); |
| 6108 | }); |
| 6109 | |
| 6110 | }); |
| 6111 | |
| 6112 | |
| 6113 | unittest.group("resource-LiveStreamsResourceApi", () { |
| 6114 | unittest.test("method--delete", () { |
| 6115 | |
| 6116 | var mock = new common_test.HttpServerMock(); |
| 6117 | api.LiveStreamsResourceApi res = new api.YoutubeApi(mock).liveStreams; |
| 6118 | var arg_id = "foo"; |
| 6119 | var arg_onBehalfOfContentOwner = "foo"; |
| 6120 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6121 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6122 | var path = (req.url).path; |
| 6123 | var pathOffset = 0; |
| 6124 | var index; |
| 6125 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6126 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6127 | pathOffset += 1; |
| 6128 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6129 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6130 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("liveStreams")); |
| 6131 | pathOffset += 11; |
| 6132 | |
| 6133 | var query = (req.url).query; |
| 6134 | var queryOffset = 0; |
| 6135 | var queryMap = {}; |
| 6136 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6137 | parseBool(n) { |
| 6138 | if (n == "true") return true; |
| 6139 | if (n == "false") return false; |
| 6140 | if (n == null) return null; |
| 6141 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6142 | } |
| 6143 | if (query.length > 0) { |
| 6144 | for (var part in query.split("&")) { |
| 6145 | var keyvalue = part.split("="); |
| 6146 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6147 | } |
| 6148 | } |
| 6149 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6150 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6151 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6152 | |
| 6153 | |
| 6154 | var h = { |
| 6155 | "content-type" : "application/json; charset=utf-8", |
| 6156 | }; |
| 6157 | var resp = ""; |
| 6158 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6159 | }), true); |
| 6160 | res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync((_) {})); |
| 6161 | }); |
| 6162 | |
| 6163 | unittest.test("method--insert", () { |
| 6164 | |
| 6165 | var mock = new common_test.HttpServerMock(); |
| 6166 | api.LiveStreamsResourceApi res = new api.YoutubeApi(mock).liveStreams; |
| 6167 | var arg_request = buildLiveStream(); |
| 6168 | var arg_part = "foo"; |
| 6169 | var arg_onBehalfOfContentOwner = "foo"; |
| 6170 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6171 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6172 | var obj = new api.LiveStream.fromJson(json); |
| 6173 | checkLiveStream(obj); |
| 6174 | |
| 6175 | var path = (req.url).path; |
| 6176 | var pathOffset = 0; |
| 6177 | var index; |
| 6178 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6179 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6180 | pathOffset += 1; |
| 6181 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6182 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6183 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("liveStreams")); |
| 6184 | pathOffset += 11; |
| 6185 | |
| 6186 | var query = (req.url).query; |
| 6187 | var queryOffset = 0; |
| 6188 | var queryMap = {}; |
| 6189 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6190 | parseBool(n) { |
| 6191 | if (n == "true") return true; |
| 6192 | if (n == "false") return false; |
| 6193 | if (n == null) return null; |
| 6194 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6195 | } |
| 6196 | if (query.length > 0) { |
| 6197 | for (var part in query.split("&")) { |
| 6198 | var keyvalue = part.split("="); |
| 6199 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6200 | } |
| 6201 | } |
| 6202 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6203 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6204 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6205 | |
| 6206 | |
| 6207 | var h = { |
| 6208 | "content-type" : "application/json; charset=utf-8", |
| 6209 | }; |
| 6210 | var resp = convert.JSON.encode(buildLiveStream()); |
| 6211 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6212 | }), true); |
| 6213 | res.insert(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.LiveStream response) { |
| 6214 | checkLiveStream(response); |
| 6215 | }))); |
| 6216 | }); |
| 6217 | |
| 6218 | unittest.test("method--list", () { |
| 6219 | |
| 6220 | var mock = new common_test.HttpServerMock(); |
| 6221 | api.LiveStreamsResourceApi res = new api.YoutubeApi(mock).liveStreams; |
| 6222 | var arg_part = "foo"; |
| 6223 | var arg_id = "foo"; |
| 6224 | var arg_maxResults = 42; |
| 6225 | var arg_mine = true; |
| 6226 | var arg_onBehalfOfContentOwner = "foo"; |
| 6227 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6228 | var arg_pageToken = "foo"; |
| 6229 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6230 | var path = (req.url).path; |
| 6231 | var pathOffset = 0; |
| 6232 | var index; |
| 6233 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6234 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6235 | pathOffset += 1; |
| 6236 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6237 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6238 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("liveStreams")); |
| 6239 | pathOffset += 11; |
| 6240 | |
| 6241 | var query = (req.url).query; |
| 6242 | var queryOffset = 0; |
| 6243 | var queryMap = {}; |
| 6244 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6245 | parseBool(n) { |
| 6246 | if (n == "true") return true; |
| 6247 | if (n == "false") return false; |
| 6248 | if (n == null) return null; |
| 6249 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6250 | } |
| 6251 | if (query.length > 0) { |
| 6252 | for (var part in query.split("&")) { |
| 6253 | var keyvalue = part.split("="); |
| 6254 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6255 | } |
| 6256 | } |
| 6257 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6258 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6259 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 6260 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 6261 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6262 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6263 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 6264 | |
| 6265 | |
| 6266 | var h = { |
| 6267 | "content-type" : "application/json; charset=utf-8", |
| 6268 | }; |
| 6269 | var resp = convert.JSON.encode(buildLiveStreamListResponse()); |
| 6270 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6271 | }), true); |
| 6272 | res.list(arg_part, id: arg_id, maxResults: arg_maxResults, mine: arg_mine, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, pageToken: arg_pageToken).then(unittest.expectAsync(((api.LiveStreamListResponse response) { |
| 6273 | checkLiveStreamListResponse(response); |
| 6274 | }))); |
| 6275 | }); |
| 6276 | |
| 6277 | unittest.test("method--update", () { |
| 6278 | |
| 6279 | var mock = new common_test.HttpServerMock(); |
| 6280 | api.LiveStreamsResourceApi res = new api.YoutubeApi(mock).liveStreams; |
| 6281 | var arg_request = buildLiveStream(); |
| 6282 | var arg_part = "foo"; |
| 6283 | var arg_onBehalfOfContentOwner = "foo"; |
| 6284 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6285 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6286 | var obj = new api.LiveStream.fromJson(json); |
| 6287 | checkLiveStream(obj); |
| 6288 | |
| 6289 | var path = (req.url).path; |
| 6290 | var pathOffset = 0; |
| 6291 | var index; |
| 6292 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6293 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6294 | pathOffset += 1; |
| 6295 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6296 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6297 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("liveStreams")); |
| 6298 | pathOffset += 11; |
| 6299 | |
| 6300 | var query = (req.url).query; |
| 6301 | var queryOffset = 0; |
| 6302 | var queryMap = {}; |
| 6303 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6304 | parseBool(n) { |
| 6305 | if (n == "true") return true; |
| 6306 | if (n == "false") return false; |
| 6307 | if (n == null) return null; |
| 6308 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6309 | } |
| 6310 | if (query.length > 0) { |
| 6311 | for (var part in query.split("&")) { |
| 6312 | var keyvalue = part.split("="); |
| 6313 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6314 | } |
| 6315 | } |
| 6316 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6317 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6318 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6319 | |
| 6320 | |
| 6321 | var h = { |
| 6322 | "content-type" : "application/json; charset=utf-8", |
| 6323 | }; |
| 6324 | var resp = convert.JSON.encode(buildLiveStream()); |
| 6325 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6326 | }), true); |
| 6327 | res.update(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.LiveStream response) { |
| 6328 | checkLiveStream(response); |
| 6329 | }))); |
| 6330 | }); |
| 6331 | |
| 6332 | }); |
| 6333 | |
| 6334 | |
| 6335 | unittest.group("resource-PlaylistItemsResourceApi", () { |
| 6336 | unittest.test("method--delete", () { |
| 6337 | |
| 6338 | var mock = new common_test.HttpServerMock(); |
| 6339 | api.PlaylistItemsResourceApi res = new api.YoutubeApi(mock).playlistItems; |
| 6340 | var arg_id = "foo"; |
| 6341 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6342 | var path = (req.url).path; |
| 6343 | var pathOffset = 0; |
| 6344 | var index; |
| 6345 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6346 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6347 | pathOffset += 1; |
| 6348 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6349 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6350 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("playlistItems")); |
| 6351 | pathOffset += 13; |
| 6352 | |
| 6353 | var query = (req.url).query; |
| 6354 | var queryOffset = 0; |
| 6355 | var queryMap = {}; |
| 6356 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6357 | parseBool(n) { |
| 6358 | if (n == "true") return true; |
| 6359 | if (n == "false") return false; |
| 6360 | if (n == null) return null; |
| 6361 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6362 | } |
| 6363 | if (query.length > 0) { |
| 6364 | for (var part in query.split("&")) { |
| 6365 | var keyvalue = part.split("="); |
| 6366 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6367 | } |
| 6368 | } |
| 6369 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6370 | |
| 6371 | |
| 6372 | var h = { |
| 6373 | "content-type" : "application/json; charset=utf-8", |
| 6374 | }; |
| 6375 | var resp = ""; |
| 6376 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6377 | }), true); |
| 6378 | res.delete(arg_id).then(unittest.expectAsync((_) {})); |
| 6379 | }); |
| 6380 | |
| 6381 | unittest.test("method--insert", () { |
| 6382 | |
| 6383 | var mock = new common_test.HttpServerMock(); |
| 6384 | api.PlaylistItemsResourceApi res = new api.YoutubeApi(mock).playlistItems; |
| 6385 | var arg_request = buildPlaylistItem(); |
| 6386 | var arg_part = "foo"; |
| 6387 | var arg_onBehalfOfContentOwner = "foo"; |
| 6388 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6389 | var obj = new api.PlaylistItem.fromJson(json); |
| 6390 | checkPlaylistItem(obj); |
| 6391 | |
| 6392 | var path = (req.url).path; |
| 6393 | var pathOffset = 0; |
| 6394 | var index; |
| 6395 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6396 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6397 | pathOffset += 1; |
| 6398 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6399 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6400 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("playlistItems")); |
| 6401 | pathOffset += 13; |
| 6402 | |
| 6403 | var query = (req.url).query; |
| 6404 | var queryOffset = 0; |
| 6405 | var queryMap = {}; |
| 6406 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6407 | parseBool(n) { |
| 6408 | if (n == "true") return true; |
| 6409 | if (n == "false") return false; |
| 6410 | if (n == null) return null; |
| 6411 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6412 | } |
| 6413 | if (query.length > 0) { |
| 6414 | for (var part in query.split("&")) { |
| 6415 | var keyvalue = part.split("="); |
| 6416 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6417 | } |
| 6418 | } |
| 6419 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6420 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6421 | |
| 6422 | |
| 6423 | var h = { |
| 6424 | "content-type" : "application/json; charset=utf-8", |
| 6425 | }; |
| 6426 | var resp = convert.JSON.encode(buildPlaylistItem()); |
| 6427 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6428 | }), true); |
| 6429 | res.insert(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.PlaylistItem response) { |
| 6430 | checkPlaylistItem(response); |
| 6431 | }))); |
| 6432 | }); |
| 6433 | |
| 6434 | unittest.test("method--list", () { |
| 6435 | |
| 6436 | var mock = new common_test.HttpServerMock(); |
| 6437 | api.PlaylistItemsResourceApi res = new api.YoutubeApi(mock).playlistItems; |
| 6438 | var arg_part = "foo"; |
| 6439 | var arg_id = "foo"; |
| 6440 | var arg_maxResults = 42; |
| 6441 | var arg_onBehalfOfContentOwner = "foo"; |
| 6442 | var arg_pageToken = "foo"; |
| 6443 | var arg_playlistId = "foo"; |
| 6444 | var arg_videoId = "foo"; |
| 6445 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6446 | var path = (req.url).path; |
| 6447 | var pathOffset = 0; |
| 6448 | var index; |
| 6449 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6450 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6451 | pathOffset += 1; |
| 6452 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6453 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6454 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("playlistItems")); |
| 6455 | pathOffset += 13; |
| 6456 | |
| 6457 | var query = (req.url).query; |
| 6458 | var queryOffset = 0; |
| 6459 | var queryMap = {}; |
| 6460 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6461 | parseBool(n) { |
| 6462 | if (n == "true") return true; |
| 6463 | if (n == "false") return false; |
| 6464 | if (n == null) return null; |
| 6465 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6466 | } |
| 6467 | if (query.length > 0) { |
| 6468 | for (var part in query.split("&")) { |
| 6469 | var keyvalue = part.split("="); |
| 6470 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6471 | } |
| 6472 | } |
| 6473 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6474 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6475 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 6476 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6477 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 6478 | unittest.expect(queryMap["playlistId"].first, unittest.equals(arg_playlistId)); |
| 6479 | unittest.expect(queryMap["videoId"].first, unittest.equals(arg_videoId)); |
| 6480 | |
| 6481 | |
| 6482 | var h = { |
| 6483 | "content-type" : "application/json; charset=utf-8", |
| 6484 | }; |
| 6485 | var resp = convert.JSON.encode(buildPlaylistItemListResponse()); |
| 6486 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6487 | }), true); |
| 6488 | res.list(arg_part, id: arg_id, maxResults: arg_maxResults, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, pageToken: arg_pageToken, playlistId: arg_playlistId, videoId: arg_videoId).then(unittest.expectAsync(((api.PlaylistItemListResponse response) { |
| 6489 | checkPlaylistItemListResponse(response); |
| 6490 | }))); |
| 6491 | }); |
| 6492 | |
| 6493 | unittest.test("method--update", () { |
| 6494 | |
| 6495 | var mock = new common_test.HttpServerMock(); |
| 6496 | api.PlaylistItemsResourceApi res = new api.YoutubeApi(mock).playlistItems; |
| 6497 | var arg_request = buildPlaylistItem(); |
| 6498 | var arg_part = "foo"; |
| 6499 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6500 | var obj = new api.PlaylistItem.fromJson(json); |
| 6501 | checkPlaylistItem(obj); |
| 6502 | |
| 6503 | var path = (req.url).path; |
| 6504 | var pathOffset = 0; |
| 6505 | var index; |
| 6506 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6507 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6508 | pathOffset += 1; |
| 6509 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6510 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6511 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("playlistItems")); |
| 6512 | pathOffset += 13; |
| 6513 | |
| 6514 | var query = (req.url).query; |
| 6515 | var queryOffset = 0; |
| 6516 | var queryMap = {}; |
| 6517 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6518 | parseBool(n) { |
| 6519 | if (n == "true") return true; |
| 6520 | if (n == "false") return false; |
| 6521 | if (n == null) return null; |
| 6522 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6523 | } |
| 6524 | if (query.length > 0) { |
| 6525 | for (var part in query.split("&")) { |
| 6526 | var keyvalue = part.split("="); |
| 6527 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6528 | } |
| 6529 | } |
| 6530 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6531 | |
| 6532 | |
| 6533 | var h = { |
| 6534 | "content-type" : "application/json; charset=utf-8", |
| 6535 | }; |
| 6536 | var resp = convert.JSON.encode(buildPlaylistItem()); |
| 6537 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6538 | }), true); |
| 6539 | res.update(arg_request, arg_part).then(unittest.expectAsync(((api.PlaylistItem response) { |
| 6540 | checkPlaylistItem(response); |
| 6541 | }))); |
| 6542 | }); |
| 6543 | |
| 6544 | }); |
| 6545 | |
| 6546 | |
| 6547 | unittest.group("resource-PlaylistsResourceApi", () { |
| 6548 | unittest.test("method--delete", () { |
| 6549 | |
| 6550 | var mock = new common_test.HttpServerMock(); |
| 6551 | api.PlaylistsResourceApi res = new api.YoutubeApi(mock).playlists; |
| 6552 | var arg_id = "foo"; |
| 6553 | var arg_onBehalfOfContentOwner = "foo"; |
| 6554 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6555 | var path = (req.url).path; |
| 6556 | var pathOffset = 0; |
| 6557 | var index; |
| 6558 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6559 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6560 | pathOffset += 1; |
| 6561 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6562 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6563 | unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("playlists")); |
| 6564 | pathOffset += 9; |
| 6565 | |
| 6566 | var query = (req.url).query; |
| 6567 | var queryOffset = 0; |
| 6568 | var queryMap = {}; |
| 6569 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6570 | parseBool(n) { |
| 6571 | if (n == "true") return true; |
| 6572 | if (n == "false") return false; |
| 6573 | if (n == null) return null; |
| 6574 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6575 | } |
| 6576 | if (query.length > 0) { |
| 6577 | for (var part in query.split("&")) { |
| 6578 | var keyvalue = part.split("="); |
| 6579 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6580 | } |
| 6581 | } |
| 6582 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6583 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6584 | |
| 6585 | |
| 6586 | var h = { |
| 6587 | "content-type" : "application/json; charset=utf-8", |
| 6588 | }; |
| 6589 | var resp = ""; |
| 6590 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6591 | }), true); |
| 6592 | res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync((_) {})); |
| 6593 | }); |
| 6594 | |
| 6595 | unittest.test("method--insert", () { |
| 6596 | |
| 6597 | var mock = new common_test.HttpServerMock(); |
| 6598 | api.PlaylistsResourceApi res = new api.YoutubeApi(mock).playlists; |
| 6599 | var arg_request = buildPlaylist(); |
| 6600 | var arg_part = "foo"; |
| 6601 | var arg_onBehalfOfContentOwner = "foo"; |
| 6602 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6603 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6604 | var obj = new api.Playlist.fromJson(json); |
| 6605 | checkPlaylist(obj); |
| 6606 | |
| 6607 | var path = (req.url).path; |
| 6608 | var pathOffset = 0; |
| 6609 | var index; |
| 6610 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6611 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6612 | pathOffset += 1; |
| 6613 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6614 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6615 | unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("playlists")); |
| 6616 | pathOffset += 9; |
| 6617 | |
| 6618 | var query = (req.url).query; |
| 6619 | var queryOffset = 0; |
| 6620 | var queryMap = {}; |
| 6621 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6622 | parseBool(n) { |
| 6623 | if (n == "true") return true; |
| 6624 | if (n == "false") return false; |
| 6625 | if (n == null) return null; |
| 6626 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6627 | } |
| 6628 | if (query.length > 0) { |
| 6629 | for (var part in query.split("&")) { |
| 6630 | var keyvalue = part.split("="); |
| 6631 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6632 | } |
| 6633 | } |
| 6634 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6635 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6636 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6637 | |
| 6638 | |
| 6639 | var h = { |
| 6640 | "content-type" : "application/json; charset=utf-8", |
| 6641 | }; |
| 6642 | var resp = convert.JSON.encode(buildPlaylist()); |
| 6643 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6644 | }), true); |
| 6645 | res.insert(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel).then(unittest.expectAsync(((api.Playlist response) { |
| 6646 | checkPlaylist(response); |
| 6647 | }))); |
| 6648 | }); |
| 6649 | |
| 6650 | unittest.test("method--list", () { |
| 6651 | |
| 6652 | var mock = new common_test.HttpServerMock(); |
| 6653 | api.PlaylistsResourceApi res = new api.YoutubeApi(mock).playlists; |
| 6654 | var arg_part = "foo"; |
| 6655 | var arg_channelId = "foo"; |
| 6656 | var arg_id = "foo"; |
| 6657 | var arg_maxResults = 42; |
| 6658 | var arg_mine = true; |
| 6659 | var arg_onBehalfOfContentOwner = "foo"; |
| 6660 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6661 | var arg_pageToken = "foo"; |
| 6662 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6663 | var path = (req.url).path; |
| 6664 | var pathOffset = 0; |
| 6665 | var index; |
| 6666 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6667 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6668 | pathOffset += 1; |
| 6669 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6670 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6671 | unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("playlists")); |
| 6672 | pathOffset += 9; |
| 6673 | |
| 6674 | var query = (req.url).query; |
| 6675 | var queryOffset = 0; |
| 6676 | var queryMap = {}; |
| 6677 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6678 | parseBool(n) { |
| 6679 | if (n == "true") return true; |
| 6680 | if (n == "false") return false; |
| 6681 | if (n == null) return null; |
| 6682 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6683 | } |
| 6684 | if (query.length > 0) { |
| 6685 | for (var part in query.split("&")) { |
| 6686 | var keyvalue = part.split("="); |
| 6687 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6688 | } |
| 6689 | } |
| 6690 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6691 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 6692 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6693 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 6694 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 6695 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6696 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 6697 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 6698 | |
| 6699 | |
| 6700 | var h = { |
| 6701 | "content-type" : "application/json; charset=utf-8", |
| 6702 | }; |
| 6703 | var resp = convert.JSON.encode(buildPlaylistListResponse()); |
| 6704 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6705 | }), true); |
| 6706 | res.list(arg_part, channelId: arg_channelId, id: arg_id, maxResults: arg_maxResults, mine: arg_mine, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PlaylistListResponse response) { |
| 6707 | checkPlaylistListResponse(response); |
| 6708 | }))); |
| 6709 | }); |
| 6710 | |
| 6711 | unittest.test("method--update", () { |
| 6712 | |
| 6713 | var mock = new common_test.HttpServerMock(); |
| 6714 | api.PlaylistsResourceApi res = new api.YoutubeApi(mock).playlists; |
| 6715 | var arg_request = buildPlaylist(); |
| 6716 | var arg_part = "foo"; |
| 6717 | var arg_onBehalfOfContentOwner = "foo"; |
| 6718 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6719 | var obj = new api.Playlist.fromJson(json); |
| 6720 | checkPlaylist(obj); |
| 6721 | |
| 6722 | var path = (req.url).path; |
| 6723 | var pathOffset = 0; |
| 6724 | var index; |
| 6725 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6726 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6727 | pathOffset += 1; |
| 6728 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6729 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6730 | unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("playlists")); |
| 6731 | pathOffset += 9; |
| 6732 | |
| 6733 | var query = (req.url).query; |
| 6734 | var queryOffset = 0; |
| 6735 | var queryMap = {}; |
| 6736 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6737 | parseBool(n) { |
| 6738 | if (n == "true") return true; |
| 6739 | if (n == "false") return false; |
| 6740 | if (n == null) return null; |
| 6741 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6742 | } |
| 6743 | if (query.length > 0) { |
| 6744 | for (var part in query.split("&")) { |
| 6745 | var keyvalue = part.split("="); |
| 6746 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6747 | } |
| 6748 | } |
| 6749 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6750 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6751 | |
| 6752 | |
| 6753 | var h = { |
| 6754 | "content-type" : "application/json; charset=utf-8", |
| 6755 | }; |
| 6756 | var resp = convert.JSON.encode(buildPlaylist()); |
| 6757 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6758 | }), true); |
| 6759 | res.update(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.Playlist response) { |
| 6760 | checkPlaylist(response); |
| 6761 | }))); |
| 6762 | }); |
| 6763 | |
| 6764 | }); |
| 6765 | |
| 6766 | |
| 6767 | unittest.group("resource-SearchResourceApi", () { |
| 6768 | unittest.test("method--list", () { |
| 6769 | |
| 6770 | var mock = new common_test.HttpServerMock(); |
| 6771 | api.SearchResourceApi res = new api.YoutubeApi(mock).search; |
| 6772 | var arg_part = "foo"; |
| 6773 | var arg_channelId = "foo"; |
| 6774 | var arg_channelType = "foo"; |
| 6775 | var arg_eventType = "foo"; |
| 6776 | var arg_forContentOwner = true; |
| 6777 | var arg_forMine = true; |
| 6778 | var arg_location = "foo"; |
| 6779 | var arg_locationRadius = "foo"; |
| 6780 | var arg_maxResults = 42; |
| 6781 | var arg_onBehalfOfContentOwner = "foo"; |
| 6782 | var arg_order = "foo"; |
| 6783 | var arg_pageToken = "foo"; |
| 6784 | var arg_publishedAfter = core.DateTime.parse("2002-02-27T14:01:02"); |
| 6785 | var arg_publishedBefore = core.DateTime.parse("2002-02-27T14:01:02"); |
| 6786 | var arg_q = "foo"; |
| 6787 | var arg_regionCode = "foo"; |
| 6788 | var arg_relatedToVideoId = "foo"; |
| 6789 | var arg_safeSearch = "foo"; |
| 6790 | var arg_topicId = "foo"; |
| 6791 | var arg_type = "foo"; |
| 6792 | var arg_videoCaption = "foo"; |
| 6793 | var arg_videoCategoryId = "foo"; |
| 6794 | var arg_videoDefinition = "foo"; |
| 6795 | var arg_videoDimension = "foo"; |
| 6796 | var arg_videoDuration = "foo"; |
| 6797 | var arg_videoEmbeddable = "foo"; |
| 6798 | var arg_videoLicense = "foo"; |
| 6799 | var arg_videoSyndicated = "foo"; |
| 6800 | var arg_videoType = "foo"; |
| 6801 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6802 | var path = (req.url).path; |
| 6803 | var pathOffset = 0; |
| 6804 | var index; |
| 6805 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6806 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6807 | pathOffset += 1; |
| 6808 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6809 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6810 | unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("search")); |
| 6811 | pathOffset += 6; |
| 6812 | |
| 6813 | var query = (req.url).query; |
| 6814 | var queryOffset = 0; |
| 6815 | var queryMap = {}; |
| 6816 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6817 | parseBool(n) { |
| 6818 | if (n == "true") return true; |
| 6819 | if (n == "false") return false; |
| 6820 | if (n == null) return null; |
| 6821 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6822 | } |
| 6823 | if (query.length > 0) { |
| 6824 | for (var part in query.split("&")) { |
| 6825 | var keyvalue = part.split("="); |
| 6826 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6827 | } |
| 6828 | } |
| 6829 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6830 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 6831 | unittest.expect(queryMap["channelType"].first, unittest.equals(arg_channelType)); |
| 6832 | unittest.expect(queryMap["eventType"].first, unittest.equals(arg_eventType)); |
| 6833 | unittest.expect(queryMap["forContentOwner"].first, unittest.equals("$arg_forContentOwner")); |
| 6834 | unittest.expect(queryMap["forMine"].first, unittest.equals("$arg_forMine")); |
| 6835 | unittest.expect(queryMap["location"].first, unittest.equals(arg_location)); |
| 6836 | unittest.expect(queryMap["locationRadius"].first, unittest.equals(arg_locationRadius)); |
| 6837 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 6838 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 6839 | unittest.expect(queryMap["order"].first, unittest.equals(arg_order)); |
| 6840 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 6841 | unittest.expect(core.DateTime.parse(queryMap["publishedAfter"].first), unittest.equals(arg_publishedAfter)); |
| 6842 | unittest.expect(core.DateTime.parse(queryMap["publishedBefore"].first), unittest.equals(arg_publishedBefore)); |
| 6843 | unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); |
| 6844 | unittest.expect(queryMap["regionCode"].first, unittest.equals(arg_regionCode)); |
| 6845 | unittest.expect(queryMap["relatedToVideoId"].first, unittest.equals(arg_relatedToVideoId)); |
| 6846 | unittest.expect(queryMap["safeSearch"].first, unittest.equals(arg_safeSearch)); |
| 6847 | unittest.expect(queryMap["topicId"].first, unittest.equals(arg_topicId)); |
| 6848 | unittest.expect(queryMap["type"].first, unittest.equals(arg_type)); |
| 6849 | unittest.expect(queryMap["videoCaption"].first, unittest.equals(arg_videoCaption)); |
| 6850 | unittest.expect(queryMap["videoCategoryId"].first, unittest.equals(arg_videoCategoryId)); |
| 6851 | unittest.expect(queryMap["videoDefinition"].first, unittest.equals(arg_videoDefinition)); |
| 6852 | unittest.expect(queryMap["videoDimension"].first, unittest.equals(arg_videoDimension)); |
| 6853 | unittest.expect(queryMap["videoDuration"].first, unittest.equals(arg_videoDuration)); |
| 6854 | unittest.expect(queryMap["videoEmbeddable"].first, unittest.equals(arg_videoEmbeddable)); |
| 6855 | unittest.expect(queryMap["videoLicense"].first, unittest.equals(arg_videoLicense)); |
| 6856 | unittest.expect(queryMap["videoSyndicated"].first, unittest.equals(arg_videoSyndicated)); |
| 6857 | unittest.expect(queryMap["videoType"].first, unittest.equals(arg_videoType)); |
| 6858 | |
| 6859 | |
| 6860 | var h = { |
| 6861 | "content-type" : "application/json; charset=utf-8", |
| 6862 | }; |
| 6863 | var resp = convert.JSON.encode(buildSearchListResponse()); |
| 6864 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6865 | }), true); |
| 6866 | res.list(arg_part, channelId: arg_channelId, channelType: arg_channelType, eventType: arg_eventType, forContentOwner: arg_forContentOwner, forMine: arg_forMine, location: arg_location, locationRadius: arg_locationRadius, maxResults: arg_maxResults, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, order: arg_order, pageToken: arg_pageToken, publishedAfter: arg_publishedAfter, publishedBefore: arg_publishedBefore, q: arg_q, regionCode: arg_regionCode, relatedToVideoId: arg_relatedToVideoId, safeSearch: arg_safeSearch, topicId: arg_topicId, type: arg_type, videoCaption: arg_videoCaption, videoCategoryId: arg_videoCategoryId, videoDefinition: arg_videoDefinition, videoDimension: arg_videoDimension, videoDuration: arg_videoDuration, videoEmbeddable: arg_videoEmbeddable, videoLicense: arg_videoLicense, videoSyndicated: arg_videoSyndicated, videoType: arg_videoType).then(unittest.expectAsync(((api.SearchListResponse response) { |
| 6867 | checkSearchListResponse(response); |
| 6868 | }))); |
| 6869 | }); |
| 6870 | |
| 6871 | }); |
| 6872 | |
| 6873 | |
| 6874 | unittest.group("resource-SubscriptionsResourceApi", () { |
| 6875 | unittest.test("method--delete", () { |
| 6876 | |
| 6877 | var mock = new common_test.HttpServerMock(); |
| 6878 | api.SubscriptionsResourceApi res = new api.YoutubeApi(mock).subscriptions; |
| 6879 | var arg_id = "foo"; |
| 6880 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6881 | var path = (req.url).path; |
| 6882 | var pathOffset = 0; |
| 6883 | var index; |
| 6884 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6885 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6886 | pathOffset += 1; |
| 6887 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6888 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6889 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("subscriptions")); |
| 6890 | pathOffset += 13; |
| 6891 | |
| 6892 | var query = (req.url).query; |
| 6893 | var queryOffset = 0; |
| 6894 | var queryMap = {}; |
| 6895 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6896 | parseBool(n) { |
| 6897 | if (n == "true") return true; |
| 6898 | if (n == "false") return false; |
| 6899 | if (n == null) return null; |
| 6900 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6901 | } |
| 6902 | if (query.length > 0) { |
| 6903 | for (var part in query.split("&")) { |
| 6904 | var keyvalue = part.split("="); |
| 6905 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6906 | } |
| 6907 | } |
| 6908 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 6909 | |
| 6910 | |
| 6911 | var h = { |
| 6912 | "content-type" : "application/json; charset=utf-8", |
| 6913 | }; |
| 6914 | var resp = ""; |
| 6915 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6916 | }), true); |
| 6917 | res.delete(arg_id).then(unittest.expectAsync((_) {})); |
| 6918 | }); |
| 6919 | |
| 6920 | unittest.test("method--insert", () { |
| 6921 | |
| 6922 | var mock = new common_test.HttpServerMock(); |
| 6923 | api.SubscriptionsResourceApi res = new api.YoutubeApi(mock).subscriptions; |
| 6924 | var arg_request = buildSubscription(); |
| 6925 | var arg_part = "foo"; |
| 6926 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6927 | var obj = new api.Subscription.fromJson(json); |
| 6928 | checkSubscription(obj); |
| 6929 | |
| 6930 | var path = (req.url).path; |
| 6931 | var pathOffset = 0; |
| 6932 | var index; |
| 6933 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6934 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6935 | pathOffset += 1; |
| 6936 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6937 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6938 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("subscriptions")); |
| 6939 | pathOffset += 13; |
| 6940 | |
| 6941 | var query = (req.url).query; |
| 6942 | var queryOffset = 0; |
| 6943 | var queryMap = {}; |
| 6944 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6945 | parseBool(n) { |
| 6946 | if (n == "true") return true; |
| 6947 | if (n == "false") return false; |
| 6948 | if (n == null) return null; |
| 6949 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 6950 | } |
| 6951 | if (query.length > 0) { |
| 6952 | for (var part in query.split("&")) { |
| 6953 | var keyvalue = part.split("="); |
| 6954 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 6955 | } |
| 6956 | } |
| 6957 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 6958 | |
| 6959 | |
| 6960 | var h = { |
| 6961 | "content-type" : "application/json; charset=utf-8", |
| 6962 | }; |
| 6963 | var resp = convert.JSON.encode(buildSubscription()); |
| 6964 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6965 | }), true); |
| 6966 | res.insert(arg_request, arg_part).then(unittest.expectAsync(((api.Subscription response) { |
| 6967 | checkSubscription(response); |
| 6968 | }))); |
| 6969 | }); |
| 6970 | |
| 6971 | unittest.test("method--list", () { |
| 6972 | |
| 6973 | var mock = new common_test.HttpServerMock(); |
| 6974 | api.SubscriptionsResourceApi res = new api.YoutubeApi(mock).subscriptions; |
| 6975 | var arg_part = "foo"; |
| 6976 | var arg_channelId = "foo"; |
| 6977 | var arg_forChannelId = "foo"; |
| 6978 | var arg_id = "foo"; |
| 6979 | var arg_maxResults = 42; |
| 6980 | var arg_mine = true; |
| 6981 | var arg_mySubscribers = true; |
| 6982 | var arg_onBehalfOfContentOwner = "foo"; |
| 6983 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 6984 | var arg_order = "foo"; |
| 6985 | var arg_pageToken = "foo"; |
| 6986 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6987 | var path = (req.url).path; |
| 6988 | var pathOffset = 0; |
| 6989 | var index; |
| 6990 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 6991 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 6992 | pathOffset += 1; |
| 6993 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 6994 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 6995 | unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("subscriptions")); |
| 6996 | pathOffset += 13; |
| 6997 | |
| 6998 | var query = (req.url).query; |
| 6999 | var queryOffset = 0; |
| 7000 | var queryMap = {}; |
| 7001 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7002 | parseBool(n) { |
| 7003 | if (n == "true") return true; |
| 7004 | if (n == "false") return false; |
| 7005 | if (n == null) return null; |
| 7006 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7007 | } |
| 7008 | if (query.length > 0) { |
| 7009 | for (var part in query.split("&")) { |
| 7010 | var keyvalue = part.split("="); |
| 7011 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7012 | } |
| 7013 | } |
| 7014 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 7015 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 7016 | unittest.expect(queryMap["forChannelId"].first, unittest.equals(arg_forChannelId)); |
| 7017 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 7018 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 7019 | unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
| 7020 | unittest.expect(queryMap["mySubscribers"].first, unittest.equals("$arg_mySubscribers")); |
| 7021 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7022 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 7023 | unittest.expect(queryMap["order"].first, unittest.equals(arg_order)); |
| 7024 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 7025 | |
| 7026 | |
| 7027 | var h = { |
| 7028 | "content-type" : "application/json; charset=utf-8", |
| 7029 | }; |
| 7030 | var resp = convert.JSON.encode(buildSubscriptionListResponse()); |
| 7031 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7032 | }), true); |
| 7033 | res.list(arg_part, channelId: arg_channelId, forChannelId: arg_forChannelId, id: arg_id, maxResults: arg_maxResults, mine: arg_mine, mySubscribers: arg_mySubscribers, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, order: arg_order, pageToken: arg_pageToken).then(unittest.expectAsync(((api.SubscriptionListResponse response) { |
| 7034 | checkSubscriptionListResponse(response); |
| 7035 | }))); |
| 7036 | }); |
| 7037 | |
| 7038 | }); |
| 7039 | |
| 7040 | |
| 7041 | unittest.group("resource-ThumbnailsResourceApi", () { |
| 7042 | unittest.test("method--set", () { |
| 7043 | // TODO: Implement tests for media upload; |
| 7044 | // TODO: Implement tests for media download; |
| 7045 | |
| 7046 | var mock = new common_test.HttpServerMock(); |
| 7047 | api.ThumbnailsResourceApi res = new api.YoutubeApi(mock).thumbnails; |
| 7048 | var arg_videoId = "foo"; |
| 7049 | var arg_onBehalfOfContentOwner = "foo"; |
| 7050 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7051 | var path = (req.url).path; |
| 7052 | var pathOffset = 0; |
| 7053 | var index; |
| 7054 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7055 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7056 | pathOffset += 1; |
| 7057 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7058 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7059 | unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("thumbnails/set")); |
| 7060 | pathOffset += 14; |
| 7061 | |
| 7062 | var query = (req.url).query; |
| 7063 | var queryOffset = 0; |
| 7064 | var queryMap = {}; |
| 7065 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7066 | parseBool(n) { |
| 7067 | if (n == "true") return true; |
| 7068 | if (n == "false") return false; |
| 7069 | if (n == null) return null; |
| 7070 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7071 | } |
| 7072 | if (query.length > 0) { |
| 7073 | for (var part in query.split("&")) { |
| 7074 | var keyvalue = part.split("="); |
| 7075 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7076 | } |
| 7077 | } |
| 7078 | unittest.expect(queryMap["videoId"].first, unittest.equals(arg_videoId)); |
| 7079 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7080 | |
| 7081 | |
| 7082 | var h = { |
| 7083 | "content-type" : "application/json; charset=utf-8", |
| 7084 | }; |
| 7085 | var resp = convert.JSON.encode(buildThumbnailSetResponse()); |
| 7086 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7087 | }), true); |
| 7088 | res.set(arg_videoId, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.ThumbnailSetResponse response) { |
| 7089 | checkThumbnailSetResponse(response); |
| 7090 | }))); |
| 7091 | }); |
| 7092 | |
| 7093 | }); |
| 7094 | |
| 7095 | |
| 7096 | unittest.group("resource-VideoCategoriesResourceApi", () { |
| 7097 | unittest.test("method--list", () { |
| 7098 | |
| 7099 | var mock = new common_test.HttpServerMock(); |
| 7100 | api.VideoCategoriesResourceApi res = new api.YoutubeApi(mock).videoCategories; |
| 7101 | var arg_part = "foo"; |
| 7102 | var arg_hl = "foo"; |
| 7103 | var arg_id = "foo"; |
| 7104 | var arg_regionCode = "foo"; |
| 7105 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7106 | var path = (req.url).path; |
| 7107 | var pathOffset = 0; |
| 7108 | var index; |
| 7109 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7110 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7111 | pathOffset += 1; |
| 7112 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7113 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7114 | unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("videoCategories")); |
| 7115 | pathOffset += 15; |
| 7116 | |
| 7117 | var query = (req.url).query; |
| 7118 | var queryOffset = 0; |
| 7119 | var queryMap = {}; |
| 7120 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7121 | parseBool(n) { |
| 7122 | if (n == "true") return true; |
| 7123 | if (n == "false") return false; |
| 7124 | if (n == null) return null; |
| 7125 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7126 | } |
| 7127 | if (query.length > 0) { |
| 7128 | for (var part in query.split("&")) { |
| 7129 | var keyvalue = part.split("="); |
| 7130 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7131 | } |
| 7132 | } |
| 7133 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 7134 | unittest.expect(queryMap["hl"].first, unittest.equals(arg_hl)); |
| 7135 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 7136 | unittest.expect(queryMap["regionCode"].first, unittest.equals(arg_regionCode)); |
| 7137 | |
| 7138 | |
| 7139 | var h = { |
| 7140 | "content-type" : "application/json; charset=utf-8", |
| 7141 | }; |
| 7142 | var resp = convert.JSON.encode(buildVideoCategoryListResponse()); |
| 7143 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7144 | }), true); |
| 7145 | res.list(arg_part, hl: arg_hl, id: arg_id, regionCode: arg_regionCode).then(unittest.expectAsync(((api.VideoCategoryListResponse response) { |
| 7146 | checkVideoCategoryListResponse(response); |
| 7147 | }))); |
| 7148 | }); |
| 7149 | |
| 7150 | }); |
| 7151 | |
| 7152 | |
| 7153 | unittest.group("resource-VideosResourceApi", () { |
| 7154 | unittest.test("method--delete", () { |
| 7155 | |
| 7156 | var mock = new common_test.HttpServerMock(); |
| 7157 | api.VideosResourceApi res = new api.YoutubeApi(mock).videos; |
| 7158 | var arg_id = "foo"; |
| 7159 | var arg_onBehalfOfContentOwner = "foo"; |
| 7160 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7161 | var path = (req.url).path; |
| 7162 | var pathOffset = 0; |
| 7163 | var index; |
| 7164 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7165 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7166 | pathOffset += 1; |
| 7167 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7168 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7169 | unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("videos")); |
| 7170 | pathOffset += 6; |
| 7171 | |
| 7172 | var query = (req.url).query; |
| 7173 | var queryOffset = 0; |
| 7174 | var queryMap = {}; |
| 7175 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7176 | parseBool(n) { |
| 7177 | if (n == "true") return true; |
| 7178 | if (n == "false") return false; |
| 7179 | if (n == null) return null; |
| 7180 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7181 | } |
| 7182 | if (query.length > 0) { |
| 7183 | for (var part in query.split("&")) { |
| 7184 | var keyvalue = part.split("="); |
| 7185 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7186 | } |
| 7187 | } |
| 7188 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 7189 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7190 | |
| 7191 | |
| 7192 | var h = { |
| 7193 | "content-type" : "application/json; charset=utf-8", |
| 7194 | }; |
| 7195 | var resp = ""; |
| 7196 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7197 | }), true); |
| 7198 | res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync((_) {})); |
| 7199 | }); |
| 7200 | |
| 7201 | unittest.test("method--getRating", () { |
| 7202 | |
| 7203 | var mock = new common_test.HttpServerMock(); |
| 7204 | api.VideosResourceApi res = new api.YoutubeApi(mock).videos; |
| 7205 | var arg_id = "foo"; |
| 7206 | var arg_onBehalfOfContentOwner = "foo"; |
| 7207 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7208 | var path = (req.url).path; |
| 7209 | var pathOffset = 0; |
| 7210 | var index; |
| 7211 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7212 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7213 | pathOffset += 1; |
| 7214 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7215 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7216 | unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.equals("videos/getRating")); |
| 7217 | pathOffset += 16; |
| 7218 | |
| 7219 | var query = (req.url).query; |
| 7220 | var queryOffset = 0; |
| 7221 | var queryMap = {}; |
| 7222 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7223 | parseBool(n) { |
| 7224 | if (n == "true") return true; |
| 7225 | if (n == "false") return false; |
| 7226 | if (n == null) return null; |
| 7227 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7228 | } |
| 7229 | if (query.length > 0) { |
| 7230 | for (var part in query.split("&")) { |
| 7231 | var keyvalue = part.split("="); |
| 7232 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7233 | } |
| 7234 | } |
| 7235 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 7236 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7237 | |
| 7238 | |
| 7239 | var h = { |
| 7240 | "content-type" : "application/json; charset=utf-8", |
| 7241 | }; |
| 7242 | var resp = convert.JSON.encode(buildVideoGetRatingResponse()); |
| 7243 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7244 | }), true); |
| 7245 | res.getRating(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.VideoGetRatingResponse response) { |
| 7246 | checkVideoGetRatingResponse(response); |
| 7247 | }))); |
| 7248 | }); |
| 7249 | |
| 7250 | unittest.test("method--insert", () { |
| 7251 | // TODO: Implement tests for media upload; |
| 7252 | // TODO: Implement tests for media download; |
| 7253 | |
| 7254 | var mock = new common_test.HttpServerMock(); |
| 7255 | api.VideosResourceApi res = new api.YoutubeApi(mock).videos; |
| 7256 | var arg_request = buildVideo(); |
| 7257 | var arg_part = "foo"; |
| 7258 | var arg_autoLevels = true; |
| 7259 | var arg_notifySubscribers = true; |
| 7260 | var arg_onBehalfOfContentOwner = "foo"; |
| 7261 | var arg_onBehalfOfContentOwnerChannel = "foo"; |
| 7262 | var arg_stabilize = true; |
| 7263 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7264 | var obj = new api.Video.fromJson(json); |
| 7265 | checkVideo(obj); |
| 7266 | |
| 7267 | var path = (req.url).path; |
| 7268 | var pathOffset = 0; |
| 7269 | var index; |
| 7270 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7271 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7272 | pathOffset += 1; |
| 7273 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7274 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7275 | unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("videos")); |
| 7276 | pathOffset += 6; |
| 7277 | |
| 7278 | var query = (req.url).query; |
| 7279 | var queryOffset = 0; |
| 7280 | var queryMap = {}; |
| 7281 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7282 | parseBool(n) { |
| 7283 | if (n == "true") return true; |
| 7284 | if (n == "false") return false; |
| 7285 | if (n == null) return null; |
| 7286 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7287 | } |
| 7288 | if (query.length > 0) { |
| 7289 | for (var part in query.split("&")) { |
| 7290 | var keyvalue = part.split("="); |
| 7291 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7292 | } |
| 7293 | } |
| 7294 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 7295 | unittest.expect(queryMap["autoLevels"].first, unittest.equals("$arg_autoLevels")); |
| 7296 | unittest.expect(queryMap["notifySubscribers"].first, unittest.equals("$arg_notifySubscribers")); |
| 7297 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7298 | unittest.expect(queryMap["onBehalfOfContentOwnerChannel"].first, unittest.equals(arg_onBehalfOfContentOwnerChannel)); |
| 7299 | unittest.expect(queryMap["stabilize"].first, unittest.equals("$arg_stabilize")); |
| 7300 | |
| 7301 | |
| 7302 | var h = { |
| 7303 | "content-type" : "application/json; charset=utf-8", |
| 7304 | }; |
| 7305 | var resp = convert.JSON.encode(buildVideo()); |
| 7306 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7307 | }), true); |
| 7308 | res.insert(arg_request, arg_part, autoLevels: arg_autoLevels, notifySubscribers: arg_notifySubscribers, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, onBehalfOfContentOwnerChannel: arg_onBehalfOfContentOwnerChannel, stabilize: arg_stabilize).then(unittest.expectAsync(((api.Video response) { |
| 7309 | checkVideo(response); |
| 7310 | }))); |
| 7311 | }); |
| 7312 | |
| 7313 | unittest.test("method--list", () { |
| 7314 | |
| 7315 | var mock = new common_test.HttpServerMock(); |
| 7316 | api.VideosResourceApi res = new api.YoutubeApi(mock).videos; |
| 7317 | var arg_part = "foo"; |
| 7318 | var arg_chart = "foo"; |
| 7319 | var arg_id = "foo"; |
| 7320 | var arg_locale = "foo"; |
| 7321 | var arg_maxResults = 42; |
| 7322 | var arg_myRating = "foo"; |
| 7323 | var arg_onBehalfOfContentOwner = "foo"; |
| 7324 | var arg_pageToken = "foo"; |
| 7325 | var arg_regionCode = "foo"; |
| 7326 | var arg_videoCategoryId = "foo"; |
| 7327 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7328 | var path = (req.url).path; |
| 7329 | var pathOffset = 0; |
| 7330 | var index; |
| 7331 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7332 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7333 | pathOffset += 1; |
| 7334 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7335 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7336 | unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("videos")); |
| 7337 | pathOffset += 6; |
| 7338 | |
| 7339 | var query = (req.url).query; |
| 7340 | var queryOffset = 0; |
| 7341 | var queryMap = {}; |
| 7342 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7343 | parseBool(n) { |
| 7344 | if (n == "true") return true; |
| 7345 | if (n == "false") return false; |
| 7346 | if (n == null) return null; |
| 7347 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7348 | } |
| 7349 | if (query.length > 0) { |
| 7350 | for (var part in query.split("&")) { |
| 7351 | var keyvalue = part.split("="); |
| 7352 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7353 | } |
| 7354 | } |
| 7355 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 7356 | unittest.expect(queryMap["chart"].first, unittest.equals(arg_chart)); |
| 7357 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 7358 | unittest.expect(queryMap["locale"].first, unittest.equals(arg_locale)); |
| 7359 | unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| 7360 | unittest.expect(queryMap["myRating"].first, unittest.equals(arg_myRating)); |
| 7361 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7362 | unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 7363 | unittest.expect(queryMap["regionCode"].first, unittest.equals(arg_regionCode)); |
| 7364 | unittest.expect(queryMap["videoCategoryId"].first, unittest.equals(arg_videoCategoryId)); |
| 7365 | |
| 7366 | |
| 7367 | var h = { |
| 7368 | "content-type" : "application/json; charset=utf-8", |
| 7369 | }; |
| 7370 | var resp = convert.JSON.encode(buildVideoListResponse()); |
| 7371 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7372 | }), true); |
| 7373 | res.list(arg_part, chart: arg_chart, id: arg_id, locale: arg_locale, maxResults: arg_maxResults, myRating: arg_myRating, onBehalfOfContentOwner: arg_onBehalfOfContentOwner, pageToken: arg_pageToken, regionCode: arg_regionCode, videoCategoryId: arg_videoCategoryId).then(unittest.expectAsync(((api.VideoListResponse response) { |
| 7374 | checkVideoListResponse(response); |
| 7375 | }))); |
| 7376 | }); |
| 7377 | |
| 7378 | unittest.test("method--rate", () { |
| 7379 | |
| 7380 | var mock = new common_test.HttpServerMock(); |
| 7381 | api.VideosResourceApi res = new api.YoutubeApi(mock).videos; |
| 7382 | var arg_id = "foo"; |
| 7383 | var arg_rating = "foo"; |
| 7384 | var arg_onBehalfOfContentOwner = "foo"; |
| 7385 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7386 | var path = (req.url).path; |
| 7387 | var pathOffset = 0; |
| 7388 | var index; |
| 7389 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7390 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7391 | pathOffset += 1; |
| 7392 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7393 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7394 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("videos/rate")); |
| 7395 | pathOffset += 11; |
| 7396 | |
| 7397 | var query = (req.url).query; |
| 7398 | var queryOffset = 0; |
| 7399 | var queryMap = {}; |
| 7400 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7401 | parseBool(n) { |
| 7402 | if (n == "true") return true; |
| 7403 | if (n == "false") return false; |
| 7404 | if (n == null) return null; |
| 7405 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7406 | } |
| 7407 | if (query.length > 0) { |
| 7408 | for (var part in query.split("&")) { |
| 7409 | var keyvalue = part.split("="); |
| 7410 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7411 | } |
| 7412 | } |
| 7413 | unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
| 7414 | unittest.expect(queryMap["rating"].first, unittest.equals(arg_rating)); |
| 7415 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7416 | |
| 7417 | |
| 7418 | var h = { |
| 7419 | "content-type" : "application/json; charset=utf-8", |
| 7420 | }; |
| 7421 | var resp = ""; |
| 7422 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7423 | }), true); |
| 7424 | res.rate(arg_id, arg_rating, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync((_) {})); |
| 7425 | }); |
| 7426 | |
| 7427 | unittest.test("method--update", () { |
| 7428 | |
| 7429 | var mock = new common_test.HttpServerMock(); |
| 7430 | api.VideosResourceApi res = new api.YoutubeApi(mock).videos; |
| 7431 | var arg_request = buildVideo(); |
| 7432 | var arg_part = "foo"; |
| 7433 | var arg_onBehalfOfContentOwner = "foo"; |
| 7434 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7435 | var obj = new api.Video.fromJson(json); |
| 7436 | checkVideo(obj); |
| 7437 | |
| 7438 | var path = (req.url).path; |
| 7439 | var pathOffset = 0; |
| 7440 | var index; |
| 7441 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7442 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7443 | pathOffset += 1; |
| 7444 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7445 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7446 | unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("videos")); |
| 7447 | pathOffset += 6; |
| 7448 | |
| 7449 | var query = (req.url).query; |
| 7450 | var queryOffset = 0; |
| 7451 | var queryMap = {}; |
| 7452 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7453 | parseBool(n) { |
| 7454 | if (n == "true") return true; |
| 7455 | if (n == "false") return false; |
| 7456 | if (n == null) return null; |
| 7457 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7458 | } |
| 7459 | if (query.length > 0) { |
| 7460 | for (var part in query.split("&")) { |
| 7461 | var keyvalue = part.split("="); |
| 7462 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7463 | } |
| 7464 | } |
| 7465 | unittest.expect(queryMap["part"].first, unittest.equals(arg_part)); |
| 7466 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7467 | |
| 7468 | |
| 7469 | var h = { |
| 7470 | "content-type" : "application/json; charset=utf-8", |
| 7471 | }; |
| 7472 | var resp = convert.JSON.encode(buildVideo()); |
| 7473 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7474 | }), true); |
| 7475 | res.update(arg_request, arg_part, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.Video response) { |
| 7476 | checkVideo(response); |
| 7477 | }))); |
| 7478 | }); |
| 7479 | |
| 7480 | }); |
| 7481 | |
| 7482 | |
| 7483 | unittest.group("resource-WatermarksResourceApi", () { |
| 7484 | unittest.test("method--set", () { |
| 7485 | // TODO: Implement tests for media upload; |
| 7486 | // TODO: Implement tests for media download; |
| 7487 | |
| 7488 | var mock = new common_test.HttpServerMock(); |
| 7489 | api.WatermarksResourceApi res = new api.YoutubeApi(mock).watermarks; |
| 7490 | var arg_request = buildInvideoBranding(); |
| 7491 | var arg_channelId = "foo"; |
| 7492 | var arg_onBehalfOfContentOwner = "foo"; |
| 7493 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7494 | var obj = new api.InvideoBranding.fromJson(json); |
| 7495 | checkInvideoBranding(obj); |
| 7496 | |
| 7497 | var path = (req.url).path; |
| 7498 | var pathOffset = 0; |
| 7499 | var index; |
| 7500 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7501 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7502 | pathOffset += 1; |
| 7503 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7504 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7505 | unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("watermarks/set")); |
| 7506 | pathOffset += 14; |
| 7507 | |
| 7508 | var query = (req.url).query; |
| 7509 | var queryOffset = 0; |
| 7510 | var queryMap = {}; |
| 7511 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7512 | parseBool(n) { |
| 7513 | if (n == "true") return true; |
| 7514 | if (n == "false") return false; |
| 7515 | if (n == null) return null; |
| 7516 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7517 | } |
| 7518 | if (query.length > 0) { |
| 7519 | for (var part in query.split("&")) { |
| 7520 | var keyvalue = part.split("="); |
| 7521 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7522 | } |
| 7523 | } |
| 7524 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 7525 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7526 | |
| 7527 | |
| 7528 | var h = { |
| 7529 | "content-type" : "application/json; charset=utf-8", |
| 7530 | }; |
| 7531 | var resp = ""; |
| 7532 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7533 | }), true); |
| 7534 | res.set(arg_request, arg_channelId, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync((_) {})); |
| 7535 | }); |
| 7536 | |
| 7537 | unittest.test("method--unset", () { |
| 7538 | |
| 7539 | var mock = new common_test.HttpServerMock(); |
| 7540 | api.WatermarksResourceApi res = new api.YoutubeApi(mock).watermarks; |
| 7541 | var arg_channelId = "foo"; |
| 7542 | var arg_onBehalfOfContentOwner = "foo"; |
| 7543 | mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7544 | var path = (req.url).path; |
| 7545 | var pathOffset = 0; |
| 7546 | var index; |
| 7547 | var subPart; |
Martin Kustermann | 0abb810 | 2014-09-23 16:10:54 +0200 | [diff] [blame] | 7548 | unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 7549 | pathOffset += 1; |
| 7550 | unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("youtube/v3/")); |
| 7551 | pathOffset += 11; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 7552 | unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.equals("watermarks/unset")); |
| 7553 | pathOffset += 16; |
| 7554 | |
| 7555 | var query = (req.url).query; |
| 7556 | var queryOffset = 0; |
| 7557 | var queryMap = {}; |
| 7558 | addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7559 | parseBool(n) { |
| 7560 | if (n == "true") return true; |
| 7561 | if (n == "false") return false; |
| 7562 | if (n == null) return null; |
| 7563 | throw new core.ArgumentError("Invalid boolean: $n"); |
| 7564 | } |
| 7565 | if (query.length > 0) { |
| 7566 | for (var part in query.split("&")) { |
| 7567 | var keyvalue = part.split("="); |
| 7568 | addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| 7569 | } |
| 7570 | } |
| 7571 | unittest.expect(queryMap["channelId"].first, unittest.equals(arg_channelId)); |
| 7572 | unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equals(arg_onBehalfOfContentOwner)); |
| 7573 | |
| 7574 | |
| 7575 | var h = { |
| 7576 | "content-type" : "application/json; charset=utf-8", |
| 7577 | }; |
| 7578 | var resp = ""; |
| 7579 | return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7580 | }), true); |
| 7581 | res.unset(arg_channelId, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).then(unittest.expectAsync((_) {})); |
| 7582 | }); |
| 7583 | |
| 7584 | }); |
| 7585 | |
| 7586 | |
| 7587 | } |
| 7588 | |