OLD | NEW |
1 library googleapis.appsactivity.v1.test; | 1 library googleapis.appsactivity.v1.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/appsactivity/v1.dart' as api; | 15 import 'package:googleapis/appsactivity/v1.dart' as api; |
16 | 16 |
17 | 17 |
18 | 18 |
19 buildUnnamed656() { | 19 buildUnnamed684() { |
20 var o = new core.List<api.Event>(); | 20 var o = new core.List<api.Event>(); |
21 o.add(buildEvent()); | 21 o.add(buildEvent()); |
22 o.add(buildEvent()); | 22 o.add(buildEvent()); |
23 return o; | 23 return o; |
24 } | 24 } |
25 | 25 |
26 checkUnnamed656(core.List<api.Event> o) { | 26 checkUnnamed684(core.List<api.Event> o) { |
27 unittest.expect(o, unittest.hasLength(2)); | 27 unittest.expect(o, unittest.hasLength(2)); |
28 checkEvent(o[0]); | 28 checkEvent(o[0]); |
29 checkEvent(o[1]); | 29 checkEvent(o[1]); |
30 } | 30 } |
31 | 31 |
32 core.int buildCounterActivity = 0; | 32 core.int buildCounterActivity = 0; |
33 buildActivity() { | 33 buildActivity() { |
34 var o = new api.Activity(); | 34 var o = new api.Activity(); |
35 buildCounterActivity++; | 35 buildCounterActivity++; |
36 if (buildCounterActivity < 3) { | 36 if (buildCounterActivity < 3) { |
37 o.combinedEvent = buildEvent(); | 37 o.combinedEvent = buildEvent(); |
38 o.singleEvents = buildUnnamed656(); | 38 o.singleEvents = buildUnnamed684(); |
39 } | 39 } |
40 buildCounterActivity--; | 40 buildCounterActivity--; |
41 return o; | 41 return o; |
42 } | 42 } |
43 | 43 |
44 checkActivity(api.Activity o) { | 44 checkActivity(api.Activity o) { |
45 buildCounterActivity++; | 45 buildCounterActivity++; |
46 if (buildCounterActivity < 3) { | 46 if (buildCounterActivity < 3) { |
47 checkEvent(o.combinedEvent); | 47 checkEvent(o.combinedEvent); |
48 checkUnnamed656(o.singleEvents); | 48 checkUnnamed684(o.singleEvents); |
49 } | 49 } |
50 buildCounterActivity--; | 50 buildCounterActivity--; |
51 } | 51 } |
52 | 52 |
53 buildUnnamed657() { | 53 buildUnnamed685() { |
54 var o = new core.List<core.String>(); | 54 var o = new core.List<core.String>(); |
55 o.add("foo"); | 55 o.add("foo"); |
56 o.add("foo"); | 56 o.add("foo"); |
57 return o; | 57 return o; |
58 } | 58 } |
59 | 59 |
60 checkUnnamed657(core.List<core.String> o) { | 60 checkUnnamed685(core.List<core.String> o) { |
61 unittest.expect(o, unittest.hasLength(2)); | 61 unittest.expect(o, unittest.hasLength(2)); |
62 unittest.expect(o[0], unittest.equals('foo')); | 62 unittest.expect(o[0], unittest.equals('foo')); |
63 unittest.expect(o[1], unittest.equals('foo')); | 63 unittest.expect(o[1], unittest.equals('foo')); |
64 } | 64 } |
65 | 65 |
66 buildUnnamed658() { | 66 buildUnnamed686() { |
67 var o = new core.List<api.PermissionChange>(); | 67 var o = new core.List<api.PermissionChange>(); |
68 o.add(buildPermissionChange()); | 68 o.add(buildPermissionChange()); |
69 o.add(buildPermissionChange()); | 69 o.add(buildPermissionChange()); |
70 return o; | 70 return o; |
71 } | 71 } |
72 | 72 |
73 checkUnnamed658(core.List<api.PermissionChange> o) { | 73 checkUnnamed686(core.List<api.PermissionChange> o) { |
74 unittest.expect(o, unittest.hasLength(2)); | 74 unittest.expect(o, unittest.hasLength(2)); |
75 checkPermissionChange(o[0]); | 75 checkPermissionChange(o[0]); |
76 checkPermissionChange(o[1]); | 76 checkPermissionChange(o[1]); |
77 } | 77 } |
78 | 78 |
79 core.int buildCounterEvent = 0; | 79 core.int buildCounterEvent = 0; |
80 buildEvent() { | 80 buildEvent() { |
81 var o = new api.Event(); | 81 var o = new api.Event(); |
82 buildCounterEvent++; | 82 buildCounterEvent++; |
83 if (buildCounterEvent < 3) { | 83 if (buildCounterEvent < 3) { |
84 o.additionalEventTypes = buildUnnamed657(); | 84 o.additionalEventTypes = buildUnnamed685(); |
85 o.eventTimeMillis = "foo"; | 85 o.eventTimeMillis = "foo"; |
86 o.fromUserDeletion = true; | 86 o.fromUserDeletion = true; |
87 o.move = buildMove(); | 87 o.move = buildMove(); |
88 o.permissionChanges = buildUnnamed658(); | 88 o.permissionChanges = buildUnnamed686(); |
89 o.primaryEventType = "foo"; | 89 o.primaryEventType = "foo"; |
90 o.rename = buildRename(); | 90 o.rename = buildRename(); |
91 o.target = buildTarget(); | 91 o.target = buildTarget(); |
92 o.user = buildUser(); | 92 o.user = buildUser(); |
93 } | 93 } |
94 buildCounterEvent--; | 94 buildCounterEvent--; |
95 return o; | 95 return o; |
96 } | 96 } |
97 | 97 |
98 checkEvent(api.Event o) { | 98 checkEvent(api.Event o) { |
99 buildCounterEvent++; | 99 buildCounterEvent++; |
100 if (buildCounterEvent < 3) { | 100 if (buildCounterEvent < 3) { |
101 checkUnnamed657(o.additionalEventTypes); | 101 checkUnnamed685(o.additionalEventTypes); |
102 unittest.expect(o.eventTimeMillis, unittest.equals('foo')); | 102 unittest.expect(o.eventTimeMillis, unittest.equals('foo')); |
103 unittest.expect(o.fromUserDeletion, unittest.isTrue); | 103 unittest.expect(o.fromUserDeletion, unittest.isTrue); |
104 checkMove(o.move); | 104 checkMove(o.move); |
105 checkUnnamed658(o.permissionChanges); | 105 checkUnnamed686(o.permissionChanges); |
106 unittest.expect(o.primaryEventType, unittest.equals('foo')); | 106 unittest.expect(o.primaryEventType, unittest.equals('foo')); |
107 checkRename(o.rename); | 107 checkRename(o.rename); |
108 checkTarget(o.target); | 108 checkTarget(o.target); |
109 checkUser(o.user); | 109 checkUser(o.user); |
110 } | 110 } |
111 buildCounterEvent--; | 111 buildCounterEvent--; |
112 } | 112 } |
113 | 113 |
114 buildUnnamed659() { | 114 buildUnnamed687() { |
115 var o = new core.List<api.Activity>(); | 115 var o = new core.List<api.Activity>(); |
116 o.add(buildActivity()); | 116 o.add(buildActivity()); |
117 o.add(buildActivity()); | 117 o.add(buildActivity()); |
118 return o; | 118 return o; |
119 } | 119 } |
120 | 120 |
121 checkUnnamed659(core.List<api.Activity> o) { | 121 checkUnnamed687(core.List<api.Activity> o) { |
122 unittest.expect(o, unittest.hasLength(2)); | 122 unittest.expect(o, unittest.hasLength(2)); |
123 checkActivity(o[0]); | 123 checkActivity(o[0]); |
124 checkActivity(o[1]); | 124 checkActivity(o[1]); |
125 } | 125 } |
126 | 126 |
127 core.int buildCounterListActivitiesResponse = 0; | 127 core.int buildCounterListActivitiesResponse = 0; |
128 buildListActivitiesResponse() { | 128 buildListActivitiesResponse() { |
129 var o = new api.ListActivitiesResponse(); | 129 var o = new api.ListActivitiesResponse(); |
130 buildCounterListActivitiesResponse++; | 130 buildCounterListActivitiesResponse++; |
131 if (buildCounterListActivitiesResponse < 3) { | 131 if (buildCounterListActivitiesResponse < 3) { |
132 o.activities = buildUnnamed659(); | 132 o.activities = buildUnnamed687(); |
133 o.nextPageToken = "foo"; | 133 o.nextPageToken = "foo"; |
134 } | 134 } |
135 buildCounterListActivitiesResponse--; | 135 buildCounterListActivitiesResponse--; |
136 return o; | 136 return o; |
137 } | 137 } |
138 | 138 |
139 checkListActivitiesResponse(api.ListActivitiesResponse o) { | 139 checkListActivitiesResponse(api.ListActivitiesResponse o) { |
140 buildCounterListActivitiesResponse++; | 140 buildCounterListActivitiesResponse++; |
141 if (buildCounterListActivitiesResponse < 3) { | 141 if (buildCounterListActivitiesResponse < 3) { |
142 checkUnnamed659(o.activities); | 142 checkUnnamed687(o.activities); |
143 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 143 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
144 } | 144 } |
145 buildCounterListActivitiesResponse--; | 145 buildCounterListActivitiesResponse--; |
146 } | 146 } |
147 | 147 |
148 buildUnnamed660() { | 148 buildUnnamed688() { |
149 var o = new core.List<api.Parent>(); | 149 var o = new core.List<api.Parent>(); |
150 o.add(buildParent()); | 150 o.add(buildParent()); |
151 o.add(buildParent()); | 151 o.add(buildParent()); |
152 return o; | 152 return o; |
153 } | 153 } |
154 | 154 |
155 checkUnnamed660(core.List<api.Parent> o) { | 155 checkUnnamed688(core.List<api.Parent> o) { |
156 unittest.expect(o, unittest.hasLength(2)); | 156 unittest.expect(o, unittest.hasLength(2)); |
157 checkParent(o[0]); | 157 checkParent(o[0]); |
158 checkParent(o[1]); | 158 checkParent(o[1]); |
159 } | 159 } |
160 | 160 |
161 buildUnnamed661() { | 161 buildUnnamed689() { |
162 var o = new core.List<api.Parent>(); | 162 var o = new core.List<api.Parent>(); |
163 o.add(buildParent()); | 163 o.add(buildParent()); |
164 o.add(buildParent()); | 164 o.add(buildParent()); |
165 return o; | 165 return o; |
166 } | 166 } |
167 | 167 |
168 checkUnnamed661(core.List<api.Parent> o) { | 168 checkUnnamed689(core.List<api.Parent> o) { |
169 unittest.expect(o, unittest.hasLength(2)); | 169 unittest.expect(o, unittest.hasLength(2)); |
170 checkParent(o[0]); | 170 checkParent(o[0]); |
171 checkParent(o[1]); | 171 checkParent(o[1]); |
172 } | 172 } |
173 | 173 |
174 core.int buildCounterMove = 0; | 174 core.int buildCounterMove = 0; |
175 buildMove() { | 175 buildMove() { |
176 var o = new api.Move(); | 176 var o = new api.Move(); |
177 buildCounterMove++; | 177 buildCounterMove++; |
178 if (buildCounterMove < 3) { | 178 if (buildCounterMove < 3) { |
179 o.addedParents = buildUnnamed660(); | 179 o.addedParents = buildUnnamed688(); |
180 o.removedParents = buildUnnamed661(); | 180 o.removedParents = buildUnnamed689(); |
181 } | 181 } |
182 buildCounterMove--; | 182 buildCounterMove--; |
183 return o; | 183 return o; |
184 } | 184 } |
185 | 185 |
186 checkMove(api.Move o) { | 186 checkMove(api.Move o) { |
187 buildCounterMove++; | 187 buildCounterMove++; |
188 if (buildCounterMove < 3) { | 188 if (buildCounterMove < 3) { |
189 checkUnnamed660(o.addedParents); | 189 checkUnnamed688(o.addedParents); |
190 checkUnnamed661(o.removedParents); | 190 checkUnnamed689(o.removedParents); |
191 } | 191 } |
192 buildCounterMove--; | 192 buildCounterMove--; |
193 } | 193 } |
194 | 194 |
195 core.int buildCounterParent = 0; | 195 core.int buildCounterParent = 0; |
196 buildParent() { | 196 buildParent() { |
197 var o = new api.Parent(); | 197 var o = new api.Parent(); |
198 buildCounterParent++; | 198 buildCounterParent++; |
199 if (buildCounterParent < 3) { | 199 if (buildCounterParent < 3) { |
200 o.id = "foo"; | 200 o.id = "foo"; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 unittest.expect(o.name, unittest.equals('foo')); | 237 unittest.expect(o.name, unittest.equals('foo')); |
238 unittest.expect(o.permissionId, unittest.equals('foo')); | 238 unittest.expect(o.permissionId, unittest.equals('foo')); |
239 unittest.expect(o.role, unittest.equals('foo')); | 239 unittest.expect(o.role, unittest.equals('foo')); |
240 unittest.expect(o.type, unittest.equals('foo')); | 240 unittest.expect(o.type, unittest.equals('foo')); |
241 checkUser(o.user); | 241 checkUser(o.user); |
242 unittest.expect(o.withLink, unittest.isTrue); | 242 unittest.expect(o.withLink, unittest.isTrue); |
243 } | 243 } |
244 buildCounterPermission--; | 244 buildCounterPermission--; |
245 } | 245 } |
246 | 246 |
247 buildUnnamed662() { | 247 buildUnnamed690() { |
248 var o = new core.List<api.Permission>(); | 248 var o = new core.List<api.Permission>(); |
249 o.add(buildPermission()); | 249 o.add(buildPermission()); |
250 o.add(buildPermission()); | 250 o.add(buildPermission()); |
251 return o; | 251 return o; |
252 } | 252 } |
253 | 253 |
254 checkUnnamed662(core.List<api.Permission> o) { | 254 checkUnnamed690(core.List<api.Permission> o) { |
255 unittest.expect(o, unittest.hasLength(2)); | 255 unittest.expect(o, unittest.hasLength(2)); |
256 checkPermission(o[0]); | 256 checkPermission(o[0]); |
257 checkPermission(o[1]); | 257 checkPermission(o[1]); |
258 } | 258 } |
259 | 259 |
260 buildUnnamed663() { | 260 buildUnnamed691() { |
261 var o = new core.List<api.Permission>(); | 261 var o = new core.List<api.Permission>(); |
262 o.add(buildPermission()); | 262 o.add(buildPermission()); |
263 o.add(buildPermission()); | 263 o.add(buildPermission()); |
264 return o; | 264 return o; |
265 } | 265 } |
266 | 266 |
267 checkUnnamed663(core.List<api.Permission> o) { | 267 checkUnnamed691(core.List<api.Permission> o) { |
268 unittest.expect(o, unittest.hasLength(2)); | 268 unittest.expect(o, unittest.hasLength(2)); |
269 checkPermission(o[0]); | 269 checkPermission(o[0]); |
270 checkPermission(o[1]); | 270 checkPermission(o[1]); |
271 } | 271 } |
272 | 272 |
273 core.int buildCounterPermissionChange = 0; | 273 core.int buildCounterPermissionChange = 0; |
274 buildPermissionChange() { | 274 buildPermissionChange() { |
275 var o = new api.PermissionChange(); | 275 var o = new api.PermissionChange(); |
276 buildCounterPermissionChange++; | 276 buildCounterPermissionChange++; |
277 if (buildCounterPermissionChange < 3) { | 277 if (buildCounterPermissionChange < 3) { |
278 o.addedPermissions = buildUnnamed662(); | 278 o.addedPermissions = buildUnnamed690(); |
279 o.removedPermissions = buildUnnamed663(); | 279 o.removedPermissions = buildUnnamed691(); |
280 } | 280 } |
281 buildCounterPermissionChange--; | 281 buildCounterPermissionChange--; |
282 return o; | 282 return o; |
283 } | 283 } |
284 | 284 |
285 checkPermissionChange(api.PermissionChange o) { | 285 checkPermissionChange(api.PermissionChange o) { |
286 buildCounterPermissionChange++; | 286 buildCounterPermissionChange++; |
287 if (buildCounterPermissionChange < 3) { | 287 if (buildCounterPermissionChange < 3) { |
288 checkUnnamed662(o.addedPermissions); | 288 checkUnnamed690(o.addedPermissions); |
289 checkUnnamed663(o.removedPermissions); | 289 checkUnnamed691(o.removedPermissions); |
290 } | 290 } |
291 buildCounterPermissionChange--; | 291 buildCounterPermissionChange--; |
292 } | 292 } |
293 | 293 |
294 core.int buildCounterPhoto = 0; | 294 core.int buildCounterPhoto = 0; |
295 buildPhoto() { | 295 buildPhoto() { |
296 var o = new api.Photo(); | 296 var o = new api.Photo(); |
297 buildCounterPhoto++; | 297 buildCounterPhoto++; |
298 if (buildCounterPhoto < 3) { | 298 if (buildCounterPhoto < 3) { |
299 o.url = "foo"; | 299 o.url = "foo"; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 var arg_groupingStrategy = "foo"; | 486 var arg_groupingStrategy = "foo"; |
487 var arg_pageSize = 42; | 487 var arg_pageSize = 42; |
488 var arg_pageToken = "foo"; | 488 var arg_pageToken = "foo"; |
489 var arg_source = "foo"; | 489 var arg_source = "foo"; |
490 var arg_userId = "foo"; | 490 var arg_userId = "foo"; |
491 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 491 mock.register(unittest.expectAsync((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 + 17), unittest.eq
uals("/appsactivity/v1/")); | 496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
497 pathOffset += 17; | 497 pathOffset += 1; |
| 498 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("appsactivity/v1/")); |
| 499 pathOffset += 16; |
498 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("activities")); | 500 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("activities")); |
499 pathOffset += 10; | 501 pathOffset += 10; |
500 | 502 |
501 var query = (req.url).query; | 503 var query = (req.url).query; |
502 var queryOffset = 0; | 504 var queryOffset = 0; |
503 var queryMap = {}; | 505 var queryMap = {}; |
504 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 506 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
505 parseBool(n) { | 507 parseBool(n) { |
506 if (n == "true") return true; | 508 if (n == "true") return true; |
507 if (n == "false") return false; | 509 if (n == "false") return false; |
(...skipping 24 matching lines...) Expand all Loading... |
532 res.list(drive_ancestorId: arg_drive_ancestorId, drive_fileId: arg_drive_f
ileId, groupingStrategy: arg_groupingStrategy, pageSize: arg_pageSize, pageToken
: arg_pageToken, source: arg_source, userId: arg_userId).then(unittest.expectAsy
nc(((api.ListActivitiesResponse response) { | 534 res.list(drive_ancestorId: arg_drive_ancestorId, drive_fileId: arg_drive_f
ileId, groupingStrategy: arg_groupingStrategy, pageSize: arg_pageSize, pageToken
: arg_pageToken, source: arg_source, userId: arg_userId).then(unittest.expectAsy
nc(((api.ListActivitiesResponse response) { |
533 checkListActivitiesResponse(response); | 535 checkListActivitiesResponse(response); |
534 }))); | 536 }))); |
535 }); | 537 }); |
536 | 538 |
537 }); | 539 }); |
538 | 540 |
539 | 541 |
540 } | 542 } |
541 | 543 |
OLD | NEW |