| OLD | NEW |
| 1 library googleapis.admin.email_migration_v2.test; | 1 library googleapis.admin.email_migration_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; |
| 11 import 'package:googleapis/common/common.dart' as common; | 11 import 'package:googleapis/common/common.dart' as common; |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; | 12 import 'package:googleapis/src/common_internal.dart' as common_internal; |
| 13 import '../common/common_internal_test.dart' as common_test; | 13 import '../common/common_internal_test.dart' as common_test; |
| 14 | 14 |
| 15 import 'package:googleapis/admin/email_migration_v2.dart' as api; | 15 import 'package:googleapis/admin/email_migration_v2.dart' as api; |
| 16 | 16 |
| 17 | 17 |
| 18 | 18 |
| 19 buildUnnamed0() { | 19 buildUnnamed120() { |
| 20 var o = new core.List<core.String>(); | 20 var o = new core.List<core.String>(); |
| 21 o.add("foo"); | 21 o.add("foo"); |
| 22 o.add("foo"); | 22 o.add("foo"); |
| 23 return o; | 23 return o; |
| 24 } | 24 } |
| 25 | 25 |
| 26 checkUnnamed0(core.List<core.String> o) { | 26 checkUnnamed120(core.List<core.String> o) { |
| 27 unittest.expect(o, unittest.hasLength(2)); | 27 unittest.expect(o, unittest.hasLength(2)); |
| 28 unittest.expect(o[0], unittest.equals('foo')); | 28 unittest.expect(o[0], unittest.equals('foo')); |
| 29 unittest.expect(o[1], unittest.equals('foo')); | 29 unittest.expect(o[1], unittest.equals('foo')); |
| 30 } | 30 } |
| 31 | 31 |
| 32 core.int buildCounterMailItem = 0; | 32 core.int buildCounterMailItem = 0; |
| 33 buildMailItem() { | 33 buildMailItem() { |
| 34 var o = new api.MailItem(); | 34 var o = new api.MailItem(); |
| 35 buildCounterMailItem++; | 35 buildCounterMailItem++; |
| 36 if (buildCounterMailItem < 3) { | 36 if (buildCounterMailItem < 3) { |
| 37 o.isDeleted = true; | 37 o.isDeleted = true; |
| 38 o.isDraft = true; | 38 o.isDraft = true; |
| 39 o.isInbox = true; | 39 o.isInbox = true; |
| 40 o.isSent = true; | 40 o.isSent = true; |
| 41 o.isStarred = true; | 41 o.isStarred = true; |
| 42 o.isTrash = true; | 42 o.isTrash = true; |
| 43 o.isUnread = true; | 43 o.isUnread = true; |
| 44 o.kind = "foo"; | 44 o.kind = "foo"; |
| 45 o.labels = buildUnnamed0(); | 45 o.labels = buildUnnamed120(); |
| 46 } | 46 } |
| 47 buildCounterMailItem--; | 47 buildCounterMailItem--; |
| 48 return o; | 48 return o; |
| 49 } | 49 } |
| 50 | 50 |
| 51 checkMailItem(api.MailItem o) { | 51 checkMailItem(api.MailItem o) { |
| 52 buildCounterMailItem++; | 52 buildCounterMailItem++; |
| 53 if (buildCounterMailItem < 3) { | 53 if (buildCounterMailItem < 3) { |
| 54 unittest.expect(o.isDeleted, unittest.isTrue); | 54 unittest.expect(o.isDeleted, unittest.isTrue); |
| 55 unittest.expect(o.isDraft, unittest.isTrue); | 55 unittest.expect(o.isDraft, unittest.isTrue); |
| 56 unittest.expect(o.isInbox, unittest.isTrue); | 56 unittest.expect(o.isInbox, unittest.isTrue); |
| 57 unittest.expect(o.isSent, unittest.isTrue); | 57 unittest.expect(o.isSent, unittest.isTrue); |
| 58 unittest.expect(o.isStarred, unittest.isTrue); | 58 unittest.expect(o.isStarred, unittest.isTrue); |
| 59 unittest.expect(o.isTrash, unittest.isTrue); | 59 unittest.expect(o.isTrash, unittest.isTrue); |
| 60 unittest.expect(o.isUnread, unittest.isTrue); | 60 unittest.expect(o.isUnread, unittest.isTrue); |
| 61 unittest.expect(o.kind, unittest.equals('foo')); | 61 unittest.expect(o.kind, unittest.equals('foo')); |
| 62 checkUnnamed0(o.labels); | 62 checkUnnamed120(o.labels); |
| 63 } | 63 } |
| 64 buildCounterMailItem--; | 64 buildCounterMailItem--; |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 main() { | 68 main() { |
| 69 unittest.group("obj-schema-MailItem", () { | 69 unittest.group("obj-schema-MailItem", () { |
| 70 unittest.test("to-json--from-json", () { | 70 unittest.test("to-json--from-json", () { |
| 71 var o = buildMailItem(); | 71 var o = buildMailItem(); |
| 72 var od = new api.MailItem.fromJson(o.toJson()); | 72 var od = new api.MailItem.fromJson(o.toJson()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 120 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 121 }), true); | 121 }), true); |
| 122 res.insert(arg_request, arg_userKey).then(unittest.expectAsync((_) {})); | 122 res.insert(arg_request, arg_userKey).then(unittest.expectAsync((_) {})); |
| 123 }); | 123 }); |
| 124 | 124 |
| 125 }); | 125 }); |
| 126 | 126 |
| 127 | 127 |
| 128 } | 128 } |
| 129 | 129 |
| OLD | NEW |