OLD | NEW |
1 library googleapis.gamesConfiguration.v1configuration.test; | 1 library googleapis.gamesConfiguration.v1configuration.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis/gamesconfiguration/v1configuration.dart' as api; | 12 import 'package:googleapis/gamesconfiguration/v1configuration.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 core.int buildCounterAchievementConfiguration = 0; | 54 core.int buildCounterAchievementConfiguration = 0; |
55 buildAchievementConfiguration() { | 55 buildAchievementConfiguration() { |
56 var o = new api.AchievementConfiguration(); | 56 var o = new api.AchievementConfiguration(); |
57 buildCounterAchievementConfiguration++; | 57 buildCounterAchievementConfiguration++; |
58 if (buildCounterAchievementConfiguration < 3) { | 58 if (buildCounterAchievementConfiguration < 3) { |
59 o.achievementType = "foo"; | 59 o.achievementType = "foo"; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 checkLocalizedStringBundle(o.description); | 106 checkLocalizedStringBundle(o.description); |
107 unittest.expect(o.iconUrl, unittest.equals('foo')); | 107 unittest.expect(o.iconUrl, unittest.equals('foo')); |
108 unittest.expect(o.kind, unittest.equals('foo')); | 108 unittest.expect(o.kind, unittest.equals('foo')); |
109 checkLocalizedStringBundle(o.name); | 109 checkLocalizedStringBundle(o.name); |
110 unittest.expect(o.pointValue, unittest.equals(42)); | 110 unittest.expect(o.pointValue, unittest.equals(42)); |
111 unittest.expect(o.sortRank, unittest.equals(42)); | 111 unittest.expect(o.sortRank, unittest.equals(42)); |
112 } | 112 } |
113 buildCounterAchievementConfigurationDetail--; | 113 buildCounterAchievementConfigurationDetail--; |
114 } | 114 } |
115 | 115 |
116 buildUnnamed683() { | 116 buildUnnamed688() { |
117 var o = new core.List<api.AchievementConfiguration>(); | 117 var o = new core.List<api.AchievementConfiguration>(); |
118 o.add(buildAchievementConfiguration()); | 118 o.add(buildAchievementConfiguration()); |
119 o.add(buildAchievementConfiguration()); | 119 o.add(buildAchievementConfiguration()); |
120 return o; | 120 return o; |
121 } | 121 } |
122 | 122 |
123 checkUnnamed683(core.List<api.AchievementConfiguration> o) { | 123 checkUnnamed688(core.List<api.AchievementConfiguration> o) { |
124 unittest.expect(o, unittest.hasLength(2)); | 124 unittest.expect(o, unittest.hasLength(2)); |
125 checkAchievementConfiguration(o[0]); | 125 checkAchievementConfiguration(o[0]); |
126 checkAchievementConfiguration(o[1]); | 126 checkAchievementConfiguration(o[1]); |
127 } | 127 } |
128 | 128 |
129 core.int buildCounterAchievementConfigurationListResponse = 0; | 129 core.int buildCounterAchievementConfigurationListResponse = 0; |
130 buildAchievementConfigurationListResponse() { | 130 buildAchievementConfigurationListResponse() { |
131 var o = new api.AchievementConfigurationListResponse(); | 131 var o = new api.AchievementConfigurationListResponse(); |
132 buildCounterAchievementConfigurationListResponse++; | 132 buildCounterAchievementConfigurationListResponse++; |
133 if (buildCounterAchievementConfigurationListResponse < 3) { | 133 if (buildCounterAchievementConfigurationListResponse < 3) { |
134 o.items = buildUnnamed683(); | 134 o.items = buildUnnamed688(); |
135 o.kind = "foo"; | 135 o.kind = "foo"; |
136 o.nextPageToken = "foo"; | 136 o.nextPageToken = "foo"; |
137 } | 137 } |
138 buildCounterAchievementConfigurationListResponse--; | 138 buildCounterAchievementConfigurationListResponse--; |
139 return o; | 139 return o; |
140 } | 140 } |
141 | 141 |
142 checkAchievementConfigurationListResponse(api.AchievementConfigurationListRespon
se o) { | 142 checkAchievementConfigurationListResponse(api.AchievementConfigurationListRespon
se o) { |
143 buildCounterAchievementConfigurationListResponse++; | 143 buildCounterAchievementConfigurationListResponse++; |
144 if (buildCounterAchievementConfigurationListResponse < 3) { | 144 if (buildCounterAchievementConfigurationListResponse < 3) { |
145 checkUnnamed683(o.items); | 145 checkUnnamed688(o.items); |
146 unittest.expect(o.kind, unittest.equals('foo')); | 146 unittest.expect(o.kind, unittest.equals('foo')); |
147 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 147 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
148 } | 148 } |
149 buildCounterAchievementConfigurationListResponse--; | 149 buildCounterAchievementConfigurationListResponse--; |
150 } | 150 } |
151 | 151 |
152 core.int buildCounterGamesNumberAffixConfiguration = 0; | 152 core.int buildCounterGamesNumberAffixConfiguration = 0; |
153 buildGamesNumberAffixConfiguration() { | 153 buildGamesNumberAffixConfiguration() { |
154 var o = new api.GamesNumberAffixConfiguration(); | 154 var o = new api.GamesNumberAffixConfiguration(); |
155 buildCounterGamesNumberAffixConfiguration++; | 155 buildCounterGamesNumberAffixConfiguration++; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 if (buildCounterLeaderboardConfigurationDetail < 3) { | 281 if (buildCounterLeaderboardConfigurationDetail < 3) { |
282 unittest.expect(o.iconUrl, unittest.equals('foo')); | 282 unittest.expect(o.iconUrl, unittest.equals('foo')); |
283 unittest.expect(o.kind, unittest.equals('foo')); | 283 unittest.expect(o.kind, unittest.equals('foo')); |
284 checkLocalizedStringBundle(o.name); | 284 checkLocalizedStringBundle(o.name); |
285 checkGamesNumberFormatConfiguration(o.scoreFormat); | 285 checkGamesNumberFormatConfiguration(o.scoreFormat); |
286 unittest.expect(o.sortRank, unittest.equals(42)); | 286 unittest.expect(o.sortRank, unittest.equals(42)); |
287 } | 287 } |
288 buildCounterLeaderboardConfigurationDetail--; | 288 buildCounterLeaderboardConfigurationDetail--; |
289 } | 289 } |
290 | 290 |
291 buildUnnamed684() { | 291 buildUnnamed689() { |
292 var o = new core.List<api.LeaderboardConfiguration>(); | 292 var o = new core.List<api.LeaderboardConfiguration>(); |
293 o.add(buildLeaderboardConfiguration()); | 293 o.add(buildLeaderboardConfiguration()); |
294 o.add(buildLeaderboardConfiguration()); | 294 o.add(buildLeaderboardConfiguration()); |
295 return o; | 295 return o; |
296 } | 296 } |
297 | 297 |
298 checkUnnamed684(core.List<api.LeaderboardConfiguration> o) { | 298 checkUnnamed689(core.List<api.LeaderboardConfiguration> o) { |
299 unittest.expect(o, unittest.hasLength(2)); | 299 unittest.expect(o, unittest.hasLength(2)); |
300 checkLeaderboardConfiguration(o[0]); | 300 checkLeaderboardConfiguration(o[0]); |
301 checkLeaderboardConfiguration(o[1]); | 301 checkLeaderboardConfiguration(o[1]); |
302 } | 302 } |
303 | 303 |
304 core.int buildCounterLeaderboardConfigurationListResponse = 0; | 304 core.int buildCounterLeaderboardConfigurationListResponse = 0; |
305 buildLeaderboardConfigurationListResponse() { | 305 buildLeaderboardConfigurationListResponse() { |
306 var o = new api.LeaderboardConfigurationListResponse(); | 306 var o = new api.LeaderboardConfigurationListResponse(); |
307 buildCounterLeaderboardConfigurationListResponse++; | 307 buildCounterLeaderboardConfigurationListResponse++; |
308 if (buildCounterLeaderboardConfigurationListResponse < 3) { | 308 if (buildCounterLeaderboardConfigurationListResponse < 3) { |
309 o.items = buildUnnamed684(); | 309 o.items = buildUnnamed689(); |
310 o.kind = "foo"; | 310 o.kind = "foo"; |
311 o.nextPageToken = "foo"; | 311 o.nextPageToken = "foo"; |
312 } | 312 } |
313 buildCounterLeaderboardConfigurationListResponse--; | 313 buildCounterLeaderboardConfigurationListResponse--; |
314 return o; | 314 return o; |
315 } | 315 } |
316 | 316 |
317 checkLeaderboardConfigurationListResponse(api.LeaderboardConfigurationListRespon
se o) { | 317 checkLeaderboardConfigurationListResponse(api.LeaderboardConfigurationListRespon
se o) { |
318 buildCounterLeaderboardConfigurationListResponse++; | 318 buildCounterLeaderboardConfigurationListResponse++; |
319 if (buildCounterLeaderboardConfigurationListResponse < 3) { | 319 if (buildCounterLeaderboardConfigurationListResponse < 3) { |
320 checkUnnamed684(o.items); | 320 checkUnnamed689(o.items); |
321 unittest.expect(o.kind, unittest.equals('foo')); | 321 unittest.expect(o.kind, unittest.equals('foo')); |
322 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 322 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
323 } | 323 } |
324 buildCounterLeaderboardConfigurationListResponse--; | 324 buildCounterLeaderboardConfigurationListResponse--; |
325 } | 325 } |
326 | 326 |
327 core.int buildCounterLocalizedString = 0; | 327 core.int buildCounterLocalizedString = 0; |
328 buildLocalizedString() { | 328 buildLocalizedString() { |
329 var o = new api.LocalizedString(); | 329 var o = new api.LocalizedString(); |
330 buildCounterLocalizedString++; | 330 buildCounterLocalizedString++; |
331 if (buildCounterLocalizedString < 3) { | 331 if (buildCounterLocalizedString < 3) { |
332 o.kind = "foo"; | 332 o.kind = "foo"; |
333 o.locale = "foo"; | 333 o.locale = "foo"; |
334 o.value = "foo"; | 334 o.value = "foo"; |
335 } | 335 } |
336 buildCounterLocalizedString--; | 336 buildCounterLocalizedString--; |
337 return o; | 337 return o; |
338 } | 338 } |
339 | 339 |
340 checkLocalizedString(api.LocalizedString o) { | 340 checkLocalizedString(api.LocalizedString o) { |
341 buildCounterLocalizedString++; | 341 buildCounterLocalizedString++; |
342 if (buildCounterLocalizedString < 3) { | 342 if (buildCounterLocalizedString < 3) { |
343 unittest.expect(o.kind, unittest.equals('foo')); | 343 unittest.expect(o.kind, unittest.equals('foo')); |
344 unittest.expect(o.locale, unittest.equals('foo')); | 344 unittest.expect(o.locale, unittest.equals('foo')); |
345 unittest.expect(o.value, unittest.equals('foo')); | 345 unittest.expect(o.value, unittest.equals('foo')); |
346 } | 346 } |
347 buildCounterLocalizedString--; | 347 buildCounterLocalizedString--; |
348 } | 348 } |
349 | 349 |
350 buildUnnamed685() { | 350 buildUnnamed690() { |
351 var o = new core.List<api.LocalizedString>(); | 351 var o = new core.List<api.LocalizedString>(); |
352 o.add(buildLocalizedString()); | 352 o.add(buildLocalizedString()); |
353 o.add(buildLocalizedString()); | 353 o.add(buildLocalizedString()); |
354 return o; | 354 return o; |
355 } | 355 } |
356 | 356 |
357 checkUnnamed685(core.List<api.LocalizedString> o) { | 357 checkUnnamed690(core.List<api.LocalizedString> o) { |
358 unittest.expect(o, unittest.hasLength(2)); | 358 unittest.expect(o, unittest.hasLength(2)); |
359 checkLocalizedString(o[0]); | 359 checkLocalizedString(o[0]); |
360 checkLocalizedString(o[1]); | 360 checkLocalizedString(o[1]); |
361 } | 361 } |
362 | 362 |
363 core.int buildCounterLocalizedStringBundle = 0; | 363 core.int buildCounterLocalizedStringBundle = 0; |
364 buildLocalizedStringBundle() { | 364 buildLocalizedStringBundle() { |
365 var o = new api.LocalizedStringBundle(); | 365 var o = new api.LocalizedStringBundle(); |
366 buildCounterLocalizedStringBundle++; | 366 buildCounterLocalizedStringBundle++; |
367 if (buildCounterLocalizedStringBundle < 3) { | 367 if (buildCounterLocalizedStringBundle < 3) { |
368 o.kind = "foo"; | 368 o.kind = "foo"; |
369 o.translations = buildUnnamed685(); | 369 o.translations = buildUnnamed690(); |
370 } | 370 } |
371 buildCounterLocalizedStringBundle--; | 371 buildCounterLocalizedStringBundle--; |
372 return o; | 372 return o; |
373 } | 373 } |
374 | 374 |
375 checkLocalizedStringBundle(api.LocalizedStringBundle o) { | 375 checkLocalizedStringBundle(api.LocalizedStringBundle o) { |
376 buildCounterLocalizedStringBundle++; | 376 buildCounterLocalizedStringBundle++; |
377 if (buildCounterLocalizedStringBundle < 3) { | 377 if (buildCounterLocalizedStringBundle < 3) { |
378 unittest.expect(o.kind, unittest.equals('foo')); | 378 unittest.expect(o.kind, unittest.equals('foo')); |
379 checkUnnamed685(o.translations); | 379 checkUnnamed690(o.translations); |
380 } | 380 } |
381 buildCounterLocalizedStringBundle--; | 381 buildCounterLocalizedStringBundle--; |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 main() { | 385 main() { |
386 unittest.group("obj-schema-AchievementConfiguration", () { | 386 unittest.group("obj-schema-AchievementConfiguration", () { |
387 unittest.test("to-json--from-json", () { | 387 unittest.test("to-json--from-json", () { |
388 var o = buildAchievementConfiguration(); | 388 var o = buildAchievementConfiguration(); |
389 var od = new api.AchievementConfiguration.fromJson(o.toJson()); | 389 var od = new api.AchievementConfiguration.fromJson(o.toJson()); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 }); | 481 }); |
482 }); | 482 }); |
483 | 483 |
484 | 484 |
485 unittest.group("resource-AchievementConfigurationsResourceApi", () { | 485 unittest.group("resource-AchievementConfigurationsResourceApi", () { |
486 unittest.test("method--delete", () { | 486 unittest.test("method--delete", () { |
487 | 487 |
488 var mock = new HttpServerMock(); | 488 var mock = new HttpServerMock(); |
489 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 489 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
490 var arg_achievementId = "foo"; | 490 var arg_achievementId = "foo"; |
491 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 491 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
492 var path = (req.url).path; | 492 var path = (req.url).path; |
493 var pathOffset = 0; | 493 var pathOffset = 0; |
494 var index; | 494 var index; |
495 var subPart; | 495 var subPart; |
496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
497 pathOffset += 1; | 497 pathOffset += 1; |
498 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 498 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
499 pathOffset += 22; | 499 pathOffset += 22; |
500 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("achievements/")); | 500 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("achievements/")); |
501 pathOffset += 13; | 501 pathOffset += 13; |
(...skipping 18 matching lines...) Expand all Loading... |
520 } | 520 } |
521 } | 521 } |
522 | 522 |
523 | 523 |
524 var h = { | 524 var h = { |
525 "content-type" : "application/json; charset=utf-8", | 525 "content-type" : "application/json; charset=utf-8", |
526 }; | 526 }; |
527 var resp = ""; | 527 var resp = ""; |
528 return new async.Future.value(stringResponse(200, h, resp)); | 528 return new async.Future.value(stringResponse(200, h, resp)); |
529 }), true); | 529 }), true); |
530 res.delete(arg_achievementId).then(unittest.expectAsync((_) {})); | 530 res.delete(arg_achievementId).then(unittest.expectAsync1((_) {})); |
531 }); | 531 }); |
532 | 532 |
533 unittest.test("method--get", () { | 533 unittest.test("method--get", () { |
534 | 534 |
535 var mock = new HttpServerMock(); | 535 var mock = new HttpServerMock(); |
536 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 536 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
537 var arg_achievementId = "foo"; | 537 var arg_achievementId = "foo"; |
538 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 538 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
539 var path = (req.url).path; | 539 var path = (req.url).path; |
540 var pathOffset = 0; | 540 var pathOffset = 0; |
541 var index; | 541 var index; |
542 var subPart; | 542 var subPart; |
543 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 543 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
544 pathOffset += 1; | 544 pathOffset += 1; |
545 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 545 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
546 pathOffset += 22; | 546 pathOffset += 22; |
547 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("achievements/")); | 547 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("achievements/")); |
548 pathOffset += 13; | 548 pathOffset += 13; |
(...skipping 18 matching lines...) Expand all Loading... |
567 } | 567 } |
568 } | 568 } |
569 | 569 |
570 | 570 |
571 var h = { | 571 var h = { |
572 "content-type" : "application/json; charset=utf-8", | 572 "content-type" : "application/json; charset=utf-8", |
573 }; | 573 }; |
574 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 574 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
575 return new async.Future.value(stringResponse(200, h, resp)); | 575 return new async.Future.value(stringResponse(200, h, resp)); |
576 }), true); | 576 }), true); |
577 res.get(arg_achievementId).then(unittest.expectAsync(((api.AchievementConf
iguration response) { | 577 res.get(arg_achievementId).then(unittest.expectAsync1(((api.AchievementCon
figuration response) { |
578 checkAchievementConfiguration(response); | 578 checkAchievementConfiguration(response); |
579 }))); | 579 }))); |
580 }); | 580 }); |
581 | 581 |
582 unittest.test("method--insert", () { | 582 unittest.test("method--insert", () { |
583 | 583 |
584 var mock = new HttpServerMock(); | 584 var mock = new HttpServerMock(); |
585 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 585 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
586 var arg_request = buildAchievementConfiguration(); | 586 var arg_request = buildAchievementConfiguration(); |
587 var arg_applicationId = "foo"; | 587 var arg_applicationId = "foo"; |
588 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 588 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
589 var obj = new api.AchievementConfiguration.fromJson(json); | 589 var obj = new api.AchievementConfiguration.fromJson(json); |
590 checkAchievementConfiguration(obj); | 590 checkAchievementConfiguration(obj); |
591 | 591 |
592 var path = (req.url).path; | 592 var path = (req.url).path; |
593 var pathOffset = 0; | 593 var pathOffset = 0; |
594 var index; | 594 var index; |
595 var subPart; | 595 var subPart; |
596 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 596 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
597 pathOffset += 1; | 597 pathOffset += 1; |
598 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 598 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
(...skipping 25 matching lines...) Expand all Loading... |
624 } | 624 } |
625 } | 625 } |
626 | 626 |
627 | 627 |
628 var h = { | 628 var h = { |
629 "content-type" : "application/json; charset=utf-8", | 629 "content-type" : "application/json; charset=utf-8", |
630 }; | 630 }; |
631 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 631 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
632 return new async.Future.value(stringResponse(200, h, resp)); | 632 return new async.Future.value(stringResponse(200, h, resp)); |
633 }), true); | 633 }), true); |
634 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync(((api
.AchievementConfiguration response) { | 634 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync1(((ap
i.AchievementConfiguration response) { |
635 checkAchievementConfiguration(response); | 635 checkAchievementConfiguration(response); |
636 }))); | 636 }))); |
637 }); | 637 }); |
638 | 638 |
639 unittest.test("method--list", () { | 639 unittest.test("method--list", () { |
640 | 640 |
641 var mock = new HttpServerMock(); | 641 var mock = new HttpServerMock(); |
642 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 642 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
643 var arg_applicationId = "foo"; | 643 var arg_applicationId = "foo"; |
644 var arg_maxResults = 42; | 644 var arg_maxResults = 42; |
645 var arg_pageToken = "foo"; | 645 var arg_pageToken = "foo"; |
646 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 646 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
647 var path = (req.url).path; | 647 var path = (req.url).path; |
648 var pathOffset = 0; | 648 var pathOffset = 0; |
649 var index; | 649 var index; |
650 var subPart; | 650 var subPart; |
651 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 651 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
652 pathOffset += 1; | 652 pathOffset += 1; |
653 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 653 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
654 pathOffset += 22; | 654 pathOffset += 22; |
655 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("applications/")); | 655 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("applications/")); |
656 pathOffset += 13; | 656 pathOffset += 13; |
(...skipping 24 matching lines...) Expand all Loading... |
681 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 681 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
682 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 682 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
683 | 683 |
684 | 684 |
685 var h = { | 685 var h = { |
686 "content-type" : "application/json; charset=utf-8", | 686 "content-type" : "application/json; charset=utf-8", |
687 }; | 687 }; |
688 var resp = convert.JSON.encode(buildAchievementConfigurationListResponse
()); | 688 var resp = convert.JSON.encode(buildAchievementConfigurationListResponse
()); |
689 return new async.Future.value(stringResponse(200, h, resp)); | 689 return new async.Future.value(stringResponse(200, h, resp)); |
690 }), true); | 690 }), true); |
691 res.list(arg_applicationId, maxResults: arg_maxResults, pageToken: arg_pag
eToken).then(unittest.expectAsync(((api.AchievementConfigurationListResponse res
ponse) { | 691 res.list(arg_applicationId, maxResults: arg_maxResults, pageToken: arg_pag
eToken).then(unittest.expectAsync1(((api.AchievementConfigurationListResponse re
sponse) { |
692 checkAchievementConfigurationListResponse(response); | 692 checkAchievementConfigurationListResponse(response); |
693 }))); | 693 }))); |
694 }); | 694 }); |
695 | 695 |
696 unittest.test("method--patch", () { | 696 unittest.test("method--patch", () { |
697 | 697 |
698 var mock = new HttpServerMock(); | 698 var mock = new HttpServerMock(); |
699 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 699 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
700 var arg_request = buildAchievementConfiguration(); | 700 var arg_request = buildAchievementConfiguration(); |
701 var arg_achievementId = "foo"; | 701 var arg_achievementId = "foo"; |
702 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 702 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
703 var obj = new api.AchievementConfiguration.fromJson(json); | 703 var obj = new api.AchievementConfiguration.fromJson(json); |
704 checkAchievementConfiguration(obj); | 704 checkAchievementConfiguration(obj); |
705 | 705 |
706 var path = (req.url).path; | 706 var path = (req.url).path; |
707 var pathOffset = 0; | 707 var pathOffset = 0; |
708 var index; | 708 var index; |
709 var subPart; | 709 var subPart; |
710 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 710 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
711 pathOffset += 1; | 711 pathOffset += 1; |
712 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 712 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
(...skipping 21 matching lines...) Expand all Loading... |
734 } | 734 } |
735 } | 735 } |
736 | 736 |
737 | 737 |
738 var h = { | 738 var h = { |
739 "content-type" : "application/json; charset=utf-8", | 739 "content-type" : "application/json; charset=utf-8", |
740 }; | 740 }; |
741 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 741 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
742 return new async.Future.value(stringResponse(200, h, resp)); | 742 return new async.Future.value(stringResponse(200, h, resp)); |
743 }), true); | 743 }), true); |
744 res.patch(arg_request, arg_achievementId).then(unittest.expectAsync(((api.
AchievementConfiguration response) { | 744 res.patch(arg_request, arg_achievementId).then(unittest.expectAsync1(((api
.AchievementConfiguration response) { |
745 checkAchievementConfiguration(response); | 745 checkAchievementConfiguration(response); |
746 }))); | 746 }))); |
747 }); | 747 }); |
748 | 748 |
749 unittest.test("method--update", () { | 749 unittest.test("method--update", () { |
750 | 750 |
751 var mock = new HttpServerMock(); | 751 var mock = new HttpServerMock(); |
752 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 752 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
753 var arg_request = buildAchievementConfiguration(); | 753 var arg_request = buildAchievementConfiguration(); |
754 var arg_achievementId = "foo"; | 754 var arg_achievementId = "foo"; |
755 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 755 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
756 var obj = new api.AchievementConfiguration.fromJson(json); | 756 var obj = new api.AchievementConfiguration.fromJson(json); |
757 checkAchievementConfiguration(obj); | 757 checkAchievementConfiguration(obj); |
758 | 758 |
759 var path = (req.url).path; | 759 var path = (req.url).path; |
760 var pathOffset = 0; | 760 var pathOffset = 0; |
761 var index; | 761 var index; |
762 var subPart; | 762 var subPart; |
763 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 763 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
764 pathOffset += 1; | 764 pathOffset += 1; |
765 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 765 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
(...skipping 21 matching lines...) Expand all Loading... |
787 } | 787 } |
788 } | 788 } |
789 | 789 |
790 | 790 |
791 var h = { | 791 var h = { |
792 "content-type" : "application/json; charset=utf-8", | 792 "content-type" : "application/json; charset=utf-8", |
793 }; | 793 }; |
794 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 794 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
795 return new async.Future.value(stringResponse(200, h, resp)); | 795 return new async.Future.value(stringResponse(200, h, resp)); |
796 }), true); | 796 }), true); |
797 res.update(arg_request, arg_achievementId).then(unittest.expectAsync(((api
.AchievementConfiguration response) { | 797 res.update(arg_request, arg_achievementId).then(unittest.expectAsync1(((ap
i.AchievementConfiguration response) { |
798 checkAchievementConfiguration(response); | 798 checkAchievementConfiguration(response); |
799 }))); | 799 }))); |
800 }); | 800 }); |
801 | 801 |
802 }); | 802 }); |
803 | 803 |
804 | 804 |
805 unittest.group("resource-ImageConfigurationsResourceApi", () { | 805 unittest.group("resource-ImageConfigurationsResourceApi", () { |
806 unittest.test("method--upload", () { | 806 unittest.test("method--upload", () { |
807 // TODO: Implement tests for media upload; | 807 // TODO: Implement tests for media upload; |
808 // TODO: Implement tests for media download; | 808 // TODO: Implement tests for media download; |
809 | 809 |
810 var mock = new HttpServerMock(); | 810 var mock = new HttpServerMock(); |
811 api.ImageConfigurationsResourceApi res = new api.GamesConfigurationApi(moc
k).imageConfigurations; | 811 api.ImageConfigurationsResourceApi res = new api.GamesConfigurationApi(moc
k).imageConfigurations; |
812 var arg_resourceId = "foo"; | 812 var arg_resourceId = "foo"; |
813 var arg_imageType = "foo"; | 813 var arg_imageType = "foo"; |
814 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 814 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
815 var path = (req.url).path; | 815 var path = (req.url).path; |
816 var pathOffset = 0; | 816 var pathOffset = 0; |
817 var index; | 817 var index; |
818 var subPart; | 818 var subPart; |
819 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 819 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
820 pathOffset += 1; | 820 pathOffset += 1; |
821 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 821 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
822 pathOffset += 22; | 822 pathOffset += 22; |
823 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("images/")); | 823 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("images/")); |
824 pathOffset += 7; | 824 pathOffset += 7; |
(...skipping 25 matching lines...) Expand all Loading... |
850 } | 850 } |
851 } | 851 } |
852 | 852 |
853 | 853 |
854 var h = { | 854 var h = { |
855 "content-type" : "application/json; charset=utf-8", | 855 "content-type" : "application/json; charset=utf-8", |
856 }; | 856 }; |
857 var resp = convert.JSON.encode(buildImageConfiguration()); | 857 var resp = convert.JSON.encode(buildImageConfiguration()); |
858 return new async.Future.value(stringResponse(200, h, resp)); | 858 return new async.Future.value(stringResponse(200, h, resp)); |
859 }), true); | 859 }), true); |
860 res.upload(arg_resourceId, arg_imageType).then(unittest.expectAsync(((api.
ImageConfiguration response) { | 860 res.upload(arg_resourceId, arg_imageType).then(unittest.expectAsync1(((api
.ImageConfiguration response) { |
861 checkImageConfiguration(response); | 861 checkImageConfiguration(response); |
862 }))); | 862 }))); |
863 }); | 863 }); |
864 | 864 |
865 }); | 865 }); |
866 | 866 |
867 | 867 |
868 unittest.group("resource-LeaderboardConfigurationsResourceApi", () { | 868 unittest.group("resource-LeaderboardConfigurationsResourceApi", () { |
869 unittest.test("method--delete", () { | 869 unittest.test("method--delete", () { |
870 | 870 |
871 var mock = new HttpServerMock(); | 871 var mock = new HttpServerMock(); |
872 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 872 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
873 var arg_leaderboardId = "foo"; | 873 var arg_leaderboardId = "foo"; |
874 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 874 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
875 var path = (req.url).path; | 875 var path = (req.url).path; |
876 var pathOffset = 0; | 876 var pathOffset = 0; |
877 var index; | 877 var index; |
878 var subPart; | 878 var subPart; |
879 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 879 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
880 pathOffset += 1; | 880 pathOffset += 1; |
881 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 881 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
882 pathOffset += 22; | 882 pathOffset += 22; |
883 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("leaderboards/")); | 883 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("leaderboards/")); |
884 pathOffset += 13; | 884 pathOffset += 13; |
(...skipping 18 matching lines...) Expand all Loading... |
903 } | 903 } |
904 } | 904 } |
905 | 905 |
906 | 906 |
907 var h = { | 907 var h = { |
908 "content-type" : "application/json; charset=utf-8", | 908 "content-type" : "application/json; charset=utf-8", |
909 }; | 909 }; |
910 var resp = ""; | 910 var resp = ""; |
911 return new async.Future.value(stringResponse(200, h, resp)); | 911 return new async.Future.value(stringResponse(200, h, resp)); |
912 }), true); | 912 }), true); |
913 res.delete(arg_leaderboardId).then(unittest.expectAsync((_) {})); | 913 res.delete(arg_leaderboardId).then(unittest.expectAsync1((_) {})); |
914 }); | 914 }); |
915 | 915 |
916 unittest.test("method--get", () { | 916 unittest.test("method--get", () { |
917 | 917 |
918 var mock = new HttpServerMock(); | 918 var mock = new HttpServerMock(); |
919 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 919 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
920 var arg_leaderboardId = "foo"; | 920 var arg_leaderboardId = "foo"; |
921 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 921 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
922 var path = (req.url).path; | 922 var path = (req.url).path; |
923 var pathOffset = 0; | 923 var pathOffset = 0; |
924 var index; | 924 var index; |
925 var subPart; | 925 var subPart; |
926 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 926 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
927 pathOffset += 1; | 927 pathOffset += 1; |
928 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 928 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
929 pathOffset += 22; | 929 pathOffset += 22; |
930 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("leaderboards/")); | 930 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("leaderboards/")); |
931 pathOffset += 13; | 931 pathOffset += 13; |
(...skipping 18 matching lines...) Expand all Loading... |
950 } | 950 } |
951 } | 951 } |
952 | 952 |
953 | 953 |
954 var h = { | 954 var h = { |
955 "content-type" : "application/json; charset=utf-8", | 955 "content-type" : "application/json; charset=utf-8", |
956 }; | 956 }; |
957 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 957 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
958 return new async.Future.value(stringResponse(200, h, resp)); | 958 return new async.Future.value(stringResponse(200, h, resp)); |
959 }), true); | 959 }), true); |
960 res.get(arg_leaderboardId).then(unittest.expectAsync(((api.LeaderboardConf
iguration response) { | 960 res.get(arg_leaderboardId).then(unittest.expectAsync1(((api.LeaderboardCon
figuration response) { |
961 checkLeaderboardConfiguration(response); | 961 checkLeaderboardConfiguration(response); |
962 }))); | 962 }))); |
963 }); | 963 }); |
964 | 964 |
965 unittest.test("method--insert", () { | 965 unittest.test("method--insert", () { |
966 | 966 |
967 var mock = new HttpServerMock(); | 967 var mock = new HttpServerMock(); |
968 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 968 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
969 var arg_request = buildLeaderboardConfiguration(); | 969 var arg_request = buildLeaderboardConfiguration(); |
970 var arg_applicationId = "foo"; | 970 var arg_applicationId = "foo"; |
971 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 971 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
972 var obj = new api.LeaderboardConfiguration.fromJson(json); | 972 var obj = new api.LeaderboardConfiguration.fromJson(json); |
973 checkLeaderboardConfiguration(obj); | 973 checkLeaderboardConfiguration(obj); |
974 | 974 |
975 var path = (req.url).path; | 975 var path = (req.url).path; |
976 var pathOffset = 0; | 976 var pathOffset = 0; |
977 var index; | 977 var index; |
978 var subPart; | 978 var subPart; |
979 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 979 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
980 pathOffset += 1; | 980 pathOffset += 1; |
981 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 981 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
(...skipping 25 matching lines...) Expand all Loading... |
1007 } | 1007 } |
1008 } | 1008 } |
1009 | 1009 |
1010 | 1010 |
1011 var h = { | 1011 var h = { |
1012 "content-type" : "application/json; charset=utf-8", | 1012 "content-type" : "application/json; charset=utf-8", |
1013 }; | 1013 }; |
1014 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 1014 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
1015 return new async.Future.value(stringResponse(200, h, resp)); | 1015 return new async.Future.value(stringResponse(200, h, resp)); |
1016 }), true); | 1016 }), true); |
1017 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync(((api
.LeaderboardConfiguration response) { | 1017 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync1(((ap
i.LeaderboardConfiguration response) { |
1018 checkLeaderboardConfiguration(response); | 1018 checkLeaderboardConfiguration(response); |
1019 }))); | 1019 }))); |
1020 }); | 1020 }); |
1021 | 1021 |
1022 unittest.test("method--list", () { | 1022 unittest.test("method--list", () { |
1023 | 1023 |
1024 var mock = new HttpServerMock(); | 1024 var mock = new HttpServerMock(); |
1025 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 1025 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
1026 var arg_applicationId = "foo"; | 1026 var arg_applicationId = "foo"; |
1027 var arg_maxResults = 42; | 1027 var arg_maxResults = 42; |
1028 var arg_pageToken = "foo"; | 1028 var arg_pageToken = "foo"; |
1029 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1029 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1030 var path = (req.url).path; | 1030 var path = (req.url).path; |
1031 var pathOffset = 0; | 1031 var pathOffset = 0; |
1032 var index; | 1032 var index; |
1033 var subPart; | 1033 var subPart; |
1034 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1034 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1035 pathOffset += 1; | 1035 pathOffset += 1; |
1036 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 1036 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
1037 pathOffset += 22; | 1037 pathOffset += 22; |
1038 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("applications/")); | 1038 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("applications/")); |
1039 pathOffset += 13; | 1039 pathOffset += 13; |
(...skipping 24 matching lines...) Expand all Loading... |
1064 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1064 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
1065 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1065 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1066 | 1066 |
1067 | 1067 |
1068 var h = { | 1068 var h = { |
1069 "content-type" : "application/json; charset=utf-8", | 1069 "content-type" : "application/json; charset=utf-8", |
1070 }; | 1070 }; |
1071 var resp = convert.JSON.encode(buildLeaderboardConfigurationListResponse
()); | 1071 var resp = convert.JSON.encode(buildLeaderboardConfigurationListResponse
()); |
1072 return new async.Future.value(stringResponse(200, h, resp)); | 1072 return new async.Future.value(stringResponse(200, h, resp)); |
1073 }), true); | 1073 }), true); |
1074 res.list(arg_applicationId, maxResults: arg_maxResults, pageToken: arg_pag
eToken).then(unittest.expectAsync(((api.LeaderboardConfigurationListResponse res
ponse) { | 1074 res.list(arg_applicationId, maxResults: arg_maxResults, pageToken: arg_pag
eToken).then(unittest.expectAsync1(((api.LeaderboardConfigurationListResponse re
sponse) { |
1075 checkLeaderboardConfigurationListResponse(response); | 1075 checkLeaderboardConfigurationListResponse(response); |
1076 }))); | 1076 }))); |
1077 }); | 1077 }); |
1078 | 1078 |
1079 unittest.test("method--patch", () { | 1079 unittest.test("method--patch", () { |
1080 | 1080 |
1081 var mock = new HttpServerMock(); | 1081 var mock = new HttpServerMock(); |
1082 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 1082 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
1083 var arg_request = buildLeaderboardConfiguration(); | 1083 var arg_request = buildLeaderboardConfiguration(); |
1084 var arg_leaderboardId = "foo"; | 1084 var arg_leaderboardId = "foo"; |
1085 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1085 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1086 var obj = new api.LeaderboardConfiguration.fromJson(json); | 1086 var obj = new api.LeaderboardConfiguration.fromJson(json); |
1087 checkLeaderboardConfiguration(obj); | 1087 checkLeaderboardConfiguration(obj); |
1088 | 1088 |
1089 var path = (req.url).path; | 1089 var path = (req.url).path; |
1090 var pathOffset = 0; | 1090 var pathOffset = 0; |
1091 var index; | 1091 var index; |
1092 var subPart; | 1092 var subPart; |
1093 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1093 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1094 pathOffset += 1; | 1094 pathOffset += 1; |
1095 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 1095 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
(...skipping 21 matching lines...) Expand all Loading... |
1117 } | 1117 } |
1118 } | 1118 } |
1119 | 1119 |
1120 | 1120 |
1121 var h = { | 1121 var h = { |
1122 "content-type" : "application/json; charset=utf-8", | 1122 "content-type" : "application/json; charset=utf-8", |
1123 }; | 1123 }; |
1124 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 1124 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
1125 return new async.Future.value(stringResponse(200, h, resp)); | 1125 return new async.Future.value(stringResponse(200, h, resp)); |
1126 }), true); | 1126 }), true); |
1127 res.patch(arg_request, arg_leaderboardId).then(unittest.expectAsync(((api.
LeaderboardConfiguration response) { | 1127 res.patch(arg_request, arg_leaderboardId).then(unittest.expectAsync1(((api
.LeaderboardConfiguration response) { |
1128 checkLeaderboardConfiguration(response); | 1128 checkLeaderboardConfiguration(response); |
1129 }))); | 1129 }))); |
1130 }); | 1130 }); |
1131 | 1131 |
1132 unittest.test("method--update", () { | 1132 unittest.test("method--update", () { |
1133 | 1133 |
1134 var mock = new HttpServerMock(); | 1134 var mock = new HttpServerMock(); |
1135 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 1135 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
1136 var arg_request = buildLeaderboardConfiguration(); | 1136 var arg_request = buildLeaderboardConfiguration(); |
1137 var arg_leaderboardId = "foo"; | 1137 var arg_leaderboardId = "foo"; |
1138 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1138 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1139 var obj = new api.LeaderboardConfiguration.fromJson(json); | 1139 var obj = new api.LeaderboardConfiguration.fromJson(json); |
1140 checkLeaderboardConfiguration(obj); | 1140 checkLeaderboardConfiguration(obj); |
1141 | 1141 |
1142 var path = (req.url).path; | 1142 var path = (req.url).path; |
1143 var pathOffset = 0; | 1143 var pathOffset = 0; |
1144 var index; | 1144 var index; |
1145 var subPart; | 1145 var subPart; |
1146 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1146 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1147 pathOffset += 1; | 1147 pathOffset += 1; |
1148 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); | 1148 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("games/v1configuration/")); |
(...skipping 21 matching lines...) Expand all Loading... |
1170 } | 1170 } |
1171 } | 1171 } |
1172 | 1172 |
1173 | 1173 |
1174 var h = { | 1174 var h = { |
1175 "content-type" : "application/json; charset=utf-8", | 1175 "content-type" : "application/json; charset=utf-8", |
1176 }; | 1176 }; |
1177 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 1177 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
1178 return new async.Future.value(stringResponse(200, h, resp)); | 1178 return new async.Future.value(stringResponse(200, h, resp)); |
1179 }), true); | 1179 }), true); |
1180 res.update(arg_request, arg_leaderboardId).then(unittest.expectAsync(((api
.LeaderboardConfiguration response) { | 1180 res.update(arg_request, arg_leaderboardId).then(unittest.expectAsync1(((ap
i.LeaderboardConfiguration response) { |
1181 checkLeaderboardConfiguration(response); | 1181 checkLeaderboardConfiguration(response); |
1182 }))); | 1182 }))); |
1183 }); | 1183 }); |
1184 | 1184 |
1185 }); | 1185 }); |
1186 | 1186 |
1187 | 1187 |
1188 } | 1188 } |
1189 | 1189 |
OLD | NEW |