OLD | NEW |
1 library googleapis.youtubeAnalytics.v1.test; | 1 library googleapis.youtubeAnalytics.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
11 import 'package:googleapis/common/common.dart' as common; | |
12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
13 import '../common/common_internal_test.dart' as common_test; | |
14 | 11 |
15 import 'package:googleapis/youtubeanalytics/v1.dart' as api; | 12 import 'package:googleapis/youtubeanalytics/v1.dart' as api; |
16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
18 | 53 |
19 core.int buildCounterBatchReportOutputs = 0; | 54 core.int buildCounterBatchReportOutputs = 0; |
20 buildBatchReportOutputs() { | 55 buildBatchReportOutputs() { |
21 var o = new api.BatchReportOutputs(); | 56 var o = new api.BatchReportOutputs(); |
22 buildCounterBatchReportOutputs++; | 57 buildCounterBatchReportOutputs++; |
23 if (buildCounterBatchReportOutputs < 3) { | 58 if (buildCounterBatchReportOutputs < 3) { |
24 o.downloadUrl = "foo"; | 59 o.downloadUrl = "foo"; |
25 o.format = "foo"; | 60 o.format = "foo"; |
26 o.type = "foo"; | 61 o.type = "foo"; |
27 } | 62 } |
28 buildCounterBatchReportOutputs--; | 63 buildCounterBatchReportOutputs--; |
29 return o; | 64 return o; |
30 } | 65 } |
31 | 66 |
32 checkBatchReportOutputs(api.BatchReportOutputs o) { | 67 checkBatchReportOutputs(api.BatchReportOutputs o) { |
33 buildCounterBatchReportOutputs++; | 68 buildCounterBatchReportOutputs++; |
34 if (buildCounterBatchReportOutputs < 3) { | 69 if (buildCounterBatchReportOutputs < 3) { |
35 unittest.expect(o.downloadUrl, unittest.equals('foo')); | 70 unittest.expect(o.downloadUrl, unittest.equals('foo')); |
36 unittest.expect(o.format, unittest.equals('foo')); | 71 unittest.expect(o.format, unittest.equals('foo')); |
37 unittest.expect(o.type, unittest.equals('foo')); | 72 unittest.expect(o.type, unittest.equals('foo')); |
38 } | 73 } |
39 buildCounterBatchReportOutputs--; | 74 buildCounterBatchReportOutputs--; |
40 } | 75 } |
41 | 76 |
42 buildUnnamed188() { | 77 buildUnnamed1459() { |
43 var o = new core.List<api.BatchReportOutputs>(); | 78 var o = new core.List<api.BatchReportOutputs>(); |
44 o.add(buildBatchReportOutputs()); | 79 o.add(buildBatchReportOutputs()); |
45 o.add(buildBatchReportOutputs()); | 80 o.add(buildBatchReportOutputs()); |
46 return o; | 81 return o; |
47 } | 82 } |
48 | 83 |
49 checkUnnamed188(core.List<api.BatchReportOutputs> o) { | 84 checkUnnamed1459(core.List<api.BatchReportOutputs> o) { |
50 unittest.expect(o, unittest.hasLength(2)); | 85 unittest.expect(o, unittest.hasLength(2)); |
51 checkBatchReportOutputs(o[0]); | 86 checkBatchReportOutputs(o[0]); |
52 checkBatchReportOutputs(o[1]); | 87 checkBatchReportOutputs(o[1]); |
53 } | 88 } |
54 | 89 |
55 core.int buildCounterBatchReportTimeSpan = 0; | 90 core.int buildCounterBatchReportTimeSpan = 0; |
56 buildBatchReportTimeSpan() { | 91 buildBatchReportTimeSpan() { |
57 var o = new api.BatchReportTimeSpan(); | 92 var o = new api.BatchReportTimeSpan(); |
58 buildCounterBatchReportTimeSpan++; | 93 buildCounterBatchReportTimeSpan++; |
59 if (buildCounterBatchReportTimeSpan < 3) { | 94 if (buildCounterBatchReportTimeSpan < 3) { |
(...skipping 13 matching lines...) Expand all Loading... |
73 buildCounterBatchReportTimeSpan--; | 108 buildCounterBatchReportTimeSpan--; |
74 } | 109 } |
75 | 110 |
76 core.int buildCounterBatchReport = 0; | 111 core.int buildCounterBatchReport = 0; |
77 buildBatchReport() { | 112 buildBatchReport() { |
78 var o = new api.BatchReport(); | 113 var o = new api.BatchReport(); |
79 buildCounterBatchReport++; | 114 buildCounterBatchReport++; |
80 if (buildCounterBatchReport < 3) { | 115 if (buildCounterBatchReport < 3) { |
81 o.id = "foo"; | 116 o.id = "foo"; |
82 o.kind = "foo"; | 117 o.kind = "foo"; |
83 o.outputs = buildUnnamed188(); | 118 o.outputs = buildUnnamed1459(); |
84 o.reportId = "foo"; | 119 o.reportId = "foo"; |
85 o.timeSpan = buildBatchReportTimeSpan(); | 120 o.timeSpan = buildBatchReportTimeSpan(); |
86 o.timeUpdated = core.DateTime.parse("2002-02-27T14:01:02"); | 121 o.timeUpdated = core.DateTime.parse("2002-02-27T14:01:02"); |
87 } | 122 } |
88 buildCounterBatchReport--; | 123 buildCounterBatchReport--; |
89 return o; | 124 return o; |
90 } | 125 } |
91 | 126 |
92 checkBatchReport(api.BatchReport o) { | 127 checkBatchReport(api.BatchReport o) { |
93 buildCounterBatchReport++; | 128 buildCounterBatchReport++; |
94 if (buildCounterBatchReport < 3) { | 129 if (buildCounterBatchReport < 3) { |
95 unittest.expect(o.id, unittest.equals('foo')); | 130 unittest.expect(o.id, unittest.equals('foo')); |
96 unittest.expect(o.kind, unittest.equals('foo')); | 131 unittest.expect(o.kind, unittest.equals('foo')); |
97 checkUnnamed188(o.outputs); | 132 checkUnnamed1459(o.outputs); |
98 unittest.expect(o.reportId, unittest.equals('foo')); | 133 unittest.expect(o.reportId, unittest.equals('foo')); |
99 checkBatchReportTimeSpan(o.timeSpan); | 134 checkBatchReportTimeSpan(o.timeSpan); |
100 unittest.expect(o.timeUpdated, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); | 135 unittest.expect(o.timeUpdated, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); |
101 } | 136 } |
102 buildCounterBatchReport--; | 137 buildCounterBatchReport--; |
103 } | 138 } |
104 | 139 |
105 core.int buildCounterBatchReportDefinition = 0; | 140 core.int buildCounterBatchReportDefinition = 0; |
106 buildBatchReportDefinition() { | 141 buildBatchReportDefinition() { |
107 var o = new api.BatchReportDefinition(); | 142 var o = new api.BatchReportDefinition(); |
(...skipping 14 matching lines...) Expand all Loading... |
122 if (buildCounterBatchReportDefinition < 3) { | 157 if (buildCounterBatchReportDefinition < 3) { |
123 unittest.expect(o.id, unittest.equals('foo')); | 158 unittest.expect(o.id, unittest.equals('foo')); |
124 unittest.expect(o.kind, unittest.equals('foo')); | 159 unittest.expect(o.kind, unittest.equals('foo')); |
125 unittest.expect(o.name, unittest.equals('foo')); | 160 unittest.expect(o.name, unittest.equals('foo')); |
126 unittest.expect(o.status, unittest.equals('foo')); | 161 unittest.expect(o.status, unittest.equals('foo')); |
127 unittest.expect(o.type, unittest.equals('foo')); | 162 unittest.expect(o.type, unittest.equals('foo')); |
128 } | 163 } |
129 buildCounterBatchReportDefinition--; | 164 buildCounterBatchReportDefinition--; |
130 } | 165 } |
131 | 166 |
132 buildUnnamed189() { | 167 buildUnnamed1460() { |
133 var o = new core.List<api.BatchReportDefinition>(); | 168 var o = new core.List<api.BatchReportDefinition>(); |
134 o.add(buildBatchReportDefinition()); | 169 o.add(buildBatchReportDefinition()); |
135 o.add(buildBatchReportDefinition()); | 170 o.add(buildBatchReportDefinition()); |
136 return o; | 171 return o; |
137 } | 172 } |
138 | 173 |
139 checkUnnamed189(core.List<api.BatchReportDefinition> o) { | 174 checkUnnamed1460(core.List<api.BatchReportDefinition> o) { |
140 unittest.expect(o, unittest.hasLength(2)); | 175 unittest.expect(o, unittest.hasLength(2)); |
141 checkBatchReportDefinition(o[0]); | 176 checkBatchReportDefinition(o[0]); |
142 checkBatchReportDefinition(o[1]); | 177 checkBatchReportDefinition(o[1]); |
143 } | 178 } |
144 | 179 |
145 core.int buildCounterBatchReportDefinitionList = 0; | 180 core.int buildCounterBatchReportDefinitionList = 0; |
146 buildBatchReportDefinitionList() { | 181 buildBatchReportDefinitionList() { |
147 var o = new api.BatchReportDefinitionList(); | 182 var o = new api.BatchReportDefinitionList(); |
148 buildCounterBatchReportDefinitionList++; | 183 buildCounterBatchReportDefinitionList++; |
149 if (buildCounterBatchReportDefinitionList < 3) { | 184 if (buildCounterBatchReportDefinitionList < 3) { |
150 o.items = buildUnnamed189(); | 185 o.items = buildUnnamed1460(); |
151 o.kind = "foo"; | 186 o.kind = "foo"; |
152 } | 187 } |
153 buildCounterBatchReportDefinitionList--; | 188 buildCounterBatchReportDefinitionList--; |
154 return o; | 189 return o; |
155 } | 190 } |
156 | 191 |
157 checkBatchReportDefinitionList(api.BatchReportDefinitionList o) { | 192 checkBatchReportDefinitionList(api.BatchReportDefinitionList o) { |
158 buildCounterBatchReportDefinitionList++; | 193 buildCounterBatchReportDefinitionList++; |
159 if (buildCounterBatchReportDefinitionList < 3) { | 194 if (buildCounterBatchReportDefinitionList < 3) { |
160 checkUnnamed189(o.items); | 195 checkUnnamed1460(o.items); |
161 unittest.expect(o.kind, unittest.equals('foo')); | 196 unittest.expect(o.kind, unittest.equals('foo')); |
162 } | 197 } |
163 buildCounterBatchReportDefinitionList--; | 198 buildCounterBatchReportDefinitionList--; |
164 } | 199 } |
165 | 200 |
166 buildUnnamed190() { | 201 buildUnnamed1461() { |
167 var o = new core.List<api.BatchReport>(); | 202 var o = new core.List<api.BatchReport>(); |
168 o.add(buildBatchReport()); | 203 o.add(buildBatchReport()); |
169 o.add(buildBatchReport()); | 204 o.add(buildBatchReport()); |
170 return o; | 205 return o; |
171 } | 206 } |
172 | 207 |
173 checkUnnamed190(core.List<api.BatchReport> o) { | 208 checkUnnamed1461(core.List<api.BatchReport> o) { |
174 unittest.expect(o, unittest.hasLength(2)); | 209 unittest.expect(o, unittest.hasLength(2)); |
175 checkBatchReport(o[0]); | 210 checkBatchReport(o[0]); |
176 checkBatchReport(o[1]); | 211 checkBatchReport(o[1]); |
177 } | 212 } |
178 | 213 |
179 core.int buildCounterBatchReportList = 0; | 214 core.int buildCounterBatchReportList = 0; |
180 buildBatchReportList() { | 215 buildBatchReportList() { |
181 var o = new api.BatchReportList(); | 216 var o = new api.BatchReportList(); |
182 buildCounterBatchReportList++; | 217 buildCounterBatchReportList++; |
183 if (buildCounterBatchReportList < 3) { | 218 if (buildCounterBatchReportList < 3) { |
184 o.items = buildUnnamed190(); | 219 o.items = buildUnnamed1461(); |
185 o.kind = "foo"; | 220 o.kind = "foo"; |
186 } | 221 } |
187 buildCounterBatchReportList--; | 222 buildCounterBatchReportList--; |
188 return o; | 223 return o; |
189 } | 224 } |
190 | 225 |
191 checkBatchReportList(api.BatchReportList o) { | 226 checkBatchReportList(api.BatchReportList o) { |
192 buildCounterBatchReportList++; | 227 buildCounterBatchReportList++; |
193 if (buildCounterBatchReportList < 3) { | 228 if (buildCounterBatchReportList < 3) { |
194 checkUnnamed190(o.items); | 229 checkUnnamed1461(o.items); |
195 unittest.expect(o.kind, unittest.equals('foo')); | 230 unittest.expect(o.kind, unittest.equals('foo')); |
196 } | 231 } |
197 buildCounterBatchReportList--; | 232 buildCounterBatchReportList--; |
198 } | 233 } |
199 | 234 |
200 core.int buildCounterGroupContentDetails = 0; | 235 core.int buildCounterGroupContentDetails = 0; |
201 buildGroupContentDetails() { | 236 buildGroupContentDetails() { |
202 var o = new api.GroupContentDetails(); | 237 var o = new api.GroupContentDetails(); |
203 buildCounterGroupContentDetails++; | 238 buildCounterGroupContentDetails++; |
204 if (buildCounterGroupContentDetails < 3) { | 239 if (buildCounterGroupContentDetails < 3) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 if (buildCounterGroupItem < 3) { | 342 if (buildCounterGroupItem < 3) { |
308 unittest.expect(o.etag, unittest.equals('foo')); | 343 unittest.expect(o.etag, unittest.equals('foo')); |
309 unittest.expect(o.groupId, unittest.equals('foo')); | 344 unittest.expect(o.groupId, unittest.equals('foo')); |
310 unittest.expect(o.id, unittest.equals('foo')); | 345 unittest.expect(o.id, unittest.equals('foo')); |
311 unittest.expect(o.kind, unittest.equals('foo')); | 346 unittest.expect(o.kind, unittest.equals('foo')); |
312 checkGroupItemResource(o.resource); | 347 checkGroupItemResource(o.resource); |
313 } | 348 } |
314 buildCounterGroupItem--; | 349 buildCounterGroupItem--; |
315 } | 350 } |
316 | 351 |
317 buildUnnamed191() { | 352 buildUnnamed1462() { |
318 var o = new core.List<api.GroupItem>(); | 353 var o = new core.List<api.GroupItem>(); |
319 o.add(buildGroupItem()); | 354 o.add(buildGroupItem()); |
320 o.add(buildGroupItem()); | 355 o.add(buildGroupItem()); |
321 return o; | 356 return o; |
322 } | 357 } |
323 | 358 |
324 checkUnnamed191(core.List<api.GroupItem> o) { | 359 checkUnnamed1462(core.List<api.GroupItem> o) { |
325 unittest.expect(o, unittest.hasLength(2)); | 360 unittest.expect(o, unittest.hasLength(2)); |
326 checkGroupItem(o[0]); | 361 checkGroupItem(o[0]); |
327 checkGroupItem(o[1]); | 362 checkGroupItem(o[1]); |
328 } | 363 } |
329 | 364 |
330 core.int buildCounterGroupItemListResponse = 0; | 365 core.int buildCounterGroupItemListResponse = 0; |
331 buildGroupItemListResponse() { | 366 buildGroupItemListResponse() { |
332 var o = new api.GroupItemListResponse(); | 367 var o = new api.GroupItemListResponse(); |
333 buildCounterGroupItemListResponse++; | 368 buildCounterGroupItemListResponse++; |
334 if (buildCounterGroupItemListResponse < 3) { | 369 if (buildCounterGroupItemListResponse < 3) { |
335 o.etag = "foo"; | 370 o.etag = "foo"; |
336 o.items = buildUnnamed191(); | 371 o.items = buildUnnamed1462(); |
337 o.kind = "foo"; | 372 o.kind = "foo"; |
338 } | 373 } |
339 buildCounterGroupItemListResponse--; | 374 buildCounterGroupItemListResponse--; |
340 return o; | 375 return o; |
341 } | 376 } |
342 | 377 |
343 checkGroupItemListResponse(api.GroupItemListResponse o) { | 378 checkGroupItemListResponse(api.GroupItemListResponse o) { |
344 buildCounterGroupItemListResponse++; | 379 buildCounterGroupItemListResponse++; |
345 if (buildCounterGroupItemListResponse < 3) { | 380 if (buildCounterGroupItemListResponse < 3) { |
346 unittest.expect(o.etag, unittest.equals('foo')); | 381 unittest.expect(o.etag, unittest.equals('foo')); |
347 checkUnnamed191(o.items); | 382 checkUnnamed1462(o.items); |
348 unittest.expect(o.kind, unittest.equals('foo')); | 383 unittest.expect(o.kind, unittest.equals('foo')); |
349 } | 384 } |
350 buildCounterGroupItemListResponse--; | 385 buildCounterGroupItemListResponse--; |
351 } | 386 } |
352 | 387 |
353 buildUnnamed192() { | 388 buildUnnamed1463() { |
354 var o = new core.List<api.Group>(); | 389 var o = new core.List<api.Group>(); |
355 o.add(buildGroup()); | 390 o.add(buildGroup()); |
356 o.add(buildGroup()); | 391 o.add(buildGroup()); |
357 return o; | 392 return o; |
358 } | 393 } |
359 | 394 |
360 checkUnnamed192(core.List<api.Group> o) { | 395 checkUnnamed1463(core.List<api.Group> o) { |
361 unittest.expect(o, unittest.hasLength(2)); | 396 unittest.expect(o, unittest.hasLength(2)); |
362 checkGroup(o[0]); | 397 checkGroup(o[0]); |
363 checkGroup(o[1]); | 398 checkGroup(o[1]); |
364 } | 399 } |
365 | 400 |
366 core.int buildCounterGroupListResponse = 0; | 401 core.int buildCounterGroupListResponse = 0; |
367 buildGroupListResponse() { | 402 buildGroupListResponse() { |
368 var o = new api.GroupListResponse(); | 403 var o = new api.GroupListResponse(); |
369 buildCounterGroupListResponse++; | 404 buildCounterGroupListResponse++; |
370 if (buildCounterGroupListResponse < 3) { | 405 if (buildCounterGroupListResponse < 3) { |
371 o.etag = "foo"; | 406 o.etag = "foo"; |
372 o.items = buildUnnamed192(); | 407 o.items = buildUnnamed1463(); |
373 o.kind = "foo"; | 408 o.kind = "foo"; |
374 } | 409 } |
375 buildCounterGroupListResponse--; | 410 buildCounterGroupListResponse--; |
376 return o; | 411 return o; |
377 } | 412 } |
378 | 413 |
379 checkGroupListResponse(api.GroupListResponse o) { | 414 checkGroupListResponse(api.GroupListResponse o) { |
380 buildCounterGroupListResponse++; | 415 buildCounterGroupListResponse++; |
381 if (buildCounterGroupListResponse < 3) { | 416 if (buildCounterGroupListResponse < 3) { |
382 unittest.expect(o.etag, unittest.equals('foo')); | 417 unittest.expect(o.etag, unittest.equals('foo')); |
383 checkUnnamed192(o.items); | 418 checkUnnamed1463(o.items); |
384 unittest.expect(o.kind, unittest.equals('foo')); | 419 unittest.expect(o.kind, unittest.equals('foo')); |
385 } | 420 } |
386 buildCounterGroupListResponse--; | 421 buildCounterGroupListResponse--; |
387 } | 422 } |
388 | 423 |
389 core.int buildCounterResultTableColumnHeaders = 0; | 424 core.int buildCounterResultTableColumnHeaders = 0; |
390 buildResultTableColumnHeaders() { | 425 buildResultTableColumnHeaders() { |
391 var o = new api.ResultTableColumnHeaders(); | 426 var o = new api.ResultTableColumnHeaders(); |
392 buildCounterResultTableColumnHeaders++; | 427 buildCounterResultTableColumnHeaders++; |
393 if (buildCounterResultTableColumnHeaders < 3) { | 428 if (buildCounterResultTableColumnHeaders < 3) { |
394 o.columnType = "foo"; | 429 o.columnType = "foo"; |
395 o.dataType = "foo"; | 430 o.dataType = "foo"; |
396 o.name = "foo"; | 431 o.name = "foo"; |
397 } | 432 } |
398 buildCounterResultTableColumnHeaders--; | 433 buildCounterResultTableColumnHeaders--; |
399 return o; | 434 return o; |
400 } | 435 } |
401 | 436 |
402 checkResultTableColumnHeaders(api.ResultTableColumnHeaders o) { | 437 checkResultTableColumnHeaders(api.ResultTableColumnHeaders o) { |
403 buildCounterResultTableColumnHeaders++; | 438 buildCounterResultTableColumnHeaders++; |
404 if (buildCounterResultTableColumnHeaders < 3) { | 439 if (buildCounterResultTableColumnHeaders < 3) { |
405 unittest.expect(o.columnType, unittest.equals('foo')); | 440 unittest.expect(o.columnType, unittest.equals('foo')); |
406 unittest.expect(o.dataType, unittest.equals('foo')); | 441 unittest.expect(o.dataType, unittest.equals('foo')); |
407 unittest.expect(o.name, unittest.equals('foo')); | 442 unittest.expect(o.name, unittest.equals('foo')); |
408 } | 443 } |
409 buildCounterResultTableColumnHeaders--; | 444 buildCounterResultTableColumnHeaders--; |
410 } | 445 } |
411 | 446 |
412 buildUnnamed193() { | 447 buildUnnamed1464() { |
413 var o = new core.List<api.ResultTableColumnHeaders>(); | 448 var o = new core.List<api.ResultTableColumnHeaders>(); |
414 o.add(buildResultTableColumnHeaders()); | 449 o.add(buildResultTableColumnHeaders()); |
415 o.add(buildResultTableColumnHeaders()); | 450 o.add(buildResultTableColumnHeaders()); |
416 return o; | 451 return o; |
417 } | 452 } |
418 | 453 |
419 checkUnnamed193(core.List<api.ResultTableColumnHeaders> o) { | 454 checkUnnamed1464(core.List<api.ResultTableColumnHeaders> o) { |
420 unittest.expect(o, unittest.hasLength(2)); | 455 unittest.expect(o, unittest.hasLength(2)); |
421 checkResultTableColumnHeaders(o[0]); | 456 checkResultTableColumnHeaders(o[0]); |
422 checkResultTableColumnHeaders(o[1]); | 457 checkResultTableColumnHeaders(o[1]); |
423 } | 458 } |
424 | 459 |
425 buildUnnamed194() { | 460 buildUnnamed1465() { |
426 var o = new core.List<core.Object>(); | 461 var o = new core.List<core.Object>(); |
427 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 462 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
428 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 463 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
429 return o; | 464 return o; |
430 } | 465 } |
431 | 466 |
432 checkUnnamed194(core.List<core.Object> o) { | 467 checkUnnamed1465(core.List<core.Object> o) { |
433 unittest.expect(o, unittest.hasLength(2)); | 468 unittest.expect(o, unittest.hasLength(2)); |
434 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); | 469 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); |
435 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); | 470 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); |
436 } | 471 } |
437 | 472 |
438 buildUnnamed195() { | 473 buildUnnamed1466() { |
439 var o = new core.List<core.List<core.Object>>(); | 474 var o = new core.List<core.List<core.Object>>(); |
440 o.add(buildUnnamed194()); | 475 o.add(buildUnnamed1465()); |
441 o.add(buildUnnamed194()); | 476 o.add(buildUnnamed1465()); |
442 return o; | 477 return o; |
443 } | 478 } |
444 | 479 |
445 checkUnnamed195(core.List<core.List<core.Object>> o) { | 480 checkUnnamed1466(core.List<core.List<core.Object>> o) { |
446 unittest.expect(o, unittest.hasLength(2)); | 481 unittest.expect(o, unittest.hasLength(2)); |
447 checkUnnamed194(o[0]); | 482 checkUnnamed1465(o[0]); |
448 checkUnnamed194(o[1]); | 483 checkUnnamed1465(o[1]); |
449 } | 484 } |
450 | 485 |
451 core.int buildCounterResultTable = 0; | 486 core.int buildCounterResultTable = 0; |
452 buildResultTable() { | 487 buildResultTable() { |
453 var o = new api.ResultTable(); | 488 var o = new api.ResultTable(); |
454 buildCounterResultTable++; | 489 buildCounterResultTable++; |
455 if (buildCounterResultTable < 3) { | 490 if (buildCounterResultTable < 3) { |
456 o.columnHeaders = buildUnnamed193(); | 491 o.columnHeaders = buildUnnamed1464(); |
457 o.kind = "foo"; | 492 o.kind = "foo"; |
458 o.rows = buildUnnamed195(); | 493 o.rows = buildUnnamed1466(); |
459 } | 494 } |
460 buildCounterResultTable--; | 495 buildCounterResultTable--; |
461 return o; | 496 return o; |
462 } | 497 } |
463 | 498 |
464 checkResultTable(api.ResultTable o) { | 499 checkResultTable(api.ResultTable o) { |
465 buildCounterResultTable++; | 500 buildCounterResultTable++; |
466 if (buildCounterResultTable < 3) { | 501 if (buildCounterResultTable < 3) { |
467 checkUnnamed193(o.columnHeaders); | 502 checkUnnamed1464(o.columnHeaders); |
468 unittest.expect(o.kind, unittest.equals('foo')); | 503 unittest.expect(o.kind, unittest.equals('foo')); |
469 checkUnnamed195(o.rows); | 504 checkUnnamed1466(o.rows); |
470 } | 505 } |
471 buildCounterResultTable--; | 506 buildCounterResultTable--; |
472 } | 507 } |
473 | 508 |
474 | 509 |
475 main() { | 510 main() { |
476 unittest.group("obj-schema-BatchReportOutputs", () { | 511 unittest.group("obj-schema-BatchReportOutputs", () { |
477 unittest.test("to-json--from-json", () { | 512 unittest.test("to-json--from-json", () { |
478 var o = buildBatchReportOutputs(); | 513 var o = buildBatchReportOutputs(); |
479 var od = new api.BatchReportOutputs.fromJson(o.toJson()); | 514 var od = new api.BatchReportOutputs.fromJson(o.toJson()); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 var o = buildResultTable(); | 639 var o = buildResultTable(); |
605 var od = new api.ResultTable.fromJson(o.toJson()); | 640 var od = new api.ResultTable.fromJson(o.toJson()); |
606 checkResultTable(od); | 641 checkResultTable(od); |
607 }); | 642 }); |
608 }); | 643 }); |
609 | 644 |
610 | 645 |
611 unittest.group("resource-BatchReportDefinitionsResourceApi", () { | 646 unittest.group("resource-BatchReportDefinitionsResourceApi", () { |
612 unittest.test("method--list", () { | 647 unittest.test("method--list", () { |
613 | 648 |
614 var mock = new common_test.HttpServerMock(); | 649 var mock = new HttpServerMock(); |
615 api.BatchReportDefinitionsResourceApi res = new api.YoutubeAnalyticsApi(mo
ck).batchReportDefinitions; | 650 api.BatchReportDefinitionsResourceApi res = new api.YoutubeAnalyticsApi(mo
ck).batchReportDefinitions; |
616 var arg_onBehalfOfContentOwner = "foo"; | 651 var arg_onBehalfOfContentOwner = "foo"; |
617 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 652 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
618 var path = (req.url).path; | 653 var path = (req.url).path; |
619 var pathOffset = 0; | 654 var pathOffset = 0; |
620 var index; | 655 var index; |
621 var subPart; | 656 var subPart; |
622 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 657 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
623 pathOffset += 1; | 658 pathOffset += 1; |
624 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("youtube/analytics/v1/")); | 659 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("youtube/analytics/v1/")); |
(...skipping 17 matching lines...) Expand all Loading... |
642 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 677 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
643 } | 678 } |
644 } | 679 } |
645 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 680 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
646 | 681 |
647 | 682 |
648 var h = { | 683 var h = { |
649 "content-type" : "application/json; charset=utf-8", | 684 "content-type" : "application/json; charset=utf-8", |
650 }; | 685 }; |
651 var resp = convert.JSON.encode(buildBatchReportDefinitionList()); | 686 var resp = convert.JSON.encode(buildBatchReportDefinitionList()); |
652 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 687 return new async.Future.value(stringResponse(200, h, resp)); |
653 }), true); | 688 }), true); |
654 res.list(arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.Batch
ReportDefinitionList response) { | 689 res.list(arg_onBehalfOfContentOwner).then(unittest.expectAsync(((api.Batch
ReportDefinitionList response) { |
655 checkBatchReportDefinitionList(response); | 690 checkBatchReportDefinitionList(response); |
656 }))); | 691 }))); |
657 }); | 692 }); |
658 | 693 |
659 }); | 694 }); |
660 | 695 |
661 | 696 |
662 unittest.group("resource-BatchReportsResourceApi", () { | 697 unittest.group("resource-BatchReportsResourceApi", () { |
663 unittest.test("method--list", () { | 698 unittest.test("method--list", () { |
664 | 699 |
665 var mock = new common_test.HttpServerMock(); | 700 var mock = new HttpServerMock(); |
666 api.BatchReportsResourceApi res = new api.YoutubeAnalyticsApi(mock).batchR
eports; | 701 api.BatchReportsResourceApi res = new api.YoutubeAnalyticsApi(mock).batchR
eports; |
667 var arg_batchReportDefinitionId = "foo"; | 702 var arg_batchReportDefinitionId = "foo"; |
668 var arg_onBehalfOfContentOwner = "foo"; | 703 var arg_onBehalfOfContentOwner = "foo"; |
669 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 704 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
670 var path = (req.url).path; | 705 var path = (req.url).path; |
671 var pathOffset = 0; | 706 var pathOffset = 0; |
672 var index; | 707 var index; |
673 var subPart; | 708 var subPart; |
674 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 709 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
675 pathOffset += 1; | 710 pathOffset += 1; |
(...skipping 19 matching lines...) Expand all Loading... |
695 } | 730 } |
696 } | 731 } |
697 unittest.expect(queryMap["batchReportDefinitionId"].first, unittest.equa
ls(arg_batchReportDefinitionId)); | 732 unittest.expect(queryMap["batchReportDefinitionId"].first, unittest.equa
ls(arg_batchReportDefinitionId)); |
698 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 733 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
699 | 734 |
700 | 735 |
701 var h = { | 736 var h = { |
702 "content-type" : "application/json; charset=utf-8", | 737 "content-type" : "application/json; charset=utf-8", |
703 }; | 738 }; |
704 var resp = convert.JSON.encode(buildBatchReportList()); | 739 var resp = convert.JSON.encode(buildBatchReportList()); |
705 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 740 return new async.Future.value(stringResponse(200, h, resp)); |
706 }), true); | 741 }), true); |
707 res.list(arg_batchReportDefinitionId, arg_onBehalfOfContentOwner).then(uni
ttest.expectAsync(((api.BatchReportList response) { | 742 res.list(arg_batchReportDefinitionId, arg_onBehalfOfContentOwner).then(uni
ttest.expectAsync(((api.BatchReportList response) { |
708 checkBatchReportList(response); | 743 checkBatchReportList(response); |
709 }))); | 744 }))); |
710 }); | 745 }); |
711 | 746 |
712 }); | 747 }); |
713 | 748 |
714 | 749 |
715 unittest.group("resource-GroupItemsResourceApi", () { | 750 unittest.group("resource-GroupItemsResourceApi", () { |
716 unittest.test("method--delete", () { | 751 unittest.test("method--delete", () { |
717 | 752 |
718 var mock = new common_test.HttpServerMock(); | 753 var mock = new HttpServerMock(); |
719 api.GroupItemsResourceApi res = new api.YoutubeAnalyticsApi(mock).groupIte
ms; | 754 api.GroupItemsResourceApi res = new api.YoutubeAnalyticsApi(mock).groupIte
ms; |
720 var arg_id = "foo"; | 755 var arg_id = "foo"; |
721 var arg_onBehalfOfContentOwner = "foo"; | 756 var arg_onBehalfOfContentOwner = "foo"; |
722 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 757 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
723 var path = (req.url).path; | 758 var path = (req.url).path; |
724 var pathOffset = 0; | 759 var pathOffset = 0; |
725 var index; | 760 var index; |
726 var subPart; | 761 var subPart; |
727 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 762 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
728 pathOffset += 1; | 763 pathOffset += 1; |
(...skipping 19 matching lines...) Expand all Loading... |
748 } | 783 } |
749 } | 784 } |
750 unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); | 785 unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
751 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 786 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
752 | 787 |
753 | 788 |
754 var h = { | 789 var h = { |
755 "content-type" : "application/json; charset=utf-8", | 790 "content-type" : "application/json; charset=utf-8", |
756 }; | 791 }; |
757 var resp = ""; | 792 var resp = ""; |
758 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 793 return new async.Future.value(stringResponse(200, h, resp)); |
759 }), true); | 794 }), true); |
760 res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).the
n(unittest.expectAsync((_) {})); | 795 res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).the
n(unittest.expectAsync((_) {})); |
761 }); | 796 }); |
762 | 797 |
763 unittest.test("method--insert", () { | 798 unittest.test("method--insert", () { |
764 | 799 |
765 var mock = new common_test.HttpServerMock(); | 800 var mock = new HttpServerMock(); |
766 api.GroupItemsResourceApi res = new api.YoutubeAnalyticsApi(mock).groupIte
ms; | 801 api.GroupItemsResourceApi res = new api.YoutubeAnalyticsApi(mock).groupIte
ms; |
767 var arg_request = buildGroupItem(); | 802 var arg_request = buildGroupItem(); |
768 var arg_onBehalfOfContentOwner = "foo"; | 803 var arg_onBehalfOfContentOwner = "foo"; |
769 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 804 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
770 var obj = new api.GroupItem.fromJson(json); | 805 var obj = new api.GroupItem.fromJson(json); |
771 checkGroupItem(obj); | 806 checkGroupItem(obj); |
772 | 807 |
773 var path = (req.url).path; | 808 var path = (req.url).path; |
774 var pathOffset = 0; | 809 var pathOffset = 0; |
775 var index; | 810 var index; |
(...skipping 21 matching lines...) Expand all Loading... |
797 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 832 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
798 } | 833 } |
799 } | 834 } |
800 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 835 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
801 | 836 |
802 | 837 |
803 var h = { | 838 var h = { |
804 "content-type" : "application/json; charset=utf-8", | 839 "content-type" : "application/json; charset=utf-8", |
805 }; | 840 }; |
806 var resp = convert.JSON.encode(buildGroupItem()); | 841 var resp = convert.JSON.encode(buildGroupItem()); |
807 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 842 return new async.Future.value(stringResponse(200, h, resp)); |
808 }), true); | 843 }), true); |
809 res.insert(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner
).then(unittest.expectAsync(((api.GroupItem response) { | 844 res.insert(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner
).then(unittest.expectAsync(((api.GroupItem response) { |
810 checkGroupItem(response); | 845 checkGroupItem(response); |
811 }))); | 846 }))); |
812 }); | 847 }); |
813 | 848 |
814 unittest.test("method--list", () { | 849 unittest.test("method--list", () { |
815 | 850 |
816 var mock = new common_test.HttpServerMock(); | 851 var mock = new HttpServerMock(); |
817 api.GroupItemsResourceApi res = new api.YoutubeAnalyticsApi(mock).groupIte
ms; | 852 api.GroupItemsResourceApi res = new api.YoutubeAnalyticsApi(mock).groupIte
ms; |
818 var arg_groupId = "foo"; | 853 var arg_groupId = "foo"; |
819 var arg_onBehalfOfContentOwner = "foo"; | 854 var arg_onBehalfOfContentOwner = "foo"; |
820 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 855 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
821 var path = (req.url).path; | 856 var path = (req.url).path; |
822 var pathOffset = 0; | 857 var pathOffset = 0; |
823 var index; | 858 var index; |
824 var subPart; | 859 var subPart; |
825 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 860 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
826 pathOffset += 1; | 861 pathOffset += 1; |
(...skipping 19 matching lines...) Expand all Loading... |
846 } | 881 } |
847 } | 882 } |
848 unittest.expect(queryMap["groupId"].first, unittest.equals(arg_groupId))
; | 883 unittest.expect(queryMap["groupId"].first, unittest.equals(arg_groupId))
; |
849 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 884 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
850 | 885 |
851 | 886 |
852 var h = { | 887 var h = { |
853 "content-type" : "application/json; charset=utf-8", | 888 "content-type" : "application/json; charset=utf-8", |
854 }; | 889 }; |
855 var resp = convert.JSON.encode(buildGroupItemListResponse()); | 890 var resp = convert.JSON.encode(buildGroupItemListResponse()); |
856 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 891 return new async.Future.value(stringResponse(200, h, resp)); |
857 }), true); | 892 }), true); |
858 res.list(arg_groupId, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).
then(unittest.expectAsync(((api.GroupItemListResponse response) { | 893 res.list(arg_groupId, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).
then(unittest.expectAsync(((api.GroupItemListResponse response) { |
859 checkGroupItemListResponse(response); | 894 checkGroupItemListResponse(response); |
860 }))); | 895 }))); |
861 }); | 896 }); |
862 | 897 |
863 }); | 898 }); |
864 | 899 |
865 | 900 |
866 unittest.group("resource-GroupsResourceApi", () { | 901 unittest.group("resource-GroupsResourceApi", () { |
867 unittest.test("method--delete", () { | 902 unittest.test("method--delete", () { |
868 | 903 |
869 var mock = new common_test.HttpServerMock(); | 904 var mock = new HttpServerMock(); |
870 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; | 905 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; |
871 var arg_id = "foo"; | 906 var arg_id = "foo"; |
872 var arg_onBehalfOfContentOwner = "foo"; | 907 var arg_onBehalfOfContentOwner = "foo"; |
873 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 908 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
874 var path = (req.url).path; | 909 var path = (req.url).path; |
875 var pathOffset = 0; | 910 var pathOffset = 0; |
876 var index; | 911 var index; |
877 var subPart; | 912 var subPart; |
878 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 913 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
879 pathOffset += 1; | 914 pathOffset += 1; |
(...skipping 19 matching lines...) Expand all Loading... |
899 } | 934 } |
900 } | 935 } |
901 unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); | 936 unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
902 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 937 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
903 | 938 |
904 | 939 |
905 var h = { | 940 var h = { |
906 "content-type" : "application/json; charset=utf-8", | 941 "content-type" : "application/json; charset=utf-8", |
907 }; | 942 }; |
908 var resp = ""; | 943 var resp = ""; |
909 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 944 return new async.Future.value(stringResponse(200, h, resp)); |
910 }), true); | 945 }), true); |
911 res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).the
n(unittest.expectAsync((_) {})); | 946 res.delete(arg_id, onBehalfOfContentOwner: arg_onBehalfOfContentOwner).the
n(unittest.expectAsync((_) {})); |
912 }); | 947 }); |
913 | 948 |
914 unittest.test("method--insert", () { | 949 unittest.test("method--insert", () { |
915 | 950 |
916 var mock = new common_test.HttpServerMock(); | 951 var mock = new HttpServerMock(); |
917 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; | 952 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; |
918 var arg_request = buildGroup(); | 953 var arg_request = buildGroup(); |
919 var arg_onBehalfOfContentOwner = "foo"; | 954 var arg_onBehalfOfContentOwner = "foo"; |
920 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 955 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
921 var obj = new api.Group.fromJson(json); | 956 var obj = new api.Group.fromJson(json); |
922 checkGroup(obj); | 957 checkGroup(obj); |
923 | 958 |
924 var path = (req.url).path; | 959 var path = (req.url).path; |
925 var pathOffset = 0; | 960 var pathOffset = 0; |
926 var index; | 961 var index; |
(...skipping 21 matching lines...) Expand all Loading... |
948 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 983 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
949 } | 984 } |
950 } | 985 } |
951 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 986 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
952 | 987 |
953 | 988 |
954 var h = { | 989 var h = { |
955 "content-type" : "application/json; charset=utf-8", | 990 "content-type" : "application/json; charset=utf-8", |
956 }; | 991 }; |
957 var resp = convert.JSON.encode(buildGroup()); | 992 var resp = convert.JSON.encode(buildGroup()); |
958 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 993 return new async.Future.value(stringResponse(200, h, resp)); |
959 }), true); | 994 }), true); |
960 res.insert(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner
).then(unittest.expectAsync(((api.Group response) { | 995 res.insert(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner
).then(unittest.expectAsync(((api.Group response) { |
961 checkGroup(response); | 996 checkGroup(response); |
962 }))); | 997 }))); |
963 }); | 998 }); |
964 | 999 |
965 unittest.test("method--list", () { | 1000 unittest.test("method--list", () { |
966 | 1001 |
967 var mock = new common_test.HttpServerMock(); | 1002 var mock = new HttpServerMock(); |
968 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; | 1003 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; |
969 var arg_id = "foo"; | 1004 var arg_id = "foo"; |
970 var arg_mine = true; | 1005 var arg_mine = true; |
971 var arg_onBehalfOfContentOwner = "foo"; | 1006 var arg_onBehalfOfContentOwner = "foo"; |
972 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1007 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
973 var path = (req.url).path; | 1008 var path = (req.url).path; |
974 var pathOffset = 0; | 1009 var pathOffset = 0; |
975 var index; | 1010 var index; |
976 var subPart; | 1011 var subPart; |
977 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1012 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 21 matching lines...) Expand all Loading... |
999 } | 1034 } |
1000 unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); | 1035 unittest.expect(queryMap["id"].first, unittest.equals(arg_id)); |
1001 unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); | 1036 unittest.expect(queryMap["mine"].first, unittest.equals("$arg_mine")); |
1002 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 1037 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
1003 | 1038 |
1004 | 1039 |
1005 var h = { | 1040 var h = { |
1006 "content-type" : "application/json; charset=utf-8", | 1041 "content-type" : "application/json; charset=utf-8", |
1007 }; | 1042 }; |
1008 var resp = convert.JSON.encode(buildGroupListResponse()); | 1043 var resp = convert.JSON.encode(buildGroupListResponse()); |
1009 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1044 return new async.Future.value(stringResponse(200, h, resp)); |
1010 }), true); | 1045 }), true); |
1011 res.list(id: arg_id, mine: arg_mine, onBehalfOfContentOwner: arg_onBehalfO
fContentOwner).then(unittest.expectAsync(((api.GroupListResponse response) { | 1046 res.list(id: arg_id, mine: arg_mine, onBehalfOfContentOwner: arg_onBehalfO
fContentOwner).then(unittest.expectAsync(((api.GroupListResponse response) { |
1012 checkGroupListResponse(response); | 1047 checkGroupListResponse(response); |
1013 }))); | 1048 }))); |
1014 }); | 1049 }); |
1015 | 1050 |
1016 unittest.test("method--update", () { | 1051 unittest.test("method--update", () { |
1017 | 1052 |
1018 var mock = new common_test.HttpServerMock(); | 1053 var mock = new HttpServerMock(); |
1019 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; | 1054 api.GroupsResourceApi res = new api.YoutubeAnalyticsApi(mock).groups; |
1020 var arg_request = buildGroup(); | 1055 var arg_request = buildGroup(); |
1021 var arg_onBehalfOfContentOwner = "foo"; | 1056 var arg_onBehalfOfContentOwner = "foo"; |
1022 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1057 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1023 var obj = new api.Group.fromJson(json); | 1058 var obj = new api.Group.fromJson(json); |
1024 checkGroup(obj); | 1059 checkGroup(obj); |
1025 | 1060 |
1026 var path = (req.url).path; | 1061 var path = (req.url).path; |
1027 var pathOffset = 0; | 1062 var pathOffset = 0; |
1028 var index; | 1063 var index; |
(...skipping 21 matching lines...) Expand all Loading... |
1050 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1085 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1051 } | 1086 } |
1052 } | 1087 } |
1053 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); | 1088 unittest.expect(queryMap["onBehalfOfContentOwner"].first, unittest.equal
s(arg_onBehalfOfContentOwner)); |
1054 | 1089 |
1055 | 1090 |
1056 var h = { | 1091 var h = { |
1057 "content-type" : "application/json; charset=utf-8", | 1092 "content-type" : "application/json; charset=utf-8", |
1058 }; | 1093 }; |
1059 var resp = convert.JSON.encode(buildGroup()); | 1094 var resp = convert.JSON.encode(buildGroup()); |
1060 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1095 return new async.Future.value(stringResponse(200, h, resp)); |
1061 }), true); | 1096 }), true); |
1062 res.update(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner
).then(unittest.expectAsync(((api.Group response) { | 1097 res.update(arg_request, onBehalfOfContentOwner: arg_onBehalfOfContentOwner
).then(unittest.expectAsync(((api.Group response) { |
1063 checkGroup(response); | 1098 checkGroup(response); |
1064 }))); | 1099 }))); |
1065 }); | 1100 }); |
1066 | 1101 |
1067 }); | 1102 }); |
1068 | 1103 |
1069 | 1104 |
1070 unittest.group("resource-ReportsResourceApi", () { | 1105 unittest.group("resource-ReportsResourceApi", () { |
1071 unittest.test("method--query", () { | 1106 unittest.test("method--query", () { |
1072 | 1107 |
1073 var mock = new common_test.HttpServerMock(); | 1108 var mock = new HttpServerMock(); |
1074 api.ReportsResourceApi res = new api.YoutubeAnalyticsApi(mock).reports; | 1109 api.ReportsResourceApi res = new api.YoutubeAnalyticsApi(mock).reports; |
1075 var arg_ids = "foo"; | 1110 var arg_ids = "foo"; |
1076 var arg_start_date = "foo"; | 1111 var arg_start_date = "foo"; |
1077 var arg_end_date = "foo"; | 1112 var arg_end_date = "foo"; |
1078 var arg_metrics = "foo"; | 1113 var arg_metrics = "foo"; |
| 1114 var arg_currency = "foo"; |
1079 var arg_dimensions = "foo"; | 1115 var arg_dimensions = "foo"; |
1080 var arg_filters = "foo"; | 1116 var arg_filters = "foo"; |
1081 var arg_max_results = 42; | 1117 var arg_max_results = 42; |
1082 var arg_sort = "foo"; | 1118 var arg_sort = "foo"; |
1083 var arg_start_index = 42; | 1119 var arg_start_index = 42; |
1084 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1120 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1085 var path = (req.url).path; | 1121 var path = (req.url).path; |
1086 var pathOffset = 0; | 1122 var pathOffset = 0; |
1087 var index; | 1123 var index; |
1088 var subPart; | 1124 var subPart; |
(...skipping 17 matching lines...) Expand all Loading... |
1106 if (query.length > 0) { | 1142 if (query.length > 0) { |
1107 for (var part in query.split("&")) { | 1143 for (var part in query.split("&")) { |
1108 var keyvalue = part.split("="); | 1144 var keyvalue = part.split("="); |
1109 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1145 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1110 } | 1146 } |
1111 } | 1147 } |
1112 unittest.expect(queryMap["ids"].first, unittest.equals(arg_ids)); | 1148 unittest.expect(queryMap["ids"].first, unittest.equals(arg_ids)); |
1113 unittest.expect(queryMap["start-date"].first, unittest.equals(arg_start_
date)); | 1149 unittest.expect(queryMap["start-date"].first, unittest.equals(arg_start_
date)); |
1114 unittest.expect(queryMap["end-date"].first, unittest.equals(arg_end_date
)); | 1150 unittest.expect(queryMap["end-date"].first, unittest.equals(arg_end_date
)); |
1115 unittest.expect(queryMap["metrics"].first, unittest.equals(arg_metrics))
; | 1151 unittest.expect(queryMap["metrics"].first, unittest.equals(arg_metrics))
; |
| 1152 unittest.expect(queryMap["currency"].first, unittest.equals(arg_currency
)); |
1116 unittest.expect(queryMap["dimensions"].first, unittest.equals(arg_dimens
ions)); | 1153 unittest.expect(queryMap["dimensions"].first, unittest.equals(arg_dimens
ions)); |
1117 unittest.expect(queryMap["filters"].first, unittest.equals(arg_filters))
; | 1154 unittest.expect(queryMap["filters"].first, unittest.equals(arg_filters))
; |
1118 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); | 1155 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
1119 unittest.expect(queryMap["sort"].first, unittest.equals(arg_sort)); | 1156 unittest.expect(queryMap["sort"].first, unittest.equals(arg_sort)); |
1120 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); | 1157 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
1121 | 1158 |
1122 | 1159 |
1123 var h = { | 1160 var h = { |
1124 "content-type" : "application/json; charset=utf-8", | 1161 "content-type" : "application/json; charset=utf-8", |
1125 }; | 1162 }; |
1126 var resp = convert.JSON.encode(buildResultTable()); | 1163 var resp = convert.JSON.encode(buildResultTable()); |
1127 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1164 return new async.Future.value(stringResponse(200, h, resp)); |
1128 }), true); | 1165 }), true); |
1129 res.query(arg_ids, arg_start_date, arg_end_date, arg_metrics, dimensions:
arg_dimensions, filters: arg_filters, max_results: arg_max_results, sort: arg_so
rt, start_index: arg_start_index).then(unittest.expectAsync(((api.ResultTable re
sponse) { | 1166 res.query(arg_ids, arg_start_date, arg_end_date, arg_metrics, currency: ar
g_currency, dimensions: arg_dimensions, filters: arg_filters, max_results: arg_m
ax_results, sort: arg_sort, start_index: arg_start_index).then(unittest.expectAs
ync(((api.ResultTable response) { |
1130 checkResultTable(response); | 1167 checkResultTable(response); |
1131 }))); | 1168 }))); |
1132 }); | 1169 }); |
1133 | 1170 |
1134 }); | 1171 }); |
1135 | 1172 |
1136 | 1173 |
1137 } | 1174 } |
1138 | 1175 |
OLD | NEW |