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:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis/mirror/v1.dart' as api; | 12 import 'package:googleapis/mirror/v1.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed1399() { | 54 buildUnnamed1406() { |
55 var o = new core.List<api.AuthToken>(); | 55 var o = new core.List<api.AuthToken>(); |
56 o.add(buildAuthToken()); | 56 o.add(buildAuthToken()); |
57 o.add(buildAuthToken()); | 57 o.add(buildAuthToken()); |
58 return o; | 58 return o; |
59 } | 59 } |
60 | 60 |
61 checkUnnamed1399(core.List<api.AuthToken> o) { | 61 checkUnnamed1406(core.List<api.AuthToken> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
63 checkAuthToken(o[0]); | 63 checkAuthToken(o[0]); |
64 checkAuthToken(o[1]); | 64 checkAuthToken(o[1]); |
65 } | 65 } |
66 | 66 |
67 buildUnnamed1400() { | 67 buildUnnamed1407() { |
68 var o = new core.List<core.String>(); | 68 var o = new core.List<core.String>(); |
69 o.add("foo"); | 69 o.add("foo"); |
70 o.add("foo"); | 70 o.add("foo"); |
71 return o; | 71 return o; |
72 } | 72 } |
73 | 73 |
74 checkUnnamed1400(core.List<core.String> o) { | 74 checkUnnamed1407(core.List<core.String> o) { |
75 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
76 unittest.expect(o[0], unittest.equals('foo')); | 76 unittest.expect(o[0], unittest.equals('foo')); |
77 unittest.expect(o[1], unittest.equals('foo')); | 77 unittest.expect(o[1], unittest.equals('foo')); |
78 } | 78 } |
79 | 79 |
80 buildUnnamed1401() { | 80 buildUnnamed1408() { |
81 var o = new core.List<api.UserData>(); | 81 var o = new core.List<api.UserData>(); |
82 o.add(buildUserData()); | 82 o.add(buildUserData()); |
83 o.add(buildUserData()); | 83 o.add(buildUserData()); |
84 return o; | 84 return o; |
85 } | 85 } |
86 | 86 |
87 checkUnnamed1401(core.List<api.UserData> o) { | 87 checkUnnamed1408(core.List<api.UserData> o) { |
88 unittest.expect(o, unittest.hasLength(2)); | 88 unittest.expect(o, unittest.hasLength(2)); |
89 checkUserData(o[0]); | 89 checkUserData(o[0]); |
90 checkUserData(o[1]); | 90 checkUserData(o[1]); |
91 } | 91 } |
92 | 92 |
93 core.int buildCounterAccount = 0; | 93 core.int buildCounterAccount = 0; |
94 buildAccount() { | 94 buildAccount() { |
95 var o = new api.Account(); | 95 var o = new api.Account(); |
96 buildCounterAccount++; | 96 buildCounterAccount++; |
97 if (buildCounterAccount < 3) { | 97 if (buildCounterAccount < 3) { |
98 o.authTokens = buildUnnamed1399(); | 98 o.authTokens = buildUnnamed1406(); |
99 o.features = buildUnnamed1400(); | 99 o.features = buildUnnamed1407(); |
100 o.password = "foo"; | 100 o.password = "foo"; |
101 o.userData = buildUnnamed1401(); | 101 o.userData = buildUnnamed1408(); |
102 } | 102 } |
103 buildCounterAccount--; | 103 buildCounterAccount--; |
104 return o; | 104 return o; |
105 } | 105 } |
106 | 106 |
107 checkAccount(api.Account o) { | 107 checkAccount(api.Account o) { |
108 buildCounterAccount++; | 108 buildCounterAccount++; |
109 if (buildCounterAccount < 3) { | 109 if (buildCounterAccount < 3) { |
110 checkUnnamed1399(o.authTokens); | 110 checkUnnamed1406(o.authTokens); |
111 checkUnnamed1400(o.features); | 111 checkUnnamed1407(o.features); |
112 unittest.expect(o.password, unittest.equals('foo')); | 112 unittest.expect(o.password, unittest.equals('foo')); |
113 checkUnnamed1401(o.userData); | 113 checkUnnamed1408(o.userData); |
114 } | 114 } |
115 buildCounterAccount--; | 115 buildCounterAccount--; |
116 } | 116 } |
117 | 117 |
118 core.int buildCounterAttachment = 0; | 118 core.int buildCounterAttachment = 0; |
119 buildAttachment() { | 119 buildAttachment() { |
120 var o = new api.Attachment(); | 120 var o = new api.Attachment(); |
121 buildCounterAttachment++; | 121 buildCounterAttachment++; |
122 if (buildCounterAttachment < 3) { | 122 if (buildCounterAttachment < 3) { |
123 o.contentType = "foo"; | 123 o.contentType = "foo"; |
124 o.contentUrl = "foo"; | 124 o.contentUrl = "foo"; |
125 o.id = "foo"; | 125 o.id = "foo"; |
126 o.isProcessingContent = true; | 126 o.isProcessingContent = true; |
127 } | 127 } |
128 buildCounterAttachment--; | 128 buildCounterAttachment--; |
129 return o; | 129 return o; |
130 } | 130 } |
131 | 131 |
132 checkAttachment(api.Attachment o) { | 132 checkAttachment(api.Attachment o) { |
133 buildCounterAttachment++; | 133 buildCounterAttachment++; |
134 if (buildCounterAttachment < 3) { | 134 if (buildCounterAttachment < 3) { |
135 unittest.expect(o.contentType, unittest.equals('foo')); | 135 unittest.expect(o.contentType, unittest.equals('foo')); |
136 unittest.expect(o.contentUrl, unittest.equals('foo')); | 136 unittest.expect(o.contentUrl, unittest.equals('foo')); |
137 unittest.expect(o.id, unittest.equals('foo')); | 137 unittest.expect(o.id, unittest.equals('foo')); |
138 unittest.expect(o.isProcessingContent, unittest.isTrue); | 138 unittest.expect(o.isProcessingContent, unittest.isTrue); |
139 } | 139 } |
140 buildCounterAttachment--; | 140 buildCounterAttachment--; |
141 } | 141 } |
142 | 142 |
143 buildUnnamed1402() { | 143 buildUnnamed1409() { |
144 var o = new core.List<api.Attachment>(); | 144 var o = new core.List<api.Attachment>(); |
145 o.add(buildAttachment()); | 145 o.add(buildAttachment()); |
146 o.add(buildAttachment()); | 146 o.add(buildAttachment()); |
147 return o; | 147 return o; |
148 } | 148 } |
149 | 149 |
150 checkUnnamed1402(core.List<api.Attachment> o) { | 150 checkUnnamed1409(core.List<api.Attachment> o) { |
151 unittest.expect(o, unittest.hasLength(2)); | 151 unittest.expect(o, unittest.hasLength(2)); |
152 checkAttachment(o[0]); | 152 checkAttachment(o[0]); |
153 checkAttachment(o[1]); | 153 checkAttachment(o[1]); |
154 } | 154 } |
155 | 155 |
156 core.int buildCounterAttachmentsListResponse = 0; | 156 core.int buildCounterAttachmentsListResponse = 0; |
157 buildAttachmentsListResponse() { | 157 buildAttachmentsListResponse() { |
158 var o = new api.AttachmentsListResponse(); | 158 var o = new api.AttachmentsListResponse(); |
159 buildCounterAttachmentsListResponse++; | 159 buildCounterAttachmentsListResponse++; |
160 if (buildCounterAttachmentsListResponse < 3) { | 160 if (buildCounterAttachmentsListResponse < 3) { |
161 o.items = buildUnnamed1402(); | 161 o.items = buildUnnamed1409(); |
162 o.kind = "foo"; | 162 o.kind = "foo"; |
163 } | 163 } |
164 buildCounterAttachmentsListResponse--; | 164 buildCounterAttachmentsListResponse--; |
165 return o; | 165 return o; |
166 } | 166 } |
167 | 167 |
168 checkAttachmentsListResponse(api.AttachmentsListResponse o) { | 168 checkAttachmentsListResponse(api.AttachmentsListResponse o) { |
169 buildCounterAttachmentsListResponse++; | 169 buildCounterAttachmentsListResponse++; |
170 if (buildCounterAttachmentsListResponse < 3) { | 170 if (buildCounterAttachmentsListResponse < 3) { |
171 checkUnnamed1402(o.items); | 171 checkUnnamed1409(o.items); |
172 unittest.expect(o.kind, unittest.equals('foo')); | 172 unittest.expect(o.kind, unittest.equals('foo')); |
173 } | 173 } |
174 buildCounterAttachmentsListResponse--; | 174 buildCounterAttachmentsListResponse--; |
175 } | 175 } |
176 | 176 |
177 core.int buildCounterAuthToken = 0; | 177 core.int buildCounterAuthToken = 0; |
178 buildAuthToken() { | 178 buildAuthToken() { |
179 var o = new api.AuthToken(); | 179 var o = new api.AuthToken(); |
180 buildCounterAuthToken++; | 180 buildCounterAuthToken++; |
181 if (buildCounterAuthToken < 3) { | 181 if (buildCounterAuthToken < 3) { |
(...skipping 25 matching lines...) Expand all Loading... |
207 } | 207 } |
208 | 208 |
209 checkCommand(api.Command o) { | 209 checkCommand(api.Command o) { |
210 buildCounterCommand++; | 210 buildCounterCommand++; |
211 if (buildCounterCommand < 3) { | 211 if (buildCounterCommand < 3) { |
212 unittest.expect(o.type, unittest.equals('foo')); | 212 unittest.expect(o.type, unittest.equals('foo')); |
213 } | 213 } |
214 buildCounterCommand--; | 214 buildCounterCommand--; |
215 } | 215 } |
216 | 216 |
217 buildUnnamed1403() { | 217 buildUnnamed1410() { |
218 var o = new core.List<api.Command>(); | 218 var o = new core.List<api.Command>(); |
219 o.add(buildCommand()); | 219 o.add(buildCommand()); |
220 o.add(buildCommand()); | 220 o.add(buildCommand()); |
221 return o; | 221 return o; |
222 } | 222 } |
223 | 223 |
224 checkUnnamed1403(core.List<api.Command> o) { | 224 checkUnnamed1410(core.List<api.Command> o) { |
225 unittest.expect(o, unittest.hasLength(2)); | 225 unittest.expect(o, unittest.hasLength(2)); |
226 checkCommand(o[0]); | 226 checkCommand(o[0]); |
227 checkCommand(o[1]); | 227 checkCommand(o[1]); |
228 } | 228 } |
229 | 229 |
230 buildUnnamed1404() { | 230 buildUnnamed1411() { |
231 var o = new core.List<core.String>(); | 231 var o = new core.List<core.String>(); |
232 o.add("foo"); | 232 o.add("foo"); |
233 o.add("foo"); | 233 o.add("foo"); |
234 return o; | 234 return o; |
235 } | 235 } |
236 | 236 |
237 checkUnnamed1404(core.List<core.String> o) { | 237 checkUnnamed1411(core.List<core.String> o) { |
238 unittest.expect(o, unittest.hasLength(2)); | 238 unittest.expect(o, unittest.hasLength(2)); |
239 unittest.expect(o[0], unittest.equals('foo')); | 239 unittest.expect(o[0], unittest.equals('foo')); |
240 unittest.expect(o[1], unittest.equals('foo')); | 240 unittest.expect(o[1], unittest.equals('foo')); |
241 } | 241 } |
242 | 242 |
243 buildUnnamed1405() { | 243 buildUnnamed1412() { |
244 var o = new core.List<core.String>(); | 244 var o = new core.List<core.String>(); |
245 o.add("foo"); | 245 o.add("foo"); |
246 o.add("foo"); | 246 o.add("foo"); |
247 return o; | 247 return o; |
248 } | 248 } |
249 | 249 |
250 checkUnnamed1405(core.List<core.String> o) { | 250 checkUnnamed1412(core.List<core.String> o) { |
251 unittest.expect(o, unittest.hasLength(2)); | 251 unittest.expect(o, unittest.hasLength(2)); |
252 unittest.expect(o[0], unittest.equals('foo')); | 252 unittest.expect(o[0], unittest.equals('foo')); |
253 unittest.expect(o[1], unittest.equals('foo')); | 253 unittest.expect(o[1], unittest.equals('foo')); |
254 } | 254 } |
255 | 255 |
256 buildUnnamed1406() { | 256 buildUnnamed1413() { |
257 var o = new core.List<core.String>(); | 257 var o = new core.List<core.String>(); |
258 o.add("foo"); | 258 o.add("foo"); |
259 o.add("foo"); | 259 o.add("foo"); |
260 return o; | 260 return o; |
261 } | 261 } |
262 | 262 |
263 checkUnnamed1406(core.List<core.String> o) { | 263 checkUnnamed1413(core.List<core.String> o) { |
264 unittest.expect(o, unittest.hasLength(2)); | 264 unittest.expect(o, unittest.hasLength(2)); |
265 unittest.expect(o[0], unittest.equals('foo')); | 265 unittest.expect(o[0], unittest.equals('foo')); |
266 unittest.expect(o[1], unittest.equals('foo')); | 266 unittest.expect(o[1], unittest.equals('foo')); |
267 } | 267 } |
268 | 268 |
269 core.int buildCounterContact = 0; | 269 core.int buildCounterContact = 0; |
270 buildContact() { | 270 buildContact() { |
271 var o = new api.Contact(); | 271 var o = new api.Contact(); |
272 buildCounterContact++; | 272 buildCounterContact++; |
273 if (buildCounterContact < 3) { | 273 if (buildCounterContact < 3) { |
274 o.acceptCommands = buildUnnamed1403(); | 274 o.acceptCommands = buildUnnamed1410(); |
275 o.acceptTypes = buildUnnamed1404(); | 275 o.acceptTypes = buildUnnamed1411(); |
276 o.displayName = "foo"; | 276 o.displayName = "foo"; |
277 o.id = "foo"; | 277 o.id = "foo"; |
278 o.imageUrls = buildUnnamed1405(); | 278 o.imageUrls = buildUnnamed1412(); |
279 o.kind = "foo"; | 279 o.kind = "foo"; |
280 o.phoneNumber = "foo"; | 280 o.phoneNumber = "foo"; |
281 o.priority = 42; | 281 o.priority = 42; |
282 o.sharingFeatures = buildUnnamed1406(); | 282 o.sharingFeatures = buildUnnamed1413(); |
283 o.source = "foo"; | 283 o.source = "foo"; |
284 o.speakableName = "foo"; | 284 o.speakableName = "foo"; |
285 o.type = "foo"; | 285 o.type = "foo"; |
286 } | 286 } |
287 buildCounterContact--; | 287 buildCounterContact--; |
288 return o; | 288 return o; |
289 } | 289 } |
290 | 290 |
291 checkContact(api.Contact o) { | 291 checkContact(api.Contact o) { |
292 buildCounterContact++; | 292 buildCounterContact++; |
293 if (buildCounterContact < 3) { | 293 if (buildCounterContact < 3) { |
294 checkUnnamed1403(o.acceptCommands); | 294 checkUnnamed1410(o.acceptCommands); |
295 checkUnnamed1404(o.acceptTypes); | 295 checkUnnamed1411(o.acceptTypes); |
296 unittest.expect(o.displayName, unittest.equals('foo')); | 296 unittest.expect(o.displayName, unittest.equals('foo')); |
297 unittest.expect(o.id, unittest.equals('foo')); | 297 unittest.expect(o.id, unittest.equals('foo')); |
298 checkUnnamed1405(o.imageUrls); | 298 checkUnnamed1412(o.imageUrls); |
299 unittest.expect(o.kind, unittest.equals('foo')); | 299 unittest.expect(o.kind, unittest.equals('foo')); |
300 unittest.expect(o.phoneNumber, unittest.equals('foo')); | 300 unittest.expect(o.phoneNumber, unittest.equals('foo')); |
301 unittest.expect(o.priority, unittest.equals(42)); | 301 unittest.expect(o.priority, unittest.equals(42)); |
302 checkUnnamed1406(o.sharingFeatures); | 302 checkUnnamed1413(o.sharingFeatures); |
303 unittest.expect(o.source, unittest.equals('foo')); | 303 unittest.expect(o.source, unittest.equals('foo')); |
304 unittest.expect(o.speakableName, unittest.equals('foo')); | 304 unittest.expect(o.speakableName, unittest.equals('foo')); |
305 unittest.expect(o.type, unittest.equals('foo')); | 305 unittest.expect(o.type, unittest.equals('foo')); |
306 } | 306 } |
307 buildCounterContact--; | 307 buildCounterContact--; |
308 } | 308 } |
309 | 309 |
310 buildUnnamed1407() { | 310 buildUnnamed1414() { |
311 var o = new core.List<api.Contact>(); | 311 var o = new core.List<api.Contact>(); |
312 o.add(buildContact()); | 312 o.add(buildContact()); |
313 o.add(buildContact()); | 313 o.add(buildContact()); |
314 return o; | 314 return o; |
315 } | 315 } |
316 | 316 |
317 checkUnnamed1407(core.List<api.Contact> o) { | 317 checkUnnamed1414(core.List<api.Contact> o) { |
318 unittest.expect(o, unittest.hasLength(2)); | 318 unittest.expect(o, unittest.hasLength(2)); |
319 checkContact(o[0]); | 319 checkContact(o[0]); |
320 checkContact(o[1]); | 320 checkContact(o[1]); |
321 } | 321 } |
322 | 322 |
323 core.int buildCounterContactsListResponse = 0; | 323 core.int buildCounterContactsListResponse = 0; |
324 buildContactsListResponse() { | 324 buildContactsListResponse() { |
325 var o = new api.ContactsListResponse(); | 325 var o = new api.ContactsListResponse(); |
326 buildCounterContactsListResponse++; | 326 buildCounterContactsListResponse++; |
327 if (buildCounterContactsListResponse < 3) { | 327 if (buildCounterContactsListResponse < 3) { |
328 o.items = buildUnnamed1407(); | 328 o.items = buildUnnamed1414(); |
329 o.kind = "foo"; | 329 o.kind = "foo"; |
330 } | 330 } |
331 buildCounterContactsListResponse--; | 331 buildCounterContactsListResponse--; |
332 return o; | 332 return o; |
333 } | 333 } |
334 | 334 |
335 checkContactsListResponse(api.ContactsListResponse o) { | 335 checkContactsListResponse(api.ContactsListResponse o) { |
336 buildCounterContactsListResponse++; | 336 buildCounterContactsListResponse++; |
337 if (buildCounterContactsListResponse < 3) { | 337 if (buildCounterContactsListResponse < 3) { |
338 checkUnnamed1407(o.items); | 338 checkUnnamed1414(o.items); |
339 unittest.expect(o.kind, unittest.equals('foo')); | 339 unittest.expect(o.kind, unittest.equals('foo')); |
340 } | 340 } |
341 buildCounterContactsListResponse--; | 341 buildCounterContactsListResponse--; |
342 } | 342 } |
343 | 343 |
344 core.int buildCounterLocation = 0; | 344 core.int buildCounterLocation = 0; |
345 buildLocation() { | 345 buildLocation() { |
346 var o = new api.Location(); | 346 var o = new api.Location(); |
347 buildCounterLocation++; | 347 buildCounterLocation++; |
348 if (buildCounterLocation < 3) { | 348 if (buildCounterLocation < 3) { |
(...skipping 18 matching lines...) Expand all Loading... |
367 unittest.expect(o.displayName, unittest.equals('foo')); | 367 unittest.expect(o.displayName, unittest.equals('foo')); |
368 unittest.expect(o.id, unittest.equals('foo')); | 368 unittest.expect(o.id, unittest.equals('foo')); |
369 unittest.expect(o.kind, unittest.equals('foo')); | 369 unittest.expect(o.kind, unittest.equals('foo')); |
370 unittest.expect(o.latitude, unittest.equals(42.0)); | 370 unittest.expect(o.latitude, unittest.equals(42.0)); |
371 unittest.expect(o.longitude, unittest.equals(42.0)); | 371 unittest.expect(o.longitude, unittest.equals(42.0)); |
372 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"))); |
373 } | 373 } |
374 buildCounterLocation--; | 374 buildCounterLocation--; |
375 } | 375 } |
376 | 376 |
377 buildUnnamed1408() { | 377 buildUnnamed1415() { |
378 var o = new core.List<api.Location>(); | 378 var o = new core.List<api.Location>(); |
379 o.add(buildLocation()); | 379 o.add(buildLocation()); |
380 o.add(buildLocation()); | 380 o.add(buildLocation()); |
381 return o; | 381 return o; |
382 } | 382 } |
383 | 383 |
384 checkUnnamed1408(core.List<api.Location> o) { | 384 checkUnnamed1415(core.List<api.Location> o) { |
385 unittest.expect(o, unittest.hasLength(2)); | 385 unittest.expect(o, unittest.hasLength(2)); |
386 checkLocation(o[0]); | 386 checkLocation(o[0]); |
387 checkLocation(o[1]); | 387 checkLocation(o[1]); |
388 } | 388 } |
389 | 389 |
390 core.int buildCounterLocationsListResponse = 0; | 390 core.int buildCounterLocationsListResponse = 0; |
391 buildLocationsListResponse() { | 391 buildLocationsListResponse() { |
392 var o = new api.LocationsListResponse(); | 392 var o = new api.LocationsListResponse(); |
393 buildCounterLocationsListResponse++; | 393 buildCounterLocationsListResponse++; |
394 if (buildCounterLocationsListResponse < 3) { | 394 if (buildCounterLocationsListResponse < 3) { |
395 o.items = buildUnnamed1408(); | 395 o.items = buildUnnamed1415(); |
396 o.kind = "foo"; | 396 o.kind = "foo"; |
397 } | 397 } |
398 buildCounterLocationsListResponse--; | 398 buildCounterLocationsListResponse--; |
399 return o; | 399 return o; |
400 } | 400 } |
401 | 401 |
402 checkLocationsListResponse(api.LocationsListResponse o) { | 402 checkLocationsListResponse(api.LocationsListResponse o) { |
403 buildCounterLocationsListResponse++; | 403 buildCounterLocationsListResponse++; |
404 if (buildCounterLocationsListResponse < 3) { | 404 if (buildCounterLocationsListResponse < 3) { |
405 checkUnnamed1408(o.items); | 405 checkUnnamed1415(o.items); |
406 unittest.expect(o.kind, unittest.equals('foo')); | 406 unittest.expect(o.kind, unittest.equals('foo')); |
407 } | 407 } |
408 buildCounterLocationsListResponse--; | 408 buildCounterLocationsListResponse--; |
409 } | 409 } |
410 | 410 |
411 buildUnnamed1409() { | 411 buildUnnamed1416() { |
412 var o = new core.List<api.MenuValue>(); | 412 var o = new core.List<api.MenuValue>(); |
413 o.add(buildMenuValue()); | 413 o.add(buildMenuValue()); |
414 o.add(buildMenuValue()); | 414 o.add(buildMenuValue()); |
415 return o; | 415 return o; |
416 } | 416 } |
417 | 417 |
418 checkUnnamed1409(core.List<api.MenuValue> o) { | 418 checkUnnamed1416(core.List<api.MenuValue> o) { |
419 unittest.expect(o, unittest.hasLength(2)); | 419 unittest.expect(o, unittest.hasLength(2)); |
420 checkMenuValue(o[0]); | 420 checkMenuValue(o[0]); |
421 checkMenuValue(o[1]); | 421 checkMenuValue(o[1]); |
422 } | 422 } |
423 | 423 |
424 core.int buildCounterMenuItem = 0; | 424 core.int buildCounterMenuItem = 0; |
425 buildMenuItem() { | 425 buildMenuItem() { |
426 var o = new api.MenuItem(); | 426 var o = new api.MenuItem(); |
427 buildCounterMenuItem++; | 427 buildCounterMenuItem++; |
428 if (buildCounterMenuItem < 3) { | 428 if (buildCounterMenuItem < 3) { |
429 o.action = "foo"; | 429 o.action = "foo"; |
430 o.contextualCommand = "foo"; | 430 o.contextualCommand = "foo"; |
431 o.id = "foo"; | 431 o.id = "foo"; |
432 o.payload = "foo"; | 432 o.payload = "foo"; |
433 o.removeWhenSelected = true; | 433 o.removeWhenSelected = true; |
434 o.values = buildUnnamed1409(); | 434 o.values = buildUnnamed1416(); |
435 } | 435 } |
436 buildCounterMenuItem--; | 436 buildCounterMenuItem--; |
437 return o; | 437 return o; |
438 } | 438 } |
439 | 439 |
440 checkMenuItem(api.MenuItem o) { | 440 checkMenuItem(api.MenuItem o) { |
441 buildCounterMenuItem++; | 441 buildCounterMenuItem++; |
442 if (buildCounterMenuItem < 3) { | 442 if (buildCounterMenuItem < 3) { |
443 unittest.expect(o.action, unittest.equals('foo')); | 443 unittest.expect(o.action, unittest.equals('foo')); |
444 unittest.expect(o.contextualCommand, unittest.equals('foo')); | 444 unittest.expect(o.contextualCommand, unittest.equals('foo')); |
445 unittest.expect(o.id, unittest.equals('foo')); | 445 unittest.expect(o.id, unittest.equals('foo')); |
446 unittest.expect(o.payload, unittest.equals('foo')); | 446 unittest.expect(o.payload, unittest.equals('foo')); |
447 unittest.expect(o.removeWhenSelected, unittest.isTrue); | 447 unittest.expect(o.removeWhenSelected, unittest.isTrue); |
448 checkUnnamed1409(o.values); | 448 checkUnnamed1416(o.values); |
449 } | 449 } |
450 buildCounterMenuItem--; | 450 buildCounterMenuItem--; |
451 } | 451 } |
452 | 452 |
453 core.int buildCounterMenuValue = 0; | 453 core.int buildCounterMenuValue = 0; |
454 buildMenuValue() { | 454 buildMenuValue() { |
455 var o = new api.MenuValue(); | 455 var o = new api.MenuValue(); |
456 buildCounterMenuValue++; | 456 buildCounterMenuValue++; |
457 if (buildCounterMenuValue < 3) { | 457 if (buildCounterMenuValue < 3) { |
458 o.displayName = "foo"; | 458 o.displayName = "foo"; |
459 o.iconUrl = "foo"; | 459 o.iconUrl = "foo"; |
460 o.state = "foo"; | 460 o.state = "foo"; |
461 } | 461 } |
462 buildCounterMenuValue--; | 462 buildCounterMenuValue--; |
463 return o; | 463 return o; |
464 } | 464 } |
465 | 465 |
466 checkMenuValue(api.MenuValue o) { | 466 checkMenuValue(api.MenuValue o) { |
467 buildCounterMenuValue++; | 467 buildCounterMenuValue++; |
468 if (buildCounterMenuValue < 3) { | 468 if (buildCounterMenuValue < 3) { |
469 unittest.expect(o.displayName, unittest.equals('foo')); | 469 unittest.expect(o.displayName, unittest.equals('foo')); |
470 unittest.expect(o.iconUrl, unittest.equals('foo')); | 470 unittest.expect(o.iconUrl, unittest.equals('foo')); |
471 unittest.expect(o.state, unittest.equals('foo')); | 471 unittest.expect(o.state, unittest.equals('foo')); |
472 } | 472 } |
473 buildCounterMenuValue--; | 473 buildCounterMenuValue--; |
474 } | 474 } |
475 | 475 |
476 buildUnnamed1410() { | 476 buildUnnamed1417() { |
477 var o = new core.List<api.UserAction>(); | 477 var o = new core.List<api.UserAction>(); |
478 o.add(buildUserAction()); | 478 o.add(buildUserAction()); |
479 o.add(buildUserAction()); | 479 o.add(buildUserAction()); |
480 return o; | 480 return o; |
481 } | 481 } |
482 | 482 |
483 checkUnnamed1410(core.List<api.UserAction> o) { | 483 checkUnnamed1417(core.List<api.UserAction> o) { |
484 unittest.expect(o, unittest.hasLength(2)); | 484 unittest.expect(o, unittest.hasLength(2)); |
485 checkUserAction(o[0]); | 485 checkUserAction(o[0]); |
486 checkUserAction(o[1]); | 486 checkUserAction(o[1]); |
487 } | 487 } |
488 | 488 |
489 core.int buildCounterNotification = 0; | 489 core.int buildCounterNotification = 0; |
490 buildNotification() { | 490 buildNotification() { |
491 var o = new api.Notification(); | 491 var o = new api.Notification(); |
492 buildCounterNotification++; | 492 buildCounterNotification++; |
493 if (buildCounterNotification < 3) { | 493 if (buildCounterNotification < 3) { |
494 o.collection = "foo"; | 494 o.collection = "foo"; |
495 o.itemId = "foo"; | 495 o.itemId = "foo"; |
496 o.operation = "foo"; | 496 o.operation = "foo"; |
497 o.userActions = buildUnnamed1410(); | 497 o.userActions = buildUnnamed1417(); |
498 o.userToken = "foo"; | 498 o.userToken = "foo"; |
499 o.verifyToken = "foo"; | 499 o.verifyToken = "foo"; |
500 } | 500 } |
501 buildCounterNotification--; | 501 buildCounterNotification--; |
502 return o; | 502 return o; |
503 } | 503 } |
504 | 504 |
505 checkNotification(api.Notification o) { | 505 checkNotification(api.Notification o) { |
506 buildCounterNotification++; | 506 buildCounterNotification++; |
507 if (buildCounterNotification < 3) { | 507 if (buildCounterNotification < 3) { |
508 unittest.expect(o.collection, unittest.equals('foo')); | 508 unittest.expect(o.collection, unittest.equals('foo')); |
509 unittest.expect(o.itemId, unittest.equals('foo')); | 509 unittest.expect(o.itemId, unittest.equals('foo')); |
510 unittest.expect(o.operation, unittest.equals('foo')); | 510 unittest.expect(o.operation, unittest.equals('foo')); |
511 checkUnnamed1410(o.userActions); | 511 checkUnnamed1417(o.userActions); |
512 unittest.expect(o.userToken, unittest.equals('foo')); | 512 unittest.expect(o.userToken, unittest.equals('foo')); |
513 unittest.expect(o.verifyToken, unittest.equals('foo')); | 513 unittest.expect(o.verifyToken, unittest.equals('foo')); |
514 } | 514 } |
515 buildCounterNotification--; | 515 buildCounterNotification--; |
516 } | 516 } |
517 | 517 |
518 core.int buildCounterNotificationConfig = 0; | 518 core.int buildCounterNotificationConfig = 0; |
519 buildNotificationConfig() { | 519 buildNotificationConfig() { |
520 var o = new api.NotificationConfig(); | 520 var o = new api.NotificationConfig(); |
521 buildCounterNotificationConfig++; | 521 buildCounterNotificationConfig++; |
(...skipping 30 matching lines...) Expand all Loading... |
552 checkSetting(api.Setting o) { | 552 checkSetting(api.Setting o) { |
553 buildCounterSetting++; | 553 buildCounterSetting++; |
554 if (buildCounterSetting < 3) { | 554 if (buildCounterSetting < 3) { |
555 unittest.expect(o.id, unittest.equals('foo')); | 555 unittest.expect(o.id, unittest.equals('foo')); |
556 unittest.expect(o.kind, unittest.equals('foo')); | 556 unittest.expect(o.kind, unittest.equals('foo')); |
557 unittest.expect(o.value, unittest.equals('foo')); | 557 unittest.expect(o.value, unittest.equals('foo')); |
558 } | 558 } |
559 buildCounterSetting--; | 559 buildCounterSetting--; |
560 } | 560 } |
561 | 561 |
562 buildUnnamed1411() { | 562 buildUnnamed1418() { |
563 var o = new core.List<core.String>(); | 563 var o = new core.List<core.String>(); |
564 o.add("foo"); | 564 o.add("foo"); |
565 o.add("foo"); | 565 o.add("foo"); |
566 return o; | 566 return o; |
567 } | 567 } |
568 | 568 |
569 checkUnnamed1411(core.List<core.String> o) { | 569 checkUnnamed1418(core.List<core.String> o) { |
570 unittest.expect(o, unittest.hasLength(2)); | 570 unittest.expect(o, unittest.hasLength(2)); |
571 unittest.expect(o[0], unittest.equals('foo')); | 571 unittest.expect(o[0], unittest.equals('foo')); |
572 unittest.expect(o[1], unittest.equals('foo')); | 572 unittest.expect(o[1], unittest.equals('foo')); |
573 } | 573 } |
574 | 574 |
575 core.int buildCounterSubscription = 0; | 575 core.int buildCounterSubscription = 0; |
576 buildSubscription() { | 576 buildSubscription() { |
577 var o = new api.Subscription(); | 577 var o = new api.Subscription(); |
578 buildCounterSubscription++; | 578 buildCounterSubscription++; |
579 if (buildCounterSubscription < 3) { | 579 if (buildCounterSubscription < 3) { |
580 o.callbackUrl = "foo"; | 580 o.callbackUrl = "foo"; |
581 o.collection = "foo"; | 581 o.collection = "foo"; |
582 o.id = "foo"; | 582 o.id = "foo"; |
583 o.kind = "foo"; | 583 o.kind = "foo"; |
584 o.notification = buildNotification(); | 584 o.notification = buildNotification(); |
585 o.operation = buildUnnamed1411(); | 585 o.operation = buildUnnamed1418(); |
586 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | 586 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
587 o.userToken = "foo"; | 587 o.userToken = "foo"; |
588 o.verifyToken = "foo"; | 588 o.verifyToken = "foo"; |
589 } | 589 } |
590 buildCounterSubscription--; | 590 buildCounterSubscription--; |
591 return o; | 591 return o; |
592 } | 592 } |
593 | 593 |
594 checkSubscription(api.Subscription o) { | 594 checkSubscription(api.Subscription o) { |
595 buildCounterSubscription++; | 595 buildCounterSubscription++; |
596 if (buildCounterSubscription < 3) { | 596 if (buildCounterSubscription < 3) { |
597 unittest.expect(o.callbackUrl, unittest.equals('foo')); | 597 unittest.expect(o.callbackUrl, unittest.equals('foo')); |
598 unittest.expect(o.collection, unittest.equals('foo')); | 598 unittest.expect(o.collection, unittest.equals('foo')); |
599 unittest.expect(o.id, unittest.equals('foo')); | 599 unittest.expect(o.id, unittest.equals('foo')); |
600 unittest.expect(o.kind, unittest.equals('foo')); | 600 unittest.expect(o.kind, unittest.equals('foo')); |
601 checkNotification(o.notification); | 601 checkNotification(o.notification); |
602 checkUnnamed1411(o.operation); | 602 checkUnnamed1418(o.operation); |
603 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"))); |
604 unittest.expect(o.userToken, unittest.equals('foo')); | 604 unittest.expect(o.userToken, unittest.equals('foo')); |
605 unittest.expect(o.verifyToken, unittest.equals('foo')); | 605 unittest.expect(o.verifyToken, unittest.equals('foo')); |
606 } | 606 } |
607 buildCounterSubscription--; | 607 buildCounterSubscription--; |
608 } | 608 } |
609 | 609 |
610 buildUnnamed1412() { | 610 buildUnnamed1419() { |
611 var o = new core.List<api.Subscription>(); | 611 var o = new core.List<api.Subscription>(); |
612 o.add(buildSubscription()); | 612 o.add(buildSubscription()); |
613 o.add(buildSubscription()); | 613 o.add(buildSubscription()); |
614 return o; | 614 return o; |
615 } | 615 } |
616 | 616 |
617 checkUnnamed1412(core.List<api.Subscription> o) { | 617 checkUnnamed1419(core.List<api.Subscription> o) { |
618 unittest.expect(o, unittest.hasLength(2)); | 618 unittest.expect(o, unittest.hasLength(2)); |
619 checkSubscription(o[0]); | 619 checkSubscription(o[0]); |
620 checkSubscription(o[1]); | 620 checkSubscription(o[1]); |
621 } | 621 } |
622 | 622 |
623 core.int buildCounterSubscriptionsListResponse = 0; | 623 core.int buildCounterSubscriptionsListResponse = 0; |
624 buildSubscriptionsListResponse() { | 624 buildSubscriptionsListResponse() { |
625 var o = new api.SubscriptionsListResponse(); | 625 var o = new api.SubscriptionsListResponse(); |
626 buildCounterSubscriptionsListResponse++; | 626 buildCounterSubscriptionsListResponse++; |
627 if (buildCounterSubscriptionsListResponse < 3) { | 627 if (buildCounterSubscriptionsListResponse < 3) { |
628 o.items = buildUnnamed1412(); | 628 o.items = buildUnnamed1419(); |
629 o.kind = "foo"; | 629 o.kind = "foo"; |
630 } | 630 } |
631 buildCounterSubscriptionsListResponse--; | 631 buildCounterSubscriptionsListResponse--; |
632 return o; | 632 return o; |
633 } | 633 } |
634 | 634 |
635 checkSubscriptionsListResponse(api.SubscriptionsListResponse o) { | 635 checkSubscriptionsListResponse(api.SubscriptionsListResponse o) { |
636 buildCounterSubscriptionsListResponse++; | 636 buildCounterSubscriptionsListResponse++; |
637 if (buildCounterSubscriptionsListResponse < 3) { | 637 if (buildCounterSubscriptionsListResponse < 3) { |
638 checkUnnamed1412(o.items); | 638 checkUnnamed1419(o.items); |
639 unittest.expect(o.kind, unittest.equals('foo')); | 639 unittest.expect(o.kind, unittest.equals('foo')); |
640 } | 640 } |
641 buildCounterSubscriptionsListResponse--; | 641 buildCounterSubscriptionsListResponse--; |
642 } | 642 } |
643 | 643 |
644 buildUnnamed1413() { | 644 buildUnnamed1420() { |
645 var o = new core.List<api.Attachment>(); | 645 var o = new core.List<api.Attachment>(); |
646 o.add(buildAttachment()); | 646 o.add(buildAttachment()); |
647 o.add(buildAttachment()); | 647 o.add(buildAttachment()); |
648 return o; | 648 return o; |
649 } | 649 } |
650 | 650 |
651 checkUnnamed1413(core.List<api.Attachment> o) { | 651 checkUnnamed1420(core.List<api.Attachment> o) { |
652 unittest.expect(o, unittest.hasLength(2)); | 652 unittest.expect(o, unittest.hasLength(2)); |
653 checkAttachment(o[0]); | 653 checkAttachment(o[0]); |
654 checkAttachment(o[1]); | 654 checkAttachment(o[1]); |
655 } | 655 } |
656 | 656 |
657 buildUnnamed1414() { | 657 buildUnnamed1421() { |
658 var o = new core.List<api.MenuItem>(); | 658 var o = new core.List<api.MenuItem>(); |
659 o.add(buildMenuItem()); | 659 o.add(buildMenuItem()); |
660 o.add(buildMenuItem()); | 660 o.add(buildMenuItem()); |
661 return o; | 661 return o; |
662 } | 662 } |
663 | 663 |
664 checkUnnamed1414(core.List<api.MenuItem> o) { | 664 checkUnnamed1421(core.List<api.MenuItem> o) { |
665 unittest.expect(o, unittest.hasLength(2)); | 665 unittest.expect(o, unittest.hasLength(2)); |
666 checkMenuItem(o[0]); | 666 checkMenuItem(o[0]); |
667 checkMenuItem(o[1]); | 667 checkMenuItem(o[1]); |
668 } | 668 } |
669 | 669 |
670 buildUnnamed1415() { | 670 buildUnnamed1422() { |
671 var o = new core.List<api.Contact>(); | 671 var o = new core.List<api.Contact>(); |
672 o.add(buildContact()); | 672 o.add(buildContact()); |
673 o.add(buildContact()); | 673 o.add(buildContact()); |
674 return o; | 674 return o; |
675 } | 675 } |
676 | 676 |
677 checkUnnamed1415(core.List<api.Contact> o) { | 677 checkUnnamed1422(core.List<api.Contact> o) { |
678 unittest.expect(o, unittest.hasLength(2)); | 678 unittest.expect(o, unittest.hasLength(2)); |
679 checkContact(o[0]); | 679 checkContact(o[0]); |
680 checkContact(o[1]); | 680 checkContact(o[1]); |
681 } | 681 } |
682 | 682 |
683 core.int buildCounterTimelineItem = 0; | 683 core.int buildCounterTimelineItem = 0; |
684 buildTimelineItem() { | 684 buildTimelineItem() { |
685 var o = new api.TimelineItem(); | 685 var o = new api.TimelineItem(); |
686 buildCounterTimelineItem++; | 686 buildCounterTimelineItem++; |
687 if (buildCounterTimelineItem < 3) { | 687 if (buildCounterTimelineItem < 3) { |
688 o.attachments = buildUnnamed1413(); | 688 o.attachments = buildUnnamed1420(); |
689 o.bundleId = "foo"; | 689 o.bundleId = "foo"; |
690 o.canonicalUrl = "foo"; | 690 o.canonicalUrl = "foo"; |
691 o.created = core.DateTime.parse("2002-02-27T14:01:02"); | 691 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
692 o.creator = buildContact(); | 692 o.creator = buildContact(); |
693 o.displayTime = core.DateTime.parse("2002-02-27T14:01:02"); | 693 o.displayTime = core.DateTime.parse("2002-02-27T14:01:02"); |
694 o.etag = "foo"; | 694 o.etag = "foo"; |
695 o.html = "foo"; | 695 o.html = "foo"; |
696 o.id = "foo"; | 696 o.id = "foo"; |
697 o.inReplyTo = "foo"; | 697 o.inReplyTo = "foo"; |
698 o.isBundleCover = true; | 698 o.isBundleCover = true; |
699 o.isDeleted = true; | 699 o.isDeleted = true; |
700 o.isPinned = true; | 700 o.isPinned = true; |
701 o.kind = "foo"; | 701 o.kind = "foo"; |
702 o.location = buildLocation(); | 702 o.location = buildLocation(); |
703 o.menuItems = buildUnnamed1414(); | 703 o.menuItems = buildUnnamed1421(); |
704 o.notification = buildNotificationConfig(); | 704 o.notification = buildNotificationConfig(); |
705 o.pinScore = 42; | 705 o.pinScore = 42; |
706 o.recipients = buildUnnamed1415(); | 706 o.recipients = buildUnnamed1422(); |
707 o.selfLink = "foo"; | 707 o.selfLink = "foo"; |
708 o.sourceItemId = "foo"; | 708 o.sourceItemId = "foo"; |
709 o.speakableText = "foo"; | 709 o.speakableText = "foo"; |
710 o.speakableType = "foo"; | 710 o.speakableType = "foo"; |
711 o.text = "foo"; | 711 o.text = "foo"; |
712 o.title = "foo"; | 712 o.title = "foo"; |
713 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | 713 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
714 } | 714 } |
715 buildCounterTimelineItem--; | 715 buildCounterTimelineItem--; |
716 return o; | 716 return o; |
717 } | 717 } |
718 | 718 |
719 checkTimelineItem(api.TimelineItem o) { | 719 checkTimelineItem(api.TimelineItem o) { |
720 buildCounterTimelineItem++; | 720 buildCounterTimelineItem++; |
721 if (buildCounterTimelineItem < 3) { | 721 if (buildCounterTimelineItem < 3) { |
722 checkUnnamed1413(o.attachments); | 722 checkUnnamed1420(o.attachments); |
723 unittest.expect(o.bundleId, unittest.equals('foo')); | 723 unittest.expect(o.bundleId, unittest.equals('foo')); |
724 unittest.expect(o.canonicalUrl, unittest.equals('foo')); | 724 unittest.expect(o.canonicalUrl, unittest.equals('foo')); |
725 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"))); |
726 checkContact(o.creator); | 726 checkContact(o.creator); |
727 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"))); |
728 unittest.expect(o.etag, unittest.equals('foo')); | 728 unittest.expect(o.etag, unittest.equals('foo')); |
729 unittest.expect(o.html, unittest.equals('foo')); | 729 unittest.expect(o.html, unittest.equals('foo')); |
730 unittest.expect(o.id, unittest.equals('foo')); | 730 unittest.expect(o.id, unittest.equals('foo')); |
731 unittest.expect(o.inReplyTo, unittest.equals('foo')); | 731 unittest.expect(o.inReplyTo, unittest.equals('foo')); |
732 unittest.expect(o.isBundleCover, unittest.isTrue); | 732 unittest.expect(o.isBundleCover, unittest.isTrue); |
733 unittest.expect(o.isDeleted, unittest.isTrue); | 733 unittest.expect(o.isDeleted, unittest.isTrue); |
734 unittest.expect(o.isPinned, unittest.isTrue); | 734 unittest.expect(o.isPinned, unittest.isTrue); |
735 unittest.expect(o.kind, unittest.equals('foo')); | 735 unittest.expect(o.kind, unittest.equals('foo')); |
736 checkLocation(o.location); | 736 checkLocation(o.location); |
737 checkUnnamed1414(o.menuItems); | 737 checkUnnamed1421(o.menuItems); |
738 checkNotificationConfig(o.notification); | 738 checkNotificationConfig(o.notification); |
739 unittest.expect(o.pinScore, unittest.equals(42)); | 739 unittest.expect(o.pinScore, unittest.equals(42)); |
740 checkUnnamed1415(o.recipients); | 740 checkUnnamed1422(o.recipients); |
741 unittest.expect(o.selfLink, unittest.equals('foo')); | 741 unittest.expect(o.selfLink, unittest.equals('foo')); |
742 unittest.expect(o.sourceItemId, unittest.equals('foo')); | 742 unittest.expect(o.sourceItemId, unittest.equals('foo')); |
743 unittest.expect(o.speakableText, unittest.equals('foo')); | 743 unittest.expect(o.speakableText, unittest.equals('foo')); |
744 unittest.expect(o.speakableType, unittest.equals('foo')); | 744 unittest.expect(o.speakableType, unittest.equals('foo')); |
745 unittest.expect(o.text, unittest.equals('foo')); | 745 unittest.expect(o.text, unittest.equals('foo')); |
746 unittest.expect(o.title, unittest.equals('foo')); | 746 unittest.expect(o.title, unittest.equals('foo')); |
747 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"))); |
748 } | 748 } |
749 buildCounterTimelineItem--; | 749 buildCounterTimelineItem--; |
750 } | 750 } |
751 | 751 |
752 buildUnnamed1416() { | 752 buildUnnamed1423() { |
753 var o = new core.List<api.TimelineItem>(); | 753 var o = new core.List<api.TimelineItem>(); |
754 o.add(buildTimelineItem()); | 754 o.add(buildTimelineItem()); |
755 o.add(buildTimelineItem()); | 755 o.add(buildTimelineItem()); |
756 return o; | 756 return o; |
757 } | 757 } |
758 | 758 |
759 checkUnnamed1416(core.List<api.TimelineItem> o) { | 759 checkUnnamed1423(core.List<api.TimelineItem> o) { |
760 unittest.expect(o, unittest.hasLength(2)); | 760 unittest.expect(o, unittest.hasLength(2)); |
761 checkTimelineItem(o[0]); | 761 checkTimelineItem(o[0]); |
762 checkTimelineItem(o[1]); | 762 checkTimelineItem(o[1]); |
763 } | 763 } |
764 | 764 |
765 core.int buildCounterTimelineListResponse = 0; | 765 core.int buildCounterTimelineListResponse = 0; |
766 buildTimelineListResponse() { | 766 buildTimelineListResponse() { |
767 var o = new api.TimelineListResponse(); | 767 var o = new api.TimelineListResponse(); |
768 buildCounterTimelineListResponse++; | 768 buildCounterTimelineListResponse++; |
769 if (buildCounterTimelineListResponse < 3) { | 769 if (buildCounterTimelineListResponse < 3) { |
770 o.items = buildUnnamed1416(); | 770 o.items = buildUnnamed1423(); |
771 o.kind = "foo"; | 771 o.kind = "foo"; |
772 o.nextPageToken = "foo"; | 772 o.nextPageToken = "foo"; |
773 } | 773 } |
774 buildCounterTimelineListResponse--; | 774 buildCounterTimelineListResponse--; |
775 return o; | 775 return o; |
776 } | 776 } |
777 | 777 |
778 checkTimelineListResponse(api.TimelineListResponse o) { | 778 checkTimelineListResponse(api.TimelineListResponse o) { |
779 buildCounterTimelineListResponse++; | 779 buildCounterTimelineListResponse++; |
780 if (buildCounterTimelineListResponse < 3) { | 780 if (buildCounterTimelineListResponse < 3) { |
781 checkUnnamed1416(o.items); | 781 checkUnnamed1423(o.items); |
782 unittest.expect(o.kind, unittest.equals('foo')); | 782 unittest.expect(o.kind, unittest.equals('foo')); |
783 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 783 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
784 } | 784 } |
785 buildCounterTimelineListResponse--; | 785 buildCounterTimelineListResponse--; |
786 } | 786 } |
787 | 787 |
788 core.int buildCounterUserAction = 0; | 788 core.int buildCounterUserAction = 0; |
789 buildUserAction() { | 789 buildUserAction() { |
790 var o = new api.UserAction(); | 790 var o = new api.UserAction(); |
791 buildCounterUserAction++; | 791 buildCounterUserAction++; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 | 1011 |
1012 unittest.group("resource-AccountsResourceApi", () { | 1012 unittest.group("resource-AccountsResourceApi", () { |
1013 unittest.test("method--insert", () { | 1013 unittest.test("method--insert", () { |
1014 | 1014 |
1015 var mock = new HttpServerMock(); | 1015 var mock = new HttpServerMock(); |
1016 api.AccountsResourceApi res = new api.MirrorApi(mock).accounts; | 1016 api.AccountsResourceApi res = new api.MirrorApi(mock).accounts; |
1017 var arg_request = buildAccount(); | 1017 var arg_request = buildAccount(); |
1018 var arg_userToken = "foo"; | 1018 var arg_userToken = "foo"; |
1019 var arg_accountType = "foo"; | 1019 var arg_accountType = "foo"; |
1020 var arg_accountName = "foo"; | 1020 var arg_accountName = "foo"; |
1021 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1021 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1022 var obj = new api.Account.fromJson(json); | 1022 var obj = new api.Account.fromJson(json); |
1023 checkAccount(obj); | 1023 checkAccount(obj); |
1024 | 1024 |
1025 var path = (req.url).path; | 1025 var path = (req.url).path; |
1026 var pathOffset = 0; | 1026 var pathOffset = 0; |
1027 var index; | 1027 var index; |
1028 var subPart; | 1028 var subPart; |
1029 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1029 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1030 pathOffset += 1; | 1030 pathOffset += 1; |
1031 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1031 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 } | 1067 } |
1068 } | 1068 } |
1069 | 1069 |
1070 | 1070 |
1071 var h = { | 1071 var h = { |
1072 "content-type" : "application/json; charset=utf-8", | 1072 "content-type" : "application/json; charset=utf-8", |
1073 }; | 1073 }; |
1074 var resp = convert.JSON.encode(buildAccount()); | 1074 var resp = convert.JSON.encode(buildAccount()); |
1075 return new async.Future.value(stringResponse(200, h, resp)); | 1075 return new async.Future.value(stringResponse(200, h, resp)); |
1076 }), true); | 1076 }), true); |
1077 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.expectAsync1(((api.Account response) { |
1078 checkAccount(response); | 1078 checkAccount(response); |
1079 }))); | 1079 }))); |
1080 }); | 1080 }); |
1081 | 1081 |
1082 }); | 1082 }); |
1083 | 1083 |
1084 | 1084 |
1085 unittest.group("resource-ContactsResourceApi", () { | 1085 unittest.group("resource-ContactsResourceApi", () { |
1086 unittest.test("method--delete", () { | 1086 unittest.test("method--delete", () { |
1087 | 1087 |
1088 var mock = new HttpServerMock(); | 1088 var mock = new HttpServerMock(); |
1089 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1089 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1090 var arg_id = "foo"; | 1090 var arg_id = "foo"; |
1091 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1091 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1092 var path = (req.url).path; | 1092 var path = (req.url).path; |
1093 var pathOffset = 0; | 1093 var pathOffset = 0; |
1094 var index; | 1094 var index; |
1095 var subPart; | 1095 var subPart; |
1096 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1096 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1097 pathOffset += 1; | 1097 pathOffset += 1; |
1098 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/")); |
1099 pathOffset += 10; | 1099 pathOffset += 10; |
1100 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("contacts/")); | 1100 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("contacts/")); |
1101 pathOffset += 9; | 1101 pathOffset += 9; |
(...skipping 18 matching lines...) Expand all Loading... |
1120 } | 1120 } |
1121 } | 1121 } |
1122 | 1122 |
1123 | 1123 |
1124 var h = { | 1124 var h = { |
1125 "content-type" : "application/json; charset=utf-8", | 1125 "content-type" : "application/json; charset=utf-8", |
1126 }; | 1126 }; |
1127 var resp = ""; | 1127 var resp = ""; |
1128 return new async.Future.value(stringResponse(200, h, resp)); | 1128 return new async.Future.value(stringResponse(200, h, resp)); |
1129 }), true); | 1129 }), true); |
1130 res.delete(arg_id).then(unittest.expectAsync((_) {})); | 1130 res.delete(arg_id).then(unittest.expectAsync1((_) {})); |
1131 }); | 1131 }); |
1132 | 1132 |
1133 unittest.test("method--get", () { | 1133 unittest.test("method--get", () { |
1134 | 1134 |
1135 var mock = new HttpServerMock(); | 1135 var mock = new HttpServerMock(); |
1136 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1136 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1137 var arg_id = "foo"; | 1137 var arg_id = "foo"; |
1138 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1138 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1139 var path = (req.url).path; | 1139 var path = (req.url).path; |
1140 var pathOffset = 0; | 1140 var pathOffset = 0; |
1141 var index; | 1141 var index; |
1142 var subPart; | 1142 var subPart; |
1143 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1143 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1144 pathOffset += 1; | 1144 pathOffset += 1; |
1145 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/")); |
1146 pathOffset += 10; | 1146 pathOffset += 10; |
1147 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("contacts/")); | 1147 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("contacts/")); |
1148 pathOffset += 9; | 1148 pathOffset += 9; |
(...skipping 18 matching lines...) Expand all Loading... |
1167 } | 1167 } |
1168 } | 1168 } |
1169 | 1169 |
1170 | 1170 |
1171 var h = { | 1171 var h = { |
1172 "content-type" : "application/json; charset=utf-8", | 1172 "content-type" : "application/json; charset=utf-8", |
1173 }; | 1173 }; |
1174 var resp = convert.JSON.encode(buildContact()); | 1174 var resp = convert.JSON.encode(buildContact()); |
1175 return new async.Future.value(stringResponse(200, h, resp)); | 1175 return new async.Future.value(stringResponse(200, h, resp)); |
1176 }), true); | 1176 }), true); |
1177 res.get(arg_id).then(unittest.expectAsync(((api.Contact response) { | 1177 res.get(arg_id).then(unittest.expectAsync1(((api.Contact response) { |
1178 checkContact(response); | 1178 checkContact(response); |
1179 }))); | 1179 }))); |
1180 }); | 1180 }); |
1181 | 1181 |
1182 unittest.test("method--insert", () { | 1182 unittest.test("method--insert", () { |
1183 | 1183 |
1184 var mock = new HttpServerMock(); | 1184 var mock = new HttpServerMock(); |
1185 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1185 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1186 var arg_request = buildContact(); | 1186 var arg_request = buildContact(); |
1187 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1187 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1188 var obj = new api.Contact.fromJson(json); | 1188 var obj = new api.Contact.fromJson(json); |
1189 checkContact(obj); | 1189 checkContact(obj); |
1190 | 1190 |
1191 var path = (req.url).path; | 1191 var path = (req.url).path; |
1192 var pathOffset = 0; | 1192 var pathOffset = 0; |
1193 var index; | 1193 var index; |
1194 var subPart; | 1194 var subPart; |
1195 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1195 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1196 pathOffset += 1; | 1196 pathOffset += 1; |
1197 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1197 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1216 } | 1216 } |
1217 } | 1217 } |
1218 | 1218 |
1219 | 1219 |
1220 var h = { | 1220 var h = { |
1221 "content-type" : "application/json; charset=utf-8", | 1221 "content-type" : "application/json; charset=utf-8", |
1222 }; | 1222 }; |
1223 var resp = convert.JSON.encode(buildContact()); | 1223 var resp = convert.JSON.encode(buildContact()); |
1224 return new async.Future.value(stringResponse(200, h, resp)); | 1224 return new async.Future.value(stringResponse(200, h, resp)); |
1225 }), true); | 1225 }), true); |
1226 res.insert(arg_request).then(unittest.expectAsync(((api.Contact response)
{ | 1226 res.insert(arg_request).then(unittest.expectAsync1(((api.Contact response)
{ |
1227 checkContact(response); | 1227 checkContact(response); |
1228 }))); | 1228 }))); |
1229 }); | 1229 }); |
1230 | 1230 |
1231 unittest.test("method--list", () { | 1231 unittest.test("method--list", () { |
1232 | 1232 |
1233 var mock = new HttpServerMock(); | 1233 var mock = new HttpServerMock(); |
1234 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1234 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1235 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1235 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1236 var path = (req.url).path; | 1236 var path = (req.url).path; |
1237 var pathOffset = 0; | 1237 var pathOffset = 0; |
1238 var index; | 1238 var index; |
1239 var subPart; | 1239 var subPart; |
1240 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1240 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1241 pathOffset += 1; | 1241 pathOffset += 1; |
1242 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/")); |
1243 pathOffset += 10; | 1243 pathOffset += 10; |
1244 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("contacts")); | 1244 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("contacts")); |
1245 pathOffset += 8; | 1245 pathOffset += 8; |
(...skipping 15 matching lines...) Expand all Loading... |
1261 } | 1261 } |
1262 } | 1262 } |
1263 | 1263 |
1264 | 1264 |
1265 var h = { | 1265 var h = { |
1266 "content-type" : "application/json; charset=utf-8", | 1266 "content-type" : "application/json; charset=utf-8", |
1267 }; | 1267 }; |
1268 var resp = convert.JSON.encode(buildContactsListResponse()); | 1268 var resp = convert.JSON.encode(buildContactsListResponse()); |
1269 return new async.Future.value(stringResponse(200, h, resp)); | 1269 return new async.Future.value(stringResponse(200, h, resp)); |
1270 }), true); | 1270 }), true); |
1271 res.list().then(unittest.expectAsync(((api.ContactsListResponse response)
{ | 1271 res.list().then(unittest.expectAsync1(((api.ContactsListResponse response)
{ |
1272 checkContactsListResponse(response); | 1272 checkContactsListResponse(response); |
1273 }))); | 1273 }))); |
1274 }); | 1274 }); |
1275 | 1275 |
1276 unittest.test("method--patch", () { | 1276 unittest.test("method--patch", () { |
1277 | 1277 |
1278 var mock = new HttpServerMock(); | 1278 var mock = new HttpServerMock(); |
1279 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1279 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1280 var arg_request = buildContact(); | 1280 var arg_request = buildContact(); |
1281 var arg_id = "foo"; | 1281 var arg_id = "foo"; |
1282 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1282 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1283 var obj = new api.Contact.fromJson(json); | 1283 var obj = new api.Contact.fromJson(json); |
1284 checkContact(obj); | 1284 checkContact(obj); |
1285 | 1285 |
1286 var path = (req.url).path; | 1286 var path = (req.url).path; |
1287 var pathOffset = 0; | 1287 var pathOffset = 0; |
1288 var index; | 1288 var index; |
1289 var subPart; | 1289 var subPart; |
1290 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1290 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1291 pathOffset += 1; | 1291 pathOffset += 1; |
1292 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1292 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 21 matching lines...) Expand all Loading... |
1314 } | 1314 } |
1315 } | 1315 } |
1316 | 1316 |
1317 | 1317 |
1318 var h = { | 1318 var h = { |
1319 "content-type" : "application/json; charset=utf-8", | 1319 "content-type" : "application/json; charset=utf-8", |
1320 }; | 1320 }; |
1321 var resp = convert.JSON.encode(buildContact()); | 1321 var resp = convert.JSON.encode(buildContact()); |
1322 return new async.Future.value(stringResponse(200, h, resp)); | 1322 return new async.Future.value(stringResponse(200, h, resp)); |
1323 }), true); | 1323 }), true); |
1324 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.Contact res
ponse) { | 1324 res.patch(arg_request, arg_id).then(unittest.expectAsync1(((api.Contact re
sponse) { |
1325 checkContact(response); | 1325 checkContact(response); |
1326 }))); | 1326 }))); |
1327 }); | 1327 }); |
1328 | 1328 |
1329 unittest.test("method--update", () { | 1329 unittest.test("method--update", () { |
1330 | 1330 |
1331 var mock = new HttpServerMock(); | 1331 var mock = new HttpServerMock(); |
1332 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; | 1332 api.ContactsResourceApi res = new api.MirrorApi(mock).contacts; |
1333 var arg_request = buildContact(); | 1333 var arg_request = buildContact(); |
1334 var arg_id = "foo"; | 1334 var arg_id = "foo"; |
1335 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1335 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1336 var obj = new api.Contact.fromJson(json); | 1336 var obj = new api.Contact.fromJson(json); |
1337 checkContact(obj); | 1337 checkContact(obj); |
1338 | 1338 |
1339 var path = (req.url).path; | 1339 var path = (req.url).path; |
1340 var pathOffset = 0; | 1340 var pathOffset = 0; |
1341 var index; | 1341 var index; |
1342 var subPart; | 1342 var subPart; |
1343 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1343 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1344 pathOffset += 1; | 1344 pathOffset += 1; |
1345 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1345 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 21 matching lines...) Expand all Loading... |
1367 } | 1367 } |
1368 } | 1368 } |
1369 | 1369 |
1370 | 1370 |
1371 var h = { | 1371 var h = { |
1372 "content-type" : "application/json; charset=utf-8", | 1372 "content-type" : "application/json; charset=utf-8", |
1373 }; | 1373 }; |
1374 var resp = convert.JSON.encode(buildContact()); | 1374 var resp = convert.JSON.encode(buildContact()); |
1375 return new async.Future.value(stringResponse(200, h, resp)); | 1375 return new async.Future.value(stringResponse(200, h, resp)); |
1376 }), true); | 1376 }), true); |
1377 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Contact re
sponse) { | 1377 res.update(arg_request, arg_id).then(unittest.expectAsync1(((api.Contact r
esponse) { |
1378 checkContact(response); | 1378 checkContact(response); |
1379 }))); | 1379 }))); |
1380 }); | 1380 }); |
1381 | 1381 |
1382 }); | 1382 }); |
1383 | 1383 |
1384 | 1384 |
1385 unittest.group("resource-LocationsResourceApi", () { | 1385 unittest.group("resource-LocationsResourceApi", () { |
1386 unittest.test("method--get", () { | 1386 unittest.test("method--get", () { |
1387 | 1387 |
1388 var mock = new HttpServerMock(); | 1388 var mock = new HttpServerMock(); |
1389 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; | 1389 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; |
1390 var arg_id = "foo"; | 1390 var arg_id = "foo"; |
1391 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1391 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1392 var path = (req.url).path; | 1392 var path = (req.url).path; |
1393 var pathOffset = 0; | 1393 var pathOffset = 0; |
1394 var index; | 1394 var index; |
1395 var subPart; | 1395 var subPart; |
1396 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1396 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1397 pathOffset += 1; | 1397 pathOffset += 1; |
1398 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/")); |
1399 pathOffset += 10; | 1399 pathOffset += 10; |
1400 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("locations/")); | 1400 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("locations/")); |
1401 pathOffset += 10; | 1401 pathOffset += 10; |
(...skipping 18 matching lines...) Expand all Loading... |
1420 } | 1420 } |
1421 } | 1421 } |
1422 | 1422 |
1423 | 1423 |
1424 var h = { | 1424 var h = { |
1425 "content-type" : "application/json; charset=utf-8", | 1425 "content-type" : "application/json; charset=utf-8", |
1426 }; | 1426 }; |
1427 var resp = convert.JSON.encode(buildLocation()); | 1427 var resp = convert.JSON.encode(buildLocation()); |
1428 return new async.Future.value(stringResponse(200, h, resp)); | 1428 return new async.Future.value(stringResponse(200, h, resp)); |
1429 }), true); | 1429 }), true); |
1430 res.get(arg_id).then(unittest.expectAsync(((api.Location response) { | 1430 res.get(arg_id).then(unittest.expectAsync1(((api.Location response) { |
1431 checkLocation(response); | 1431 checkLocation(response); |
1432 }))); | 1432 }))); |
1433 }); | 1433 }); |
1434 | 1434 |
1435 unittest.test("method--list", () { | 1435 unittest.test("method--list", () { |
1436 | 1436 |
1437 var mock = new HttpServerMock(); | 1437 var mock = new HttpServerMock(); |
1438 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; | 1438 api.LocationsResourceApi res = new api.MirrorApi(mock).locations; |
1439 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1439 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1440 var path = (req.url).path; | 1440 var path = (req.url).path; |
1441 var pathOffset = 0; | 1441 var pathOffset = 0; |
1442 var index; | 1442 var index; |
1443 var subPart; | 1443 var subPart; |
1444 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1444 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1445 pathOffset += 1; | 1445 pathOffset += 1; |
1446 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/")); |
1447 pathOffset += 10; | 1447 pathOffset += 10; |
1448 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("locations")); | 1448 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("locations")); |
1449 pathOffset += 9; | 1449 pathOffset += 9; |
(...skipping 15 matching lines...) Expand all Loading... |
1465 } | 1465 } |
1466 } | 1466 } |
1467 | 1467 |
1468 | 1468 |
1469 var h = { | 1469 var h = { |
1470 "content-type" : "application/json; charset=utf-8", | 1470 "content-type" : "application/json; charset=utf-8", |
1471 }; | 1471 }; |
1472 var resp = convert.JSON.encode(buildLocationsListResponse()); | 1472 var resp = convert.JSON.encode(buildLocationsListResponse()); |
1473 return new async.Future.value(stringResponse(200, h, resp)); | 1473 return new async.Future.value(stringResponse(200, h, resp)); |
1474 }), true); | 1474 }), true); |
1475 res.list().then(unittest.expectAsync(((api.LocationsListResponse response)
{ | 1475 res.list().then(unittest.expectAsync1(((api.LocationsListResponse response
) { |
1476 checkLocationsListResponse(response); | 1476 checkLocationsListResponse(response); |
1477 }))); | 1477 }))); |
1478 }); | 1478 }); |
1479 | 1479 |
1480 }); | 1480 }); |
1481 | 1481 |
1482 | 1482 |
1483 unittest.group("resource-SettingsResourceApi", () { | 1483 unittest.group("resource-SettingsResourceApi", () { |
1484 unittest.test("method--get", () { | 1484 unittest.test("method--get", () { |
1485 | 1485 |
1486 var mock = new HttpServerMock(); | 1486 var mock = new HttpServerMock(); |
1487 api.SettingsResourceApi res = new api.MirrorApi(mock).settings; | 1487 api.SettingsResourceApi res = new api.MirrorApi(mock).settings; |
1488 var arg_id = "foo"; | 1488 var arg_id = "foo"; |
1489 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1489 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1490 var path = (req.url).path; | 1490 var path = (req.url).path; |
1491 var pathOffset = 0; | 1491 var pathOffset = 0; |
1492 var index; | 1492 var index; |
1493 var subPart; | 1493 var subPart; |
1494 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1494 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1495 pathOffset += 1; | 1495 pathOffset += 1; |
1496 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/")); |
1497 pathOffset += 10; | 1497 pathOffset += 10; |
1498 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("settings/")); | 1498 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("settings/")); |
1499 pathOffset += 9; | 1499 pathOffset += 9; |
(...skipping 18 matching lines...) Expand all Loading... |
1518 } | 1518 } |
1519 } | 1519 } |
1520 | 1520 |
1521 | 1521 |
1522 var h = { | 1522 var h = { |
1523 "content-type" : "application/json; charset=utf-8", | 1523 "content-type" : "application/json; charset=utf-8", |
1524 }; | 1524 }; |
1525 var resp = convert.JSON.encode(buildSetting()); | 1525 var resp = convert.JSON.encode(buildSetting()); |
1526 return new async.Future.value(stringResponse(200, h, resp)); | 1526 return new async.Future.value(stringResponse(200, h, resp)); |
1527 }), true); | 1527 }), true); |
1528 res.get(arg_id).then(unittest.expectAsync(((api.Setting response) { | 1528 res.get(arg_id).then(unittest.expectAsync1(((api.Setting response) { |
1529 checkSetting(response); | 1529 checkSetting(response); |
1530 }))); | 1530 }))); |
1531 }); | 1531 }); |
1532 | 1532 |
1533 }); | 1533 }); |
1534 | 1534 |
1535 | 1535 |
1536 unittest.group("resource-SubscriptionsResourceApi", () { | 1536 unittest.group("resource-SubscriptionsResourceApi", () { |
1537 unittest.test("method--delete", () { | 1537 unittest.test("method--delete", () { |
1538 | 1538 |
1539 var mock = new HttpServerMock(); | 1539 var mock = new HttpServerMock(); |
1540 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1540 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1541 var arg_id = "foo"; | 1541 var arg_id = "foo"; |
1542 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1542 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1543 var path = (req.url).path; | 1543 var path = (req.url).path; |
1544 var pathOffset = 0; | 1544 var pathOffset = 0; |
1545 var index; | 1545 var index; |
1546 var subPart; | 1546 var subPart; |
1547 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1547 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1548 pathOffset += 1; | 1548 pathOffset += 1; |
1549 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/")); |
1550 pathOffset += 10; | 1550 pathOffset += 10; |
1551 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("subscriptions/")); | 1551 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("subscriptions/")); |
1552 pathOffset += 14; | 1552 pathOffset += 14; |
(...skipping 18 matching lines...) Expand all Loading... |
1571 } | 1571 } |
1572 } | 1572 } |
1573 | 1573 |
1574 | 1574 |
1575 var h = { | 1575 var h = { |
1576 "content-type" : "application/json; charset=utf-8", | 1576 "content-type" : "application/json; charset=utf-8", |
1577 }; | 1577 }; |
1578 var resp = ""; | 1578 var resp = ""; |
1579 return new async.Future.value(stringResponse(200, h, resp)); | 1579 return new async.Future.value(stringResponse(200, h, resp)); |
1580 }), true); | 1580 }), true); |
1581 res.delete(arg_id).then(unittest.expectAsync((_) {})); | 1581 res.delete(arg_id).then(unittest.expectAsync1((_) {})); |
1582 }); | 1582 }); |
1583 | 1583 |
1584 unittest.test("method--insert", () { | 1584 unittest.test("method--insert", () { |
1585 | 1585 |
1586 var mock = new HttpServerMock(); | 1586 var mock = new HttpServerMock(); |
1587 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1587 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1588 var arg_request = buildSubscription(); | 1588 var arg_request = buildSubscription(); |
1589 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1589 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1590 var obj = new api.Subscription.fromJson(json); | 1590 var obj = new api.Subscription.fromJson(json); |
1591 checkSubscription(obj); | 1591 checkSubscription(obj); |
1592 | 1592 |
1593 var path = (req.url).path; | 1593 var path = (req.url).path; |
1594 var pathOffset = 0; | 1594 var pathOffset = 0; |
1595 var index; | 1595 var index; |
1596 var subPart; | 1596 var subPart; |
1597 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1597 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1598 pathOffset += 1; | 1598 pathOffset += 1; |
1599 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1599 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1618 } | 1618 } |
1619 } | 1619 } |
1620 | 1620 |
1621 | 1621 |
1622 var h = { | 1622 var h = { |
1623 "content-type" : "application/json; charset=utf-8", | 1623 "content-type" : "application/json; charset=utf-8", |
1624 }; | 1624 }; |
1625 var resp = convert.JSON.encode(buildSubscription()); | 1625 var resp = convert.JSON.encode(buildSubscription()); |
1626 return new async.Future.value(stringResponse(200, h, resp)); | 1626 return new async.Future.value(stringResponse(200, h, resp)); |
1627 }), true); | 1627 }), true); |
1628 res.insert(arg_request).then(unittest.expectAsync(((api.Subscription respo
nse) { | 1628 res.insert(arg_request).then(unittest.expectAsync1(((api.Subscription resp
onse) { |
1629 checkSubscription(response); | 1629 checkSubscription(response); |
1630 }))); | 1630 }))); |
1631 }); | 1631 }); |
1632 | 1632 |
1633 unittest.test("method--list", () { | 1633 unittest.test("method--list", () { |
1634 | 1634 |
1635 var mock = new HttpServerMock(); | 1635 var mock = new HttpServerMock(); |
1636 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1636 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1637 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1637 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1638 var path = (req.url).path; | 1638 var path = (req.url).path; |
1639 var pathOffset = 0; | 1639 var pathOffset = 0; |
1640 var index; | 1640 var index; |
1641 var subPart; | 1641 var subPart; |
1642 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1642 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1643 pathOffset += 1; | 1643 pathOffset += 1; |
1644 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/")); |
1645 pathOffset += 10; | 1645 pathOffset += 10; |
1646 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("subscriptions")); | 1646 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("subscriptions")); |
1647 pathOffset += 13; | 1647 pathOffset += 13; |
(...skipping 15 matching lines...) Expand all Loading... |
1663 } | 1663 } |
1664 } | 1664 } |
1665 | 1665 |
1666 | 1666 |
1667 var h = { | 1667 var h = { |
1668 "content-type" : "application/json; charset=utf-8", | 1668 "content-type" : "application/json; charset=utf-8", |
1669 }; | 1669 }; |
1670 var resp = convert.JSON.encode(buildSubscriptionsListResponse()); | 1670 var resp = convert.JSON.encode(buildSubscriptionsListResponse()); |
1671 return new async.Future.value(stringResponse(200, h, resp)); | 1671 return new async.Future.value(stringResponse(200, h, resp)); |
1672 }), true); | 1672 }), true); |
1673 res.list().then(unittest.expectAsync(((api.SubscriptionsListResponse respo
nse) { | 1673 res.list().then(unittest.expectAsync1(((api.SubscriptionsListResponse resp
onse) { |
1674 checkSubscriptionsListResponse(response); | 1674 checkSubscriptionsListResponse(response); |
1675 }))); | 1675 }))); |
1676 }); | 1676 }); |
1677 | 1677 |
1678 unittest.test("method--update", () { | 1678 unittest.test("method--update", () { |
1679 | 1679 |
1680 var mock = new HttpServerMock(); | 1680 var mock = new HttpServerMock(); |
1681 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; | 1681 api.SubscriptionsResourceApi res = new api.MirrorApi(mock).subscriptions; |
1682 var arg_request = buildSubscription(); | 1682 var arg_request = buildSubscription(); |
1683 var arg_id = "foo"; | 1683 var arg_id = "foo"; |
1684 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1684 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1685 var obj = new api.Subscription.fromJson(json); | 1685 var obj = new api.Subscription.fromJson(json); |
1686 checkSubscription(obj); | 1686 checkSubscription(obj); |
1687 | 1687 |
1688 var path = (req.url).path; | 1688 var path = (req.url).path; |
1689 var pathOffset = 0; | 1689 var pathOffset = 0; |
1690 var index; | 1690 var index; |
1691 var subPart; | 1691 var subPart; |
1692 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1692 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1693 pathOffset += 1; | 1693 pathOffset += 1; |
1694 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1694 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 21 matching lines...) Expand all Loading... |
1716 } | 1716 } |
1717 } | 1717 } |
1718 | 1718 |
1719 | 1719 |
1720 var h = { | 1720 var h = { |
1721 "content-type" : "application/json; charset=utf-8", | 1721 "content-type" : "application/json; charset=utf-8", |
1722 }; | 1722 }; |
1723 var resp = convert.JSON.encode(buildSubscription()); | 1723 var resp = convert.JSON.encode(buildSubscription()); |
1724 return new async.Future.value(stringResponse(200, h, resp)); | 1724 return new async.Future.value(stringResponse(200, h, resp)); |
1725 }), true); | 1725 }), true); |
1726 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Subscripti
on response) { | 1726 res.update(arg_request, arg_id).then(unittest.expectAsync1(((api.Subscript
ion response) { |
1727 checkSubscription(response); | 1727 checkSubscription(response); |
1728 }))); | 1728 }))); |
1729 }); | 1729 }); |
1730 | 1730 |
1731 }); | 1731 }); |
1732 | 1732 |
1733 | 1733 |
1734 unittest.group("resource-TimelineResourceApi", () { | 1734 unittest.group("resource-TimelineResourceApi", () { |
1735 unittest.test("method--delete", () { | 1735 unittest.test("method--delete", () { |
1736 | 1736 |
1737 var mock = new HttpServerMock(); | 1737 var mock = new HttpServerMock(); |
1738 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1738 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1739 var arg_id = "foo"; | 1739 var arg_id = "foo"; |
1740 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1740 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1741 var path = (req.url).path; | 1741 var path = (req.url).path; |
1742 var pathOffset = 0; | 1742 var pathOffset = 0; |
1743 var index; | 1743 var index; |
1744 var subPart; | 1744 var subPart; |
1745 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1745 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1746 pathOffset += 1; | 1746 pathOffset += 1; |
1747 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/")); |
1748 pathOffset += 10; | 1748 pathOffset += 10; |
1749 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); | 1749 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); |
1750 pathOffset += 9; | 1750 pathOffset += 9; |
(...skipping 18 matching lines...) Expand all Loading... |
1769 } | 1769 } |
1770 } | 1770 } |
1771 | 1771 |
1772 | 1772 |
1773 var h = { | 1773 var h = { |
1774 "content-type" : "application/json; charset=utf-8", | 1774 "content-type" : "application/json; charset=utf-8", |
1775 }; | 1775 }; |
1776 var resp = ""; | 1776 var resp = ""; |
1777 return new async.Future.value(stringResponse(200, h, resp)); | 1777 return new async.Future.value(stringResponse(200, h, resp)); |
1778 }), true); | 1778 }), true); |
1779 res.delete(arg_id).then(unittest.expectAsync((_) {})); | 1779 res.delete(arg_id).then(unittest.expectAsync1((_) {})); |
1780 }); | 1780 }); |
1781 | 1781 |
1782 unittest.test("method--get", () { | 1782 unittest.test("method--get", () { |
1783 | 1783 |
1784 var mock = new HttpServerMock(); | 1784 var mock = new HttpServerMock(); |
1785 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1785 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1786 var arg_id = "foo"; | 1786 var arg_id = "foo"; |
1787 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1787 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1788 var path = (req.url).path; | 1788 var path = (req.url).path; |
1789 var pathOffset = 0; | 1789 var pathOffset = 0; |
1790 var index; | 1790 var index; |
1791 var subPart; | 1791 var subPart; |
1792 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1792 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1793 pathOffset += 1; | 1793 pathOffset += 1; |
1794 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/")); |
1795 pathOffset += 10; | 1795 pathOffset += 10; |
1796 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); | 1796 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); |
1797 pathOffset += 9; | 1797 pathOffset += 9; |
(...skipping 18 matching lines...) Expand all Loading... |
1816 } | 1816 } |
1817 } | 1817 } |
1818 | 1818 |
1819 | 1819 |
1820 var h = { | 1820 var h = { |
1821 "content-type" : "application/json; charset=utf-8", | 1821 "content-type" : "application/json; charset=utf-8", |
1822 }; | 1822 }; |
1823 var resp = convert.JSON.encode(buildTimelineItem()); | 1823 var resp = convert.JSON.encode(buildTimelineItem()); |
1824 return new async.Future.value(stringResponse(200, h, resp)); | 1824 return new async.Future.value(stringResponse(200, h, resp)); |
1825 }), true); | 1825 }), true); |
1826 res.get(arg_id).then(unittest.expectAsync(((api.TimelineItem response) { | 1826 res.get(arg_id).then(unittest.expectAsync1(((api.TimelineItem response) { |
1827 checkTimelineItem(response); | 1827 checkTimelineItem(response); |
1828 }))); | 1828 }))); |
1829 }); | 1829 }); |
1830 | 1830 |
1831 unittest.test("method--insert", () { | 1831 unittest.test("method--insert", () { |
1832 // TODO: Implement tests for media upload; | 1832 // TODO: Implement tests for media upload; |
1833 // TODO: Implement tests for media download; | 1833 // TODO: Implement tests for media download; |
1834 | 1834 |
1835 var mock = new HttpServerMock(); | 1835 var mock = new HttpServerMock(); |
1836 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1836 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1837 var arg_request = buildTimelineItem(); | 1837 var arg_request = buildTimelineItem(); |
1838 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1838 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1839 var obj = new api.TimelineItem.fromJson(json); | 1839 var obj = new api.TimelineItem.fromJson(json); |
1840 checkTimelineItem(obj); | 1840 checkTimelineItem(obj); |
1841 | 1841 |
1842 var path = (req.url).path; | 1842 var path = (req.url).path; |
1843 var pathOffset = 0; | 1843 var pathOffset = 0; |
1844 var index; | 1844 var index; |
1845 var subPart; | 1845 var subPart; |
1846 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1846 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1847 pathOffset += 1; | 1847 pathOffset += 1; |
1848 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1848 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1867 } | 1867 } |
1868 } | 1868 } |
1869 | 1869 |
1870 | 1870 |
1871 var h = { | 1871 var h = { |
1872 "content-type" : "application/json; charset=utf-8", | 1872 "content-type" : "application/json; charset=utf-8", |
1873 }; | 1873 }; |
1874 var resp = convert.JSON.encode(buildTimelineItem()); | 1874 var resp = convert.JSON.encode(buildTimelineItem()); |
1875 return new async.Future.value(stringResponse(200, h, resp)); | 1875 return new async.Future.value(stringResponse(200, h, resp)); |
1876 }), true); | 1876 }), true); |
1877 res.insert(arg_request).then(unittest.expectAsync(((api.TimelineItem respo
nse) { | 1877 res.insert(arg_request).then(unittest.expectAsync1(((api.TimelineItem resp
onse) { |
1878 checkTimelineItem(response); | 1878 checkTimelineItem(response); |
1879 }))); | 1879 }))); |
1880 }); | 1880 }); |
1881 | 1881 |
1882 unittest.test("method--list", () { | 1882 unittest.test("method--list", () { |
1883 | 1883 |
1884 var mock = new HttpServerMock(); | 1884 var mock = new HttpServerMock(); |
1885 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1885 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1886 var arg_bundleId = "foo"; | 1886 var arg_bundleId = "foo"; |
1887 var arg_includeDeleted = true; | 1887 var arg_includeDeleted = true; |
1888 var arg_maxResults = 42; | 1888 var arg_maxResults = 42; |
1889 var arg_orderBy = "foo"; | 1889 var arg_orderBy = "foo"; |
1890 var arg_pageToken = "foo"; | 1890 var arg_pageToken = "foo"; |
1891 var arg_pinnedOnly = true; | 1891 var arg_pinnedOnly = true; |
1892 var arg_sourceItemId = "foo"; | 1892 var arg_sourceItemId = "foo"; |
1893 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1893 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1894 var path = (req.url).path; | 1894 var path = (req.url).path; |
1895 var pathOffset = 0; | 1895 var pathOffset = 0; |
1896 var index; | 1896 var index; |
1897 var subPart; | 1897 var subPart; |
1898 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1898 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1899 pathOffset += 1; | 1899 pathOffset += 1; |
1900 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1900 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
1901 pathOffset += 10; | 1901 pathOffset += 10; |
1902 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("timeline")); | 1902 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("timeline")); |
1903 pathOffset += 8; | 1903 pathOffset += 8; |
(...skipping 22 matching lines...) Expand all Loading... |
1926 unittest.expect(queryMap["pinnedOnly"].first, unittest.equals("$arg_pinn
edOnly")); | 1926 unittest.expect(queryMap["pinnedOnly"].first, unittest.equals("$arg_pinn
edOnly")); |
1927 unittest.expect(queryMap["sourceItemId"].first, unittest.equals(arg_sour
ceItemId)); | 1927 unittest.expect(queryMap["sourceItemId"].first, unittest.equals(arg_sour
ceItemId)); |
1928 | 1928 |
1929 | 1929 |
1930 var h = { | 1930 var h = { |
1931 "content-type" : "application/json; charset=utf-8", | 1931 "content-type" : "application/json; charset=utf-8", |
1932 }; | 1932 }; |
1933 var resp = convert.JSON.encode(buildTimelineListResponse()); | 1933 var resp = convert.JSON.encode(buildTimelineListResponse()); |
1934 return new async.Future.value(stringResponse(200, h, resp)); | 1934 return new async.Future.value(stringResponse(200, h, resp)); |
1935 }), true); | 1935 }), true); |
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) { | 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.expectAsync1(((
api.TimelineListResponse response) { |
1937 checkTimelineListResponse(response); | 1937 checkTimelineListResponse(response); |
1938 }))); | 1938 }))); |
1939 }); | 1939 }); |
1940 | 1940 |
1941 unittest.test("method--patch", () { | 1941 unittest.test("method--patch", () { |
1942 | 1942 |
1943 var mock = new HttpServerMock(); | 1943 var mock = new HttpServerMock(); |
1944 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1944 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
1945 var arg_request = buildTimelineItem(); | 1945 var arg_request = buildTimelineItem(); |
1946 var arg_id = "foo"; | 1946 var arg_id = "foo"; |
1947 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1947 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1948 var obj = new api.TimelineItem.fromJson(json); | 1948 var obj = new api.TimelineItem.fromJson(json); |
1949 checkTimelineItem(obj); | 1949 checkTimelineItem(obj); |
1950 | 1950 |
1951 var path = (req.url).path; | 1951 var path = (req.url).path; |
1952 var pathOffset = 0; | 1952 var pathOffset = 0; |
1953 var index; | 1953 var index; |
1954 var subPart; | 1954 var subPart; |
1955 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1955 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1956 pathOffset += 1; | 1956 pathOffset += 1; |
1957 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 1957 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 21 matching lines...) Expand all Loading... |
1979 } | 1979 } |
1980 } | 1980 } |
1981 | 1981 |
1982 | 1982 |
1983 var h = { | 1983 var h = { |
1984 "content-type" : "application/json; charset=utf-8", | 1984 "content-type" : "application/json; charset=utf-8", |
1985 }; | 1985 }; |
1986 var resp = convert.JSON.encode(buildTimelineItem()); | 1986 var resp = convert.JSON.encode(buildTimelineItem()); |
1987 return new async.Future.value(stringResponse(200, h, resp)); | 1987 return new async.Future.value(stringResponse(200, h, resp)); |
1988 }), true); | 1988 }), true); |
1989 res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.TimelineIte
m response) { | 1989 res.patch(arg_request, arg_id).then(unittest.expectAsync1(((api.TimelineIt
em response) { |
1990 checkTimelineItem(response); | 1990 checkTimelineItem(response); |
1991 }))); | 1991 }))); |
1992 }); | 1992 }); |
1993 | 1993 |
1994 unittest.test("method--update", () { | 1994 unittest.test("method--update", () { |
1995 // TODO: Implement tests for media upload; | 1995 // TODO: Implement tests for media upload; |
1996 // TODO: Implement tests for media download; | 1996 // TODO: Implement tests for media download; |
1997 | 1997 |
1998 var mock = new HttpServerMock(); | 1998 var mock = new HttpServerMock(); |
1999 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; | 1999 api.TimelineResourceApi res = new api.MirrorApi(mock).timeline; |
2000 var arg_request = buildTimelineItem(); | 2000 var arg_request = buildTimelineItem(); |
2001 var arg_id = "foo"; | 2001 var arg_id = "foo"; |
2002 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2002 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2003 var obj = new api.TimelineItem.fromJson(json); | 2003 var obj = new api.TimelineItem.fromJson(json); |
2004 checkTimelineItem(obj); | 2004 checkTimelineItem(obj); |
2005 | 2005 |
2006 var path = (req.url).path; | 2006 var path = (req.url).path; |
2007 var pathOffset = 0; | 2007 var pathOffset = 0; |
2008 var index; | 2008 var index; |
2009 var subPart; | 2009 var subPart; |
2010 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2010 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2011 pathOffset += 1; | 2011 pathOffset += 1; |
2012 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 2012 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
(...skipping 21 matching lines...) Expand all Loading... |
2034 } | 2034 } |
2035 } | 2035 } |
2036 | 2036 |
2037 | 2037 |
2038 var h = { | 2038 var h = { |
2039 "content-type" : "application/json; charset=utf-8", | 2039 "content-type" : "application/json; charset=utf-8", |
2040 }; | 2040 }; |
2041 var resp = convert.JSON.encode(buildTimelineItem()); | 2041 var resp = convert.JSON.encode(buildTimelineItem()); |
2042 return new async.Future.value(stringResponse(200, h, resp)); | 2042 return new async.Future.value(stringResponse(200, h, resp)); |
2043 }), true); | 2043 }), true); |
2044 res.update(arg_request, arg_id).then(unittest.expectAsync(((api.TimelineIt
em response) { | 2044 res.update(arg_request, arg_id).then(unittest.expectAsync1(((api.TimelineI
tem response) { |
2045 checkTimelineItem(response); | 2045 checkTimelineItem(response); |
2046 }))); | 2046 }))); |
2047 }); | 2047 }); |
2048 | 2048 |
2049 }); | 2049 }); |
2050 | 2050 |
2051 | 2051 |
2052 unittest.group("resource-TimelineAttachmentsResourceApi", () { | 2052 unittest.group("resource-TimelineAttachmentsResourceApi", () { |
2053 unittest.test("method--delete", () { | 2053 unittest.test("method--delete", () { |
2054 | 2054 |
2055 var mock = new HttpServerMock(); | 2055 var mock = new HttpServerMock(); |
2056 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2056 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2057 var arg_itemId = "foo"; | 2057 var arg_itemId = "foo"; |
2058 var arg_attachmentId = "foo"; | 2058 var arg_attachmentId = "foo"; |
2059 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2059 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2060 var path = (req.url).path; | 2060 var path = (req.url).path; |
2061 var pathOffset = 0; | 2061 var pathOffset = 0; |
2062 var index; | 2062 var index; |
2063 var subPart; | 2063 var subPart; |
2064 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2064 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2065 pathOffset += 1; | 2065 pathOffset += 1; |
2066 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 2066 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
2067 pathOffset += 10; | 2067 pathOffset += 10; |
2068 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); | 2068 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); |
2069 pathOffset += 9; | 2069 pathOffset += 9; |
(...skipping 25 matching lines...) Expand all Loading... |
2095 } | 2095 } |
2096 } | 2096 } |
2097 | 2097 |
2098 | 2098 |
2099 var h = { | 2099 var h = { |
2100 "content-type" : "application/json; charset=utf-8", | 2100 "content-type" : "application/json; charset=utf-8", |
2101 }; | 2101 }; |
2102 var resp = ""; | 2102 var resp = ""; |
2103 return new async.Future.value(stringResponse(200, h, resp)); | 2103 return new async.Future.value(stringResponse(200, h, resp)); |
2104 }), true); | 2104 }), true); |
2105 res.delete(arg_itemId, arg_attachmentId).then(unittest.expectAsync((_) {})
); | 2105 res.delete(arg_itemId, arg_attachmentId).then(unittest.expectAsync1((_) {}
)); |
2106 }); | 2106 }); |
2107 | 2107 |
2108 unittest.test("method--get", () { | 2108 unittest.test("method--get", () { |
2109 // TODO: Implement tests for media upload; | 2109 // TODO: Implement tests for media upload; |
2110 // TODO: Implement tests for media download; | 2110 // TODO: Implement tests for media download; |
2111 | 2111 |
2112 var mock = new HttpServerMock(); | 2112 var mock = new HttpServerMock(); |
2113 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2113 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2114 var arg_itemId = "foo"; | 2114 var arg_itemId = "foo"; |
2115 var arg_attachmentId = "foo"; | 2115 var arg_attachmentId = "foo"; |
2116 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2116 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2117 var path = (req.url).path; | 2117 var path = (req.url).path; |
2118 var pathOffset = 0; | 2118 var pathOffset = 0; |
2119 var index; | 2119 var index; |
2120 var subPart; | 2120 var subPart; |
2121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2122 pathOffset += 1; | 2122 pathOffset += 1; |
2123 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); | 2123 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("mirror/v1/")); |
2124 pathOffset += 10; | 2124 pathOffset += 10; |
2125 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); | 2125 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); |
2126 pathOffset += 9; | 2126 pathOffset += 9; |
(...skipping 25 matching lines...) Expand all Loading... |
2152 } | 2152 } |
2153 } | 2153 } |
2154 | 2154 |
2155 | 2155 |
2156 var h = { | 2156 var h = { |
2157 "content-type" : "application/json; charset=utf-8", | 2157 "content-type" : "application/json; charset=utf-8", |
2158 }; | 2158 }; |
2159 var resp = convert.JSON.encode(buildAttachment()); | 2159 var resp = convert.JSON.encode(buildAttachment()); |
2160 return new async.Future.value(stringResponse(200, h, resp)); | 2160 return new async.Future.value(stringResponse(200, h, resp)); |
2161 }), true); | 2161 }), true); |
2162 res.get(arg_itemId, arg_attachmentId).then(unittest.expectAsync(((api.Atta
chment response) { | 2162 res.get(arg_itemId, arg_attachmentId).then(unittest.expectAsync1(((api.Att
achment response) { |
2163 checkAttachment(response); | 2163 checkAttachment(response); |
2164 }))); | 2164 }))); |
2165 }); | 2165 }); |
2166 | 2166 |
2167 unittest.test("method--insert", () { | 2167 unittest.test("method--insert", () { |
2168 // TODO: Implement tests for media upload; | 2168 // TODO: Implement tests for media upload; |
2169 // TODO: Implement tests for media download; | 2169 // TODO: Implement tests for media download; |
2170 | 2170 |
2171 var mock = new HttpServerMock(); | 2171 var mock = new HttpServerMock(); |
2172 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2172 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2173 var arg_itemId = "foo"; | 2173 var arg_itemId = "foo"; |
2174 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2174 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2175 var path = (req.url).path; | 2175 var path = (req.url).path; |
2176 var pathOffset = 0; | 2176 var pathOffset = 0; |
2177 var index; | 2177 var index; |
2178 var subPart; | 2178 var subPart; |
2179 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2179 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2180 pathOffset += 1; | 2180 pathOffset += 1; |
2181 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/")); |
2182 pathOffset += 10; | 2182 pathOffset += 10; |
2183 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); | 2183 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); |
2184 pathOffset += 9; | 2184 pathOffset += 9; |
(...skipping 22 matching lines...) Expand all Loading... |
2207 } | 2207 } |
2208 } | 2208 } |
2209 | 2209 |
2210 | 2210 |
2211 var h = { | 2211 var h = { |
2212 "content-type" : "application/json; charset=utf-8", | 2212 "content-type" : "application/json; charset=utf-8", |
2213 }; | 2213 }; |
2214 var resp = convert.JSON.encode(buildAttachment()); | 2214 var resp = convert.JSON.encode(buildAttachment()); |
2215 return new async.Future.value(stringResponse(200, h, resp)); | 2215 return new async.Future.value(stringResponse(200, h, resp)); |
2216 }), true); | 2216 }), true); |
2217 res.insert(arg_itemId).then(unittest.expectAsync(((api.Attachment response
) { | 2217 res.insert(arg_itemId).then(unittest.expectAsync1(((api.Attachment respons
e) { |
2218 checkAttachment(response); | 2218 checkAttachment(response); |
2219 }))); | 2219 }))); |
2220 }); | 2220 }); |
2221 | 2221 |
2222 unittest.test("method--list", () { | 2222 unittest.test("method--list", () { |
2223 | 2223 |
2224 var mock = new HttpServerMock(); | 2224 var mock = new HttpServerMock(); |
2225 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; | 2225 api.TimelineAttachmentsResourceApi res = new api.MirrorApi(mock).timeline.
attachments; |
2226 var arg_itemId = "foo"; | 2226 var arg_itemId = "foo"; |
2227 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2227 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2228 var path = (req.url).path; | 2228 var path = (req.url).path; |
2229 var pathOffset = 0; | 2229 var pathOffset = 0; |
2230 var index; | 2230 var index; |
2231 var subPart; | 2231 var subPart; |
2232 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2232 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2233 pathOffset += 1; | 2233 pathOffset += 1; |
2234 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/")); |
2235 pathOffset += 10; | 2235 pathOffset += 10; |
2236 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); | 2236 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("timeline/")); |
2237 pathOffset += 9; | 2237 pathOffset += 9; |
(...skipping 22 matching lines...) Expand all Loading... |
2260 } | 2260 } |
2261 } | 2261 } |
2262 | 2262 |
2263 | 2263 |
2264 var h = { | 2264 var h = { |
2265 "content-type" : "application/json; charset=utf-8", | 2265 "content-type" : "application/json; charset=utf-8", |
2266 }; | 2266 }; |
2267 var resp = convert.JSON.encode(buildAttachmentsListResponse()); | 2267 var resp = convert.JSON.encode(buildAttachmentsListResponse()); |
2268 return new async.Future.value(stringResponse(200, h, resp)); | 2268 return new async.Future.value(stringResponse(200, h, resp)); |
2269 }), true); | 2269 }), true); |
2270 res.list(arg_itemId).then(unittest.expectAsync(((api.AttachmentsListRespon
se response) { | 2270 res.list(arg_itemId).then(unittest.expectAsync1(((api.AttachmentsListRespo
nse response) { |
2271 checkAttachmentsListResponse(response); | 2271 checkAttachmentsListResponse(response); |
2272 }))); | 2272 }))); |
2273 }); | 2273 }); |
2274 | 2274 |
2275 }); | 2275 }); |
2276 | 2276 |
2277 | 2277 |
2278 } | 2278 } |
2279 | 2279 |
OLD | NEW |