Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: generated/googleapis/test/admin/email_migration_v2_test.dart

Issue 1268013003: Api-roll 21: 2015-08-04 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 headers, core.String body) {
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 buildUnnamed0() { 54 buildUnnamed169() {
55 var o = new core.List<core.String>(); 55 var o = new core.List<core.String>();
56 o.add("foo"); 56 o.add("foo");
57 o.add("foo"); 57 o.add("foo");
58 return o; 58 return o;
59 } 59 }
60 60
61 checkUnnamed0(core.List<core.String> o) { 61 checkUnnamed169(core.List<core.String> o) {
62 unittest.expect(o, unittest.hasLength(2)); 62 unittest.expect(o, unittest.hasLength(2));
63 unittest.expect(o[0], unittest.equals('foo')); 63 unittest.expect(o[0], unittest.equals('foo'));
64 unittest.expect(o[1], unittest.equals('foo')); 64 unittest.expect(o[1], unittest.equals('foo'));
65 } 65 }
66 66
67 core.int buildCounterMailItem = 0; 67 core.int buildCounterMailItem = 0;
68 buildMailItem() { 68 buildMailItem() {
69 var o = new api.MailItem(); 69 var o = new api.MailItem();
70 buildCounterMailItem++; 70 buildCounterMailItem++;
71 if (buildCounterMailItem < 3) { 71 if (buildCounterMailItem < 3) {
72 o.isDeleted = true; 72 o.isDeleted = true;
73 o.isDraft = true; 73 o.isDraft = true;
74 o.isInbox = true; 74 o.isInbox = true;
75 o.isSent = true; 75 o.isSent = true;
76 o.isStarred = true; 76 o.isStarred = true;
77 o.isTrash = true; 77 o.isTrash = true;
78 o.isUnread = true; 78 o.isUnread = true;
79 o.kind = "foo"; 79 o.kind = "foo";
80 o.labels = buildUnnamed0(); 80 o.labels = buildUnnamed169();
81 } 81 }
82 buildCounterMailItem--; 82 buildCounterMailItem--;
83 return o; 83 return o;
84 } 84 }
85 85
86 checkMailItem(api.MailItem o) { 86 checkMailItem(api.MailItem o) {
87 buildCounterMailItem++; 87 buildCounterMailItem++;
88 if (buildCounterMailItem < 3) { 88 if (buildCounterMailItem < 3) {
89 unittest.expect(o.isDeleted, unittest.isTrue); 89 unittest.expect(o.isDeleted, unittest.isTrue);
90 unittest.expect(o.isDraft, unittest.isTrue); 90 unittest.expect(o.isDraft, unittest.isTrue);
91 unittest.expect(o.isInbox, unittest.isTrue); 91 unittest.expect(o.isInbox, unittest.isTrue);
92 unittest.expect(o.isSent, unittest.isTrue); 92 unittest.expect(o.isSent, unittest.isTrue);
93 unittest.expect(o.isStarred, unittest.isTrue); 93 unittest.expect(o.isStarred, unittest.isTrue);
94 unittest.expect(o.isTrash, unittest.isTrue); 94 unittest.expect(o.isTrash, unittest.isTrue);
95 unittest.expect(o.isUnread, unittest.isTrue); 95 unittest.expect(o.isUnread, unittest.isTrue);
96 unittest.expect(o.kind, unittest.equals('foo')); 96 unittest.expect(o.kind, unittest.equals('foo'));
97 checkUnnamed0(o.labels); 97 checkUnnamed169(o.labels);
98 } 98 }
99 buildCounterMailItem--; 99 buildCounterMailItem--;
100 } 100 }
101 101
102 102
103 main() { 103 main() {
104 unittest.group("obj-schema-MailItem", () { 104 unittest.group("obj-schema-MailItem", () {
105 unittest.test("to-json--from-json", () { 105 unittest.test("to-json--from-json", () {
106 var o = buildMailItem(); 106 var o = buildMailItem();
107 var od = new api.MailItem.fromJson(o.toJson()); 107 var od = new api.MailItem.fromJson(o.toJson());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return new async.Future.value(stringResponse(200, h, resp)); 155 return new async.Future.value(stringResponse(200, h, resp));
156 }), true); 156 }), true);
157 res.insert(arg_request, arg_userKey).then(unittest.expectAsync((_) {})); 157 res.insert(arg_request, arg_userKey).then(unittest.expectAsync((_) {}));
158 }); 158 });
159 159
160 }); 160 });
161 161
162 162
163 } 163 }
164 164
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698