OLD | NEW |
1 library googleapis.fitness.v1.test; | 1 library googleapis.fitness.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 23 matching lines...) Expand all Loading... |
34 buildCounterApplication++; | 34 buildCounterApplication++; |
35 if (buildCounterApplication < 3) { | 35 if (buildCounterApplication < 3) { |
36 unittest.expect(o.detailsUrl, unittest.equals('foo')); | 36 unittest.expect(o.detailsUrl, unittest.equals('foo')); |
37 unittest.expect(o.name, unittest.equals('foo')); | 37 unittest.expect(o.name, unittest.equals('foo')); |
38 unittest.expect(o.packageName, unittest.equals('foo')); | 38 unittest.expect(o.packageName, unittest.equals('foo')); |
39 unittest.expect(o.version, unittest.equals('foo')); | 39 unittest.expect(o.version, unittest.equals('foo')); |
40 } | 40 } |
41 buildCounterApplication--; | 41 buildCounterApplication--; |
42 } | 42 } |
43 | 43 |
44 buildUnnamed918() { | 44 buildUnnamed759() { |
45 var o = new core.List<api.Value>(); | 45 var o = new core.List<api.Value>(); |
46 o.add(buildValue()); | 46 o.add(buildValue()); |
47 o.add(buildValue()); | 47 o.add(buildValue()); |
48 return o; | 48 return o; |
49 } | 49 } |
50 | 50 |
51 checkUnnamed918(core.List<api.Value> o) { | 51 checkUnnamed759(core.List<api.Value> o) { |
52 unittest.expect(o, unittest.hasLength(2)); | 52 unittest.expect(o, unittest.hasLength(2)); |
53 checkValue(o[0]); | 53 checkValue(o[0]); |
54 checkValue(o[1]); | 54 checkValue(o[1]); |
55 } | 55 } |
56 | 56 |
57 core.int buildCounterDataPoint = 0; | 57 core.int buildCounterDataPoint = 0; |
58 buildDataPoint() { | 58 buildDataPoint() { |
59 var o = new api.DataPoint(); | 59 var o = new api.DataPoint(); |
60 buildCounterDataPoint++; | 60 buildCounterDataPoint++; |
61 if (buildCounterDataPoint < 3) { | 61 if (buildCounterDataPoint < 3) { |
62 o.computationTimeMillis = "foo"; | 62 o.computationTimeMillis = "foo"; |
63 o.dataTypeName = "foo"; | 63 o.dataTypeName = "foo"; |
64 o.endTimeNanos = "foo"; | 64 o.endTimeNanos = "foo"; |
65 o.modifiedTimeMillis = "foo"; | 65 o.modifiedTimeMillis = "foo"; |
66 o.originDataSourceId = "foo"; | 66 o.originDataSourceId = "foo"; |
67 o.rawTimestampNanos = "foo"; | 67 o.rawTimestampNanos = "foo"; |
68 o.startTimeNanos = "foo"; | 68 o.startTimeNanos = "foo"; |
69 o.value = buildUnnamed918(); | 69 o.value = buildUnnamed759(); |
70 } | 70 } |
71 buildCounterDataPoint--; | 71 buildCounterDataPoint--; |
72 return o; | 72 return o; |
73 } | 73 } |
74 | 74 |
75 checkDataPoint(api.DataPoint o) { | 75 checkDataPoint(api.DataPoint o) { |
76 buildCounterDataPoint++; | 76 buildCounterDataPoint++; |
77 if (buildCounterDataPoint < 3) { | 77 if (buildCounterDataPoint < 3) { |
78 unittest.expect(o.computationTimeMillis, unittest.equals('foo')); | 78 unittest.expect(o.computationTimeMillis, unittest.equals('foo')); |
79 unittest.expect(o.dataTypeName, unittest.equals('foo')); | 79 unittest.expect(o.dataTypeName, unittest.equals('foo')); |
80 unittest.expect(o.endTimeNanos, unittest.equals('foo')); | 80 unittest.expect(o.endTimeNanos, unittest.equals('foo')); |
81 unittest.expect(o.modifiedTimeMillis, unittest.equals('foo')); | 81 unittest.expect(o.modifiedTimeMillis, unittest.equals('foo')); |
82 unittest.expect(o.originDataSourceId, unittest.equals('foo')); | 82 unittest.expect(o.originDataSourceId, unittest.equals('foo')); |
83 unittest.expect(o.rawTimestampNanos, unittest.equals('foo')); | 83 unittest.expect(o.rawTimestampNanos, unittest.equals('foo')); |
84 unittest.expect(o.startTimeNanos, unittest.equals('foo')); | 84 unittest.expect(o.startTimeNanos, unittest.equals('foo')); |
85 checkUnnamed918(o.value); | 85 checkUnnamed759(o.value); |
86 } | 86 } |
87 buildCounterDataPoint--; | 87 buildCounterDataPoint--; |
88 } | 88 } |
89 | 89 |
90 core.int buildCounterDataSource = 0; | 90 core.int buildCounterDataSource = 0; |
91 buildDataSource() { | 91 buildDataSource() { |
92 var o = new api.DataSource(); | 92 var o = new api.DataSource(); |
93 buildCounterDataSource++; | 93 buildCounterDataSource++; |
94 if (buildCounterDataSource < 3) { | 94 if (buildCounterDataSource < 3) { |
95 o.application = buildApplication(); | 95 o.application = buildApplication(); |
(...skipping 15 matching lines...) Expand all Loading... |
111 unittest.expect(o.dataStreamId, unittest.equals('foo')); | 111 unittest.expect(o.dataStreamId, unittest.equals('foo')); |
112 unittest.expect(o.dataStreamName, unittest.equals('foo')); | 112 unittest.expect(o.dataStreamName, unittest.equals('foo')); |
113 checkDataType(o.dataType); | 113 checkDataType(o.dataType); |
114 checkDevice(o.device); | 114 checkDevice(o.device); |
115 unittest.expect(o.name, unittest.equals('foo')); | 115 unittest.expect(o.name, unittest.equals('foo')); |
116 unittest.expect(o.type, unittest.equals('foo')); | 116 unittest.expect(o.type, unittest.equals('foo')); |
117 } | 117 } |
118 buildCounterDataSource--; | 118 buildCounterDataSource--; |
119 } | 119 } |
120 | 120 |
121 buildUnnamed919() { | 121 buildUnnamed760() { |
122 var o = new core.List<api.DataTypeField>(); | 122 var o = new core.List<api.DataTypeField>(); |
123 o.add(buildDataTypeField()); | 123 o.add(buildDataTypeField()); |
124 o.add(buildDataTypeField()); | 124 o.add(buildDataTypeField()); |
125 return o; | 125 return o; |
126 } | 126 } |
127 | 127 |
128 checkUnnamed919(core.List<api.DataTypeField> o) { | 128 checkUnnamed760(core.List<api.DataTypeField> o) { |
129 unittest.expect(o, unittest.hasLength(2)); | 129 unittest.expect(o, unittest.hasLength(2)); |
130 checkDataTypeField(o[0]); | 130 checkDataTypeField(o[0]); |
131 checkDataTypeField(o[1]); | 131 checkDataTypeField(o[1]); |
132 } | 132 } |
133 | 133 |
134 core.int buildCounterDataType = 0; | 134 core.int buildCounterDataType = 0; |
135 buildDataType() { | 135 buildDataType() { |
136 var o = new api.DataType(); | 136 var o = new api.DataType(); |
137 buildCounterDataType++; | 137 buildCounterDataType++; |
138 if (buildCounterDataType < 3) { | 138 if (buildCounterDataType < 3) { |
139 o.field = buildUnnamed919(); | 139 o.field = buildUnnamed760(); |
140 o.name = "foo"; | 140 o.name = "foo"; |
141 } | 141 } |
142 buildCounterDataType--; | 142 buildCounterDataType--; |
143 return o; | 143 return o; |
144 } | 144 } |
145 | 145 |
146 checkDataType(api.DataType o) { | 146 checkDataType(api.DataType o) { |
147 buildCounterDataType++; | 147 buildCounterDataType++; |
148 if (buildCounterDataType < 3) { | 148 if (buildCounterDataType < 3) { |
149 checkUnnamed919(o.field); | 149 checkUnnamed760(o.field); |
150 unittest.expect(o.name, unittest.equals('foo')); | 150 unittest.expect(o.name, unittest.equals('foo')); |
151 } | 151 } |
152 buildCounterDataType--; | 152 buildCounterDataType--; |
153 } | 153 } |
154 | 154 |
155 core.int buildCounterDataTypeField = 0; | 155 core.int buildCounterDataTypeField = 0; |
156 buildDataTypeField() { | 156 buildDataTypeField() { |
157 var o = new api.DataTypeField(); | 157 var o = new api.DataTypeField(); |
158 buildCounterDataTypeField++; | 158 buildCounterDataTypeField++; |
159 if (buildCounterDataTypeField < 3) { | 159 if (buildCounterDataTypeField < 3) { |
160 o.format = "foo"; | 160 o.format = "foo"; |
161 o.name = "foo"; | 161 o.name = "foo"; |
162 } | 162 } |
163 buildCounterDataTypeField--; | 163 buildCounterDataTypeField--; |
164 return o; | 164 return o; |
165 } | 165 } |
166 | 166 |
167 checkDataTypeField(api.DataTypeField o) { | 167 checkDataTypeField(api.DataTypeField o) { |
168 buildCounterDataTypeField++; | 168 buildCounterDataTypeField++; |
169 if (buildCounterDataTypeField < 3) { | 169 if (buildCounterDataTypeField < 3) { |
170 unittest.expect(o.format, unittest.equals('foo')); | 170 unittest.expect(o.format, unittest.equals('foo')); |
171 unittest.expect(o.name, unittest.equals('foo')); | 171 unittest.expect(o.name, unittest.equals('foo')); |
172 } | 172 } |
173 buildCounterDataTypeField--; | 173 buildCounterDataTypeField--; |
174 } | 174 } |
175 | 175 |
176 buildUnnamed920() { | 176 buildUnnamed761() { |
177 var o = new core.List<api.DataPoint>(); | 177 var o = new core.List<api.DataPoint>(); |
178 o.add(buildDataPoint()); | 178 o.add(buildDataPoint()); |
179 o.add(buildDataPoint()); | 179 o.add(buildDataPoint()); |
180 return o; | 180 return o; |
181 } | 181 } |
182 | 182 |
183 checkUnnamed920(core.List<api.DataPoint> o) { | 183 checkUnnamed761(core.List<api.DataPoint> o) { |
184 unittest.expect(o, unittest.hasLength(2)); | 184 unittest.expect(o, unittest.hasLength(2)); |
185 checkDataPoint(o[0]); | 185 checkDataPoint(o[0]); |
186 checkDataPoint(o[1]); | 186 checkDataPoint(o[1]); |
187 } | 187 } |
188 | 188 |
189 core.int buildCounterDataset = 0; | 189 core.int buildCounterDataset = 0; |
190 buildDataset() { | 190 buildDataset() { |
191 var o = new api.Dataset(); | 191 var o = new api.Dataset(); |
192 buildCounterDataset++; | 192 buildCounterDataset++; |
193 if (buildCounterDataset < 3) { | 193 if (buildCounterDataset < 3) { |
194 o.dataSourceId = "foo"; | 194 o.dataSourceId = "foo"; |
195 o.maxEndTimeNs = "foo"; | 195 o.maxEndTimeNs = "foo"; |
196 o.minStartTimeNs = "foo"; | 196 o.minStartTimeNs = "foo"; |
197 o.nextPageToken = "foo"; | 197 o.nextPageToken = "foo"; |
198 o.point = buildUnnamed920(); | 198 o.point = buildUnnamed761(); |
199 } | 199 } |
200 buildCounterDataset--; | 200 buildCounterDataset--; |
201 return o; | 201 return o; |
202 } | 202 } |
203 | 203 |
204 checkDataset(api.Dataset o) { | 204 checkDataset(api.Dataset o) { |
205 buildCounterDataset++; | 205 buildCounterDataset++; |
206 if (buildCounterDataset < 3) { | 206 if (buildCounterDataset < 3) { |
207 unittest.expect(o.dataSourceId, unittest.equals('foo')); | 207 unittest.expect(o.dataSourceId, unittest.equals('foo')); |
208 unittest.expect(o.maxEndTimeNs, unittest.equals('foo')); | 208 unittest.expect(o.maxEndTimeNs, unittest.equals('foo')); |
209 unittest.expect(o.minStartTimeNs, unittest.equals('foo')); | 209 unittest.expect(o.minStartTimeNs, unittest.equals('foo')); |
210 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 210 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
211 checkUnnamed920(o.point); | 211 checkUnnamed761(o.point); |
212 } | 212 } |
213 buildCounterDataset--; | 213 buildCounterDataset--; |
214 } | 214 } |
215 | 215 |
216 core.int buildCounterDevice = 0; | 216 core.int buildCounterDevice = 0; |
217 buildDevice() { | 217 buildDevice() { |
218 var o = new api.Device(); | 218 var o = new api.Device(); |
219 buildCounterDevice++; | 219 buildCounterDevice++; |
220 if (buildCounterDevice < 3) { | 220 if (buildCounterDevice < 3) { |
221 o.manufacturer = "foo"; | 221 o.manufacturer = "foo"; |
(...skipping 11 matching lines...) Expand all Loading... |
233 if (buildCounterDevice < 3) { | 233 if (buildCounterDevice < 3) { |
234 unittest.expect(o.manufacturer, unittest.equals('foo')); | 234 unittest.expect(o.manufacturer, unittest.equals('foo')); |
235 unittest.expect(o.model, unittest.equals('foo')); | 235 unittest.expect(o.model, unittest.equals('foo')); |
236 unittest.expect(o.type, unittest.equals('foo')); | 236 unittest.expect(o.type, unittest.equals('foo')); |
237 unittest.expect(o.uid, unittest.equals('foo')); | 237 unittest.expect(o.uid, unittest.equals('foo')); |
238 unittest.expect(o.version, unittest.equals('foo')); | 238 unittest.expect(o.version, unittest.equals('foo')); |
239 } | 239 } |
240 buildCounterDevice--; | 240 buildCounterDevice--; |
241 } | 241 } |
242 | 242 |
243 buildUnnamed921() { | 243 buildUnnamed762() { |
244 var o = new core.List<api.DataSource>(); | 244 var o = new core.List<api.DataSource>(); |
245 o.add(buildDataSource()); | 245 o.add(buildDataSource()); |
246 o.add(buildDataSource()); | 246 o.add(buildDataSource()); |
247 return o; | 247 return o; |
248 } | 248 } |
249 | 249 |
250 checkUnnamed921(core.List<api.DataSource> o) { | 250 checkUnnamed762(core.List<api.DataSource> o) { |
251 unittest.expect(o, unittest.hasLength(2)); | 251 unittest.expect(o, unittest.hasLength(2)); |
252 checkDataSource(o[0]); | 252 checkDataSource(o[0]); |
253 checkDataSource(o[1]); | 253 checkDataSource(o[1]); |
254 } | 254 } |
255 | 255 |
256 core.int buildCounterListDataSourcesResponse = 0; | 256 core.int buildCounterListDataSourcesResponse = 0; |
257 buildListDataSourcesResponse() { | 257 buildListDataSourcesResponse() { |
258 var o = new api.ListDataSourcesResponse(); | 258 var o = new api.ListDataSourcesResponse(); |
259 buildCounterListDataSourcesResponse++; | 259 buildCounterListDataSourcesResponse++; |
260 if (buildCounterListDataSourcesResponse < 3) { | 260 if (buildCounterListDataSourcesResponse < 3) { |
261 o.dataSource = buildUnnamed921(); | 261 o.dataSource = buildUnnamed762(); |
262 } | 262 } |
263 buildCounterListDataSourcesResponse--; | 263 buildCounterListDataSourcesResponse--; |
264 return o; | 264 return o; |
265 } | 265 } |
266 | 266 |
267 checkListDataSourcesResponse(api.ListDataSourcesResponse o) { | 267 checkListDataSourcesResponse(api.ListDataSourcesResponse o) { |
268 buildCounterListDataSourcesResponse++; | 268 buildCounterListDataSourcesResponse++; |
269 if (buildCounterListDataSourcesResponse < 3) { | 269 if (buildCounterListDataSourcesResponse < 3) { |
270 checkUnnamed921(o.dataSource); | 270 checkUnnamed762(o.dataSource); |
271 } | 271 } |
272 buildCounterListDataSourcesResponse--; | 272 buildCounterListDataSourcesResponse--; |
273 } | 273 } |
274 | 274 |
275 buildUnnamed922() { | 275 buildUnnamed763() { |
276 var o = new core.List<api.Session>(); | 276 var o = new core.List<api.Session>(); |
277 o.add(buildSession()); | 277 o.add(buildSession()); |
278 o.add(buildSession()); | 278 o.add(buildSession()); |
279 return o; | 279 return o; |
280 } | 280 } |
281 | 281 |
282 checkUnnamed922(core.List<api.Session> o) { | 282 checkUnnamed763(core.List<api.Session> o) { |
283 unittest.expect(o, unittest.hasLength(2)); | 283 unittest.expect(o, unittest.hasLength(2)); |
284 checkSession(o[0]); | 284 checkSession(o[0]); |
285 checkSession(o[1]); | 285 checkSession(o[1]); |
286 } | 286 } |
287 | 287 |
288 buildUnnamed923() { | 288 buildUnnamed764() { |
289 var o = new core.List<api.Session>(); | 289 var o = new core.List<api.Session>(); |
290 o.add(buildSession()); | 290 o.add(buildSession()); |
291 o.add(buildSession()); | 291 o.add(buildSession()); |
292 return o; | 292 return o; |
293 } | 293 } |
294 | 294 |
295 checkUnnamed923(core.List<api.Session> o) { | 295 checkUnnamed764(core.List<api.Session> o) { |
296 unittest.expect(o, unittest.hasLength(2)); | 296 unittest.expect(o, unittest.hasLength(2)); |
297 checkSession(o[0]); | 297 checkSession(o[0]); |
298 checkSession(o[1]); | 298 checkSession(o[1]); |
299 } | 299 } |
300 | 300 |
301 core.int buildCounterListSessionsResponse = 0; | 301 core.int buildCounterListSessionsResponse = 0; |
302 buildListSessionsResponse() { | 302 buildListSessionsResponse() { |
303 var o = new api.ListSessionsResponse(); | 303 var o = new api.ListSessionsResponse(); |
304 buildCounterListSessionsResponse++; | 304 buildCounterListSessionsResponse++; |
305 if (buildCounterListSessionsResponse < 3) { | 305 if (buildCounterListSessionsResponse < 3) { |
306 o.deletedSession = buildUnnamed922(); | 306 o.deletedSession = buildUnnamed763(); |
307 o.nextPageToken = "foo"; | 307 o.nextPageToken = "foo"; |
308 o.session = buildUnnamed923(); | 308 o.session = buildUnnamed764(); |
309 } | 309 } |
310 buildCounterListSessionsResponse--; | 310 buildCounterListSessionsResponse--; |
311 return o; | 311 return o; |
312 } | 312 } |
313 | 313 |
314 checkListSessionsResponse(api.ListSessionsResponse o) { | 314 checkListSessionsResponse(api.ListSessionsResponse o) { |
315 buildCounterListSessionsResponse++; | 315 buildCounterListSessionsResponse++; |
316 if (buildCounterListSessionsResponse < 3) { | 316 if (buildCounterListSessionsResponse < 3) { |
317 checkUnnamed922(o.deletedSession); | 317 checkUnnamed763(o.deletedSession); |
318 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 318 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
319 checkUnnamed923(o.session); | 319 checkUnnamed764(o.session); |
320 } | 320 } |
321 buildCounterListSessionsResponse--; | 321 buildCounterListSessionsResponse--; |
322 } | 322 } |
323 | 323 |
324 core.int buildCounterSession = 0; | 324 core.int buildCounterSession = 0; |
325 buildSession() { | 325 buildSession() { |
326 var o = new api.Session(); | 326 var o = new api.Session(); |
327 buildCounterSession++; | 327 buildCounterSession++; |
328 if (buildCounterSession < 3) { | 328 if (buildCounterSession < 3) { |
329 o.activityType = 42; | 329 o.activityType = 42; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 checkValue(api.Value o) { | 369 checkValue(api.Value o) { |
370 buildCounterValue++; | 370 buildCounterValue++; |
371 if (buildCounterValue < 3) { | 371 if (buildCounterValue < 3) { |
372 unittest.expect(o.fpVal, unittest.equals(42.0)); | 372 unittest.expect(o.fpVal, unittest.equals(42.0)); |
373 unittest.expect(o.intVal, unittest.equals(42)); | 373 unittest.expect(o.intVal, unittest.equals(42)); |
374 } | 374 } |
375 buildCounterValue--; | 375 buildCounterValue--; |
376 } | 376 } |
377 | 377 |
378 buildUnnamed924() { | 378 buildUnnamed765() { |
379 var o = new core.List<core.String>(); | 379 var o = new core.List<core.String>(); |
380 o.add("foo"); | 380 o.add("foo"); |
381 o.add("foo"); | 381 o.add("foo"); |
382 return o; | 382 return o; |
383 } | 383 } |
384 | 384 |
385 checkUnnamed924(core.List<core.String> o) { | 385 checkUnnamed765(core.List<core.String> o) { |
386 unittest.expect(o, unittest.hasLength(2)); | 386 unittest.expect(o, unittest.hasLength(2)); |
387 unittest.expect(o[0], unittest.equals('foo')); | 387 unittest.expect(o[0], unittest.equals('foo')); |
388 unittest.expect(o[1], unittest.equals('foo')); | 388 unittest.expect(o[1], unittest.equals('foo')); |
389 } | 389 } |
390 | 390 |
391 | 391 |
392 main() { | 392 main() { |
393 unittest.group("obj-schema-Application", () { | 393 unittest.group("obj-schema-Application", () { |
394 unittest.test("to-json--from-json", () { | 394 unittest.test("to-json--from-json", () { |
395 var o = buildApplication(); | 395 var o = buildApplication(); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 res.get(arg_userId, arg_dataSourceId).then(unittest.expectAsync(((api.Data
Source response) { | 577 res.get(arg_userId, arg_dataSourceId).then(unittest.expectAsync(((api.Data
Source response) { |
578 checkDataSource(response); | 578 checkDataSource(response); |
579 }))); | 579 }))); |
580 }); | 580 }); |
581 | 581 |
582 unittest.test("method--list", () { | 582 unittest.test("method--list", () { |
583 | 583 |
584 var mock = new common_test.HttpServerMock(); | 584 var mock = new common_test.HttpServerMock(); |
585 api.UsersDataSourcesResourceApi res = new api.FitnessApi(mock).users.dataS
ources; | 585 api.UsersDataSourcesResourceApi res = new api.FitnessApi(mock).users.dataS
ources; |
586 var arg_userId = "foo"; | 586 var arg_userId = "foo"; |
587 var arg_dataTypeName = buildUnnamed924(); | 587 var arg_dataTypeName = buildUnnamed765(); |
588 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 588 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
589 var path = (req.url).path; | 589 var path = (req.url).path; |
590 var pathOffset = 0; | 590 var pathOffset = 0; |
591 var index; | 591 var index; |
592 var subPart; | 592 var subPart; |
593 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 593 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
594 pathOffset += 1; | 594 pathOffset += 1; |
595 | 595 |
596 var query = (req.url).query; | 596 var query = (req.url).query; |
597 var queryOffset = 0; | 597 var queryOffset = 0; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 res.delete(arg_userId, arg_dataSourceId, arg_datasetId, currentTimeMillis:
arg_currentTimeMillis, modifiedTimeMillis: arg_modifiedTimeMillis).then(unittes
t.expectAsync((_) {})); | 767 res.delete(arg_userId, arg_dataSourceId, arg_datasetId, currentTimeMillis:
arg_currentTimeMillis, modifiedTimeMillis: arg_modifiedTimeMillis).then(unittes
t.expectAsync((_) {})); |
768 }); | 768 }); |
769 | 769 |
770 unittest.test("method--get", () { | 770 unittest.test("method--get", () { |
771 | 771 |
772 var mock = new common_test.HttpServerMock(); | 772 var mock = new common_test.HttpServerMock(); |
773 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; | 773 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; |
774 var arg_userId = "foo"; | 774 var arg_userId = "foo"; |
775 var arg_dataSourceId = "foo"; | 775 var arg_dataSourceId = "foo"; |
776 var arg_datasetId = "foo"; | 776 var arg_datasetId = "foo"; |
| 777 var arg_limit = 42; |
777 var arg_pageToken = "foo"; | 778 var arg_pageToken = "foo"; |
778 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 779 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
779 var path = (req.url).path; | 780 var path = (req.url).path; |
780 var pathOffset = 0; | 781 var pathOffset = 0; |
781 var index; | 782 var index; |
782 var subPart; | 783 var subPart; |
783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 784 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
784 pathOffset += 1; | 785 pathOffset += 1; |
785 | 786 |
786 var query = (req.url).query; | 787 var query = (req.url).query; |
787 var queryOffset = 0; | 788 var queryOffset = 0; |
788 var queryMap = {}; | 789 var queryMap = {}; |
789 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 790 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
790 parseBool(n) { | 791 parseBool(n) { |
791 if (n == "true") return true; | 792 if (n == "true") return true; |
792 if (n == "false") return false; | 793 if (n == "false") return false; |
793 if (n == null) return null; | 794 if (n == null) return null; |
794 throw new core.ArgumentError("Invalid boolean: $n"); | 795 throw new core.ArgumentError("Invalid boolean: $n"); |
795 } | 796 } |
796 if (query.length > 0) { | 797 if (query.length > 0) { |
797 for (var part in query.split("&")) { | 798 for (var part in query.split("&")) { |
798 var keyvalue = part.split("="); | 799 var keyvalue = part.split("="); |
799 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 800 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
800 } | 801 } |
801 } | 802 } |
| 803 unittest.expect(core.int.parse(queryMap["limit"].first), unittest.equals
(arg_limit)); |
802 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 804 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
803 | 805 |
804 | 806 |
805 var h = { | 807 var h = { |
806 "content-type" : "application/json; charset=utf-8", | 808 "content-type" : "application/json; charset=utf-8", |
807 }; | 809 }; |
808 var resp = convert.JSON.encode(buildDataset()); | 810 var resp = convert.JSON.encode(buildDataset()); |
809 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 811 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
810 }), true); | 812 }), true); |
811 res.get(arg_userId, arg_dataSourceId, arg_datasetId, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.Dataset response) { | 813 res.get(arg_userId, arg_dataSourceId, arg_datasetId, limit: arg_limit, pag
eToken: arg_pageToken).then(unittest.expectAsync(((api.Dataset response) { |
812 checkDataset(response); | 814 checkDataset(response); |
813 }))); | 815 }))); |
814 }); | 816 }); |
815 | 817 |
816 unittest.test("method--patch", () { | 818 unittest.test("method--patch", () { |
817 | 819 |
818 var mock = new common_test.HttpServerMock(); | 820 var mock = new common_test.HttpServerMock(); |
819 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; | 821 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; |
820 var arg_request = buildDataset(); | 822 var arg_request = buildDataset(); |
821 var arg_userId = "foo"; | 823 var arg_userId = "foo"; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 res.update(arg_request, arg_userId, arg_sessionId, currentTimeMillis: arg_
currentTimeMillis).then(unittest.expectAsync(((api.Session response) { | 1009 res.update(arg_request, arg_userId, arg_sessionId, currentTimeMillis: arg_
currentTimeMillis).then(unittest.expectAsync(((api.Session response) { |
1008 checkSession(response); | 1010 checkSession(response); |
1009 }))); | 1011 }))); |
1010 }); | 1012 }); |
1011 | 1013 |
1012 }); | 1014 }); |
1013 | 1015 |
1014 | 1016 |
1015 } | 1017 } |
1016 | 1018 |
OLD | NEW |