OLD | NEW |
1 library googleapis.mirror.v1.test; | 1 library googleapis.mirror.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; | |
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/mirror/v1.dart' as api; | 12 import 'package:googleapis/mirror/v1.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 } |
18 | 22 |
19 buildUnnamed1069() { | 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 } |
| 53 |
| 54 buildUnnamed1215() { |
20 var o = new core.List<api.AuthToken>(); | 55 var o = new core.List<api.AuthToken>(); |
21 o.add(buildAuthToken()); | 56 o.add(buildAuthToken()); |
22 o.add(buildAuthToken()); | 57 o.add(buildAuthToken()); |
23 return o; | 58 return o; |
24 } | 59 } |
25 | 60 |
26 checkUnnamed1069(core.List<api.AuthToken> o) { | 61 checkUnnamed1215(core.List<api.AuthToken> o) { |
27 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
28 checkAuthToken(o[0]); | 63 checkAuthToken(o[0]); |
29 checkAuthToken(o[1]); | 64 checkAuthToken(o[1]); |
30 } | 65 } |
31 | 66 |
32 buildUnnamed1070() { | 67 buildUnnamed1216() { |
33 var o = new core.List<core.String>(); | 68 var o = new core.List<core.String>(); |
34 o.add("foo"); | 69 o.add("foo"); |
35 o.add("foo"); | 70 o.add("foo"); |
36 return o; | 71 return o; |
37 } | 72 } |
38 | 73 |
39 checkUnnamed1070(core.List<core.String> o) { | 74 checkUnnamed1216(core.List<core.String> o) { |
40 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
41 unittest.expect(o[0], unittest.equals('foo')); | 76 unittest.expect(o[0], unittest.equals('foo')); |
42 unittest.expect(o[1], unittest.equals('foo')); | 77 unittest.expect(o[1], unittest.equals('foo')); |
43 } | 78 } |
44 | 79 |
45 buildUnnamed1071() { | 80 buildUnnamed1217() { |
46 var o = new core.List<api.UserData>(); | 81 var o = new core.List<api.UserData>(); |
47 o.add(buildUserData()); | 82 o.add(buildUserData()); |
48 o.add(buildUserData()); | 83 o.add(buildUserData()); |
49 return o; | 84 return o; |
50 } | 85 } |
51 | 86 |
52 checkUnnamed1071(core.List<api.UserData> o) { | 87 checkUnnamed1217(core.List<api.UserData> o) { |
53 unittest.expect(o, unittest.hasLength(2)); | 88 unittest.expect(o, unittest.hasLength(2)); |
54 checkUserData(o[0]); | 89 checkUserData(o[0]); |
55 checkUserData(o[1]); | 90 checkUserData(o[1]); |
56 } | 91 } |
57 | 92 |
58 core.int buildCounterAccount = 0; | 93 core.int buildCounterAccount = 0; |
59 buildAccount() { | 94 buildAccount() { |
60 var o = new api.Account(); | 95 var o = new api.Account(); |
61 buildCounterAccount++; | 96 buildCounterAccount++; |
62 if (buildCounterAccount < 3) { | 97 if (buildCounterAccount < 3) { |
63 o.authTokens = buildUnnamed1069(); | 98 o.authTokens = buildUnnamed1215(); |
64 o.features = buildUnnamed1070(); | 99 o.features = buildUnnamed1216(); |
65 o.password = "foo"; | 100 o.password = "foo"; |
66 o.userData = buildUnnamed1071(); | 101 o.userData = buildUnnamed1217(); |
67 } | 102 } |
68 buildCounterAccount--; | 103 buildCounterAccount--; |
69 return o; | 104 return o; |
70 } | 105 } |
71 | 106 |
72 checkAccount(api.Account o) { | 107 checkAccount(api.Account o) { |
73 buildCounterAccount++; | 108 buildCounterAccount++; |
74 if (buildCounterAccount < 3) { | 109 if (buildCounterAccount < 3) { |
75 checkUnnamed1069(o.authTokens); | 110 checkUnnamed1215(o.authTokens); |
76 checkUnnamed1070(o.features); | 111 checkUnnamed1216(o.features); |
77 unittest.expect(o.password, unittest.equals('foo')); | 112 unittest.expect(o.password, unittest.equals('foo')); |
78 checkUnnamed1071(o.userData); | 113 checkUnnamed1217(o.userData); |
79 } | 114 } |
80 buildCounterAccount--; | 115 buildCounterAccount--; |
81 } | 116 } |
82 | 117 |
83 core.int buildCounterAttachment = 0; | 118 core.int buildCounterAttachment = 0; |
84 buildAttachment() { | 119 buildAttachment() { |
85 var o = new api.Attachment(); | 120 var o = new api.Attachment(); |
86 buildCounterAttachment++; | 121 buildCounterAttachment++; |
87 if (buildCounterAttachment < 3) { | 122 if (buildCounterAttachment < 3) { |
88 o.contentType = "foo"; | 123 o.contentType = "foo"; |
89 o.contentUrl = "foo"; | 124 o.contentUrl = "foo"; |
90 o.id = "foo"; | 125 o.id = "foo"; |
91 o.isProcessingContent = true; | 126 o.isProcessingContent = true; |
92 } | 127 } |
93 buildCounterAttachment--; | 128 buildCounterAttachment--; |
94 return o; | 129 return o; |
95 } | 130 } |
96 | 131 |
97 checkAttachment(api.Attachment o) { | 132 checkAttachment(api.Attachment o) { |
98 buildCounterAttachment++; | 133 buildCounterAttachment++; |
99 if (buildCounterAttachment < 3) { | 134 if (buildCounterAttachment < 3) { |
100 unittest.expect(o.contentType, unittest.equals('foo')); | 135 unittest.expect(o.contentType, unittest.equals('foo')); |
101 unittest.expect(o.contentUrl, unittest.equals('foo')); | 136 unittest.expect(o.contentUrl, unittest.equals('foo')); |
102 unittest.expect(o.id, unittest.equals('foo')); | 137 unittest.expect(o.id, unittest.equals('foo')); |
103 unittest.expect(o.isProcessingContent, unittest.isTrue); | 138 unittest.expect(o.isProcessingContent, unittest.isTrue); |
104 } | 139 } |
105 buildCounterAttachment--; | 140 buildCounterAttachment--; |
106 } | 141 } |
107 | 142 |
108 buildUnnamed1072() { | 143 buildUnnamed1218() { |
109 var o = new core.List<api.Attachment>(); | 144 var o = new core.List<api.Attachment>(); |
110 o.add(buildAttachment()); | 145 o.add(buildAttachment()); |
111 o.add(buildAttachment()); | 146 o.add(buildAttachment()); |
112 return o; | 147 return o; |
113 } | 148 } |
114 | 149 |
115 checkUnnamed1072(core.List<api.Attachment> o) { | 150 checkUnnamed1218(core.List<api.Attachment> o) { |
116 unittest.expect(o, unittest.hasLength(2)); | 151 unittest.expect(o, unittest.hasLength(2)); |
117 checkAttachment(o[0]); | 152 checkAttachment(o[0]); |
118 checkAttachment(o[1]); | 153 checkAttachment(o[1]); |
119 } | 154 } |
120 | 155 |
121 core.int buildCounterAttachmentsListResponse = 0; | 156 core.int buildCounterAttachmentsListResponse = 0; |
122 buildAttachmentsListResponse() { | 157 buildAttachmentsListResponse() { |
123 var o = new api.AttachmentsListResponse(); | 158 var o = new api.AttachmentsListResponse(); |
124 buildCounterAttachmentsListResponse++; | 159 buildCounterAttachmentsListResponse++; |
125 if (buildCounterAttachmentsListResponse < 3) { | 160 if (buildCounterAttachmentsListResponse < 3) { |
126 o.items = buildUnnamed1072(); | 161 o.items = buildUnnamed1218(); |
127 o.kind = "foo"; | 162 o.kind = "foo"; |
128 } | 163 } |
129 buildCounterAttachmentsListResponse--; | 164 buildCounterAttachmentsListResponse--; |
130 return o; | 165 return o; |
131 } | 166 } |
132 | 167 |
133 checkAttachmentsListResponse(api.AttachmentsListResponse o) { | 168 checkAttachmentsListResponse(api.AttachmentsListResponse o) { |
134 buildCounterAttachmentsListResponse++; | 169 buildCounterAttachmentsListResponse++; |
135 if (buildCounterAttachmentsListResponse < 3) { | 170 if (buildCounterAttachmentsListResponse < 3) { |
136 checkUnnamed1072(o.items); | 171 checkUnnamed1218(o.items); |
137 unittest.expect(o.kind, unittest.equals('foo')); | 172 unittest.expect(o.kind, unittest.equals('foo')); |
138 } | 173 } |
139 buildCounterAttachmentsListResponse--; | 174 buildCounterAttachmentsListResponse--; |
140 } | 175 } |
141 | 176 |
142 core.int buildCounterAuthToken = 0; | 177 core.int buildCounterAuthToken = 0; |
143 buildAuthToken() { | 178 buildAuthToken() { |
144 var o = new api.AuthToken(); | 179 var o = new api.AuthToken(); |
145 buildCounterAuthToken++; | 180 buildCounterAuthToken++; |
146 if (buildCounterAuthToken < 3) { | 181 if (buildCounterAuthToken < 3) { |
(...skipping 25 matching lines...) Expand all Loading... |
172 } | 207 } |
173 | 208 |
174 checkCommand(api.Command o) { | 209 checkCommand(api.Command o) { |
175 buildCounterCommand++; | 210 buildCounterCommand++; |
176 if (buildCounterCommand < 3) { | 211 if (buildCounterCommand < 3) { |
177 unittest.expect(o.type, unittest.equals('foo')); | 212 unittest.expect(o.type, unittest.equals('foo')); |
178 } | 213 } |
179 buildCounterCommand--; | 214 buildCounterCommand--; |
180 } | 215 } |
181 | 216 |
182 buildUnnamed1073() { | 217 buildUnnamed1219() { |
183 var o = new core.List<api.Command>(); | 218 var o = new core.List<api.Command>(); |
184 o.add(buildCommand()); | 219 o.add(buildCommand()); |
185 o.add(buildCommand()); | 220 o.add(buildCommand()); |
186 return o; | 221 return o; |
187 } | 222 } |
188 | 223 |
189 checkUnnamed1073(core.List<api.Command> o) { | 224 checkUnnamed1219(core.List<api.Command> o) { |
190 unittest.expect(o, unittest.hasLength(2)); | 225 unittest.expect(o, unittest.hasLength(2)); |
191 checkCommand(o[0]); | 226 checkCommand(o[0]); |
192 checkCommand(o[1]); | 227 checkCommand(o[1]); |
193 } | 228 } |
194 | 229 |
195 buildUnnamed1074() { | 230 buildUnnamed1220() { |
196 var o = new core.List<core.String>(); | 231 var o = new core.List<core.String>(); |
197 o.add("foo"); | 232 o.add("foo"); |
198 o.add("foo"); | 233 o.add("foo"); |
199 return o; | 234 return o; |
200 } | 235 } |
201 | 236 |
202 checkUnnamed1074(core.List<core.String> o) { | 237 checkUnnamed1220(core.List<core.String> o) { |
203 unittest.expect(o, unittest.hasLength(2)); | 238 unittest.expect(o, unittest.hasLength(2)); |
204 unittest.expect(o[0], unittest.equals('foo')); | 239 unittest.expect(o[0], unittest.equals('foo')); |
205 unittest.expect(o[1], unittest.equals('foo')); | 240 unittest.expect(o[1], unittest.equals('foo')); |
206 } | 241 } |
207 | 242 |
208 buildUnnamed1075() { | 243 buildUnnamed1221() { |
209 var o = new core.List<core.String>(); | 244 var o = new core.List<core.String>(); |
210 o.add("foo"); | 245 o.add("foo"); |
211 o.add("foo"); | 246 o.add("foo"); |
212 return o; | 247 return o; |
213 } | 248 } |
214 | 249 |
215 checkUnnamed1075(core.List<core.String> o) { | 250 checkUnnamed1221(core.List<core.String> o) { |
216 unittest.expect(o, unittest.hasLength(2)); | 251 unittest.expect(o, unittest.hasLength(2)); |
217 unittest.expect(o[0], unittest.equals('foo')); | 252 unittest.expect(o[0], unittest.equals('foo')); |
218 unittest.expect(o[1], unittest.equals('foo')); | 253 unittest.expect(o[1], unittest.equals('foo')); |
219 } | 254 } |
220 | 255 |
221 buildUnnamed1076() { | 256 buildUnnamed1222() { |
222 var o = new core.List<core.String>(); | 257 var o = new core.List<core.String>(); |
223 o.add("foo"); | 258 o.add("foo"); |
224 o.add("foo"); | 259 o.add("foo"); |
225 return o; | 260 return o; |
226 } | 261 } |
227 | 262 |
228 checkUnnamed1076(core.List<core.String> o) { | 263 checkUnnamed1222(core.List<core.String> o) { |
229 unittest.expect(o, unittest.hasLength(2)); | 264 unittest.expect(o, unittest.hasLength(2)); |
230 unittest.expect(o[0], unittest.equals('foo')); | 265 unittest.expect(o[0], unittest.equals('foo')); |
231 unittest.expect(o[1], unittest.equals('foo')); | 266 unittest.expect(o[1], unittest.equals('foo')); |
232 } | 267 } |
233 | 268 |
234 core.int buildCounterContact = 0; | 269 core.int buildCounterContact = 0; |
235 buildContact() { | 270 buildContact() { |
236 var o = new api.Contact(); | 271 var o = new api.Contact(); |
237 buildCounterContact++; | 272 buildCounterContact++; |
238 if (buildCounterContact < 3) { | 273 if (buildCounterContact < 3) { |
239 o.acceptCommands = buildUnnamed1073(); | 274 o.acceptCommands = buildUnnamed1219(); |
240 o.acceptTypes = buildUnnamed1074(); | 275 o.acceptTypes = buildUnnamed1220(); |
241 o.displayName = "foo"; | 276 o.displayName = "foo"; |
242 o.id = "foo"; | 277 o.id = "foo"; |
243 o.imageUrls = buildUnnamed1075(); | 278 o.imageUrls = buildUnnamed1221(); |
244 o.kind = "foo"; | 279 o.kind = "foo"; |
245 o.phoneNumber = "foo"; | 280 o.phoneNumber = "foo"; |
246 o.priority = 42; | 281 o.priority = 42; |
247 o.sharingFeatures = buildUnnamed1076(); | 282 o.sharingFeatures = buildUnnamed1222(); |
248 o.source = "foo"; | 283 o.source = "foo"; |
249 o.speakableName = "foo"; | 284 o.speakableName = "foo"; |
250 o.type = "foo"; | 285 o.type = "foo"; |
251 } | 286 } |
252 buildCounterContact--; | 287 buildCounterContact--; |
253 return o; | 288 return o; |
254 } | 289 } |
255 | 290 |
256 checkContact(api.Contact o) { | 291 checkContact(api.Contact o) { |
257 buildCounterContact++; | 292 buildCounterContact++; |
258 if (buildCounterContact < 3) { | 293 if (buildCounterContact < 3) { |
259 checkUnnamed1073(o.acceptCommands); | 294 checkUnnamed1219(o.acceptCommands); |
260 checkUnnamed1074(o.acceptTypes); | 295 checkUnnamed1220(o.acceptTypes); |
261 unittest.expect(o.displayName, unittest.equals('foo')); | 296 unittest.expect(o.displayName, unittest.equals('foo')); |
262 unittest.expect(o.id, unittest.equals('foo')); | 297 unittest.expect(o.id, unittest.equals('foo')); |
263 checkUnnamed1075(o.imageUrls); | 298 checkUnnamed1221(o.imageUrls); |
264 unittest.expect(o.kind, unittest.equals('foo')); | 299 unittest.expect(o.kind, unittest.equals('foo')); |
265 unittest.expect(o.phoneNumber, unittest.equals('foo')); | 300 unittest.expect(o.phoneNumber, unittest.equals('foo')); |
266 unittest.expect(o.priority, unittest.equals(42)); | 301 unittest.expect(o.priority, unittest.equals(42)); |
267 checkUnnamed1076(o.sharingFeatures); | 302 checkUnnamed1222(o.sharingFeatures); |
268 unittest.expect(o.source, unittest.equals('foo')); | 303 unittest.expect(o.source, unittest.equals('foo')); |
269 unittest.expect(o.speakableName, unittest.equals('foo')); | 304 unittest.expect(o.speakableName, unittest.equals('foo')); |
270 unittest.expect(o.type, unittest.equals('foo')); | 305 unittest.expect(o.type, unittest.equals('foo')); |
271 } | 306 } |
272 buildCounterContact--; | 307 buildCounterContact--; |
273 } | 308 } |
274 | 309 |
275 buildUnnamed1077() { | 310 buildUnnamed1223() { |
276 var o = new core.List<api.Contact>(); | 311 var o = new core.List<api.Contact>(); |
277 o.add(buildContact()); | 312 o.add(buildContact()); |
278 o.add(buildContact()); | 313 o.add(buildContact()); |
279 return o; | 314 return o; |
280 } | 315 } |
281 | 316 |
282 checkUnnamed1077(core.List<api.Contact> o) { | 317 checkUnnamed1223(core.List<api.Contact> o) { |
283 unittest.expect(o, unittest.hasLength(2)); | 318 unittest.expect(o, unittest.hasLength(2)); |
284 checkContact(o[0]); | 319 checkContact(o[0]); |
285 checkContact(o[1]); | 320 checkContact(o[1]); |
286 } | 321 } |
287 | 322 |
288 core.int buildCounterContactsListResponse = 0; | 323 core.int buildCounterContactsListResponse = 0; |
289 buildContactsListResponse() { | 324 buildContactsListResponse() { |
290 var o = new api.ContactsListResponse(); | 325 var o = new api.ContactsListResponse(); |
291 buildCounterContactsListResponse++; | 326 buildCounterContactsListResponse++; |
292 if (buildCounterContactsListResponse < 3) { | 327 if (buildCounterContactsListResponse < 3) { |
293 o.items = buildUnnamed1077(); | 328 o.items = buildUnnamed1223(); |
294 o.kind = "foo"; | 329 o.kind = "foo"; |
295 } | 330 } |
296 buildCounterContactsListResponse--; | 331 buildCounterContactsListResponse--; |
297 return o; | 332 return o; |
298 } | 333 } |
299 | 334 |
300 checkContactsListResponse(api.ContactsListResponse o) { | 335 checkContactsListResponse(api.ContactsListResponse o) { |
301 buildCounterContactsListResponse++; | 336 buildCounterContactsListResponse++; |
302 if (buildCounterContactsListResponse < 3) { | 337 if (buildCounterContactsListResponse < 3) { |
303 checkUnnamed1077(o.items); | 338 checkUnnamed1223(o.items); |
304 unittest.expect(o.kind, unittest.equals('foo')); | 339 unittest.expect(o.kind, unittest.equals('foo')); |
305 } | 340 } |
306 buildCounterContactsListResponse--; | 341 buildCounterContactsListResponse--; |
307 } | 342 } |
308 | 343 |
309 core.int buildCounterLocation = 0; | 344 core.int buildCounterLocation = 0; |
310 buildLocation() { | 345 buildLocation() { |
311 var o = new api.Location(); | 346 var o = new api.Location(); |
312 buildCounterLocation++; | 347 buildCounterLocation++; |
313 if (buildCounterLocation < 3) { | 348 if (buildCounterLocation < 3) { |
(...skipping 18 matching lines...) Expand all Loading... |
332 unittest.expect(o.displayName, unittest.equals('foo')); | 367 unittest.expect(o.displayName, unittest.equals('foo')); |
333 unittest.expect(o.id, unittest.equals('foo')); | 368 unittest.expect(o.id, unittest.equals('foo')); |
334 unittest.expect(o.kind, unittest.equals('foo')); | 369 unittest.expect(o.kind, unittest.equals('foo')); |
335 unittest.expect(o.latitude, unittest.equals(42.0)); | 370 unittest.expect(o.latitude, unittest.equals(42.0)); |
336 unittest.expect(o.longitude, unittest.equals(42.0)); | 371 unittest.expect(o.longitude, unittest.equals(42.0)); |
337 unittest.expect(o.timestamp, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 372 unittest.expect(o.timestamp, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); |
338 } | 373 } |
339 buildCounterLocation--; | 374 buildCounterLocation--; |
340 } | 375 } |
341 | 376 |
342 buildUnnamed1078() { | 377 buildUnnamed1224() { |
343 var o = new core.List<api.Location>(); | 378 var o = new core.List<api.Location>(); |
344 o.add(buildLocation()); | 379 o.add(buildLocation()); |
345 o.add(buildLocation()); | 380 o.add(buildLocation()); |
346 return o; | 381 return o; |
347 } | 382 } |
348 | 383 |
349 checkUnnamed1078(core.List<api.Location> o) { | 384 checkUnnamed1224(core.List<api.Location> o) { |
350 unittest.expect(o, unittest.hasLength(2)); | 385 unittest.expect(o, unittest.hasLength(2)); |
351 checkLocation(o[0]); | 386 checkLocation(o[0]); |
352 checkLocation(o[1]); | 387 checkLocation(o[1]); |
353 } | 388 } |
354 | 389 |
355 core.int buildCounterLocationsListResponse = 0; | 390 core.int buildCounterLocationsListResponse = 0; |
356 buildLocationsListResponse() { | 391 buildLocationsListResponse() { |
357 var o = new api.LocationsListResponse(); | 392 var o = new api.LocationsListResponse(); |
358 buildCounterLocationsListResponse++; | 393 buildCounterLocationsListResponse++; |
359 if (buildCounterLocationsListResponse < 3) { | 394 if (buildCounterLocationsListResponse < 3) { |
360 o.items = buildUnnamed1078(); | 395 o.items = buildUnnamed1224(); |
361 o.kind = "foo"; | 396 o.kind = "foo"; |
362 } | 397 } |
363 buildCounterLocationsListResponse--; | 398 buildCounterLocationsListResponse--; |
364 return o; | 399 return o; |
365 } | 400 } |
366 | 401 |
367 checkLocationsListResponse(api.LocationsListResponse o) { | 402 checkLocationsListResponse(api.LocationsListResponse o) { |
368 buildCounterLocationsListResponse++; | 403 buildCounterLocationsListResponse++; |
369 if (buildCounterLocationsListResponse < 3) { | 404 if (buildCounterLocationsListResponse < 3) { |
370 checkUnnamed1078(o.items); | 405 checkUnnamed1224(o.items); |
371 unittest.expect(o.kind, unittest.equals('foo')); | 406 unittest.expect(o.kind, unittest.equals('foo')); |
372 } | 407 } |
373 buildCounterLocationsListResponse--; | 408 buildCounterLocationsListResponse--; |
374 } | 409 } |
375 | 410 |
376 buildUnnamed1079() { | 411 buildUnnamed1225() { |
377 var o = new core.List<api.MenuValue>(); | 412 var o = new core.List<api.MenuValue>(); |
378 o.add(buildMenuValue()); | 413 o.add(buildMenuValue()); |
379 o.add(buildMenuValue()); | 414 o.add(buildMenuValue()); |
380 return o; | 415 return o; |
381 } | 416 } |
382 | 417 |
383 checkUnnamed1079(core.List<api.MenuValue> o) { | 418 checkUnnamed1225(core.List<api.MenuValue> o) { |
384 unittest.expect(o, unittest.hasLength(2)); | 419 unittest.expect(o, unittest.hasLength(2)); |
385 checkMenuValue(o[0]); | 420 checkMenuValue(o[0]); |
386 checkMenuValue(o[1]); | 421 checkMenuValue(o[1]); |
387 } | 422 } |
388 | 423 |
389 core.int buildCounterMenuItem = 0; | 424 core.int buildCounterMenuItem = 0; |
390 buildMenuItem() { | 425 buildMenuItem() { |
391 var o = new api.MenuItem(); | 426 var o = new api.MenuItem(); |
392 buildCounterMenuItem++; | 427 buildCounterMenuItem++; |
393 if (buildCounterMenuItem < 3) { | 428 if (buildCounterMenuItem < 3) { |
394 o.action = "foo"; | 429 o.action = "foo"; |
395 o.contextualCommand = "foo"; | 430 o.contextualCommand = "foo"; |
396 o.id = "foo"; | 431 o.id = "foo"; |
397 o.payload = "foo"; | 432 o.payload = "foo"; |
398 o.removeWhenSelected = true; | 433 o.removeWhenSelected = true; |
399 o.values = buildUnnamed1079(); | 434 o.values = buildUnnamed1225(); |
400 } | 435 } |
401 buildCounterMenuItem--; | 436 buildCounterMenuItem--; |
402 return o; | 437 return o; |
403 } | 438 } |
404 | 439 |
405 checkMenuItem(api.MenuItem o) { | 440 checkMenuItem(api.MenuItem o) { |
406 buildCounterMenuItem++; | 441 buildCounterMenuItem++; |
407 if (buildCounterMenuItem < 3) { | 442 if (buildCounterMenuItem < 3) { |
408 unittest.expect(o.action, unittest.equals('foo')); | 443 unittest.expect(o.action, unittest.equals('foo')); |
409 unittest.expect(o.contextualCommand, unittest.equals('foo')); | 444 unittest.expect(o.contextualCommand, unittest.equals('foo')); |
410 unittest.expect(o.id, unittest.equals('foo')); | 445 unittest.expect(o.id, unittest.equals('foo')); |
411 unittest.expect(o.payload, unittest.equals('foo')); | 446 unittest.expect(o.payload, unittest.equals('foo')); |
412 unittest.expect(o.removeWhenSelected, unittest.isTrue); | 447 unittest.expect(o.removeWhenSelected, unittest.isTrue); |
413 checkUnnamed1079(o.values); | 448 checkUnnamed1225(o.values); |
414 } | 449 } |
415 buildCounterMenuItem--; | 450 buildCounterMenuItem--; |
416 } | 451 } |
417 | 452 |
418 core.int buildCounterMenuValue = 0; | 453 core.int buildCounterMenuValue = 0; |
419 buildMenuValue() { | 454 buildMenuValue() { |
420 var o = new api.MenuValue(); | 455 var o = new api.MenuValue(); |
421 buildCounterMenuValue++; | 456 buildCounterMenuValue++; |
422 if (buildCounterMenuValue < 3) { | 457 if (buildCounterMenuValue < 3) { |
423 o.displayName = "foo"; | 458 o.displayName = "foo"; |
424 o.iconUrl = "foo"; | 459 o.iconUrl = "foo"; |
425 o.state = "foo"; | 460 o.state = "foo"; |
426 } | 461 } |
427 buildCounterMenuValue--; | 462 buildCounterMenuValue--; |
428 return o; | 463 return o; |
429 } | 464 } |
430 | 465 |
431 checkMenuValue(api.MenuValue o) { | 466 checkMenuValue(api.MenuValue o) { |
432 buildCounterMenuValue++; | 467 buildCounterMenuValue++; |
433 if (buildCounterMenuValue < 3) { | 468 if (buildCounterMenuValue < 3) { |
434 unittest.expect(o.displayName, unittest.equals('foo')); | 469 unittest.expect(o.displayName, unittest.equals('foo')); |
435 unittest.expect(o.iconUrl, unittest.equals('foo')); | 470 unittest.expect(o.iconUrl, unittest.equals('foo')); |
436 unittest.expect(o.state, unittest.equals('foo')); | 471 unittest.expect(o.state, unittest.equals('foo')); |
437 } | 472 } |
438 buildCounterMenuValue--; | 473 buildCounterMenuValue--; |
439 } | 474 } |
440 | 475 |
441 buildUnnamed1080() { | 476 buildUnnamed1226() { |
442 var o = new core.List<api.UserAction>(); | 477 var o = new core.List<api.UserAction>(); |
443 o.add(buildUserAction()); | 478 o.add(buildUserAction()); |
444 o.add(buildUserAction()); | 479 o.add(buildUserAction()); |
445 return o; | 480 return o; |
446 } | 481 } |
447 | 482 |
448 checkUnnamed1080(core.List<api.UserAction> o) { | 483 checkUnnamed1226(core.List<api.UserAction> o) { |
449 unittest.expect(o, unittest.hasLength(2)); | 484 unittest.expect(o, unittest.hasLength(2)); |
450 checkUserAction(o[0]); | 485 checkUserAction(o[0]); |
451 checkUserAction(o[1]); | 486 checkUserAction(o[1]); |
452 } | 487 } |
453 | 488 |
454 core.int buildCounterNotification = 0; | 489 core.int buildCounterNotification = 0; |
455 buildNotification() { | 490 buildNotification() { |
456 var o = new api.Notification(); | 491 var o = new api.Notification(); |
457 buildCounterNotification++; | 492 buildCounterNotification++; |
458 if (buildCounterNotification < 3) { | 493 if (buildCounterNotification < 3) { |
459 o.collection = "foo"; | 494 o.collection = "foo"; |
460 o.itemId = "foo"; | 495 o.itemId = "foo"; |
461 o.operation = "foo"; | 496 o.operation = "foo"; |
462 o.userActions = buildUnnamed1080(); | 497 o.userActions = buildUnnamed1226(); |
463 o.userToken = "foo"; | 498 o.userToken = "foo"; |
464 o.verifyToken = "foo"; | 499 o.verifyToken = "foo"; |
465 } | 500 } |
466 buildCounterNotification--; | 501 buildCounterNotification--; |
467 return o; | 502 return o; |
468 } | 503 } |
469 | 504 |
470 checkNotification(api.Notification o) { | 505 checkNotification(api.Notification o) { |
471 buildCounterNotification++; | 506 buildCounterNotification++; |
472 if (buildCounterNotification < 3) { | 507 if (buildCounterNotification < 3) { |
473 unittest.expect(o.collection, unittest.equals('foo')); | 508 unittest.expect(o.collection, unittest.equals('foo')); |
474 unittest.expect(o.itemId, unittest.equals('foo')); | 509 unittest.expect(o.itemId, unittest.equals('foo')); |
475 unittest.expect(o.operation, unittest.equals('foo')); | 510 unittest.expect(o.operation, unittest.equals('foo')); |
476 checkUnnamed1080(o.userActions); | 511 checkUnnamed1226(o.userActions); |
477 unittest.expect(o.userToken, unittest.equals('foo')); | 512 unittest.expect(o.userToken, unittest.equals('foo')); |
478 unittest.expect(o.verifyToken, unittest.equals('foo')); | 513 unittest.expect(o.verifyToken, unittest.equals('foo')); |
479 } | 514 } |
480 buildCounterNotification--; | 515 buildCounterNotification--; |
481 } | 516 } |
482 | 517 |
483 core.int buildCounterNotificationConfig = 0; | 518 core.int buildCounterNotificationConfig = 0; |
484 buildNotificationConfig() { | 519 buildNotificationConfig() { |
485 var o = new api.NotificationConfig(); | 520 var o = new api.NotificationConfig(); |
486 buildCounterNotificationConfig++; | 521 buildCounterNotificationConfig++; |
(...skipping 30 matching lines...) Expand all Loading... |
517 checkSetting(api.Setting o) { | 552 checkSetting(api.Setting o) { |
518 buildCounterSetting++; | 553 buildCounterSetting++; |
519 if (buildCounterSetting < 3) { | 554 if (buildCounterSetting < 3) { |
520 unittest.expect(o.id, unittest.equals('foo')); | 555 unittest.expect(o.id, unittest.equals('foo')); |
521 unittest.expect(o.kind, unittest.equals('foo')); | 556 unittest.expect(o.kind, unittest.equals('foo')); |
522 unittest.expect(o.value, unittest.equals('foo')); | 557 unittest.expect(o.value, unittest.equals('foo')); |
523 } | 558 } |
524 buildCounterSetting--; | 559 buildCounterSetting--; |
525 } | 560 } |
526 | 561 |
527 buildUnnamed1081() { | 562 buildUnnamed1227() { |
528 var o = new core.List<core.String>(); | 563 var o = new core.List<core.String>(); |
529 o.add("foo"); | 564 o.add("foo"); |
530 o.add("foo"); | 565 o.add("foo"); |
531 return o; | 566 return o; |
532 } | 567 } |
533 | 568 |
534 checkUnnamed1081(core.List<core.String> o) { | 569 checkUnnamed1227(core.List<core.String> o) { |
535 unittest.expect(o, unittest.hasLength(2)); | 570 unittest.expect(o, unittest.hasLength(2)); |
536 unittest.expect(o[0], unittest.equals('foo')); | 571 unittest.expect(o[0], unittest.equals('foo')); |
537 unittest.expect(o[1], unittest.equals('foo')); | 572 unittest.expect(o[1], unittest.equals('foo')); |
538 } | 573 } |
539 | 574 |
540 core.int buildCounterSubscription = 0; | 575 core.int buildCounterSubscription = 0; |
541 buildSubscription() { | 576 buildSubscription() { |
542 var o = new api.Subscription(); | 577 var o = new api.Subscription(); |
543 buildCounterSubscription++; | 578 buildCounterSubscription++; |
544 if (buildCounterSubscription < 3) { | 579 if (buildCounterSubscription < 3) { |
545 o.callbackUrl = "foo"; | 580 o.callbackUrl = "foo"; |
546 o.collection = "foo"; | 581 o.collection = "foo"; |
547 o.id = "foo"; | 582 o.id = "foo"; |
548 o.kind = "foo"; | 583 o.kind = "foo"; |
549 o.notification = buildNotification(); | 584 o.notification = buildNotification(); |
550 o.operation = buildUnnamed1081(); | 585 o.operation = buildUnnamed1227(); |
551 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | 586 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
552 o.userToken = "foo"; | 587 o.userToken = "foo"; |
553 o.verifyToken = "foo"; | 588 o.verifyToken = "foo"; |
554 } | 589 } |
555 buildCounterSubscription--; | 590 buildCounterSubscription--; |
556 return o; | 591 return o; |
557 } | 592 } |
558 | 593 |
559 checkSubscription(api.Subscription o) { | 594 checkSubscription(api.Subscription o) { |
560 buildCounterSubscription++; | 595 buildCounterSubscription++; |
561 if (buildCounterSubscription < 3) { | 596 if (buildCounterSubscription < 3) { |
562 unittest.expect(o.callbackUrl, unittest.equals('foo')); | 597 unittest.expect(o.callbackUrl, unittest.equals('foo')); |
563 unittest.expect(o.collection, unittest.equals('foo')); | 598 unittest.expect(o.collection, unittest.equals('foo')); |
564 unittest.expect(o.id, unittest.equals('foo')); | 599 unittest.expect(o.id, unittest.equals('foo')); |
565 unittest.expect(o.kind, unittest.equals('foo')); | 600 unittest.expect(o.kind, unittest.equals('foo')); |
566 checkNotification(o.notification); | 601 checkNotification(o.notification); |
567 checkUnnamed1081(o.operation); | 602 checkUnnamed1227(o.operation); |
568 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 603 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
569 unittest.expect(o.userToken, unittest.equals('foo')); | 604 unittest.expect(o.userToken, unittest.equals('foo')); |
570 unittest.expect(o.verifyToken, unittest.equals('foo')); | 605 unittest.expect(o.verifyToken, unittest.equals('foo')); |
571 } | 606 } |
572 buildCounterSubscription--; | 607 buildCounterSubscription--; |
573 } | 608 } |
574 | 609 |
575 buildUnnamed1082() { | 610 buildUnnamed1228() { |
576 var o = new core.List<api.Subscription>(); | 611 var o = new core.List<api.Subscription>(); |
577 o.add(buildSubscription()); | 612 o.add(buildSubscription()); |
578 o.add(buildSubscription()); | 613 o.add(buildSubscription()); |
579 return o; | 614 return o; |
580 } | 615 } |
581 | 616 |
582 checkUnnamed1082(core.List<api.Subscription> o) { | 617 checkUnnamed1228(core.List<api.Subscription> o) { |
583 unittest.expect(o, unittest.hasLength(2)); | 618 unittest.expect(o, unittest.hasLength(2)); |
584 checkSubscription(o[0]); | 619 checkSubscription(o[0]); |
585 checkSubscription(o[1]); | 620 checkSubscription(o[1]); |
586 } | 621 } |
587 | 622 |
588 core.int buildCounterSubscriptionsListResponse = 0; | 623 core.int buildCounterSubscriptionsListResponse = 0; |
589 buildSubscriptionsListResponse() { | 624 buildSubscriptionsListResponse() { |
590 var o = new api.SubscriptionsListResponse(); | 625 var o = new api.SubscriptionsListResponse(); |
591 buildCounterSubscriptionsListResponse++; | 626 buildCounterSubscriptionsListResponse++; |
592 if (buildCounterSubscriptionsListResponse < 3) { | 627 if (buildCounterSubscriptionsListResponse < 3) { |
593 o.items = buildUnnamed1082(); | 628 o.items = buildUnnamed1228(); |
594 o.kind = "foo"; | 629 o.kind = "foo"; |
595 } | 630 } |
596 buildCounterSubscriptionsListResponse--; | 631 buildCounterSubscriptionsListResponse--; |
597 return o; | 632 return o; |
598 } | 633 } |
599 | 634 |
600 checkSubscriptionsListResponse(api.SubscriptionsListResponse o) { | 635 checkSubscriptionsListResponse(api.SubscriptionsListResponse o) { |
601 buildCounterSubscriptionsListResponse++; | 636 buildCounterSubscriptionsListResponse++; |
602 if (buildCounterSubscriptionsListResponse < 3) { | 637 if (buildCounterSubscriptionsListResponse < 3) { |
603 checkUnnamed1082(o.items); | 638 checkUnnamed1228(o.items); |
604 unittest.expect(o.kind, unittest.equals('foo')); | 639 unittest.expect(o.kind, unittest.equals('foo')); |
605 } | 640 } |
606 buildCounterSubscriptionsListResponse--; | 641 buildCounterSubscriptionsListResponse--; |
607 } | 642 } |
608 | 643 |
609 buildUnnamed1083() { | 644 buildUnnamed1229() { |
610 var o = new core.List<api.Attachment>(); | 645 var o = new core.List<api.Attachment>(); |
611 o.add(buildAttachment()); | 646 o.add(buildAttachment()); |
612 o.add(buildAttachment()); | 647 o.add(buildAttachment()); |
613 return o; | 648 return o; |
614 } | 649 } |
615 | 650 |
616 checkUnnamed1083(core.List<api.Attachment> o) { | 651 checkUnnamed1229(core.List<api.Attachment> o) { |
617 unittest.expect(o, unittest.hasLength(2)); | 652 unittest.expect(o, unittest.hasLength(2)); |
618 checkAttachment(o[0]); | 653 checkAttachment(o[0]); |
619 checkAttachment(o[1]); | 654 checkAttachment(o[1]); |
620 } | 655 } |
621 | 656 |
622 buildUnnamed1084() { | 657 buildUnnamed1230() { |
623 var o = new core.List<api.MenuItem>(); | 658 var o = new core.List<api.MenuItem>(); |
624 o.add(buildMenuItem()); | 659 o.add(buildMenuItem()); |
625 o.add(buildMenuItem()); | 660 o.add(buildMenuItem()); |
626 return o; | 661 return o; |
627 } | 662 } |
628 | 663 |
629 checkUnnamed1084(core.List<api.MenuItem> o) { | 664 checkUnnamed1230(core.List<api.MenuItem> o) { |
630 unittest.expect(o, unittest.hasLength(2)); | 665 unittest.expect(o, unittest.hasLength(2)); |
631 checkMenuItem(o[0]); | 666 checkMenuItem(o[0]); |
632 checkMenuItem(o[1]); | 667 checkMenuItem(o[1]); |
633 } | 668 } |
634 | 669 |
635 buildUnnamed1085() { | 670 buildUnnamed1231() { |
636 var o = new core.List<api.Contact>(); | 671 var o = new core.List<api.Contact>(); |
637 o.add(buildContact()); | 672 o.add(buildContact()); |
638 o.add(buildContact()); | 673 o.add(buildContact()); |
639 return o; | 674 return o; |
640 } | 675 } |
641 | 676 |
642 checkUnnamed1085(core.List<api.Contact> o) { | 677 checkUnnamed1231(core.List<api.Contact> o) { |
643 unittest.expect(o, unittest.hasLength(2)); | 678 unittest.expect(o, unittest.hasLength(2)); |
644 checkContact(o[0]); | 679 checkContact(o[0]); |
645 checkContact(o[1]); | 680 checkContact(o[1]); |
646 } | 681 } |
647 | 682 |
648 core.int buildCounterTimelineItem = 0; | 683 core.int buildCounterTimelineItem = 0; |
649 buildTimelineItem() { | 684 buildTimelineItem() { |
650 var o = new api.TimelineItem(); | 685 var o = new api.TimelineItem(); |
651 buildCounterTimelineItem++; | 686 buildCounterTimelineItem++; |
652 if (buildCounterTimelineItem < 3) { | 687 if (buildCounterTimelineItem < 3) { |
653 o.attachments = buildUnnamed1083(); | 688 o.attachments = buildUnnamed1229(); |
654 o.bundleId = "foo"; | 689 o.bundleId = "foo"; |
655 o.canonicalUrl = "foo"; | 690 o.canonicalUrl = "foo"; |
656 o.created = core.DateTime.parse("2002-02-27T14:01:02"); | 691 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
657 o.creator = buildContact(); | 692 o.creator = buildContact(); |
658 o.displayTime = core.DateTime.parse("2002-02-27T14:01:02"); | 693 o.displayTime = core.DateTime.parse("2002-02-27T14:01:02"); |
659 o.etag = "foo"; | 694 o.etag = "foo"; |
660 o.html = "foo"; | 695 o.html = "foo"; |
661 o.id = "foo"; | 696 o.id = "foo"; |
662 o.inReplyTo = "foo"; | 697 o.inReplyTo = "foo"; |
663 o.isBundleCover = true; | 698 o.isBundleCover = true; |
664 o.isDeleted = true; | 699 o.isDeleted = true; |
665 o.isPinned = true; | 700 o.isPinned = true; |
666 o.kind = "foo"; | 701 o.kind = "foo"; |
667 o.location = buildLocation(); | 702 o.location = buildLocation(); |
668 o.menuItems = buildUnnamed1084(); | 703 o.menuItems = buildUnnamed1230(); |
669 o.notification = buildNotificationConfig(); | 704 o.notification = buildNotificationConfig(); |
670 o.pinScore = 42; | 705 o.pinScore = 42; |
671 o.recipients = buildUnnamed1085(); | 706 o.recipients = buildUnnamed1231(); |
672 o.selfLink = "foo"; | 707 o.selfLink = "foo"; |
673 o.sourceItemId = "foo"; | 708 o.sourceItemId = "foo"; |
674 o.speakableText = "foo"; | 709 o.speakableText = "foo"; |
675 o.speakableType = "foo"; | 710 o.speakableType = "foo"; |
676 o.text = "foo"; | 711 o.text = "foo"; |
677 o.title = "foo"; | 712 o.title = "foo"; |
678 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | 713 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
679 } | 714 } |
680 buildCounterTimelineItem--; | 715 buildCounterTimelineItem--; |
681 return o; | 716 return o; |
682 } | 717 } |
683 | 718 |
684 checkTimelineItem(api.TimelineItem o) { | 719 checkTimelineItem(api.TimelineItem o) { |
685 buildCounterTimelineItem++; | 720 buildCounterTimelineItem++; |
686 if (buildCounterTimelineItem < 3) { | 721 if (buildCounterTimelineItem < 3) { |
687 checkUnnamed1083(o.attachments); | 722 checkUnnamed1229(o.attachments); |
688 unittest.expect(o.bundleId, unittest.equals('foo')); | 723 unittest.expect(o.bundleId, unittest.equals('foo')); |
689 unittest.expect(o.canonicalUrl, unittest.equals('foo')); | 724 unittest.expect(o.canonicalUrl, unittest.equals('foo')); |
690 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 725 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
691 checkContact(o.creator); | 726 checkContact(o.creator); |
692 unittest.expect(o.displayTime, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); | 727 unittest.expect(o.displayTime, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); |
693 unittest.expect(o.etag, unittest.equals('foo')); | 728 unittest.expect(o.etag, unittest.equals('foo')); |
694 unittest.expect(o.html, unittest.equals('foo')); | 729 unittest.expect(o.html, unittest.equals('foo')); |
695 unittest.expect(o.id, unittest.equals('foo')); | 730 unittest.expect(o.id, unittest.equals('foo')); |
696 unittest.expect(o.inReplyTo, unittest.equals('foo')); | 731 unittest.expect(o.inReplyTo, unittest.equals('foo')); |
697 unittest.expect(o.isBundleCover, unittest.isTrue); | 732 unittest.expect(o.isBundleCover, unittest.isTrue); |
698 unittest.expect(o.isDeleted, unittest.isTrue); | 733 unittest.expect(o.isDeleted, unittest.isTrue); |
699 unittest.expect(o.isPinned, unittest.isTrue); | 734 unittest.expect(o.isPinned, unittest.isTrue); |
700 unittest.expect(o.kind, unittest.equals('foo')); | 735 unittest.expect(o.kind, unittest.equals('foo')); |
701 checkLocation(o.location); | 736 checkLocation(o.location); |
702 checkUnnamed1084(o.menuItems); | 737 checkUnnamed1230(o.menuItems); |
703 checkNotificationConfig(o.notification); | 738 checkNotificationConfig(o.notification); |
704 unittest.expect(o.pinScore, unittest.equals(42)); | 739 unittest.expect(o.pinScore, unittest.equals(42)); |
705 checkUnnamed1085(o.recipients); | 740 checkUnnamed1231(o.recipients); |
706 unittest.expect(o.selfLink, unittest.equals('foo')); | 741 unittest.expect(o.selfLink, unittest.equals('foo')); |
707 unittest.expect(o.sourceItemId, unittest.equals('foo')); | 742 unittest.expect(o.sourceItemId, unittest.equals('foo')); |
708 unittest.expect(o.speakableText, unittest.equals('foo')); | 743 unittest.expect(o.speakableText, unittest.equals('foo')); |
709 unittest.expect(o.speakableType, unittest.equals('foo')); | 744 unittest.expect(o.speakableType, unittest.equals('foo')); |
710 unittest.expect(o.text, unittest.equals('foo')); | 745 unittest.expect(o.text, unittest.equals('foo')); |
711 unittest.expect(o.title, unittest.equals('foo')); | 746 unittest.expect(o.title, unittest.equals('foo')); |
712 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 747 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
713 } | 748 } |
714 buildCounterTimelineItem--; | 749 buildCounterTimelineItem--; |
715 } | 750 } |
716 | 751 |
717 buildUnnamed1086() { | 752 buildUnnamed1232() { |
718 var o = new core.List<api.TimelineItem>(); | 753 var o = new core.List<api.TimelineItem>(); |
719 o.add(buildTimelineItem()); | 754 o.add(buildTimelineItem()); |
720 o.add(buildTimelineItem()); | 755 o.add(buildTimelineItem()); |
721 return o; | 756 return o; |
722 } | 757 } |
723 | 758 |
724 checkUnnamed1086(core.List<api.TimelineItem> o) { | 759 checkUnnamed1232(core.List<api.TimelineItem> o) { |
725 unittest.expect(o, unittest.hasLength(2)); | 760 unittest.expect(o, unittest.hasLength(2)); |
726 checkTimelineItem(o[0]); | 761 checkTimelineItem(o[0]); |
727 checkTimelineItem(o[1]); | 762 checkTimelineItem(o[1]); |
728 } | 763 } |
729 | 764 |
730 core.int buildCounterTimelineListResponse = 0; | 765 core.int buildCounterTimelineListResponse = 0; |
731 buildTimelineListResponse() { | 766 buildTimelineListResponse() { |
732 var o = new api.TimelineListResponse(); | 767 var o = new api.TimelineListResponse(); |
733 buildCounterTimelineListResponse++; | 768 buildCounterTimelineListResponse++; |
734 if (buildCounterTimelineListResponse < 3) { | 769 if (buildCounterTimelineListResponse < 3) { |
735 o.items = buildUnnamed1086(); | 770 o.items = buildUnnamed1232(); |
736 o.kind = "foo"; | 771 o.kind = "foo"; |
737 o.nextPageToken = "foo"; | 772 o.nextPageToken = "foo"; |
738 } | 773 } |
739 buildCounterTimelineListResponse--; | 774 buildCounterTimelineListResponse--; |
740 return o; | 775 return o; |
741 } | 776 } |
742 | 777 |
743 checkTimelineListResponse(api.TimelineListResponse o) { | 778 checkTimelineListResponse(api.TimelineListResponse o) { |
744 buildCounterTimelineListResponse++; | 779 buildCounterTimelineListResponse++; |
745 if (buildCounterTimelineListResponse < 3) { | 780 if (buildCounterTimelineListResponse < 3) { |
746 checkUnnamed1086(o.items); | 781 checkUnnamed1232(o.items); |
747 unittest.expect(o.kind, unittest.equals('foo')); | 782 unittest.expect(o.kind, unittest.equals('foo')); |
748 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 783 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
749 } | 784 } |
750 buildCounterTimelineListResponse--; | 785 buildCounterTimelineListResponse--; |
751 } | 786 } |
752 | 787 |
753 core.int buildCounterUserAction = 0; | 788 core.int buildCounterUserAction = 0; |
754 buildUserAction() { | 789 buildUserAction() { |
755 var o = new api.UserAction(); | 790 var o = new api.UserAction(); |
756 buildCounterUserAction++; | 791 buildCounterUserAction++; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 var o = buildUserData(); | 1005 var o = buildUserData(); |
971 var od = new api.UserData.fromJson(o.toJson()); | 1006 var od = new api.UserData.fromJson(o.toJson()); |
972 checkUserData(od); | 1007 checkUserData(od); |
973 }); | 1008 }); |
974 }); | 1009 }); |
975 | 1010 |
976 | 1011 |
977 unittest.group("resource-AccountsResourceApi", () { | 1012 unittest.group("resource-AccountsResourceApi", () { |
978 unittest.test("method--insert", () { | 1013 unittest.test("method--insert", () { |
979 | 1014 |
980 var mock = new common_test.HttpServerMock(); | 1015 var mock = new HttpServerMock(); |
981 api.AccountsResourceApi res = new api.MirrorApi(mock).accounts; | 1016 api.AccountsResourceApi res = new api.MirrorApi(mock).accounts; |
982 var arg_request = buildAccount(); | 1017 var arg_request = buildAccount(); |
983 var arg_userToken = "foo"; | 1018 var arg_userToken = "foo"; |
984 var arg_accountType = "foo"; | 1019 var arg_accountType = "foo"; |
985 var arg_accountName = "foo"; | 1020 var arg_accountName = "foo"; |
986 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1021 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
987 var obj = new api.Account.fromJson(json); | 1022 var obj = new api.Account.fromJson(json); |
988 checkAccount(obj); | 1023 checkAccount(obj); |
989 | 1024 |
990 var path = (req.url).path; | 1025 var path = (req.url).path; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 var keyvalue = part.split("="); | 1065 var keyvalue = part.split("="); |
1031 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1066 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1032 } | 1067 } |
1033 } | 1068 } |
1034 | 1069 |
1035 | 1070 |
1036 var h = { | 1071 var h = { |
1037 "content-type" : "application/json; charset=utf-8", | 1072 "content-type" : "application/json; charset=utf-8", |
1038 }; | 1073 }; |
1039 var resp = convert.JSON.encode(buildAccount()); | 1074 var resp = convert.JSON.encode(buildAccount()); |
1040 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1075 return new async.Future.value(stringResponse(200, h, resp)); |
1041 }), true); | 1076 }), true); |
1042 res.insert(arg_request, arg_userToken, arg_accountType, arg_accountName).t
hen(unittest.expectAsync(((api.Account response) { | 1077 res.insert(arg_request, arg_userToken, arg_accountType, arg_accountName).t
hen(unittest.expectAsync(((api.Account response) { |
1043 checkAccount(response); | 1078 checkAccount(response); |
1044 }))); | 1079 }))); |
1045 }); | 1080 }); |
1046 | 1081 |
1047 }); | 1082 }); |
1048 | 1083 |
1049 | 1084 |
1050 unittest.group("resource-ContactsResourceApi", () { | 1085 unittest.group("resource-ContactsResourceApi", () { |
1051 unittest.test("method--delete", () { | 1086 unittest.test("method--delete", () { |
1052 | 1087 |
1053 var mock = new common_test.HttpServerMock(); | 1088 var mock = new HttpServerMock(); |
1054 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1089 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1055 var arg_id = "foo"; | 1090 var arg_id = "foo"; |
1056 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1091 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1057 var path = (req.url).path; | 1092 var path = (req.url).path; |
1058 var pathOffset = 0; | 1093 var pathOffset = 0; |
1059 var index; | 1094 var index; |
1060 var subPart; | 1095 var subPart; |
1061 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1096 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1062 pathOffset += 1; | 1097 pathOffset += 1; |
1063 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1098 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1083 var keyvalue = part.split("="); | 1118 var keyvalue = part.split("="); |
1084 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1119 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1085 } | 1120 } |
1086 } | 1121 } |
1087 | 1122 |
1088 | 1123 |
1089 var h = { | 1124 var h = { |
1090 "content-type" : "application/json; charset=utf-8", | 1125 "content-type" : "application/json; charset=utf-8", |
1091 }; | 1126 }; |
1092 var resp = ""; | 1127 var resp = ""; |
1093 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1128 return new async.Future.value(stringResponse(200, h, resp)); |
1094 }), true); | 1129 }), true); |
1095 res.delete(arg_id).then(unittest.expectAsync((_) {})); | 1130 res.delete(arg_id).then(unittest.expectAsync((_) {})); |
1096 }); | 1131 }); |
1097 | 1132 |
1098 unittest.test("method--get", () { | 1133 unittest.test("method--get", () { |
1099 | 1134 |
1100 var mock = new common_test.HttpServerMock(); | 1135 var mock = new HttpServerMock(); |
1101 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1136 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1102 var arg_id = "foo"; | 1137 var arg_id = "foo"; |
1103 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1138 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1104 var path = (req.url).path; | 1139 var path = (req.url).path; |
1105 var pathOffset = 0; | 1140 var pathOffset = 0; |
1106 var index; | 1141 var index; |
1107 var subPart; | 1142 var subPart; |
1108 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1143 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1109 pathOffset += 1; | 1144 pathOffset += 1; |
1110 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1145 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1130 var keyvalue = part.split("="); | 1165 var keyvalue = part.split("="); |
1131 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1166 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1132 } | 1167 } |
1133 } | 1168 } |
1134 | 1169 |
1135 | 1170 |
1136 var h = { | 1171 var h = { |
1137 "content-type" : "application/json; charset=utf-8", | 1172 "content-type" : "application/json; charset=utf-8", |
1138 }; | 1173 }; |
1139 var resp = convert.JSON.encode(buildContact()); | 1174 var resp = convert.JSON.encode(buildContact()); |
1140 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1175 return new async.Future.value(stringResponse(200, h, resp)); |
1141 }), true); | 1176 }), true); |
1142 res.get(arg_id).then(unittest.expectAsync(((api.Contact response) { | 1177 res.get(arg_id).then(unittest.expectAsync(((api.Contact response) { |
1143 checkContact(response); | 1178 checkContact(response); |
1144 }))); | 1179 }))); |
1145 }); | 1180 }); |
1146 | 1181 |
1147 unittest.test("method--insert", () { | 1182 unittest.test("method--insert", () { |
1148 | 1183 |
1149 var mock = new common_test.HttpServerMock(); | 1184 var mock = new HttpServerMock(); |
1150 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1185 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1151 var arg_request = buildContact(); | 1186 var arg_request = buildContact(); |
1152 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1187 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1153 var obj = new api.Contact.fromJson(json); | 1188 var obj = new api.Contact.fromJson(json); |
1154 checkContact(obj); | 1189 checkContact(obj); |
1155 | 1190 |
1156 var path = (req.url).path; | 1191 var path = (req.url).path; |
1157 var pathOffset = 0; | 1192 var pathOffset = 0; |
1158 var index; | 1193 var index; |
1159 var subPart; | 1194 var subPart; |
(...skipping 19 matching lines...) Expand all Loading... |
1179 var keyvalue = part.split("="); | 1214 var keyvalue = part.split("="); |
1180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1215 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1181 } | 1216 } |
1182 } | 1217 } |
1183 | 1218 |
1184 | 1219 |
1185 var h = { | 1220 var h = { |
1186 "content-type" : "application/json; charset=utf-8", | 1221 "content-type" : "application/json; charset=utf-8", |
1187 }; | 1222 }; |
1188 var resp = convert.JSON.encode(buildContact()); | 1223 var resp = convert.JSON.encode(buildContact()); |
1189 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1224 return new async.Future.value(stringResponse(200, h, resp)); |
1190 }), true); | 1225 }), true); |
1191 res.insert(arg_request).then(unittest.expectAsync(((api.Contact response)
{ | 1226 res.insert(arg_request).then(unittest.expectAsync(((api.Contact response)
{ |
1192 checkContact(response); | 1227 checkContact(response); |
1193 }))); | 1228 }))); |
1194 }); | 1229 }); |
1195 | 1230 |
1196 unittest.test("method--list", () { | 1231 unittest.test("method--list", () { |
1197 | 1232 |
1198 var mock = new common_test.HttpServerMock(); | 1233 var mock = new HttpServerMock(); |
1199 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1234 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1200 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1235 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1201 var path = (req.url).path; | 1236 var path = (req.url).path; |
1202 var pathOffset = 0; | 1237 var pathOffset = 0; |
1203 var index; | 1238 var index; |
1204 var subPart; | 1239 var subPart; |
1205 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1240 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1206 pathOffset += 1; | 1241 pathOffset += 1; |
1207 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1242 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
1208 pathOffset += 10; | 1243 pathOffset += 10; |
(...skipping 15 matching lines...) Expand all Loading... |
1224 var keyvalue = part.split("="); | 1259 var keyvalue = part.split("="); |
1225 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1260 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1226 } | 1261 } |
1227 } | 1262 } |
1228 | 1263 |
1229 | 1264 |
1230 var h = { | 1265 var h = { |
1231 "content-type" : "application/json; charset=utf-8", | 1266 "content-type" : "application/json; charset=utf-8", |
1232 }; | 1267 }; |
1233 var resp = convert.JSON.encode(buildContactsListResponse()); | 1268 var resp = convert.JSON.encode(buildContactsListResponse()); |
1234 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1269 return new async.Future.value(stringResponse(200, h, resp)); |
1235 }), true); | 1270 }), true); |
1236 res.list().then(unittest.expectAsync(((api.ContactsListResponse response)
{ | 1271 res.list().then(unittest.expectAsync(((api.ContactsListResponse response)
{ |
1237 checkContactsListResponse(response); | 1272 checkContactsListResponse(response); |
1238 }))); | 1273 }))); |
1239 }); | 1274 }); |
1240 | 1275 |
1241 unittest.test("method--patch", () { | 1276 unittest.test("method--patch", () { |
1242 | 1277 |
1243 var mock = new common_test.HttpServerMock(); | 1278 var mock = new HttpServerMock(); |
1244 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1279 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1245 var arg_request = buildContact(); | 1280 var arg_request = buildContact(); |
1246 var arg_id = "foo"; | 1281 var arg_id = "foo"; |
1247 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1282 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1248 var obj = new api.Contact.fromJson(json); | 1283 var obj = new api.Contact.fromJson(json); |
1249 checkContact(obj); | 1284 checkContact(obj); |
1250 | 1285 |
1251 var path = (req.url).path; | 1286 var path = (req.url).path; |
1252 var pathOffset = 0; | 1287 var pathOffset = 0; |
1253 var index; | 1288 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1277 var keyvalue = part.split("="); | 1312 var keyvalue = part.split("="); |
1278 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1313 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1279 } | 1314 } |
1280 } | 1315 } |
1281 | 1316 |
1282 | 1317 |
1283 var h = { | 1318 var h = { |
1284 "content-type" : "application/json; charset=utf-8", | 1319 "content-type" : "application/json; charset=utf-8", |
1285 }; | 1320 }; |
1286 var resp = convert.JSON.encode(buildContact()); | 1321 var resp = convert.JSON.encode(buildContact()); |
1287 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1322 return new async.Future.value(stringResponse(200, h, resp)); |
1288 }), true); | 1323 }), true); |
1289 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.Contact res
ponse) { | 1324 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.Contact res
ponse) { |
1290 checkContact(response); | 1325 checkContact(response); |
1291 }))); | 1326 }))); |
1292 }); | 1327 }); |
1293 | 1328 |
1294 unittest.test("method--update", () { | 1329 unittest.test("method--update", () { |
1295 | 1330 |
1296 var mock = new common_test.HttpServerMock(); | 1331 var mock = new HttpServerMock(); |
1297 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1332 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1298 var arg_request = buildContact(); | 1333 var arg_request = buildContact(); |
1299 var arg_id = "foo"; | 1334 var arg_id = "foo"; |
1300 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1335 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1301 var obj = new api.Contact.fromJson(json); | 1336 var obj = new api.Contact.fromJson(json); |
1302 checkContact(obj); | 1337 checkContact(obj); |
1303 | 1338 |
1304 var path = (req.url).path; | 1339 var path = (req.url).path; |
1305 var pathOffset = 0; | 1340 var pathOffset = 0; |
1306 var index; | 1341 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1330 var keyvalue = part.split("="); | 1365 var keyvalue = part.split("="); |
1331 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1366 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1332 } | 1367 } |
1333 } | 1368 } |
1334 | 1369 |
1335 | 1370 |
1336 var h = { | 1371 var h = { |
1337 "content-type" : "application/json; charset=utf-8", | 1372 "content-type" : "application/json; charset=utf-8", |
1338 }; | 1373 }; |
1339 var resp = convert.JSON.encode(buildContact()); | 1374 var resp = convert.JSON.encode(buildContact()); |
1340 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1375 return new async.Future.value(stringResponse(200, h, resp)); |
1341 }), true); | 1376 }), true); |
1342 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Contact re
sponse) { | 1377 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Contact re
sponse) { |
1343 checkContact(response); | 1378 checkContact(response); |
1344 }))); | 1379 }))); |
1345 }); | 1380 }); |
1346 | 1381 |
1347 }); | 1382 }); |
1348 | 1383 |
1349 | 1384 |
1350 unittest.group("resource-LocationsResourceApi", () { | 1385 unittest.group("resource-LocationsResourceApi", () { |
1351 unittest.test("method--get", () { | 1386 unittest.test("method--get", () { |
1352 | 1387 |
1353 var mock = new common_test.HttpServerMock(); | 1388 var mock = new HttpServerMock(); |
1354 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; | 1389 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; |
1355 var arg_id = "foo"; | 1390 var arg_id = "foo"; |
1356 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1391 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1357 var path = (req.url).path; | 1392 var path = (req.url).path; |
1358 var pathOffset = 0; | 1393 var pathOffset = 0; |
1359 var index; | 1394 var index; |
1360 var subPart; | 1395 var subPart; |
1361 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1396 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1362 pathOffset += 1; | 1397 pathOffset += 1; |
1363 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1398 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1383 var keyvalue = part.split("="); | 1418 var keyvalue = part.split("="); |
1384 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1419 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1385 } | 1420 } |
1386 } | 1421 } |
1387 | 1422 |
1388 | 1423 |
1389 var h = { | 1424 var h = { |
1390 "content-type" : "application/json; charset=utf-8", | 1425 "content-type" : "application/json; charset=utf-8", |
1391 }; | 1426 }; |
1392 var resp = convert.JSON.encode(buildLocation()); | 1427 var resp = convert.JSON.encode(buildLocation()); |
1393 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1428 return new async.Future.value(stringResponse(200, h, resp)); |
1394 }), true); | 1429 }), true); |
1395 res.get(arg_id).then(unittest.expectAsync(((api.Location response) { | 1430 res.get(arg_id).then(unittest.expectAsync(((api.Location response) { |
1396 checkLocation(response); | 1431 checkLocation(response); |
1397 }))); | 1432 }))); |
1398 }); | 1433 }); |
1399 | 1434 |
1400 unittest.test("method--list", () { | 1435 unittest.test("method--list", () { |
1401 | 1436 |
1402 var mock = new common_test.HttpServerMock(); | 1437 var mock = new HttpServerMock(); |
1403 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; | 1438 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; |
1404 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1439 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1405 var path = (req.url).path; | 1440 var path = (req.url).path; |
1406 var pathOffset = 0; | 1441 var pathOffset = 0; |
1407 var index; | 1442 var index; |
1408 var subPart; | 1443 var subPart; |
1409 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1444 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1410 pathOffset += 1; | 1445 pathOffset += 1; |
1411 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1446 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
1412 pathOffset += 10; | 1447 pathOffset += 10; |
(...skipping 15 matching lines...) Expand all Loading... |
1428 var keyvalue = part.split("="); | 1463 var keyvalue = part.split("="); |
1429 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1464 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1430 } | 1465 } |
1431 } | 1466 } |
1432 | 1467 |
1433 | 1468 |
1434 var h = { | 1469 var h = { |
1435 "content-type" : "application/json; charset=utf-8", | 1470 "content-type" : "application/json; charset=utf-8", |
1436 }; | 1471 }; |
1437 var resp = convert.JSON.encode(buildLocationsListResponse()); | 1472 var resp = convert.JSON.encode(buildLocationsListResponse()); |
1438 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1473 return new async.Future.value(stringResponse(200, h, resp)); |
1439 }), true); | 1474 }), true); |
1440 res.list().then(unittest.expectAsync(((api.LocationsListResponse response)
{ | 1475 res.list().then(unittest.expectAsync(((api.LocationsListResponse response)
{ |
1441 checkLocationsListResponse(response); | 1476 checkLocationsListResponse(response); |
1442 }))); | 1477 }))); |
1443 }); | 1478 }); |
1444 | 1479 |
1445 }); | 1480 }); |
1446 | 1481 |
1447 | 1482 |
1448 unittest.group("resource-SettingsResourceApi", () { | 1483 unittest.group("resource-SettingsResourceApi", () { |
1449 unittest.test("method--get", () { | 1484 unittest.test("method--get", () { |
1450 | 1485 |
1451 var mock = new common_test.HttpServerMock(); | 1486 var mock = new HttpServerMock(); |
1452 api.SettingsResourceApi res = new api.MirrorApi(mock).settings; | 1487 api.SettingsResourceApi res = new api.MirrorApi(mock).settings; |
1453 var arg_id = "foo"; | 1488 var arg_id = "foo"; |
1454 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1489 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1455 var path = (req.url).path; | 1490 var path = (req.url).path; |
1456 var pathOffset = 0; | 1491 var pathOffset = 0; |
1457 var index; | 1492 var index; |
1458 var subPart; | 1493 var subPart; |
1459 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1494 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1460 pathOffset += 1; | 1495 pathOffset += 1; |
1461 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1496 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1481 var keyvalue = part.split("="); | 1516 var keyvalue = part.split("="); |
1482 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1517 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1483 } | 1518 } |
1484 } | 1519 } |
1485 | 1520 |
1486 | 1521 |
1487 var h = { | 1522 var h = { |
1488 "content-type" : "application/json; charset=utf-8", | 1523 "content-type" : "application/json; charset=utf-8", |
1489 }; | 1524 }; |
1490 var resp = convert.JSON.encode(buildSetting()); | 1525 var resp = convert.JSON.encode(buildSetting()); |
1491 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1526 return new async.Future.value(stringResponse(200, h, resp)); |
1492 }), true); | 1527 }), true); |
1493 res.get(arg_id).then(unittest.expectAsync(((api.Setting response) { | 1528 res.get(arg_id).then(unittest.expectAsync(((api.Setting response) { |
1494 checkSetting(response); | 1529 checkSetting(response); |
1495 }))); | 1530 }))); |
1496 }); | 1531 }); |
1497 | 1532 |
1498 }); | 1533 }); |
1499 | 1534 |
1500 | 1535 |
1501 unittest.group("resource-SubscriptionsResourceApi", () { | 1536 unittest.group("resource-SubscriptionsResourceApi", () { |
1502 unittest.test("method--delete", () { | 1537 unittest.test("method--delete", () { |
1503 | 1538 |
1504 var mock = new common_test.HttpServerMock(); | 1539 var mock = new HttpServerMock(); |
1505 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1540 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1506 var arg_id = "foo"; | 1541 var arg_id = "foo"; |
1507 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1542 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1508 var path = (req.url).path; | 1543 var path = (req.url).path; |
1509 var pathOffset = 0; | 1544 var pathOffset = 0; |
1510 var index; | 1545 var index; |
1511 var subPart; | 1546 var subPart; |
1512 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1547 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1513 pathOffset += 1; | 1548 pathOffset += 1; |
1514 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1549 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1534 var keyvalue = part.split("="); | 1569 var keyvalue = part.split("="); |
1535 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1570 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1536 } | 1571 } |
1537 } | 1572 } |
1538 | 1573 |
1539 | 1574 |
1540 var h = { | 1575 var h = { |
1541 "content-type" : "application/json; charset=utf-8", | 1576 "content-type" : "application/json; charset=utf-8", |
1542 }; | 1577 }; |
1543 var resp = ""; | 1578 var resp = ""; |
1544 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1579 return new async.Future.value(stringResponse(200, h, resp)); |
1545 }), true); | 1580 }), true); |
1546 res.delete(arg_id).then(unittest.expectAsync((_) {})); | 1581 res.delete(arg_id).then(unittest.expectAsync((_) {})); |
1547 }); | 1582 }); |
1548 | 1583 |
1549 unittest.test("method--insert", () { | 1584 unittest.test("method--insert", () { |
1550 | 1585 |
1551 var mock = new common_test.HttpServerMock(); | 1586 var mock = new HttpServerMock(); |
1552 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1587 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1553 var arg_request = buildSubscription(); | 1588 var arg_request = buildSubscription(); |
1554 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1589 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1555 var obj = new api.Subscription.fromJson(json); | 1590 var obj = new api.Subscription.fromJson(json); |
1556 checkSubscription(obj); | 1591 checkSubscription(obj); |
1557 | 1592 |
1558 var path = (req.url).path; | 1593 var path = (req.url).path; |
1559 var pathOffset = 0; | 1594 var pathOffset = 0; |
1560 var index; | 1595 var index; |
1561 var subPart; | 1596 var subPart; |
(...skipping 19 matching lines...) Expand all Loading... |
1581 var keyvalue = part.split("="); | 1616 var keyvalue = part.split("="); |
1582 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1617 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1583 } | 1618 } |
1584 } | 1619 } |
1585 | 1620 |
1586 | 1621 |
1587 var h = { | 1622 var h = { |
1588 "content-type" : "application/json; charset=utf-8", | 1623 "content-type" : "application/json; charset=utf-8", |
1589 }; | 1624 }; |
1590 var resp = convert.JSON.encode(buildSubscription()); | 1625 var resp = convert.JSON.encode(buildSubscription()); |
1591 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1626 return new async.Future.value(stringResponse(200, h, resp)); |
1592 }), true); | 1627 }), true); |
1593 res.insert(arg_request).then(unittest.expectAsync(((api.Subscription respo
nse) { | 1628 res.insert(arg_request).then(unittest.expectAsync(((api.Subscription respo
nse) { |
1594 checkSubscription(response); | 1629 checkSubscription(response); |
1595 }))); | 1630 }))); |
1596 }); | 1631 }); |
1597 | 1632 |
1598 unittest.test("method--list", () { | 1633 unittest.test("method--list", () { |
1599 | 1634 |
1600 var mock = new common_test.HttpServerMock(); | 1635 var mock = new HttpServerMock(); |
1601 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1636 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1602 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1637 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1603 var path = (req.url).path; | 1638 var path = (req.url).path; |
1604 var pathOffset = 0; | 1639 var pathOffset = 0; |
1605 var index; | 1640 var index; |
1606 var subPart; | 1641 var subPart; |
1607 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1642 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1608 pathOffset += 1; | 1643 pathOffset += 1; |
1609 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1644 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
1610 pathOffset += 10; | 1645 pathOffset += 10; |
(...skipping 15 matching lines...) Expand all Loading... |
1626 var keyvalue = part.split("="); | 1661 var keyvalue = part.split("="); |
1627 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1662 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1628 } | 1663 } |
1629 } | 1664 } |
1630 | 1665 |
1631 | 1666 |
1632 var h = { | 1667 var h = { |
1633 "content-type" : "application/json; charset=utf-8", | 1668 "content-type" : "application/json; charset=utf-8", |
1634 }; | 1669 }; |
1635 var resp = convert.JSON.encode(buildSubscriptionsListResponse()); | 1670 var resp = convert.JSON.encode(buildSubscriptionsListResponse()); |
1636 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1671 return new async.Future.value(stringResponse(200, h, resp)); |
1637 }), true); | 1672 }), true); |
1638 res.list().then(unittest.expectAsync(((api.SubscriptionsListResponse respo
nse) { | 1673 res.list().then(unittest.expectAsync(((api.SubscriptionsListResponse respo
nse) { |
1639 checkSubscriptionsListResponse(response); | 1674 checkSubscriptionsListResponse(response); |
1640 }))); | 1675 }))); |
1641 }); | 1676 }); |
1642 | 1677 |
1643 unittest.test("method--update", () { | 1678 unittest.test("method--update", () { |
1644 | 1679 |
1645 var mock = new common_test.HttpServerMock(); | 1680 var mock = new HttpServerMock(); |
1646 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1681 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1647 var arg_request = buildSubscription(); | 1682 var arg_request = buildSubscription(); |
1648 var arg_id = "foo"; | 1683 var arg_id = "foo"; |
1649 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1684 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1650 var obj = new api.Subscription.fromJson(json); | 1685 var obj = new api.Subscription.fromJson(json); |
1651 checkSubscription(obj); | 1686 checkSubscription(obj); |
1652 | 1687 |
1653 var path = (req.url).path; | 1688 var path = (req.url).path; |
1654 var pathOffset = 0; | 1689 var pathOffset = 0; |
1655 var index; | 1690 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1679 var keyvalue = part.split("="); | 1714 var keyvalue = part.split("="); |
1680 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1715 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1681 } | 1716 } |
1682 } | 1717 } |
1683 | 1718 |
1684 | 1719 |
1685 var h = { | 1720 var h = { |
1686 "content-type" : "application/json; charset=utf-8", | 1721 "content-type" : "application/json; charset=utf-8", |
1687 }; | 1722 }; |
1688 var resp = convert.JSON.encode(buildSubscription()); | 1723 var resp = convert.JSON.encode(buildSubscription()); |
1689 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1724 return new async.Future.value(stringResponse(200, h, resp)); |
1690 }), true); | 1725 }), true); |
1691 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Subscripti
on response) { | 1726 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Subscripti
on response) { |
1692 checkSubscription(response); | 1727 checkSubscription(response); |
1693 }))); | 1728 }))); |
1694 }); | 1729 }); |
1695 | 1730 |
1696 }); | 1731 }); |
1697 | 1732 |
1698 | 1733 |
1699 unittest.group("resource-TimelineResourceApi", () { | 1734 unittest.group("resource-TimelineResourceApi", () { |
1700 unittest.test("method--delete", () { | 1735 unittest.test("method--delete", () { |
1701 | 1736 |
1702 var mock = new common_test.HttpServerMock(); | 1737 var mock = new HttpServerMock(); |
1703 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1738 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1704 var arg_id = "foo"; | 1739 var arg_id = "foo"; |
1705 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1740 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1706 var path = (req.url).path; | 1741 var path = (req.url).path; |
1707 var pathOffset = 0; | 1742 var pathOffset = 0; |
1708 var index; | 1743 var index; |
1709 var subPart; | 1744 var subPart; |
1710 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1745 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1711 pathOffset += 1; | 1746 pathOffset += 1; |
1712 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1747 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1732 var keyvalue = part.split("="); | 1767 var keyvalue = part.split("="); |
1733 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1768 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1734 } | 1769 } |
1735 } | 1770 } |
1736 | 1771 |
1737 | 1772 |
1738 var h = { | 1773 var h = { |
1739 "content-type" : "application/json; charset=utf-8", | 1774 "content-type" : "application/json; charset=utf-8", |
1740 }; | 1775 }; |
1741 var resp = ""; | 1776 var resp = ""; |
1742 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1777 return new async.Future.value(stringResponse(200, h, resp)); |
1743 }), true); | 1778 }), true); |
1744 res.delete(arg_id).then(unittest.expectAsync((_) {})); | 1779 res.delete(arg_id).then(unittest.expectAsync((_) {})); |
1745 }); | 1780 }); |
1746 | 1781 |
1747 unittest.test("method--get", () { | 1782 unittest.test("method--get", () { |
1748 | 1783 |
1749 var mock = new common_test.HttpServerMock(); | 1784 var mock = new HttpServerMock(); |
1750 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1785 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1751 var arg_id = "foo"; | 1786 var arg_id = "foo"; |
1752 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1787 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1753 var path = (req.url).path; | 1788 var path = (req.url).path; |
1754 var pathOffset = 0; | 1789 var pathOffset = 0; |
1755 var index; | 1790 var index; |
1756 var subPart; | 1791 var subPart; |
1757 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1792 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1758 pathOffset += 1; | 1793 pathOffset += 1; |
1759 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1794 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 19 matching lines...) Expand all Loading... |
1779 var keyvalue = part.split("="); | 1814 var keyvalue = part.split("="); |
1780 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1815 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1781 } | 1816 } |
1782 } | 1817 } |
1783 | 1818 |
1784 | 1819 |
1785 var h = { | 1820 var h = { |
1786 "content-type" : "application/json; charset=utf-8", | 1821 "content-type" : "application/json; charset=utf-8", |
1787 }; | 1822 }; |
1788 var resp = convert.JSON.encode(buildTimelineItem()); | 1823 var resp = convert.JSON.encode(buildTimelineItem()); |
1789 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1824 return new async.Future.value(stringResponse(200, h, resp)); |
1790 }), true); | 1825 }), true); |
1791 res.get(arg_id).then(unittest.expectAsync(((api.TimelineItem response) { | 1826 res.get(arg_id).then(unittest.expectAsync(((api.TimelineItem response) { |
1792 checkTimelineItem(response); | 1827 checkTimelineItem(response); |
1793 }))); | 1828 }))); |
1794 }); | 1829 }); |
1795 | 1830 |
1796 unittest.test("method--insert", () { | 1831 unittest.test("method--insert", () { |
1797 // TODO: Implement tests for media upload; | 1832 // TODO: Implement tests for media upload; |
1798 // TODO: Implement tests for media download; | 1833 // TODO: Implement tests for media download; |
1799 | 1834 |
1800 var mock = new common_test.HttpServerMock(); | 1835 var mock = new HttpServerMock(); |
1801 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1836 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1802 var arg_request = buildTimelineItem(); | 1837 var arg_request = buildTimelineItem(); |
1803 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1838 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1804 var obj = new api.TimelineItem.fromJson(json); | 1839 var obj = new api.TimelineItem.fromJson(json); |
1805 checkTimelineItem(obj); | 1840 checkTimelineItem(obj); |
1806 | 1841 |
1807 var path = (req.url).path; | 1842 var path = (req.url).path; |
1808 var pathOffset = 0; | 1843 var pathOffset = 0; |
1809 var index; | 1844 var index; |
1810 var subPart; | 1845 var subPart; |
(...skipping 19 matching lines...) Expand all Loading... |
1830 var keyvalue = part.split("="); | 1865 var keyvalue = part.split("="); |
1831 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1866 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1832 } | 1867 } |
1833 } | 1868 } |
1834 | 1869 |
1835 | 1870 |
1836 var h = { | 1871 var h = { |
1837 "content-type" : "application/json; charset=utf-8", | 1872 "content-type" : "application/json; charset=utf-8", |
1838 }; | 1873 }; |
1839 var resp = convert.JSON.encode(buildTimelineItem()); | 1874 var resp = convert.JSON.encode(buildTimelineItem()); |
1840 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1875 return new async.Future.value(stringResponse(200, h, resp)); |
1841 }), true); | 1876 }), true); |
1842 res.insert(arg_request).then(unittest.expectAsync(((api.TimelineItem respo
nse) { | 1877 res.insert(arg_request).then(unittest.expectAsync(((api.TimelineItem respo
nse) { |
1843 checkTimelineItem(response); | 1878 checkTimelineItem(response); |
1844 }))); | 1879 }))); |
1845 }); | 1880 }); |
1846 | 1881 |
1847 unittest.test("method--list", () { | 1882 unittest.test("method--list", () { |
1848 | 1883 |
1849 var mock = new common_test.HttpServerMock(); | 1884 var mock = new HttpServerMock(); |
1850 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1885 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1851 var arg_bundleId = "foo"; | 1886 var arg_bundleId = "foo"; |
1852 var arg_includeDeleted = true; | 1887 var arg_includeDeleted = true; |
1853 var arg_maxResults = 42; | 1888 var arg_maxResults = 42; |
1854 var arg_orderBy = "foo"; | 1889 var arg_orderBy = "foo"; |
1855 var arg_pageToken = "foo"; | 1890 var arg_pageToken = "foo"; |
1856 var arg_pinnedOnly = true; | 1891 var arg_pinnedOnly = true; |
1857 var arg_sourceItemId = "foo"; | 1892 var arg_sourceItemId = "foo"; |
1858 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1893 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1859 var path = (req.url).path; | 1894 var path = (req.url).path; |
(...skipping 29 matching lines...) Expand all Loading... |
1889 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | 1924 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; |
1890 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1925 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1891 unittest.expect(queryMap["pinnedOnly"].first, unittest.equals("$arg_pinn
edOnly")); | 1926 unittest.expect(queryMap["pinnedOnly"].first, unittest.equals("$arg_pinn
edOnly")); |
1892 unittest.expect(queryMap["sourceItemId"].first, unittest.equals(arg_sour
ceItemId)); | 1927 unittest.expect(queryMap["sourceItemId"].first, unittest.equals(arg_sour
ceItemId)); |
1893 | 1928 |
1894 | 1929 |
1895 var h = { | 1930 var h = { |
1896 "content-type" : "application/json; charset=utf-8", | 1931 "content-type" : "application/json; charset=utf-8", |
1897 }; | 1932 }; |
1898 var resp = convert.JSON.encode(buildTimelineListResponse()); | 1933 var resp = convert.JSON.encode(buildTimelineListResponse()); |
1899 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1934 return new async.Future.value(stringResponse(200, h, resp)); |
1900 }), true); | 1935 }), true); |
1901 res.list(bundleId: arg_bundleId, includeDeleted: arg_includeDeleted, maxRe
sults: arg_maxResults, orderBy: arg_orderBy, pageToken: arg_pageToken, pinnedOnl
y: arg_pinnedOnly, sourceItemId: arg_sourceItemId).then(unittest.expectAsync(((a
pi.TimelineListResponse response) { | 1936 res.list(bundleId: arg_bundleId, includeDeleted: arg_includeDeleted, maxRe
sults: arg_maxResults, orderBy: arg_orderBy, pageToken: arg_pageToken, pinnedOnl
y: arg_pinnedOnly, sourceItemId: arg_sourceItemId).then(unittest.expectAsync(((a
pi.TimelineListResponse response) { |
1902 checkTimelineListResponse(response); | 1937 checkTimelineListResponse(response); |
1903 }))); | 1938 }))); |
1904 }); | 1939 }); |
1905 | 1940 |
1906 unittest.test("method--patch", () { | 1941 unittest.test("method--patch", () { |
1907 | 1942 |
1908 var mock = new common_test.HttpServerMock(); | 1943 var mock = new HttpServerMock(); |
1909 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1944 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1910 var arg_request = buildTimelineItem(); | 1945 var arg_request = buildTimelineItem(); |
1911 var arg_id = "foo"; | 1946 var arg_id = "foo"; |
1912 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1947 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1913 var obj = new api.TimelineItem.fromJson(json); | 1948 var obj = new api.TimelineItem.fromJson(json); |
1914 checkTimelineItem(obj); | 1949 checkTimelineItem(obj); |
1915 | 1950 |
1916 var path = (req.url).path; | 1951 var path = (req.url).path; |
1917 var pathOffset = 0; | 1952 var pathOffset = 0; |
1918 var index; | 1953 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1942 var keyvalue = part.split("="); | 1977 var keyvalue = part.split("="); |
1943 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1978 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1944 } | 1979 } |
1945 } | 1980 } |
1946 | 1981 |
1947 | 1982 |
1948 var h = { | 1983 var h = { |
1949 "content-type" : "application/json; charset=utf-8", | 1984 "content-type" : "application/json; charset=utf-8", |
1950 }; | 1985 }; |
1951 var resp = convert.JSON.encode(buildTimelineItem()); | 1986 var resp = convert.JSON.encode(buildTimelineItem()); |
1952 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1987 return new async.Future.value(stringResponse(200, h, resp)); |
1953 }), true); | 1988 }), true); |
1954 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.TimelineIte
m response) { | 1989 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.TimelineIte
m response) { |
1955 checkTimelineItem(response); | 1990 checkTimelineItem(response); |
1956 }))); | 1991 }))); |
1957 }); | 1992 }); |
1958 | 1993 |
1959 unittest.test("method--update", () { | 1994 unittest.test("method--update", () { |
1960 // TODO: Implement tests for media upload; | 1995 // TODO: Implement tests for media upload; |
1961 // TODO: Implement tests for media download; | 1996 // TODO: Implement tests for media download; |
1962 | 1997 |
1963 var mock = new common_test.HttpServerMock(); | 1998 var mock = new HttpServerMock(); |
1964 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1999 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1965 var arg_request = buildTimelineItem(); | 2000 var arg_request = buildTimelineItem(); |
1966 var arg_id = "foo"; | 2001 var arg_id = "foo"; |
1967 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2002 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1968 var obj = new api.TimelineItem.fromJson(json); | 2003 var obj = new api.TimelineItem.fromJson(json); |
1969 checkTimelineItem(obj); | 2004 checkTimelineItem(obj); |
1970 | 2005 |
1971 var path = (req.url).path; | 2006 var path = (req.url).path; |
1972 var pathOffset = 0; | 2007 var pathOffset = 0; |
1973 var index; | 2008 var index; |
(...skipping 23 matching lines...) Expand all Loading... |
1997 var keyvalue = part.split("="); | 2032 var keyvalue = part.split("="); |
1998 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2033 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1999 } | 2034 } |
2000 } | 2035 } |
2001 | 2036 |
2002 | 2037 |
2003 var h = { | 2038 var h = { |
2004 "content-type" : "application/json; charset=utf-8", | 2039 "content-type" : "application/json; charset=utf-8", |
2005 }; | 2040 }; |
2006 var resp = convert.JSON.encode(buildTimelineItem()); | 2041 var resp = convert.JSON.encode(buildTimelineItem()); |
2007 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2042 return new async.Future.value(stringResponse(200, h, resp)); |
2008 }), true); | 2043 }), true); |
2009 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.TimelineIt
em response) { | 2044 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.TimelineIt
em response) { |
2010 checkTimelineItem(response); | 2045 checkTimelineItem(response); |
2011 }))); | 2046 }))); |
2012 }); | 2047 }); |
2013 | 2048 |
2014 }); | 2049 }); |
2015 | 2050 |
2016 | 2051 |
2017 unittest.group("resource-TimelineAttachmentsResourceApi", () { | 2052 unittest.group("resource-TimelineAttachmentsResourceApi", () { |
2018 unittest.test("method--delete", () { | 2053 unittest.test("method--delete", () { |
2019 | 2054 |
2020 var mock = new common_test.HttpServerMock(); | 2055 var mock = new HttpServerMock(); |
2021 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2056 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2022 var arg_itemId = "foo"; | 2057 var arg_itemId = "foo"; |
2023 var arg_attachmentId = "foo"; | 2058 var arg_attachmentId = "foo"; |
2024 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2059 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2025 var path = (req.url).path; | 2060 var path = (req.url).path; |
2026 var pathOffset = 0; | 2061 var pathOffset = 0; |
2027 var index; | 2062 var index; |
2028 var subPart; | 2063 var subPart; |
2029 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2064 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2030 pathOffset += 1; | 2065 pathOffset += 1; |
(...skipping 27 matching lines...) Expand all Loading... |
2058 var keyvalue = part.split("="); | 2093 var keyvalue = part.split("="); |
2059 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2094 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2060 } | 2095 } |
2061 } | 2096 } |
2062 | 2097 |
2063 | 2098 |
2064 var h = { | 2099 var h = { |
2065 "content-type" : "application/json; charset=utf-8", | 2100 "content-type" : "application/json; charset=utf-8", |
2066 }; | 2101 }; |
2067 var resp = ""; | 2102 var resp = ""; |
2068 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2103 return new async.Future.value(stringResponse(200, h, resp)); |
2069 }), true); | 2104 }), true); |
2070 res.delete(arg_itemId, arg_attachmentId).then(unittest.expectAsync((_) {})
); | 2105 res.delete(arg_itemId, arg_attachmentId).then(unittest.expectAsync((_) {})
); |
2071 }); | 2106 }); |
2072 | 2107 |
2073 unittest.test("method--get", () { | 2108 unittest.test("method--get", () { |
2074 // TODO: Implement tests for media upload; | 2109 // TODO: Implement tests for media upload; |
2075 // TODO: Implement tests for media download; | 2110 // TODO: Implement tests for media download; |
2076 | 2111 |
2077 var mock = new common_test.HttpServerMock(); | 2112 var mock = new HttpServerMock(); |
2078 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2113 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2079 var arg_itemId = "foo"; | 2114 var arg_itemId = "foo"; |
2080 var arg_attachmentId = "foo"; | 2115 var arg_attachmentId = "foo"; |
2081 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2116 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2082 var path = (req.url).path; | 2117 var path = (req.url).path; |
2083 var pathOffset = 0; | 2118 var pathOffset = 0; |
2084 var index; | 2119 var index; |
2085 var subPart; | 2120 var subPart; |
2086 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2087 pathOffset += 1; | 2122 pathOffset += 1; |
(...skipping 27 matching lines...) Expand all Loading... |
2115 var keyvalue = part.split("="); | 2150 var keyvalue = part.split("="); |
2116 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2151 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2117 } | 2152 } |
2118 } | 2153 } |
2119 | 2154 |
2120 | 2155 |
2121 var h = { | 2156 var h = { |
2122 "content-type" : "application/json; charset=utf-8", | 2157 "content-type" : "application/json; charset=utf-8", |
2123 }; | 2158 }; |
2124 var resp = convert.JSON.encode(buildAttachment()); | 2159 var resp = convert.JSON.encode(buildAttachment()); |
2125 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2160 return new async.Future.value(stringResponse(200, h, resp)); |
2126 }), true); | 2161 }), true); |
2127 res.get(arg_itemId, arg_attachmentId).then(unittest.expectAsync(((api.Atta
chment response) { | 2162 res.get(arg_itemId, arg_attachmentId).then(unittest.expectAsync(((api.Atta
chment response) { |
2128 checkAttachment(response); | 2163 checkAttachment(response); |
2129 }))); | 2164 }))); |
2130 }); | 2165 }); |
2131 | 2166 |
2132 unittest.test("method--insert", () { | 2167 unittest.test("method--insert", () { |
2133 // TODO: Implement tests for media upload; | 2168 // TODO: Implement tests for media upload; |
2134 // TODO: Implement tests for media download; | 2169 // TODO: Implement tests for media download; |
2135 | 2170 |
2136 var mock = new common_test.HttpServerMock(); | 2171 var mock = new HttpServerMock(); |
2137 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2172 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2138 var arg_itemId = "foo"; | 2173 var arg_itemId = "foo"; |
2139 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2174 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2140 var path = (req.url).path; | 2175 var path = (req.url).path; |
2141 var pathOffset = 0; | 2176 var pathOffset = 0; |
2142 var index; | 2177 var index; |
2143 var subPart; | 2178 var subPart; |
2144 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2179 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2145 pathOffset += 1; | 2180 pathOffset += 1; |
2146 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 2181 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 23 matching lines...) Expand all Loading... |
2170 var keyvalue = part.split("="); | 2205 var keyvalue = part.split("="); |
2171 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2206 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2172 } | 2207 } |
2173 } | 2208 } |
2174 | 2209 |
2175 | 2210 |
2176 var h = { | 2211 var h = { |
2177 "content-type" : "application/json; charset=utf-8", | 2212 "content-type" : "application/json; charset=utf-8", |
2178 }; | 2213 }; |
2179 var resp = convert.JSON.encode(buildAttachment()); | 2214 var resp = convert.JSON.encode(buildAttachment()); |
2180 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2215 return new async.Future.value(stringResponse(200, h, resp)); |
2181 }), true); | 2216 }), true); |
2182 res.insert(arg_itemId).then(unittest.expectAsync(((api.Attachment response
) { | 2217 res.insert(arg_itemId).then(unittest.expectAsync(((api.Attachment response
) { |
2183 checkAttachment(response); | 2218 checkAttachment(response); |
2184 }))); | 2219 }))); |
2185 }); | 2220 }); |
2186 | 2221 |
2187 unittest.test("method--list", () { | 2222 unittest.test("method--list", () { |
2188 | 2223 |
2189 var mock = new common_test.HttpServerMock(); | 2224 var mock = new HttpServerMock(); |
2190 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2225 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2191 var arg_itemId = "foo"; | 2226 var arg_itemId = "foo"; |
2192 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2227 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2193 var path = (req.url).path; | 2228 var path = (req.url).path; |
2194 var pathOffset = 0; | 2229 var pathOffset = 0; |
2195 var index; | 2230 var index; |
2196 var subPart; | 2231 var subPart; |
2197 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2232 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2198 pathOffset += 1; | 2233 pathOffset += 1; |
2199 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 2234 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 23 matching lines...) Expand all Loading... |
2223 var keyvalue = part.split("="); | 2258 var keyvalue = part.split("="); |
2224 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2259 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2225 } | 2260 } |
2226 } | 2261 } |
2227 | 2262 |
2228 | 2263 |
2229 var h = { | 2264 var h = { |
2230 "content-type" : "application/json; charset=utf-8", | 2265 "content-type" : "application/json; charset=utf-8", |
2231 }; | 2266 }; |
2232 var resp = convert.JSON.encode(buildAttachmentsListResponse()); | 2267 var resp = convert.JSON.encode(buildAttachmentsListResponse()); |
2233 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2268 return new async.Future.value(stringResponse(200, h, resp)); |
2234 }), true); | 2269 }), true); |
2235 res.list(arg_itemId).then(unittest.expectAsync(((api.AttachmentsListRespon
se response) { | 2270 res.list(arg_itemId).then(unittest.expectAsync(((api.AttachmentsListRespon
se response) { |
2236 checkAttachmentsListResponse(response); | 2271 checkAttachmentsListResponse(response); |
2237 }))); | 2272 }))); |
2238 }); | 2273 }); |
2239 | 2274 |
2240 }); | 2275 }); |
2241 | 2276 |
2242 | 2277 |
2243 } | 2278 } |
2244 | 2279 |
OLD | NEW |