OLD | NEW |
1 library googleapis.consumersurveys.v2.test; | 1 library googleapis.consumersurveys.v2.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 buildSurvey() { | 271 buildSurvey() { |
272 var o = new api.Survey(); | 272 var o = new api.Survey(); |
273 buildCounterSurvey++; | 273 buildCounterSurvey++; |
274 if (buildCounterSurvey < 3) { | 274 if (buildCounterSurvey < 3) { |
275 o.audience = buildSurveyAudience(); | 275 o.audience = buildSurveyAudience(); |
276 o.cost = buildSurveyCost(); | 276 o.cost = buildSurveyCost(); |
277 o.customerData = "foo"; | 277 o.customerData = "foo"; |
278 o.description = "foo"; | 278 o.description = "foo"; |
279 o.owners = buildUnnamed25(); | 279 o.owners = buildUnnamed25(); |
280 o.questions = buildUnnamed26(); | 280 o.questions = buildUnnamed26(); |
| 281 o.rejectionReason = buildSurveyRejection(); |
281 o.state = "foo"; | 282 o.state = "foo"; |
282 o.surveyUrlId = "foo"; | 283 o.surveyUrlId = "foo"; |
283 o.title = "foo"; | 284 o.title = "foo"; |
284 o.wantedResponseCount = 42; | 285 o.wantedResponseCount = 42; |
285 } | 286 } |
286 buildCounterSurvey--; | 287 buildCounterSurvey--; |
287 return o; | 288 return o; |
288 } | 289 } |
289 | 290 |
290 checkSurvey(api.Survey o) { | 291 checkSurvey(api.Survey o) { |
291 buildCounterSurvey++; | 292 buildCounterSurvey++; |
292 if (buildCounterSurvey < 3) { | 293 if (buildCounterSurvey < 3) { |
293 checkSurveyAudience(o.audience); | 294 checkSurveyAudience(o.audience); |
294 checkSurveyCost(o.cost); | 295 checkSurveyCost(o.cost); |
295 unittest.expect(o.customerData, unittest.equals('foo')); | 296 unittest.expect(o.customerData, unittest.equals('foo')); |
296 unittest.expect(o.description, unittest.equals('foo')); | 297 unittest.expect(o.description, unittest.equals('foo')); |
297 checkUnnamed25(o.owners); | 298 checkUnnamed25(o.owners); |
298 checkUnnamed26(o.questions); | 299 checkUnnamed26(o.questions); |
| 300 checkSurveyRejection(o.rejectionReason); |
299 unittest.expect(o.state, unittest.equals('foo')); | 301 unittest.expect(o.state, unittest.equals('foo')); |
300 unittest.expect(o.surveyUrlId, unittest.equals('foo')); | 302 unittest.expect(o.surveyUrlId, unittest.equals('foo')); |
301 unittest.expect(o.title, unittest.equals('foo')); | 303 unittest.expect(o.title, unittest.equals('foo')); |
302 unittest.expect(o.wantedResponseCount, unittest.equals(42)); | 304 unittest.expect(o.wantedResponseCount, unittest.equals(42)); |
303 } | 305 } |
304 buildCounterSurvey--; | 306 buildCounterSurvey--; |
305 } | 307 } |
306 | 308 |
307 buildUnnamed27() { | 309 buildUnnamed27() { |
308 var o = new core.List<core.String>(); | 310 var o = new core.List<core.String>(); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 checkSurveyQuestionImage(api.SurveyQuestionImage o) { | 509 checkSurveyQuestionImage(api.SurveyQuestionImage o) { |
508 buildCounterSurveyQuestionImage++; | 510 buildCounterSurveyQuestionImage++; |
509 if (buildCounterSurveyQuestionImage < 3) { | 511 if (buildCounterSurveyQuestionImage < 3) { |
510 unittest.expect(o.altText, unittest.equals('foo')); | 512 unittest.expect(o.altText, unittest.equals('foo')); |
511 unittest.expect(o.data, unittest.equals('foo')); | 513 unittest.expect(o.data, unittest.equals('foo')); |
512 unittest.expect(o.url, unittest.equals('foo')); | 514 unittest.expect(o.url, unittest.equals('foo')); |
513 } | 515 } |
514 buildCounterSurveyQuestionImage--; | 516 buildCounterSurveyQuestionImage--; |
515 } | 517 } |
516 | 518 |
| 519 core.int buildCounterSurveyRejection = 0; |
| 520 buildSurveyRejection() { |
| 521 var o = new api.SurveyRejection(); |
| 522 buildCounterSurveyRejection++; |
| 523 if (buildCounterSurveyRejection < 3) { |
| 524 o.explanation = "foo"; |
| 525 o.type = "foo"; |
| 526 } |
| 527 buildCounterSurveyRejection--; |
| 528 return o; |
| 529 } |
| 530 |
| 531 checkSurveyRejection(api.SurveyRejection o) { |
| 532 buildCounterSurveyRejection++; |
| 533 if (buildCounterSurveyRejection < 3) { |
| 534 unittest.expect(o.explanation, unittest.equals('foo')); |
| 535 unittest.expect(o.type, unittest.equals('foo')); |
| 536 } |
| 537 buildCounterSurveyRejection--; |
| 538 } |
| 539 |
517 core.int buildCounterSurveyResults = 0; | 540 core.int buildCounterSurveyResults = 0; |
518 buildSurveyResults() { | 541 buildSurveyResults() { |
519 var o = new api.SurveyResults(); | 542 var o = new api.SurveyResults(); |
520 buildCounterSurveyResults++; | 543 buildCounterSurveyResults++; |
521 if (buildCounterSurveyResults < 3) { | 544 if (buildCounterSurveyResults < 3) { |
522 o.status = "foo"; | 545 o.status = "foo"; |
523 o.surveyUrlId = "foo"; | 546 o.surveyUrlId = "foo"; |
524 } | 547 } |
525 buildCounterSurveyResults--; | 548 buildCounterSurveyResults--; |
526 return o; | 549 return o; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 791 |
769 unittest.group("obj-schema-SurveyQuestionImage", () { | 792 unittest.group("obj-schema-SurveyQuestionImage", () { |
770 unittest.test("to-json--from-json", () { | 793 unittest.test("to-json--from-json", () { |
771 var o = buildSurveyQuestionImage(); | 794 var o = buildSurveyQuestionImage(); |
772 var od = new api.SurveyQuestionImage.fromJson(o.toJson()); | 795 var od = new api.SurveyQuestionImage.fromJson(o.toJson()); |
773 checkSurveyQuestionImage(od); | 796 checkSurveyQuestionImage(od); |
774 }); | 797 }); |
775 }); | 798 }); |
776 | 799 |
777 | 800 |
| 801 unittest.group("obj-schema-SurveyRejection", () { |
| 802 unittest.test("to-json--from-json", () { |
| 803 var o = buildSurveyRejection(); |
| 804 var od = new api.SurveyRejection.fromJson(o.toJson()); |
| 805 checkSurveyRejection(od); |
| 806 }); |
| 807 }); |
| 808 |
| 809 |
778 unittest.group("obj-schema-SurveyResults", () { | 810 unittest.group("obj-schema-SurveyResults", () { |
779 unittest.test("to-json--from-json", () { | 811 unittest.test("to-json--from-json", () { |
780 var o = buildSurveyResults(); | 812 var o = buildSurveyResults(); |
781 var od = new api.SurveyResults.fromJson(o.toJson()); | 813 var od = new api.SurveyResults.fromJson(o.toJson()); |
782 checkSurveyResults(od); | 814 checkSurveyResults(od); |
783 }); | 815 }); |
784 }); | 816 }); |
785 | 817 |
786 | 818 |
787 unittest.group("obj-schema-SurveysDeleteResponse", () { | 819 unittest.group("obj-schema-SurveysDeleteResponse", () { |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S
urvey response) { | 1450 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S
urvey response) { |
1419 checkSurvey(response); | 1451 checkSurvey(response); |
1420 }))); | 1452 }))); |
1421 }); | 1453 }); |
1422 | 1454 |
1423 }); | 1455 }); |
1424 | 1456 |
1425 | 1457 |
1426 } | 1458 } |
1427 | 1459 |
OLD | NEW |