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: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 | 11 |
15 import 'package:googleapis/gamesconfiguration/v1configuration.dart' as api; | 12 import 'package:googleapis/gamesconfiguration/v1configuration.dart' as api; |
16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
18 | 53 |
19 core.int buildCounterAchievementConfiguration = 0; | 54 core.int buildCounterAchievementConfiguration = 0; |
20 buildAchievementConfiguration() { | 55 buildAchievementConfiguration() { |
21 var o = new api.AchievementConfiguration(); | 56 var o = new api.AchievementConfiguration(); |
22 buildCounterAchievementConfiguration++; | 57 buildCounterAchievementConfiguration++; |
23 if (buildCounterAchievementConfiguration < 3) { | 58 if (buildCounterAchievementConfiguration < 3) { |
24 o.achievementType = "foo"; | 59 o.achievementType = "foo"; |
25 o.draft = buildAchievementConfigurationDetail(); | 60 o.draft = buildAchievementConfigurationDetail(); |
26 o.id = "foo"; | 61 o.id = "foo"; |
27 o.initialState = "foo"; | 62 o.initialState = "foo"; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 checkLocalizedStringBundle(o.description); | 106 checkLocalizedStringBundle(o.description); |
72 unittest.expect(o.iconUrl, unittest.equals('foo')); | 107 unittest.expect(o.iconUrl, unittest.equals('foo')); |
73 unittest.expect(o.kind, unittest.equals('foo')); | 108 unittest.expect(o.kind, unittest.equals('foo')); |
74 checkLocalizedStringBundle(o.name); | 109 checkLocalizedStringBundle(o.name); |
75 unittest.expect(o.pointValue, unittest.equals(42)); | 110 unittest.expect(o.pointValue, unittest.equals(42)); |
76 unittest.expect(o.sortRank, unittest.equals(42)); | 111 unittest.expect(o.sortRank, unittest.equals(42)); |
77 } | 112 } |
78 buildCounterAchievementConfigurationDetail--; | 113 buildCounterAchievementConfigurationDetail--; |
79 } | 114 } |
80 | 115 |
81 buildUnnamed733() { | 116 buildUnnamed1117() { |
82 var o = new core.List<api.AchievementConfiguration>(); | 117 var o = new core.List<api.AchievementConfiguration>(); |
83 o.add(buildAchievementConfiguration()); | 118 o.add(buildAchievementConfiguration()); |
84 o.add(buildAchievementConfiguration()); | 119 o.add(buildAchievementConfiguration()); |
85 return o; | 120 return o; |
86 } | 121 } |
87 | 122 |
88 checkUnnamed733(core.List<api.AchievementConfiguration> o) { | 123 checkUnnamed1117(core.List<api.AchievementConfiguration> o) { |
89 unittest.expect(o, unittest.hasLength(2)); | 124 unittest.expect(o, unittest.hasLength(2)); |
90 checkAchievementConfiguration(o[0]); | 125 checkAchievementConfiguration(o[0]); |
91 checkAchievementConfiguration(o[1]); | 126 checkAchievementConfiguration(o[1]); |
92 } | 127 } |
93 | 128 |
94 core.int buildCounterAchievementConfigurationListResponse = 0; | 129 core.int buildCounterAchievementConfigurationListResponse = 0; |
95 buildAchievementConfigurationListResponse() { | 130 buildAchievementConfigurationListResponse() { |
96 var o = new api.AchievementConfigurationListResponse(); | 131 var o = new api.AchievementConfigurationListResponse(); |
97 buildCounterAchievementConfigurationListResponse++; | 132 buildCounterAchievementConfigurationListResponse++; |
98 if (buildCounterAchievementConfigurationListResponse < 3) { | 133 if (buildCounterAchievementConfigurationListResponse < 3) { |
99 o.items = buildUnnamed733(); | 134 o.items = buildUnnamed1117(); |
100 o.kind = "foo"; | 135 o.kind = "foo"; |
101 o.nextPageToken = "foo"; | 136 o.nextPageToken = "foo"; |
102 } | 137 } |
103 buildCounterAchievementConfigurationListResponse--; | 138 buildCounterAchievementConfigurationListResponse--; |
104 return o; | 139 return o; |
105 } | 140 } |
106 | 141 |
107 checkAchievementConfigurationListResponse(api.AchievementConfigurationListRespon
se o) { | 142 checkAchievementConfigurationListResponse(api.AchievementConfigurationListRespon
se o) { |
108 buildCounterAchievementConfigurationListResponse++; | 143 buildCounterAchievementConfigurationListResponse++; |
109 if (buildCounterAchievementConfigurationListResponse < 3) { | 144 if (buildCounterAchievementConfigurationListResponse < 3) { |
110 checkUnnamed733(o.items); | 145 checkUnnamed1117(o.items); |
111 unittest.expect(o.kind, unittest.equals('foo')); | 146 unittest.expect(o.kind, unittest.equals('foo')); |
112 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 147 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
113 } | 148 } |
114 buildCounterAchievementConfigurationListResponse--; | 149 buildCounterAchievementConfigurationListResponse--; |
115 } | 150 } |
116 | 151 |
117 core.int buildCounterGamesNumberAffixConfiguration = 0; | 152 core.int buildCounterGamesNumberAffixConfiguration = 0; |
118 buildGamesNumberAffixConfiguration() { | 153 buildGamesNumberAffixConfiguration() { |
119 var o = new api.GamesNumberAffixConfiguration(); | 154 var o = new api.GamesNumberAffixConfiguration(); |
120 buildCounterGamesNumberAffixConfiguration++; | 155 buildCounterGamesNumberAffixConfiguration++; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 if (buildCounterLeaderboardConfigurationDetail < 3) { | 281 if (buildCounterLeaderboardConfigurationDetail < 3) { |
247 unittest.expect(o.iconUrl, unittest.equals('foo')); | 282 unittest.expect(o.iconUrl, unittest.equals('foo')); |
248 unittest.expect(o.kind, unittest.equals('foo')); | 283 unittest.expect(o.kind, unittest.equals('foo')); |
249 checkLocalizedStringBundle(o.name); | 284 checkLocalizedStringBundle(o.name); |
250 checkGamesNumberFormatConfiguration(o.scoreFormat); | 285 checkGamesNumberFormatConfiguration(o.scoreFormat); |
251 unittest.expect(o.sortRank, unittest.equals(42)); | 286 unittest.expect(o.sortRank, unittest.equals(42)); |
252 } | 287 } |
253 buildCounterLeaderboardConfigurationDetail--; | 288 buildCounterLeaderboardConfigurationDetail--; |
254 } | 289 } |
255 | 290 |
256 buildUnnamed734() { | 291 buildUnnamed1118() { |
257 var o = new core.List<api.LeaderboardConfiguration>(); | 292 var o = new core.List<api.LeaderboardConfiguration>(); |
258 o.add(buildLeaderboardConfiguration()); | 293 o.add(buildLeaderboardConfiguration()); |
259 o.add(buildLeaderboardConfiguration()); | 294 o.add(buildLeaderboardConfiguration()); |
260 return o; | 295 return o; |
261 } | 296 } |
262 | 297 |
263 checkUnnamed734(core.List<api.LeaderboardConfiguration> o) { | 298 checkUnnamed1118(core.List<api.LeaderboardConfiguration> o) { |
264 unittest.expect(o, unittest.hasLength(2)); | 299 unittest.expect(o, unittest.hasLength(2)); |
265 checkLeaderboardConfiguration(o[0]); | 300 checkLeaderboardConfiguration(o[0]); |
266 checkLeaderboardConfiguration(o[1]); | 301 checkLeaderboardConfiguration(o[1]); |
267 } | 302 } |
268 | 303 |
269 core.int buildCounterLeaderboardConfigurationListResponse = 0; | 304 core.int buildCounterLeaderboardConfigurationListResponse = 0; |
270 buildLeaderboardConfigurationListResponse() { | 305 buildLeaderboardConfigurationListResponse() { |
271 var o = new api.LeaderboardConfigurationListResponse(); | 306 var o = new api.LeaderboardConfigurationListResponse(); |
272 buildCounterLeaderboardConfigurationListResponse++; | 307 buildCounterLeaderboardConfigurationListResponse++; |
273 if (buildCounterLeaderboardConfigurationListResponse < 3) { | 308 if (buildCounterLeaderboardConfigurationListResponse < 3) { |
274 o.items = buildUnnamed734(); | 309 o.items = buildUnnamed1118(); |
275 o.kind = "foo"; | 310 o.kind = "foo"; |
276 o.nextPageToken = "foo"; | 311 o.nextPageToken = "foo"; |
277 } | 312 } |
278 buildCounterLeaderboardConfigurationListResponse--; | 313 buildCounterLeaderboardConfigurationListResponse--; |
279 return o; | 314 return o; |
280 } | 315 } |
281 | 316 |
282 checkLeaderboardConfigurationListResponse(api.LeaderboardConfigurationListRespon
se o) { | 317 checkLeaderboardConfigurationListResponse(api.LeaderboardConfigurationListRespon
se o) { |
283 buildCounterLeaderboardConfigurationListResponse++; | 318 buildCounterLeaderboardConfigurationListResponse++; |
284 if (buildCounterLeaderboardConfigurationListResponse < 3) { | 319 if (buildCounterLeaderboardConfigurationListResponse < 3) { |
285 checkUnnamed734(o.items); | 320 checkUnnamed1118(o.items); |
286 unittest.expect(o.kind, unittest.equals('foo')); | 321 unittest.expect(o.kind, unittest.equals('foo')); |
287 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 322 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
288 } | 323 } |
289 buildCounterLeaderboardConfigurationListResponse--; | 324 buildCounterLeaderboardConfigurationListResponse--; |
290 } | 325 } |
291 | 326 |
292 core.int buildCounterLocalizedString = 0; | 327 core.int buildCounterLocalizedString = 0; |
293 buildLocalizedString() { | 328 buildLocalizedString() { |
294 var o = new api.LocalizedString(); | 329 var o = new api.LocalizedString(); |
295 buildCounterLocalizedString++; | 330 buildCounterLocalizedString++; |
296 if (buildCounterLocalizedString < 3) { | 331 if (buildCounterLocalizedString < 3) { |
297 o.kind = "foo"; | 332 o.kind = "foo"; |
298 o.locale = "foo"; | 333 o.locale = "foo"; |
299 o.value = "foo"; | 334 o.value = "foo"; |
300 } | 335 } |
301 buildCounterLocalizedString--; | 336 buildCounterLocalizedString--; |
302 return o; | 337 return o; |
303 } | 338 } |
304 | 339 |
305 checkLocalizedString(api.LocalizedString o) { | 340 checkLocalizedString(api.LocalizedString o) { |
306 buildCounterLocalizedString++; | 341 buildCounterLocalizedString++; |
307 if (buildCounterLocalizedString < 3) { | 342 if (buildCounterLocalizedString < 3) { |
308 unittest.expect(o.kind, unittest.equals('foo')); | 343 unittest.expect(o.kind, unittest.equals('foo')); |
309 unittest.expect(o.locale, unittest.equals('foo')); | 344 unittest.expect(o.locale, unittest.equals('foo')); |
310 unittest.expect(o.value, unittest.equals('foo')); | 345 unittest.expect(o.value, unittest.equals('foo')); |
311 } | 346 } |
312 buildCounterLocalizedString--; | 347 buildCounterLocalizedString--; |
313 } | 348 } |
314 | 349 |
315 buildUnnamed735() { | 350 buildUnnamed1119() { |
316 var o = new core.List<api.LocalizedString>(); | 351 var o = new core.List<api.LocalizedString>(); |
317 o.add(buildLocalizedString()); | 352 o.add(buildLocalizedString()); |
318 o.add(buildLocalizedString()); | 353 o.add(buildLocalizedString()); |
319 return o; | 354 return o; |
320 } | 355 } |
321 | 356 |
322 checkUnnamed735(core.List<api.LocalizedString> o) { | 357 checkUnnamed1119(core.List<api.LocalizedString> o) { |
323 unittest.expect(o, unittest.hasLength(2)); | 358 unittest.expect(o, unittest.hasLength(2)); |
324 checkLocalizedString(o[0]); | 359 checkLocalizedString(o[0]); |
325 checkLocalizedString(o[1]); | 360 checkLocalizedString(o[1]); |
326 } | 361 } |
327 | 362 |
328 core.int buildCounterLocalizedStringBundle = 0; | 363 core.int buildCounterLocalizedStringBundle = 0; |
329 buildLocalizedStringBundle() { | 364 buildLocalizedStringBundle() { |
330 var o = new api.LocalizedStringBundle(); | 365 var o = new api.LocalizedStringBundle(); |
331 buildCounterLocalizedStringBundle++; | 366 buildCounterLocalizedStringBundle++; |
332 if (buildCounterLocalizedStringBundle < 3) { | 367 if (buildCounterLocalizedStringBundle < 3) { |
333 o.kind = "foo"; | 368 o.kind = "foo"; |
334 o.translations = buildUnnamed735(); | 369 o.translations = buildUnnamed1119(); |
335 } | 370 } |
336 buildCounterLocalizedStringBundle--; | 371 buildCounterLocalizedStringBundle--; |
337 return o; | 372 return o; |
338 } | 373 } |
339 | 374 |
340 checkLocalizedStringBundle(api.LocalizedStringBundle o) { | 375 checkLocalizedStringBundle(api.LocalizedStringBundle o) { |
341 buildCounterLocalizedStringBundle++; | 376 buildCounterLocalizedStringBundle++; |
342 if (buildCounterLocalizedStringBundle < 3) { | 377 if (buildCounterLocalizedStringBundle < 3) { |
343 unittest.expect(o.kind, unittest.equals('foo')); | 378 unittest.expect(o.kind, unittest.equals('foo')); |
344 checkUnnamed735(o.translations); | 379 checkUnnamed1119(o.translations); |
345 } | 380 } |
346 buildCounterLocalizedStringBundle--; | 381 buildCounterLocalizedStringBundle--; |
347 } | 382 } |
348 | 383 |
349 | 384 |
350 main() { | 385 main() { |
351 unittest.group("obj-schema-AchievementConfiguration", () { | 386 unittest.group("obj-schema-AchievementConfiguration", () { |
352 unittest.test("to-json--from-json", () { | 387 unittest.test("to-json--from-json", () { |
353 var o = buildAchievementConfiguration(); | 388 var o = buildAchievementConfiguration(); |
354 var od = new api.AchievementConfiguration.fromJson(o.toJson()); | 389 var od = new api.AchievementConfiguration.fromJson(o.toJson()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 var o = buildLocalizedStringBundle(); | 478 var o = buildLocalizedStringBundle(); |
444 var od = new api.LocalizedStringBundle.fromJson(o.toJson()); | 479 var od = new api.LocalizedStringBundle.fromJson(o.toJson()); |
445 checkLocalizedStringBundle(od); | 480 checkLocalizedStringBundle(od); |
446 }); | 481 }); |
447 }); | 482 }); |
448 | 483 |
449 | 484 |
450 unittest.group("resource-AchievementConfigurationsResourceApi", () { | 485 unittest.group("resource-AchievementConfigurationsResourceApi", () { |
451 unittest.test("method--delete", () { | 486 unittest.test("method--delete", () { |
452 | 487 |
453 var mock = new common_test.HttpServerMock(); | 488 var mock = new HttpServerMock(); |
454 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 489 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
455 var arg_achievementId = "foo"; | 490 var arg_achievementId = "foo"; |
456 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 491 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
457 var path = (req.url).path; | 492 var path = (req.url).path; |
458 var pathOffset = 0; | 493 var pathOffset = 0; |
459 var index; | 494 var index; |
460 var subPart; | 495 var subPart; |
461 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
462 pathOffset += 1; | 497 pathOffset += 1; |
463 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/")); |
(...skipping 19 matching lines...) Expand all Loading... |
483 var keyvalue = part.split("="); | 518 var keyvalue = part.split("="); |
484 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 519 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
485 } | 520 } |
486 } | 521 } |
487 | 522 |
488 | 523 |
489 var h = { | 524 var h = { |
490 "content-type" : "application/json; charset=utf-8", | 525 "content-type" : "application/json; charset=utf-8", |
491 }; | 526 }; |
492 var resp = ""; | 527 var resp = ""; |
493 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 528 return new async.Future.value(stringResponse(200, h, resp)); |
494 }), true); | 529 }), true); |
495 res.delete(arg_achievementId).then(unittest.expectAsync((_) {})); | 530 res.delete(arg_achievementId).then(unittest.expectAsync((_) {})); |
496 }); | 531 }); |
497 | 532 |
498 unittest.test("method--get", () { | 533 unittest.test("method--get", () { |
499 | 534 |
500 var mock = new common_test.HttpServerMock(); | 535 var mock = new HttpServerMock(); |
501 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 536 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
502 var arg_achievementId = "foo"; | 537 var arg_achievementId = "foo"; |
503 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 538 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
504 var path = (req.url).path; | 539 var path = (req.url).path; |
505 var pathOffset = 0; | 540 var pathOffset = 0; |
506 var index; | 541 var index; |
507 var subPart; | 542 var subPart; |
508 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 543 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
509 pathOffset += 1; | 544 pathOffset += 1; |
510 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/")); |
(...skipping 19 matching lines...) Expand all Loading... |
530 var keyvalue = part.split("="); | 565 var keyvalue = part.split("="); |
531 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 566 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
532 } | 567 } |
533 } | 568 } |
534 | 569 |
535 | 570 |
536 var h = { | 571 var h = { |
537 "content-type" : "application/json; charset=utf-8", | 572 "content-type" : "application/json; charset=utf-8", |
538 }; | 573 }; |
539 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 574 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
540 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 575 return new async.Future.value(stringResponse(200, h, resp)); |
541 }), true); | 576 }), true); |
542 res.get(arg_achievementId).then(unittest.expectAsync(((api.AchievementConf
iguration response) { | 577 res.get(arg_achievementId).then(unittest.expectAsync(((api.AchievementConf
iguration response) { |
543 checkAchievementConfiguration(response); | 578 checkAchievementConfiguration(response); |
544 }))); | 579 }))); |
545 }); | 580 }); |
546 | 581 |
547 unittest.test("method--insert", () { | 582 unittest.test("method--insert", () { |
548 | 583 |
549 var mock = new common_test.HttpServerMock(); | 584 var mock = new HttpServerMock(); |
550 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 585 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
551 var arg_request = buildAchievementConfiguration(); | 586 var arg_request = buildAchievementConfiguration(); |
552 var arg_applicationId = "foo"; | 587 var arg_applicationId = "foo"; |
553 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 588 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
554 var obj = new api.AchievementConfiguration.fromJson(json); | 589 var obj = new api.AchievementConfiguration.fromJson(json); |
555 checkAchievementConfiguration(obj); | 590 checkAchievementConfiguration(obj); |
556 | 591 |
557 var path = (req.url).path; | 592 var path = (req.url).path; |
558 var pathOffset = 0; | 593 var pathOffset = 0; |
559 var index; | 594 var index; |
(...skipping 27 matching lines...) Expand all Loading... |
587 var keyvalue = part.split("="); | 622 var keyvalue = part.split("="); |
588 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 623 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
589 } | 624 } |
590 } | 625 } |
591 | 626 |
592 | 627 |
593 var h = { | 628 var h = { |
594 "content-type" : "application/json; charset=utf-8", | 629 "content-type" : "application/json; charset=utf-8", |
595 }; | 630 }; |
596 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 631 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
597 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 632 return new async.Future.value(stringResponse(200, h, resp)); |
598 }), true); | 633 }), true); |
599 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync(((api
.AchievementConfiguration response) { | 634 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync(((api
.AchievementConfiguration response) { |
600 checkAchievementConfiguration(response); | 635 checkAchievementConfiguration(response); |
601 }))); | 636 }))); |
602 }); | 637 }); |
603 | 638 |
604 unittest.test("method--list", () { | 639 unittest.test("method--list", () { |
605 | 640 |
606 var mock = new common_test.HttpServerMock(); | 641 var mock = new HttpServerMock(); |
607 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 642 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
608 var arg_applicationId = "foo"; | 643 var arg_applicationId = "foo"; |
609 var arg_maxResults = 42; | 644 var arg_maxResults = 42; |
610 var arg_pageToken = "foo"; | 645 var arg_pageToken = "foo"; |
611 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 646 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
612 var path = (req.url).path; | 647 var path = (req.url).path; |
613 var pathOffset = 0; | 648 var pathOffset = 0; |
614 var index; | 649 var index; |
615 var subPart; | 650 var subPart; |
616 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 651 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 27 matching lines...) Expand all Loading... |
644 } | 679 } |
645 } | 680 } |
646 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)); |
647 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 682 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
648 | 683 |
649 | 684 |
650 var h = { | 685 var h = { |
651 "content-type" : "application/json; charset=utf-8", | 686 "content-type" : "application/json; charset=utf-8", |
652 }; | 687 }; |
653 var resp = convert.JSON.encode(buildAchievementConfigurationListResponse
()); | 688 var resp = convert.JSON.encode(buildAchievementConfigurationListResponse
()); |
654 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 689 return new async.Future.value(stringResponse(200, h, resp)); |
655 }), true); | 690 }), true); |
656 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.expectAsync(((api.AchievementConfigurationListResponse res
ponse) { |
657 checkAchievementConfigurationListResponse(response); | 692 checkAchievementConfigurationListResponse(response); |
658 }))); | 693 }))); |
659 }); | 694 }); |
660 | 695 |
661 unittest.test("method--patch", () { | 696 unittest.test("method--patch", () { |
662 | 697 |
663 var mock = new common_test.HttpServerMock(); | 698 var mock = new HttpServerMock(); |
664 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 699 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
665 var arg_request = buildAchievementConfiguration(); | 700 var arg_request = buildAchievementConfiguration(); |
666 var arg_achievementId = "foo"; | 701 var arg_achievementId = "foo"; |
667 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 702 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
668 var obj = new api.AchievementConfiguration.fromJson(json); | 703 var obj = new api.AchievementConfiguration.fromJson(json); |
669 checkAchievementConfiguration(obj); | 704 checkAchievementConfiguration(obj); |
670 | 705 |
671 var path = (req.url).path; | 706 var path = (req.url).path; |
672 var pathOffset = 0; | 707 var pathOffset = 0; |
673 var index; | 708 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
697 var keyvalue = part.split("="); | 732 var keyvalue = part.split("="); |
698 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 733 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
699 } | 734 } |
700 } | 735 } |
701 | 736 |
702 | 737 |
703 var h = { | 738 var h = { |
704 "content-type" : "application/json; charset=utf-8", | 739 "content-type" : "application/json; charset=utf-8", |
705 }; | 740 }; |
706 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 741 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
707 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 742 return new async.Future.value(stringResponse(200, h, resp)); |
708 }), true); | 743 }), true); |
709 res.patch(arg_request, arg_achievementId).then(unittest.expectAsync(((api.
AchievementConfiguration response) { | 744 res.patch(arg_request, arg_achievementId).then(unittest.expectAsync(((api.
AchievementConfiguration response) { |
710 checkAchievementConfiguration(response); | 745 checkAchievementConfiguration(response); |
711 }))); | 746 }))); |
712 }); | 747 }); |
713 | 748 |
714 unittest.test("method--update", () { | 749 unittest.test("method--update", () { |
715 | 750 |
716 var mock = new common_test.HttpServerMock(); | 751 var mock = new HttpServerMock(); |
717 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; | 752 api.AchievementConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).achievementConfigurations; |
718 var arg_request = buildAchievementConfiguration(); | 753 var arg_request = buildAchievementConfiguration(); |
719 var arg_achievementId = "foo"; | 754 var arg_achievementId = "foo"; |
720 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 755 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
721 var obj = new api.AchievementConfiguration.fromJson(json); | 756 var obj = new api.AchievementConfiguration.fromJson(json); |
722 checkAchievementConfiguration(obj); | 757 checkAchievementConfiguration(obj); |
723 | 758 |
724 var path = (req.url).path; | 759 var path = (req.url).path; |
725 var pathOffset = 0; | 760 var pathOffset = 0; |
726 var index; | 761 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
750 var keyvalue = part.split("="); | 785 var keyvalue = part.split("="); |
751 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 786 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
752 } | 787 } |
753 } | 788 } |
754 | 789 |
755 | 790 |
756 var h = { | 791 var h = { |
757 "content-type" : "application/json; charset=utf-8", | 792 "content-type" : "application/json; charset=utf-8", |
758 }; | 793 }; |
759 var resp = convert.JSON.encode(buildAchievementConfiguration()); | 794 var resp = convert.JSON.encode(buildAchievementConfiguration()); |
760 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 795 return new async.Future.value(stringResponse(200, h, resp)); |
761 }), true); | 796 }), true); |
762 res.update(arg_request, arg_achievementId).then(unittest.expectAsync(((api
.AchievementConfiguration response) { | 797 res.update(arg_request, arg_achievementId).then(unittest.expectAsync(((api
.AchievementConfiguration response) { |
763 checkAchievementConfiguration(response); | 798 checkAchievementConfiguration(response); |
764 }))); | 799 }))); |
765 }); | 800 }); |
766 | 801 |
767 }); | 802 }); |
768 | 803 |
769 | 804 |
770 unittest.group("resource-ImageConfigurationsResourceApi", () { | 805 unittest.group("resource-ImageConfigurationsResourceApi", () { |
771 unittest.test("method--upload", () { | 806 unittest.test("method--upload", () { |
772 // TODO: Implement tests for media upload; | 807 // TODO: Implement tests for media upload; |
773 // TODO: Implement tests for media download; | 808 // TODO: Implement tests for media download; |
774 | 809 |
775 var mock = new common_test.HttpServerMock(); | 810 var mock = new HttpServerMock(); |
776 api.ImageConfigurationsResourceApi res = new api.GamesConfigurationApi(moc
k).imageConfigurations; | 811 api.ImageConfigurationsResourceApi res = new api.GamesConfigurationApi(moc
k).imageConfigurations; |
777 var arg_resourceId = "foo"; | 812 var arg_resourceId = "foo"; |
778 var arg_imageType = "foo"; | 813 var arg_imageType = "foo"; |
779 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 814 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
780 var path = (req.url).path; | 815 var path = (req.url).path; |
781 var pathOffset = 0; | 816 var pathOffset = 0; |
782 var index; | 817 var index; |
783 var subPart; | 818 var subPart; |
784 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 819 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
785 pathOffset += 1; | 820 pathOffset += 1; |
(...skipping 27 matching lines...) Expand all Loading... |
813 var keyvalue = part.split("="); | 848 var keyvalue = part.split("="); |
814 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 849 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
815 } | 850 } |
816 } | 851 } |
817 | 852 |
818 | 853 |
819 var h = { | 854 var h = { |
820 "content-type" : "application/json; charset=utf-8", | 855 "content-type" : "application/json; charset=utf-8", |
821 }; | 856 }; |
822 var resp = convert.JSON.encode(buildImageConfiguration()); | 857 var resp = convert.JSON.encode(buildImageConfiguration()); |
823 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 858 return new async.Future.value(stringResponse(200, h, resp)); |
824 }), true); | 859 }), true); |
825 res.upload(arg_resourceId, arg_imageType).then(unittest.expectAsync(((api.
ImageConfiguration response) { | 860 res.upload(arg_resourceId, arg_imageType).then(unittest.expectAsync(((api.
ImageConfiguration response) { |
826 checkImageConfiguration(response); | 861 checkImageConfiguration(response); |
827 }))); | 862 }))); |
828 }); | 863 }); |
829 | 864 |
830 }); | 865 }); |
831 | 866 |
832 | 867 |
833 unittest.group("resource-LeaderboardConfigurationsResourceApi", () { | 868 unittest.group("resource-LeaderboardConfigurationsResourceApi", () { |
834 unittest.test("method--delete", () { | 869 unittest.test("method--delete", () { |
835 | 870 |
836 var mock = new common_test.HttpServerMock(); | 871 var mock = new HttpServerMock(); |
837 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 872 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
838 var arg_leaderboardId = "foo"; | 873 var arg_leaderboardId = "foo"; |
839 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 874 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
840 var path = (req.url).path; | 875 var path = (req.url).path; |
841 var pathOffset = 0; | 876 var pathOffset = 0; |
842 var index; | 877 var index; |
843 var subPart; | 878 var subPart; |
844 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 879 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
845 pathOffset += 1; | 880 pathOffset += 1; |
846 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/")); |
(...skipping 19 matching lines...) Expand all Loading... |
866 var keyvalue = part.split("="); | 901 var keyvalue = part.split("="); |
867 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 902 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
868 } | 903 } |
869 } | 904 } |
870 | 905 |
871 | 906 |
872 var h = { | 907 var h = { |
873 "content-type" : "application/json; charset=utf-8", | 908 "content-type" : "application/json; charset=utf-8", |
874 }; | 909 }; |
875 var resp = ""; | 910 var resp = ""; |
876 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 911 return new async.Future.value(stringResponse(200, h, resp)); |
877 }), true); | 912 }), true); |
878 res.delete(arg_leaderboardId).then(unittest.expectAsync((_) {})); | 913 res.delete(arg_leaderboardId).then(unittest.expectAsync((_) {})); |
879 }); | 914 }); |
880 | 915 |
881 unittest.test("method--get", () { | 916 unittest.test("method--get", () { |
882 | 917 |
883 var mock = new common_test.HttpServerMock(); | 918 var mock = new HttpServerMock(); |
884 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 919 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
885 var arg_leaderboardId = "foo"; | 920 var arg_leaderboardId = "foo"; |
886 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 921 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
887 var path = (req.url).path; | 922 var path = (req.url).path; |
888 var pathOffset = 0; | 923 var pathOffset = 0; |
889 var index; | 924 var index; |
890 var subPart; | 925 var subPart; |
891 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 926 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
892 pathOffset += 1; | 927 pathOffset += 1; |
893 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/")); |
(...skipping 19 matching lines...) Expand all Loading... |
913 var keyvalue = part.split("="); | 948 var keyvalue = part.split("="); |
914 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 949 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
915 } | 950 } |
916 } | 951 } |
917 | 952 |
918 | 953 |
919 var h = { | 954 var h = { |
920 "content-type" : "application/json; charset=utf-8", | 955 "content-type" : "application/json; charset=utf-8", |
921 }; | 956 }; |
922 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 957 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
923 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 958 return new async.Future.value(stringResponse(200, h, resp)); |
924 }), true); | 959 }), true); |
925 res.get(arg_leaderboardId).then(unittest.expectAsync(((api.LeaderboardConf
iguration response) { | 960 res.get(arg_leaderboardId).then(unittest.expectAsync(((api.LeaderboardConf
iguration response) { |
926 checkLeaderboardConfiguration(response); | 961 checkLeaderboardConfiguration(response); |
927 }))); | 962 }))); |
928 }); | 963 }); |
929 | 964 |
930 unittest.test("method--insert", () { | 965 unittest.test("method--insert", () { |
931 | 966 |
932 var mock = new common_test.HttpServerMock(); | 967 var mock = new HttpServerMock(); |
933 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 968 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
934 var arg_request = buildLeaderboardConfiguration(); | 969 var arg_request = buildLeaderboardConfiguration(); |
935 var arg_applicationId = "foo"; | 970 var arg_applicationId = "foo"; |
936 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 971 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
937 var obj = new api.LeaderboardConfiguration.fromJson(json); | 972 var obj = new api.LeaderboardConfiguration.fromJson(json); |
938 checkLeaderboardConfiguration(obj); | 973 checkLeaderboardConfiguration(obj); |
939 | 974 |
940 var path = (req.url).path; | 975 var path = (req.url).path; |
941 var pathOffset = 0; | 976 var pathOffset = 0; |
942 var index; | 977 var index; |
(...skipping 27 matching lines...) Expand all Loading... |
970 var keyvalue = part.split("="); | 1005 var keyvalue = part.split("="); |
971 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1006 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
972 } | 1007 } |
973 } | 1008 } |
974 | 1009 |
975 | 1010 |
976 var h = { | 1011 var h = { |
977 "content-type" : "application/json; charset=utf-8", | 1012 "content-type" : "application/json; charset=utf-8", |
978 }; | 1013 }; |
979 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 1014 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
980 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1015 return new async.Future.value(stringResponse(200, h, resp)); |
981 }), true); | 1016 }), true); |
982 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync(((api
.LeaderboardConfiguration response) { | 1017 res.insert(arg_request, arg_applicationId).then(unittest.expectAsync(((api
.LeaderboardConfiguration response) { |
983 checkLeaderboardConfiguration(response); | 1018 checkLeaderboardConfiguration(response); |
984 }))); | 1019 }))); |
985 }); | 1020 }); |
986 | 1021 |
987 unittest.test("method--list", () { | 1022 unittest.test("method--list", () { |
988 | 1023 |
989 var mock = new common_test.HttpServerMock(); | 1024 var mock = new HttpServerMock(); |
990 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 1025 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
991 var arg_applicationId = "foo"; | 1026 var arg_applicationId = "foo"; |
992 var arg_maxResults = 42; | 1027 var arg_maxResults = 42; |
993 var arg_pageToken = "foo"; | 1028 var arg_pageToken = "foo"; |
994 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1029 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
995 var path = (req.url).path; | 1030 var path = (req.url).path; |
996 var pathOffset = 0; | 1031 var pathOffset = 0; |
997 var index; | 1032 var index; |
998 var subPart; | 1033 var subPart; |
999 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1034 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 27 matching lines...) Expand all Loading... |
1027 } | 1062 } |
1028 } | 1063 } |
1029 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)); |
1030 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1065 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1031 | 1066 |
1032 | 1067 |
1033 var h = { | 1068 var h = { |
1034 "content-type" : "application/json; charset=utf-8", | 1069 "content-type" : "application/json; charset=utf-8", |
1035 }; | 1070 }; |
1036 var resp = convert.JSON.encode(buildLeaderboardConfigurationListResponse
()); | 1071 var resp = convert.JSON.encode(buildLeaderboardConfigurationListResponse
()); |
1037 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1072 return new async.Future.value(stringResponse(200, h, resp)); |
1038 }), true); | 1073 }), true); |
1039 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.expectAsync(((api.LeaderboardConfigurationListResponse res
ponse) { |
1040 checkLeaderboardConfigurationListResponse(response); | 1075 checkLeaderboardConfigurationListResponse(response); |
1041 }))); | 1076 }))); |
1042 }); | 1077 }); |
1043 | 1078 |
1044 unittest.test("method--patch", () { | 1079 unittest.test("method--patch", () { |
1045 | 1080 |
1046 var mock = new common_test.HttpServerMock(); | 1081 var mock = new HttpServerMock(); |
1047 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 1082 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
1048 var arg_request = buildLeaderboardConfiguration(); | 1083 var arg_request = buildLeaderboardConfiguration(); |
1049 var arg_leaderboardId = "foo"; | 1084 var arg_leaderboardId = "foo"; |
1050 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1085 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1051 var obj = new api.LeaderboardConfiguration.fromJson(json); | 1086 var obj = new api.LeaderboardConfiguration.fromJson(json); |
1052 checkLeaderboardConfiguration(obj); | 1087 checkLeaderboardConfiguration(obj); |
1053 | 1088 |
1054 var path = (req.url).path; | 1089 var path = (req.url).path; |
1055 var pathOffset = 0; | 1090 var pathOffset = 0; |
1056 var index; | 1091 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1080 var keyvalue = part.split("="); | 1115 var keyvalue = part.split("="); |
1081 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1116 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1082 } | 1117 } |
1083 } | 1118 } |
1084 | 1119 |
1085 | 1120 |
1086 var h = { | 1121 var h = { |
1087 "content-type" : "application/json; charset=utf-8", | 1122 "content-type" : "application/json; charset=utf-8", |
1088 }; | 1123 }; |
1089 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 1124 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
1090 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1125 return new async.Future.value(stringResponse(200, h, resp)); |
1091 }), true); | 1126 }), true); |
1092 res.patch(arg_request, arg_leaderboardId).then(unittest.expectAsync(((api.
LeaderboardConfiguration response) { | 1127 res.patch(arg_request, arg_leaderboardId).then(unittest.expectAsync(((api.
LeaderboardConfiguration response) { |
1093 checkLeaderboardConfiguration(response); | 1128 checkLeaderboardConfiguration(response); |
1094 }))); | 1129 }))); |
1095 }); | 1130 }); |
1096 | 1131 |
1097 unittest.test("method--update", () { | 1132 unittest.test("method--update", () { |
1098 | 1133 |
1099 var mock = new common_test.HttpServerMock(); | 1134 var mock = new HttpServerMock(); |
1100 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; | 1135 api.LeaderboardConfigurationsResourceApi res = new api.GamesConfigurationA
pi(mock).leaderboardConfigurations; |
1101 var arg_request = buildLeaderboardConfiguration(); | 1136 var arg_request = buildLeaderboardConfiguration(); |
1102 var arg_leaderboardId = "foo"; | 1137 var arg_leaderboardId = "foo"; |
1103 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1138 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1104 var obj = new api.LeaderboardConfiguration.fromJson(json); | 1139 var obj = new api.LeaderboardConfiguration.fromJson(json); |
1105 checkLeaderboardConfiguration(obj); | 1140 checkLeaderboardConfiguration(obj); |
1106 | 1141 |
1107 var path = (req.url).path; | 1142 var path = (req.url).path; |
1108 var pathOffset = 0; | 1143 var pathOffset = 0; |
1109 var index; | 1144 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1133 var keyvalue = part.split("="); | 1168 var keyvalue = part.split("="); |
1134 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1169 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1135 } | 1170 } |
1136 } | 1171 } |
1137 | 1172 |
1138 | 1173 |
1139 var h = { | 1174 var h = { |
1140 "content-type" : "application/json; charset=utf-8", | 1175 "content-type" : "application/json; charset=utf-8", |
1141 }; | 1176 }; |
1142 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); | 1177 var resp = convert.JSON.encode(buildLeaderboardConfiguration()); |
1143 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1178 return new async.Future.value(stringResponse(200, h, resp)); |
1144 }), true); | 1179 }), true); |
1145 res.update(arg_request, arg_leaderboardId).then(unittest.expectAsync(((api
.LeaderboardConfiguration response) { | 1180 res.update(arg_request, arg_leaderboardId).then(unittest.expectAsync(((api
.LeaderboardConfiguration response) { |
1146 checkLeaderboardConfiguration(response); | 1181 checkLeaderboardConfiguration(response); |
1147 }))); | 1182 }))); |
1148 }); | 1183 }); |
1149 | 1184 |
1150 }); | 1185 }); |
1151 | 1186 |
1152 | 1187 |
1153 } | 1188 } |
1154 | 1189 |
OLD | NEW |