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 buildUnnamed757() { | 44 buildUnnamed918() { |
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 checkUnnamed757(core.List<api.Value> o) { | 51 checkUnnamed918(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 = buildUnnamed757(); | 69 o.value = buildUnnamed918(); |
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 checkUnnamed757(o.value); | 85 checkUnnamed918(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 buildUnnamed758() { | 121 buildUnnamed919() { |
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 checkUnnamed758(core.List<api.DataTypeField> o) { | 128 checkUnnamed919(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 = buildUnnamed758(); | 139 o.field = buildUnnamed919(); |
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 checkUnnamed758(o.field); | 149 checkUnnamed919(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 buildUnnamed759() { | 176 buildUnnamed920() { |
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 checkUnnamed759(core.List<api.DataPoint> o) { | 183 checkUnnamed920(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.point = buildUnnamed759(); | 197 o.nextPageToken = "foo"; |
| 198 o.point = buildUnnamed920(); |
198 } | 199 } |
199 buildCounterDataset--; | 200 buildCounterDataset--; |
200 return o; | 201 return o; |
201 } | 202 } |
202 | 203 |
203 checkDataset(api.Dataset o) { | 204 checkDataset(api.Dataset o) { |
204 buildCounterDataset++; | 205 buildCounterDataset++; |
205 if (buildCounterDataset < 3) { | 206 if (buildCounterDataset < 3) { |
206 unittest.expect(o.dataSourceId, unittest.equals('foo')); | 207 unittest.expect(o.dataSourceId, unittest.equals('foo')); |
207 unittest.expect(o.maxEndTimeNs, unittest.equals('foo')); | 208 unittest.expect(o.maxEndTimeNs, unittest.equals('foo')); |
208 unittest.expect(o.minStartTimeNs, unittest.equals('foo')); | 209 unittest.expect(o.minStartTimeNs, unittest.equals('foo')); |
209 checkUnnamed759(o.point); | 210 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 211 checkUnnamed920(o.point); |
210 } | 212 } |
211 buildCounterDataset--; | 213 buildCounterDataset--; |
212 } | 214 } |
213 | 215 |
214 core.int buildCounterDevice = 0; | 216 core.int buildCounterDevice = 0; |
215 buildDevice() { | 217 buildDevice() { |
216 var o = new api.Device(); | 218 var o = new api.Device(); |
217 buildCounterDevice++; | 219 buildCounterDevice++; |
218 if (buildCounterDevice < 3) { | 220 if (buildCounterDevice < 3) { |
219 o.manufacturer = "foo"; | 221 o.manufacturer = "foo"; |
(...skipping 11 matching lines...) Expand all Loading... |
231 if (buildCounterDevice < 3) { | 233 if (buildCounterDevice < 3) { |
232 unittest.expect(o.manufacturer, unittest.equals('foo')); | 234 unittest.expect(o.manufacturer, unittest.equals('foo')); |
233 unittest.expect(o.model, unittest.equals('foo')); | 235 unittest.expect(o.model, unittest.equals('foo')); |
234 unittest.expect(o.type, unittest.equals('foo')); | 236 unittest.expect(o.type, unittest.equals('foo')); |
235 unittest.expect(o.uid, unittest.equals('foo')); | 237 unittest.expect(o.uid, unittest.equals('foo')); |
236 unittest.expect(o.version, unittest.equals('foo')); | 238 unittest.expect(o.version, unittest.equals('foo')); |
237 } | 239 } |
238 buildCounterDevice--; | 240 buildCounterDevice--; |
239 } | 241 } |
240 | 242 |
241 buildUnnamed760() { | 243 buildUnnamed921() { |
242 var o = new core.List<api.DataSource>(); | 244 var o = new core.List<api.DataSource>(); |
243 o.add(buildDataSource()); | 245 o.add(buildDataSource()); |
244 o.add(buildDataSource()); | 246 o.add(buildDataSource()); |
245 return o; | 247 return o; |
246 } | 248 } |
247 | 249 |
248 checkUnnamed760(core.List<api.DataSource> o) { | 250 checkUnnamed921(core.List<api.DataSource> o) { |
249 unittest.expect(o, unittest.hasLength(2)); | 251 unittest.expect(o, unittest.hasLength(2)); |
250 checkDataSource(o[0]); | 252 checkDataSource(o[0]); |
251 checkDataSource(o[1]); | 253 checkDataSource(o[1]); |
252 } | 254 } |
253 | 255 |
254 core.int buildCounterListDataSourcesResponse = 0; | 256 core.int buildCounterListDataSourcesResponse = 0; |
255 buildListDataSourcesResponse() { | 257 buildListDataSourcesResponse() { |
256 var o = new api.ListDataSourcesResponse(); | 258 var o = new api.ListDataSourcesResponse(); |
257 buildCounterListDataSourcesResponse++; | 259 buildCounterListDataSourcesResponse++; |
258 if (buildCounterListDataSourcesResponse < 3) { | 260 if (buildCounterListDataSourcesResponse < 3) { |
259 o.dataSource = buildUnnamed760(); | 261 o.dataSource = buildUnnamed921(); |
260 } | 262 } |
261 buildCounterListDataSourcesResponse--; | 263 buildCounterListDataSourcesResponse--; |
262 return o; | 264 return o; |
263 } | 265 } |
264 | 266 |
265 checkListDataSourcesResponse(api.ListDataSourcesResponse o) { | 267 checkListDataSourcesResponse(api.ListDataSourcesResponse o) { |
266 buildCounterListDataSourcesResponse++; | 268 buildCounterListDataSourcesResponse++; |
267 if (buildCounterListDataSourcesResponse < 3) { | 269 if (buildCounterListDataSourcesResponse < 3) { |
268 checkUnnamed760(o.dataSource); | 270 checkUnnamed921(o.dataSource); |
269 } | 271 } |
270 buildCounterListDataSourcesResponse--; | 272 buildCounterListDataSourcesResponse--; |
271 } | 273 } |
272 | 274 |
273 buildUnnamed761() { | 275 buildUnnamed922() { |
274 var o = new core.List<api.Session>(); | 276 var o = new core.List<api.Session>(); |
275 o.add(buildSession()); | 277 o.add(buildSession()); |
276 o.add(buildSession()); | 278 o.add(buildSession()); |
277 return o; | 279 return o; |
278 } | 280 } |
279 | 281 |
280 checkUnnamed761(core.List<api.Session> o) { | 282 checkUnnamed922(core.List<api.Session> o) { |
281 unittest.expect(o, unittest.hasLength(2)); | 283 unittest.expect(o, unittest.hasLength(2)); |
282 checkSession(o[0]); | 284 checkSession(o[0]); |
283 checkSession(o[1]); | 285 checkSession(o[1]); |
284 } | 286 } |
285 | 287 |
286 buildUnnamed762() { | 288 buildUnnamed923() { |
287 var o = new core.List<api.Session>(); | 289 var o = new core.List<api.Session>(); |
288 o.add(buildSession()); | 290 o.add(buildSession()); |
289 o.add(buildSession()); | 291 o.add(buildSession()); |
290 return o; | 292 return o; |
291 } | 293 } |
292 | 294 |
293 checkUnnamed762(core.List<api.Session> o) { | 295 checkUnnamed923(core.List<api.Session> o) { |
294 unittest.expect(o, unittest.hasLength(2)); | 296 unittest.expect(o, unittest.hasLength(2)); |
295 checkSession(o[0]); | 297 checkSession(o[0]); |
296 checkSession(o[1]); | 298 checkSession(o[1]); |
297 } | 299 } |
298 | 300 |
299 core.int buildCounterListSessionsResponse = 0; | 301 core.int buildCounterListSessionsResponse = 0; |
300 buildListSessionsResponse() { | 302 buildListSessionsResponse() { |
301 var o = new api.ListSessionsResponse(); | 303 var o = new api.ListSessionsResponse(); |
302 buildCounterListSessionsResponse++; | 304 buildCounterListSessionsResponse++; |
303 if (buildCounterListSessionsResponse < 3) { | 305 if (buildCounterListSessionsResponse < 3) { |
304 o.deletedSession = buildUnnamed761(); | 306 o.deletedSession = buildUnnamed922(); |
305 o.nextPageToken = "foo"; | 307 o.nextPageToken = "foo"; |
306 o.session = buildUnnamed762(); | 308 o.session = buildUnnamed923(); |
307 } | 309 } |
308 buildCounterListSessionsResponse--; | 310 buildCounterListSessionsResponse--; |
309 return o; | 311 return o; |
310 } | 312 } |
311 | 313 |
312 checkListSessionsResponse(api.ListSessionsResponse o) { | 314 checkListSessionsResponse(api.ListSessionsResponse o) { |
313 buildCounterListSessionsResponse++; | 315 buildCounterListSessionsResponse++; |
314 if (buildCounterListSessionsResponse < 3) { | 316 if (buildCounterListSessionsResponse < 3) { |
315 checkUnnamed761(o.deletedSession); | 317 checkUnnamed922(o.deletedSession); |
316 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 318 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
317 checkUnnamed762(o.session); | 319 checkUnnamed923(o.session); |
318 } | 320 } |
319 buildCounterListSessionsResponse--; | 321 buildCounterListSessionsResponse--; |
320 } | 322 } |
321 | 323 |
322 core.int buildCounterSession = 0; | 324 core.int buildCounterSession = 0; |
323 buildSession() { | 325 buildSession() { |
324 var o = new api.Session(); | 326 var o = new api.Session(); |
325 buildCounterSession++; | 327 buildCounterSession++; |
326 if (buildCounterSession < 3) { | 328 if (buildCounterSession < 3) { |
327 o.activityType = 42; | 329 o.activityType = 42; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 368 |
367 checkValue(api.Value o) { | 369 checkValue(api.Value o) { |
368 buildCounterValue++; | 370 buildCounterValue++; |
369 if (buildCounterValue < 3) { | 371 if (buildCounterValue < 3) { |
370 unittest.expect(o.fpVal, unittest.equals(42.0)); | 372 unittest.expect(o.fpVal, unittest.equals(42.0)); |
371 unittest.expect(o.intVal, unittest.equals(42)); | 373 unittest.expect(o.intVal, unittest.equals(42)); |
372 } | 374 } |
373 buildCounterValue--; | 375 buildCounterValue--; |
374 } | 376 } |
375 | 377 |
376 buildUnnamed763() { | 378 buildUnnamed924() { |
377 var o = new core.List<core.String>(); | 379 var o = new core.List<core.String>(); |
378 o.add("foo"); | 380 o.add("foo"); |
379 o.add("foo"); | 381 o.add("foo"); |
380 return o; | 382 return o; |
381 } | 383 } |
382 | 384 |
383 checkUnnamed763(core.List<core.String> o) { | 385 checkUnnamed924(core.List<core.String> o) { |
384 unittest.expect(o, unittest.hasLength(2)); | 386 unittest.expect(o, unittest.hasLength(2)); |
385 unittest.expect(o[0], unittest.equals('foo')); | 387 unittest.expect(o[0], unittest.equals('foo')); |
386 unittest.expect(o[1], unittest.equals('foo')); | 388 unittest.expect(o[1], unittest.equals('foo')); |
387 } | 389 } |
388 | 390 |
389 | 391 |
390 main() { | 392 main() { |
391 unittest.group("obj-schema-Application", () { | 393 unittest.group("obj-schema-Application", () { |
392 unittest.test("to-json--from-json", () { | 394 unittest.test("to-json--from-json", () { |
393 var o = buildApplication(); | 395 var o = buildApplication(); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 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) { |
576 checkDataSource(response); | 578 checkDataSource(response); |
577 }))); | 579 }))); |
578 }); | 580 }); |
579 | 581 |
580 unittest.test("method--list", () { | 582 unittest.test("method--list", () { |
581 | 583 |
582 var mock = new common_test.HttpServerMock(); | 584 var mock = new common_test.HttpServerMock(); |
583 api.UsersDataSourcesResourceApi res = new api.FitnessApi(mock).users.dataS
ources; | 585 api.UsersDataSourcesResourceApi res = new api.FitnessApi(mock).users.dataS
ources; |
584 var arg_userId = "foo"; | 586 var arg_userId = "foo"; |
585 var arg_dataTypeName = buildUnnamed763(); | 587 var arg_dataTypeName = buildUnnamed924(); |
586 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 588 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
587 var path = (req.url).path; | 589 var path = (req.url).path; |
588 var pathOffset = 0; | 590 var pathOffset = 0; |
589 var index; | 591 var index; |
590 var subPart; | 592 var subPart; |
591 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 593 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
592 pathOffset += 1; | 594 pathOffset += 1; |
593 | 595 |
594 var query = (req.url).query; | 596 var query = (req.url).query; |
595 var queryOffset = 0; | 597 var queryOffset = 0; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 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((_) {})); |
766 }); | 768 }); |
767 | 769 |
768 unittest.test("method--get", () { | 770 unittest.test("method--get", () { |
769 | 771 |
770 var mock = new common_test.HttpServerMock(); | 772 var mock = new common_test.HttpServerMock(); |
771 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; | 773 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; |
772 var arg_userId = "foo"; | 774 var arg_userId = "foo"; |
773 var arg_dataSourceId = "foo"; | 775 var arg_dataSourceId = "foo"; |
774 var arg_datasetId = "foo"; | 776 var arg_datasetId = "foo"; |
| 777 var arg_pageToken = "foo"; |
775 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 778 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
776 var path = (req.url).path; | 779 var path = (req.url).path; |
777 var pathOffset = 0; | 780 var pathOffset = 0; |
778 var index; | 781 var index; |
779 var subPart; | 782 var subPart; |
780 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
781 pathOffset += 1; | 784 pathOffset += 1; |
782 | 785 |
783 var query = (req.url).query; | 786 var query = (req.url).query; |
784 var queryOffset = 0; | 787 var queryOffset = 0; |
785 var queryMap = {}; | 788 var queryMap = {}; |
786 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 789 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
787 parseBool(n) { | 790 parseBool(n) { |
788 if (n == "true") return true; | 791 if (n == "true") return true; |
789 if (n == "false") return false; | 792 if (n == "false") return false; |
790 if (n == null) return null; | 793 if (n == null) return null; |
791 throw new core.ArgumentError("Invalid boolean: $n"); | 794 throw new core.ArgumentError("Invalid boolean: $n"); |
792 } | 795 } |
793 if (query.length > 0) { | 796 if (query.length > 0) { |
794 for (var part in query.split("&")) { | 797 for (var part in query.split("&")) { |
795 var keyvalue = part.split("="); | 798 var keyvalue = part.split("="); |
796 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 799 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
797 } | 800 } |
798 } | 801 } |
| 802 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
799 | 803 |
800 | 804 |
801 var h = { | 805 var h = { |
802 "content-type" : "application/json; charset=utf-8", | 806 "content-type" : "application/json; charset=utf-8", |
803 }; | 807 }; |
804 var resp = convert.JSON.encode(buildDataset()); | 808 var resp = convert.JSON.encode(buildDataset()); |
805 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 809 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
806 }), true); | 810 }), true); |
807 res.get(arg_userId, arg_dataSourceId, arg_datasetId).then(unittest.expectA
sync(((api.Dataset response) { | 811 res.get(arg_userId, arg_dataSourceId, arg_datasetId, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.Dataset response) { |
808 checkDataset(response); | 812 checkDataset(response); |
809 }))); | 813 }))); |
810 }); | 814 }); |
811 | 815 |
812 unittest.test("method--patch", () { | 816 unittest.test("method--patch", () { |
813 | 817 |
814 var mock = new common_test.HttpServerMock(); | 818 var mock = new common_test.HttpServerMock(); |
815 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; | 819 api.UsersDataSourcesDatasetsResourceApi res = new api.FitnessApi(mock).use
rs.dataSources.datasets; |
816 var arg_request = buildDataset(); | 820 var arg_request = buildDataset(); |
817 var arg_userId = "foo"; | 821 var arg_userId = "foo"; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 res.update(arg_request, arg_userId, arg_sessionId, currentTimeMillis: arg_
currentTimeMillis).then(unittest.expectAsync(((api.Session response) { | 1007 res.update(arg_request, arg_userId, arg_sessionId, currentTimeMillis: arg_
currentTimeMillis).then(unittest.expectAsync(((api.Session response) { |
1004 checkSession(response); | 1008 checkSession(response); |
1005 }))); | 1009 }))); |
1006 }); | 1010 }); |
1007 | 1011 |
1008 }); | 1012 }); |
1009 | 1013 |
1010 | 1014 |
1011 } | 1015 } |
1012 | 1016 |
OLD | NEW |