OLD | NEW |
1 library googleapis.doubleclickbidmanager.v1.test; | 1 library googleapis.doubleclickbidmanager.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | |
5 import "dart:async" as async; | 4 import "dart:async" as async; |
6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
7 | 6 |
8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | |
10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
11 | 9 |
12 import 'package:googleapis/doubleclickbidmanager/v1.dart' as api; | 10 import 'package:googleapis/doubleclickbidmanager/v1.dart' as api; |
13 | 11 |
14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 13 core.Function _callback; |
16 core.bool _expectJson; | 14 core.bool _expectJson; |
17 | 15 |
18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 17 _callback = callback; |
20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
21 } | 19 } |
22 | 20 |
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
24 if (_expectJson) { | 22 if (_expectJson) { |
25 return request.finalize() | 23 return request |
| 24 .finalize() |
26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
27 .join('') | 26 .join('') |
28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
30 return _callback(request, null); | 29 return _callback(request, null); |
31 } else { | 30 } else { |
32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
33 } | 32 } |
34 }); | 33 }); |
35 } else { | 34 } else { |
36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
37 if (stream == null) { | 36 if (stream == null) { |
38 return _callback(request, []); | 37 return _callback(request, []); |
39 } else { | 38 } else { |
40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 40 return _callback(request, data); |
42 }); | 41 }); |
43 } | 42 } |
44 } | 43 } |
45 } | 44 } |
46 } | 45 } |
47 | 46 |
48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 51 } |
53 | 52 |
54 buildUnnamed1261() { | 53 buildUnnamed1257() { |
55 var o = new core.List<core.String>(); | 54 var o = new core.List<core.String>(); |
56 o.add("foo"); | 55 o.add("foo"); |
57 o.add("foo"); | 56 o.add("foo"); |
58 return o; | 57 return o; |
59 } | 58 } |
60 | 59 |
61 checkUnnamed1261(core.List<core.String> o) { | 60 checkUnnamed1257(core.List<core.String> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 61 unittest.expect(o, unittest.hasLength(2)); |
63 unittest.expect(o[0], unittest.equals('foo')); | 62 unittest.expect(o[0], unittest.equals('foo')); |
64 unittest.expect(o[1], unittest.equals('foo')); | 63 unittest.expect(o[1], unittest.equals('foo')); |
65 } | 64 } |
66 | 65 |
67 core.int buildCounterDownloadLineItemsRequest = 0; | 66 core.int buildCounterDownloadLineItemsRequest = 0; |
68 buildDownloadLineItemsRequest() { | 67 buildDownloadLineItemsRequest() { |
69 var o = new api.DownloadLineItemsRequest(); | 68 var o = new api.DownloadLineItemsRequest(); |
70 buildCounterDownloadLineItemsRequest++; | 69 buildCounterDownloadLineItemsRequest++; |
71 if (buildCounterDownloadLineItemsRequest < 3) { | 70 if (buildCounterDownloadLineItemsRequest < 3) { |
72 o.fileSpec = "foo"; | 71 o.fileSpec = "foo"; |
73 o.filterIds = buildUnnamed1261(); | 72 o.filterIds = buildUnnamed1257(); |
74 o.filterType = "foo"; | 73 o.filterType = "foo"; |
75 o.format = "foo"; | 74 o.format = "foo"; |
76 } | 75 } |
77 buildCounterDownloadLineItemsRequest--; | 76 buildCounterDownloadLineItemsRequest--; |
78 return o; | 77 return o; |
79 } | 78 } |
80 | 79 |
81 checkDownloadLineItemsRequest(api.DownloadLineItemsRequest o) { | 80 checkDownloadLineItemsRequest(api.DownloadLineItemsRequest o) { |
82 buildCounterDownloadLineItemsRequest++; | 81 buildCounterDownloadLineItemsRequest++; |
83 if (buildCounterDownloadLineItemsRequest < 3) { | 82 if (buildCounterDownloadLineItemsRequest < 3) { |
84 unittest.expect(o.fileSpec, unittest.equals('foo')); | 83 unittest.expect(o.fileSpec, unittest.equals('foo')); |
85 checkUnnamed1261(o.filterIds); | 84 checkUnnamed1257(o.filterIds); |
86 unittest.expect(o.filterType, unittest.equals('foo')); | 85 unittest.expect(o.filterType, unittest.equals('foo')); |
87 unittest.expect(o.format, unittest.equals('foo')); | 86 unittest.expect(o.format, unittest.equals('foo')); |
88 } | 87 } |
89 buildCounterDownloadLineItemsRequest--; | 88 buildCounterDownloadLineItemsRequest--; |
90 } | 89 } |
91 | 90 |
92 core.int buildCounterDownloadLineItemsResponse = 0; | 91 core.int buildCounterDownloadLineItemsResponse = 0; |
93 buildDownloadLineItemsResponse() { | 92 buildDownloadLineItemsResponse() { |
94 var o = new api.DownloadLineItemsResponse(); | 93 var o = new api.DownloadLineItemsResponse(); |
95 buildCounterDownloadLineItemsResponse++; | 94 buildCounterDownloadLineItemsResponse++; |
96 if (buildCounterDownloadLineItemsResponse < 3) { | 95 if (buildCounterDownloadLineItemsResponse < 3) { |
97 o.lineItems = "foo"; | 96 o.lineItems = "foo"; |
98 } | 97 } |
99 buildCounterDownloadLineItemsResponse--; | 98 buildCounterDownloadLineItemsResponse--; |
100 return o; | 99 return o; |
101 } | 100 } |
102 | 101 |
103 checkDownloadLineItemsResponse(api.DownloadLineItemsResponse o) { | 102 checkDownloadLineItemsResponse(api.DownloadLineItemsResponse o) { |
104 buildCounterDownloadLineItemsResponse++; | 103 buildCounterDownloadLineItemsResponse++; |
105 if (buildCounterDownloadLineItemsResponse < 3) { | 104 if (buildCounterDownloadLineItemsResponse < 3) { |
106 unittest.expect(o.lineItems, unittest.equals('foo')); | 105 unittest.expect(o.lineItems, unittest.equals('foo')); |
107 } | 106 } |
108 buildCounterDownloadLineItemsResponse--; | 107 buildCounterDownloadLineItemsResponse--; |
109 } | 108 } |
110 | 109 |
111 buildUnnamed1262() { | 110 buildUnnamed1258() { |
112 var o = new core.List<core.String>(); | 111 var o = new core.List<core.String>(); |
113 o.add("foo"); | 112 o.add("foo"); |
114 o.add("foo"); | 113 o.add("foo"); |
115 return o; | 114 return o; |
116 } | 115 } |
117 | 116 |
118 checkUnnamed1262(core.List<core.String> o) { | 117 checkUnnamed1258(core.List<core.String> o) { |
119 unittest.expect(o, unittest.hasLength(2)); | 118 unittest.expect(o, unittest.hasLength(2)); |
120 unittest.expect(o[0], unittest.equals('foo')); | 119 unittest.expect(o[0], unittest.equals('foo')); |
121 unittest.expect(o[1], unittest.equals('foo')); | 120 unittest.expect(o[1], unittest.equals('foo')); |
122 } | 121 } |
123 | 122 |
124 buildUnnamed1263() { | 123 buildUnnamed1259() { |
125 var o = new core.List<core.String>(); | 124 var o = new core.List<core.String>(); |
126 o.add("foo"); | 125 o.add("foo"); |
127 o.add("foo"); | 126 o.add("foo"); |
128 return o; | 127 return o; |
129 } | 128 } |
130 | 129 |
131 checkUnnamed1263(core.List<core.String> o) { | 130 checkUnnamed1259(core.List<core.String> o) { |
132 unittest.expect(o, unittest.hasLength(2)); | 131 unittest.expect(o, unittest.hasLength(2)); |
133 unittest.expect(o[0], unittest.equals('foo')); | 132 unittest.expect(o[0], unittest.equals('foo')); |
134 unittest.expect(o[1], unittest.equals('foo')); | 133 unittest.expect(o[1], unittest.equals('foo')); |
135 } | 134 } |
136 | 135 |
137 core.int buildCounterDownloadRequest = 0; | 136 core.int buildCounterDownloadRequest = 0; |
138 buildDownloadRequest() { | 137 buildDownloadRequest() { |
139 var o = new api.DownloadRequest(); | 138 var o = new api.DownloadRequest(); |
140 buildCounterDownloadRequest++; | 139 buildCounterDownloadRequest++; |
141 if (buildCounterDownloadRequest < 3) { | 140 if (buildCounterDownloadRequest < 3) { |
142 o.fileTypes = buildUnnamed1262(); | 141 o.fileTypes = buildUnnamed1258(); |
143 o.filterIds = buildUnnamed1263(); | 142 o.filterIds = buildUnnamed1259(); |
144 o.filterType = "foo"; | 143 o.filterType = "foo"; |
145 o.version = "foo"; | 144 o.version = "foo"; |
146 } | 145 } |
147 buildCounterDownloadRequest--; | 146 buildCounterDownloadRequest--; |
148 return o; | 147 return o; |
149 } | 148 } |
150 | 149 |
151 checkDownloadRequest(api.DownloadRequest o) { | 150 checkDownloadRequest(api.DownloadRequest o) { |
152 buildCounterDownloadRequest++; | 151 buildCounterDownloadRequest++; |
153 if (buildCounterDownloadRequest < 3) { | 152 if (buildCounterDownloadRequest < 3) { |
154 checkUnnamed1262(o.fileTypes); | 153 checkUnnamed1258(o.fileTypes); |
155 checkUnnamed1263(o.filterIds); | 154 checkUnnamed1259(o.filterIds); |
156 unittest.expect(o.filterType, unittest.equals('foo')); | 155 unittest.expect(o.filterType, unittest.equals('foo')); |
157 unittest.expect(o.version, unittest.equals('foo')); | 156 unittest.expect(o.version, unittest.equals('foo')); |
158 } | 157 } |
159 buildCounterDownloadRequest--; | 158 buildCounterDownloadRequest--; |
160 } | 159 } |
161 | 160 |
162 core.int buildCounterDownloadResponse = 0; | 161 core.int buildCounterDownloadResponse = 0; |
163 buildDownloadResponse() { | 162 buildDownloadResponse() { |
164 var o = new api.DownloadResponse(); | 163 var o = new api.DownloadResponse(); |
165 buildCounterDownloadResponse++; | 164 buildCounterDownloadResponse++; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 197 |
199 checkFilterPair(api.FilterPair o) { | 198 checkFilterPair(api.FilterPair o) { |
200 buildCounterFilterPair++; | 199 buildCounterFilterPair++; |
201 if (buildCounterFilterPair < 3) { | 200 if (buildCounterFilterPair < 3) { |
202 unittest.expect(o.type, unittest.equals('foo')); | 201 unittest.expect(o.type, unittest.equals('foo')); |
203 unittest.expect(o.value, unittest.equals('foo')); | 202 unittest.expect(o.value, unittest.equals('foo')); |
204 } | 203 } |
205 buildCounterFilterPair--; | 204 buildCounterFilterPair--; |
206 } | 205 } |
207 | 206 |
208 buildUnnamed1264() { | 207 buildUnnamed1260() { |
209 var o = new core.List<api.Query>(); | 208 var o = new core.List<api.Query>(); |
210 o.add(buildQuery()); | 209 o.add(buildQuery()); |
211 o.add(buildQuery()); | 210 o.add(buildQuery()); |
212 return o; | 211 return o; |
213 } | 212 } |
214 | 213 |
215 checkUnnamed1264(core.List<api.Query> o) { | 214 checkUnnamed1260(core.List<api.Query> o) { |
216 unittest.expect(o, unittest.hasLength(2)); | 215 unittest.expect(o, unittest.hasLength(2)); |
217 checkQuery(o[0]); | 216 checkQuery(o[0]); |
218 checkQuery(o[1]); | 217 checkQuery(o[1]); |
219 } | 218 } |
220 | 219 |
221 core.int buildCounterListQueriesResponse = 0; | 220 core.int buildCounterListQueriesResponse = 0; |
222 buildListQueriesResponse() { | 221 buildListQueriesResponse() { |
223 var o = new api.ListQueriesResponse(); | 222 var o = new api.ListQueriesResponse(); |
224 buildCounterListQueriesResponse++; | 223 buildCounterListQueriesResponse++; |
225 if (buildCounterListQueriesResponse < 3) { | 224 if (buildCounterListQueriesResponse < 3) { |
226 o.kind = "foo"; | 225 o.kind = "foo"; |
227 o.queries = buildUnnamed1264(); | 226 o.queries = buildUnnamed1260(); |
228 } | 227 } |
229 buildCounterListQueriesResponse--; | 228 buildCounterListQueriesResponse--; |
230 return o; | 229 return o; |
231 } | 230 } |
232 | 231 |
233 checkListQueriesResponse(api.ListQueriesResponse o) { | 232 checkListQueriesResponse(api.ListQueriesResponse o) { |
234 buildCounterListQueriesResponse++; | 233 buildCounterListQueriesResponse++; |
235 if (buildCounterListQueriesResponse < 3) { | 234 if (buildCounterListQueriesResponse < 3) { |
236 unittest.expect(o.kind, unittest.equals('foo')); | 235 unittest.expect(o.kind, unittest.equals('foo')); |
237 checkUnnamed1264(o.queries); | 236 checkUnnamed1260(o.queries); |
238 } | 237 } |
239 buildCounterListQueriesResponse--; | 238 buildCounterListQueriesResponse--; |
240 } | 239 } |
241 | 240 |
242 buildUnnamed1265() { | 241 buildUnnamed1261() { |
243 var o = new core.List<api.Report>(); | 242 var o = new core.List<api.Report>(); |
244 o.add(buildReport()); | 243 o.add(buildReport()); |
245 o.add(buildReport()); | 244 o.add(buildReport()); |
246 return o; | 245 return o; |
247 } | 246 } |
248 | 247 |
249 checkUnnamed1265(core.List<api.Report> o) { | 248 checkUnnamed1261(core.List<api.Report> o) { |
250 unittest.expect(o, unittest.hasLength(2)); | 249 unittest.expect(o, unittest.hasLength(2)); |
251 checkReport(o[0]); | 250 checkReport(o[0]); |
252 checkReport(o[1]); | 251 checkReport(o[1]); |
253 } | 252 } |
254 | 253 |
255 core.int buildCounterListReportsResponse = 0; | 254 core.int buildCounterListReportsResponse = 0; |
256 buildListReportsResponse() { | 255 buildListReportsResponse() { |
257 var o = new api.ListReportsResponse(); | 256 var o = new api.ListReportsResponse(); |
258 buildCounterListReportsResponse++; | 257 buildCounterListReportsResponse++; |
259 if (buildCounterListReportsResponse < 3) { | 258 if (buildCounterListReportsResponse < 3) { |
260 o.kind = "foo"; | 259 o.kind = "foo"; |
261 o.reports = buildUnnamed1265(); | 260 o.reports = buildUnnamed1261(); |
262 } | 261 } |
263 buildCounterListReportsResponse--; | 262 buildCounterListReportsResponse--; |
264 return o; | 263 return o; |
265 } | 264 } |
266 | 265 |
267 checkListReportsResponse(api.ListReportsResponse o) { | 266 checkListReportsResponse(api.ListReportsResponse o) { |
268 buildCounterListReportsResponse++; | 267 buildCounterListReportsResponse++; |
269 if (buildCounterListReportsResponse < 3) { | 268 if (buildCounterListReportsResponse < 3) { |
270 unittest.expect(o.kind, unittest.equals('foo')); | 269 unittest.expect(o.kind, unittest.equals('foo')); |
271 checkUnnamed1265(o.reports); | 270 checkUnnamed1261(o.reports); |
272 } | 271 } |
273 buildCounterListReportsResponse--; | 272 buildCounterListReportsResponse--; |
274 } | 273 } |
275 | 274 |
276 buildUnnamed1266() { | 275 buildUnnamed1262() { |
277 var o = new core.List<api.FilterPair>(); | 276 var o = new core.List<api.FilterPair>(); |
278 o.add(buildFilterPair()); | 277 o.add(buildFilterPair()); |
279 o.add(buildFilterPair()); | 278 o.add(buildFilterPair()); |
280 return o; | 279 return o; |
281 } | 280 } |
282 | 281 |
283 checkUnnamed1266(core.List<api.FilterPair> o) { | 282 checkUnnamed1262(core.List<api.FilterPair> o) { |
284 unittest.expect(o, unittest.hasLength(2)); | 283 unittest.expect(o, unittest.hasLength(2)); |
285 checkFilterPair(o[0]); | 284 checkFilterPair(o[0]); |
286 checkFilterPair(o[1]); | 285 checkFilterPair(o[1]); |
287 } | 286 } |
288 | 287 |
289 buildUnnamed1267() { | 288 buildUnnamed1263() { |
290 var o = new core.List<core.String>(); | 289 var o = new core.List<core.String>(); |
291 o.add("foo"); | 290 o.add("foo"); |
292 o.add("foo"); | 291 o.add("foo"); |
293 return o; | 292 return o; |
294 } | 293 } |
295 | 294 |
296 checkUnnamed1267(core.List<core.String> o) { | 295 checkUnnamed1263(core.List<core.String> o) { |
297 unittest.expect(o, unittest.hasLength(2)); | 296 unittest.expect(o, unittest.hasLength(2)); |
298 unittest.expect(o[0], unittest.equals('foo')); | 297 unittest.expect(o[0], unittest.equals('foo')); |
299 unittest.expect(o[1], unittest.equals('foo')); | 298 unittest.expect(o[1], unittest.equals('foo')); |
300 } | 299 } |
301 | 300 |
302 buildUnnamed1268() { | 301 buildUnnamed1264() { |
303 var o = new core.List<core.String>(); | 302 var o = new core.List<core.String>(); |
304 o.add("foo"); | 303 o.add("foo"); |
305 o.add("foo"); | 304 o.add("foo"); |
306 return o; | 305 return o; |
307 } | 306 } |
308 | 307 |
309 checkUnnamed1268(core.List<core.String> o) { | 308 checkUnnamed1264(core.List<core.String> o) { |
310 unittest.expect(o, unittest.hasLength(2)); | 309 unittest.expect(o, unittest.hasLength(2)); |
311 unittest.expect(o[0], unittest.equals('foo')); | 310 unittest.expect(o[0], unittest.equals('foo')); |
312 unittest.expect(o[1], unittest.equals('foo')); | 311 unittest.expect(o[1], unittest.equals('foo')); |
313 } | 312 } |
314 | 313 |
315 core.int buildCounterParameters = 0; | 314 core.int buildCounterParameters = 0; |
316 buildParameters() { | 315 buildParameters() { |
317 var o = new api.Parameters(); | 316 var o = new api.Parameters(); |
318 buildCounterParameters++; | 317 buildCounterParameters++; |
319 if (buildCounterParameters < 3) { | 318 if (buildCounterParameters < 3) { |
320 o.filters = buildUnnamed1266(); | 319 o.filters = buildUnnamed1262(); |
321 o.groupBys = buildUnnamed1267(); | 320 o.groupBys = buildUnnamed1263(); |
322 o.includeInviteData = true; | 321 o.includeInviteData = true; |
323 o.metrics = buildUnnamed1268(); | 322 o.metrics = buildUnnamed1264(); |
324 o.type = "foo"; | 323 o.type = "foo"; |
325 } | 324 } |
326 buildCounterParameters--; | 325 buildCounterParameters--; |
327 return o; | 326 return o; |
328 } | 327 } |
329 | 328 |
330 checkParameters(api.Parameters o) { | 329 checkParameters(api.Parameters o) { |
331 buildCounterParameters++; | 330 buildCounterParameters++; |
332 if (buildCounterParameters < 3) { | 331 if (buildCounterParameters < 3) { |
333 checkUnnamed1266(o.filters); | 332 checkUnnamed1262(o.filters); |
334 checkUnnamed1267(o.groupBys); | 333 checkUnnamed1263(o.groupBys); |
335 unittest.expect(o.includeInviteData, unittest.isTrue); | 334 unittest.expect(o.includeInviteData, unittest.isTrue); |
336 checkUnnamed1268(o.metrics); | 335 checkUnnamed1264(o.metrics); |
337 unittest.expect(o.type, unittest.equals('foo')); | 336 unittest.expect(o.type, unittest.equals('foo')); |
338 } | 337 } |
339 buildCounterParameters--; | 338 buildCounterParameters--; |
340 } | 339 } |
341 | 340 |
342 core.int buildCounterQuery = 0; | 341 core.int buildCounterQuery = 0; |
343 buildQuery() { | 342 buildQuery() { |
344 var o = new api.Query(); | 343 var o = new api.Query(); |
345 buildCounterQuery++; | 344 buildCounterQuery++; |
346 if (buildCounterQuery < 3) { | 345 if (buildCounterQuery < 3) { |
(...skipping 18 matching lines...) Expand all Loading... |
365 checkParameters(o.params); | 364 checkParameters(o.params); |
366 unittest.expect(o.queryId, unittest.equals('foo')); | 365 unittest.expect(o.queryId, unittest.equals('foo')); |
367 unittest.expect(o.reportDataEndTimeMs, unittest.equals('foo')); | 366 unittest.expect(o.reportDataEndTimeMs, unittest.equals('foo')); |
368 unittest.expect(o.reportDataStartTimeMs, unittest.equals('foo')); | 367 unittest.expect(o.reportDataStartTimeMs, unittest.equals('foo')); |
369 checkQuerySchedule(o.schedule); | 368 checkQuerySchedule(o.schedule); |
370 unittest.expect(o.timezoneCode, unittest.equals('foo')); | 369 unittest.expect(o.timezoneCode, unittest.equals('foo')); |
371 } | 370 } |
372 buildCounterQuery--; | 371 buildCounterQuery--; |
373 } | 372 } |
374 | 373 |
375 buildUnnamed1269() { | 374 buildUnnamed1265() { |
376 var o = new core.List<core.String>(); | 375 var o = new core.List<core.String>(); |
377 o.add("foo"); | 376 o.add("foo"); |
378 o.add("foo"); | 377 o.add("foo"); |
379 return o; | 378 return o; |
380 } | 379 } |
381 | 380 |
382 checkUnnamed1269(core.List<core.String> o) { | 381 checkUnnamed1265(core.List<core.String> o) { |
383 unittest.expect(o, unittest.hasLength(2)); | 382 unittest.expect(o, unittest.hasLength(2)); |
384 unittest.expect(o[0], unittest.equals('foo')); | 383 unittest.expect(o[0], unittest.equals('foo')); |
385 unittest.expect(o[1], unittest.equals('foo')); | 384 unittest.expect(o[1], unittest.equals('foo')); |
386 } | 385 } |
387 | 386 |
388 core.int buildCounterQueryMetadata = 0; | 387 core.int buildCounterQueryMetadata = 0; |
389 buildQueryMetadata() { | 388 buildQueryMetadata() { |
390 var o = new api.QueryMetadata(); | 389 var o = new api.QueryMetadata(); |
391 buildCounterQueryMetadata++; | 390 buildCounterQueryMetadata++; |
392 if (buildCounterQueryMetadata < 3) { | 391 if (buildCounterQueryMetadata < 3) { |
393 o.dataRange = "foo"; | 392 o.dataRange = "foo"; |
394 o.format = "foo"; | 393 o.format = "foo"; |
395 o.googleCloudStoragePathForLatestReport = "foo"; | 394 o.googleCloudStoragePathForLatestReport = "foo"; |
396 o.googleDrivePathForLatestReport = "foo"; | 395 o.googleDrivePathForLatestReport = "foo"; |
397 o.latestReportRunTimeMs = "foo"; | 396 o.latestReportRunTimeMs = "foo"; |
398 o.locale = "foo"; | 397 o.locale = "foo"; |
399 o.reportCount = 42; | 398 o.reportCount = 42; |
400 o.running = true; | 399 o.running = true; |
401 o.sendNotification = true; | 400 o.sendNotification = true; |
402 o.shareEmailAddress = buildUnnamed1269(); | 401 o.shareEmailAddress = buildUnnamed1265(); |
403 o.title = "foo"; | 402 o.title = "foo"; |
404 } | 403 } |
405 buildCounterQueryMetadata--; | 404 buildCounterQueryMetadata--; |
406 return o; | 405 return o; |
407 } | 406 } |
408 | 407 |
409 checkQueryMetadata(api.QueryMetadata o) { | 408 checkQueryMetadata(api.QueryMetadata o) { |
410 buildCounterQueryMetadata++; | 409 buildCounterQueryMetadata++; |
411 if (buildCounterQueryMetadata < 3) { | 410 if (buildCounterQueryMetadata < 3) { |
412 unittest.expect(o.dataRange, unittest.equals('foo')); | 411 unittest.expect(o.dataRange, unittest.equals('foo')); |
413 unittest.expect(o.format, unittest.equals('foo')); | 412 unittest.expect(o.format, unittest.equals('foo')); |
414 unittest.expect(o.googleCloudStoragePathForLatestReport, unittest.equals('fo
o')); | 413 unittest.expect( |
| 414 o.googleCloudStoragePathForLatestReport, unittest.equals('foo')); |
415 unittest.expect(o.googleDrivePathForLatestReport, unittest.equals('foo')); | 415 unittest.expect(o.googleDrivePathForLatestReport, unittest.equals('foo')); |
416 unittest.expect(o.latestReportRunTimeMs, unittest.equals('foo')); | 416 unittest.expect(o.latestReportRunTimeMs, unittest.equals('foo')); |
417 unittest.expect(o.locale, unittest.equals('foo')); | 417 unittest.expect(o.locale, unittest.equals('foo')); |
418 unittest.expect(o.reportCount, unittest.equals(42)); | 418 unittest.expect(o.reportCount, unittest.equals(42)); |
419 unittest.expect(o.running, unittest.isTrue); | 419 unittest.expect(o.running, unittest.isTrue); |
420 unittest.expect(o.sendNotification, unittest.isTrue); | 420 unittest.expect(o.sendNotification, unittest.isTrue); |
421 checkUnnamed1269(o.shareEmailAddress); | 421 checkUnnamed1265(o.shareEmailAddress); |
422 unittest.expect(o.title, unittest.equals('foo')); | 422 unittest.expect(o.title, unittest.equals('foo')); |
423 } | 423 } |
424 buildCounterQueryMetadata--; | 424 buildCounterQueryMetadata--; |
425 } | 425 } |
426 | 426 |
427 core.int buildCounterQuerySchedule = 0; | 427 core.int buildCounterQuerySchedule = 0; |
428 buildQuerySchedule() { | 428 buildQuerySchedule() { |
429 var o = new api.QuerySchedule(); | 429 var o = new api.QuerySchedule(); |
430 buildCounterQuerySchedule++; | 430 buildCounterQuerySchedule++; |
431 if (buildCounterQuerySchedule < 3) { | 431 if (buildCounterQuerySchedule < 3) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 buildCounterReportStatus++; | 555 buildCounterReportStatus++; |
556 if (buildCounterReportStatus < 3) { | 556 if (buildCounterReportStatus < 3) { |
557 checkReportFailure(o.failure); | 557 checkReportFailure(o.failure); |
558 unittest.expect(o.finishTimeMs, unittest.equals('foo')); | 558 unittest.expect(o.finishTimeMs, unittest.equals('foo')); |
559 unittest.expect(o.format, unittest.equals('foo')); | 559 unittest.expect(o.format, unittest.equals('foo')); |
560 unittest.expect(o.state, unittest.equals('foo')); | 560 unittest.expect(o.state, unittest.equals('foo')); |
561 } | 561 } |
562 buildCounterReportStatus--; | 562 buildCounterReportStatus--; |
563 } | 563 } |
564 | 564 |
565 buildUnnamed1270() { | 565 buildUnnamed1266() { |
566 var o = new core.List<core.String>(); | 566 var o = new core.List<core.String>(); |
567 o.add("foo"); | 567 o.add("foo"); |
568 o.add("foo"); | 568 o.add("foo"); |
569 return o; | 569 return o; |
570 } | 570 } |
571 | 571 |
572 checkUnnamed1270(core.List<core.String> o) { | 572 checkUnnamed1266(core.List<core.String> o) { |
573 unittest.expect(o, unittest.hasLength(2)); | 573 unittest.expect(o, unittest.hasLength(2)); |
574 unittest.expect(o[0], unittest.equals('foo')); | 574 unittest.expect(o[0], unittest.equals('foo')); |
575 unittest.expect(o[1], unittest.equals('foo')); | 575 unittest.expect(o[1], unittest.equals('foo')); |
576 } | 576 } |
577 | 577 |
578 core.int buildCounterRowStatus = 0; | 578 core.int buildCounterRowStatus = 0; |
579 buildRowStatus() { | 579 buildRowStatus() { |
580 var o = new api.RowStatus(); | 580 var o = new api.RowStatus(); |
581 buildCounterRowStatus++; | 581 buildCounterRowStatus++; |
582 if (buildCounterRowStatus < 3) { | 582 if (buildCounterRowStatus < 3) { |
583 o.changed = true; | 583 o.changed = true; |
584 o.entityId = "foo"; | 584 o.entityId = "foo"; |
585 o.entityName = "foo"; | 585 o.entityName = "foo"; |
586 o.errors = buildUnnamed1270(); | 586 o.errors = buildUnnamed1266(); |
587 o.persisted = true; | 587 o.persisted = true; |
588 o.rowNumber = 42; | 588 o.rowNumber = 42; |
589 } | 589 } |
590 buildCounterRowStatus--; | 590 buildCounterRowStatus--; |
591 return o; | 591 return o; |
592 } | 592 } |
593 | 593 |
594 checkRowStatus(api.RowStatus o) { | 594 checkRowStatus(api.RowStatus o) { |
595 buildCounterRowStatus++; | 595 buildCounterRowStatus++; |
596 if (buildCounterRowStatus < 3) { | 596 if (buildCounterRowStatus < 3) { |
597 unittest.expect(o.changed, unittest.isTrue); | 597 unittest.expect(o.changed, unittest.isTrue); |
598 unittest.expect(o.entityId, unittest.equals('foo')); | 598 unittest.expect(o.entityId, unittest.equals('foo')); |
599 unittest.expect(o.entityName, unittest.equals('foo')); | 599 unittest.expect(o.entityName, unittest.equals('foo')); |
600 checkUnnamed1270(o.errors); | 600 checkUnnamed1266(o.errors); |
601 unittest.expect(o.persisted, unittest.isTrue); | 601 unittest.expect(o.persisted, unittest.isTrue); |
602 unittest.expect(o.rowNumber, unittest.equals(42)); | 602 unittest.expect(o.rowNumber, unittest.equals(42)); |
603 } | 603 } |
604 buildCounterRowStatus--; | 604 buildCounterRowStatus--; |
605 } | 605 } |
606 | 606 |
607 core.int buildCounterRunQueryRequest = 0; | 607 core.int buildCounterRunQueryRequest = 0; |
608 buildRunQueryRequest() { | 608 buildRunQueryRequest() { |
609 var o = new api.RunQueryRequest(); | 609 var o = new api.RunQueryRequest(); |
610 buildCounterRunQueryRequest++; | 610 buildCounterRunQueryRequest++; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 } | 664 } |
665 | 665 |
666 checkUploadLineItemsResponse(api.UploadLineItemsResponse o) { | 666 checkUploadLineItemsResponse(api.UploadLineItemsResponse o) { |
667 buildCounterUploadLineItemsResponse++; | 667 buildCounterUploadLineItemsResponse++; |
668 if (buildCounterUploadLineItemsResponse < 3) { | 668 if (buildCounterUploadLineItemsResponse < 3) { |
669 checkUploadStatus(o.uploadStatus); | 669 checkUploadStatus(o.uploadStatus); |
670 } | 670 } |
671 buildCounterUploadLineItemsResponse--; | 671 buildCounterUploadLineItemsResponse--; |
672 } | 672 } |
673 | 673 |
674 buildUnnamed1271() { | 674 buildUnnamed1267() { |
675 var o = new core.List<core.String>(); | 675 var o = new core.List<core.String>(); |
676 o.add("foo"); | 676 o.add("foo"); |
677 o.add("foo"); | 677 o.add("foo"); |
678 return o; | 678 return o; |
679 } | 679 } |
680 | 680 |
681 checkUnnamed1271(core.List<core.String> o) { | 681 checkUnnamed1267(core.List<core.String> o) { |
682 unittest.expect(o, unittest.hasLength(2)); | 682 unittest.expect(o, unittest.hasLength(2)); |
683 unittest.expect(o[0], unittest.equals('foo')); | 683 unittest.expect(o[0], unittest.equals('foo')); |
684 unittest.expect(o[1], unittest.equals('foo')); | 684 unittest.expect(o[1], unittest.equals('foo')); |
685 } | 685 } |
686 | 686 |
687 buildUnnamed1272() { | 687 buildUnnamed1268() { |
688 var o = new core.List<api.RowStatus>(); | 688 var o = new core.List<api.RowStatus>(); |
689 o.add(buildRowStatus()); | 689 o.add(buildRowStatus()); |
690 o.add(buildRowStatus()); | 690 o.add(buildRowStatus()); |
691 return o; | 691 return o; |
692 } | 692 } |
693 | 693 |
694 checkUnnamed1272(core.List<api.RowStatus> o) { | 694 checkUnnamed1268(core.List<api.RowStatus> o) { |
695 unittest.expect(o, unittest.hasLength(2)); | 695 unittest.expect(o, unittest.hasLength(2)); |
696 checkRowStatus(o[0]); | 696 checkRowStatus(o[0]); |
697 checkRowStatus(o[1]); | 697 checkRowStatus(o[1]); |
698 } | 698 } |
699 | 699 |
700 core.int buildCounterUploadStatus = 0; | 700 core.int buildCounterUploadStatus = 0; |
701 buildUploadStatus() { | 701 buildUploadStatus() { |
702 var o = new api.UploadStatus(); | 702 var o = new api.UploadStatus(); |
703 buildCounterUploadStatus++; | 703 buildCounterUploadStatus++; |
704 if (buildCounterUploadStatus < 3) { | 704 if (buildCounterUploadStatus < 3) { |
705 o.errors = buildUnnamed1271(); | 705 o.errors = buildUnnamed1267(); |
706 o.rowStatus = buildUnnamed1272(); | 706 o.rowStatus = buildUnnamed1268(); |
707 } | 707 } |
708 buildCounterUploadStatus--; | 708 buildCounterUploadStatus--; |
709 return o; | 709 return o; |
710 } | 710 } |
711 | 711 |
712 checkUploadStatus(api.UploadStatus o) { | 712 checkUploadStatus(api.UploadStatus o) { |
713 buildCounterUploadStatus++; | 713 buildCounterUploadStatus++; |
714 if (buildCounterUploadStatus < 3) { | 714 if (buildCounterUploadStatus < 3) { |
715 checkUnnamed1271(o.errors); | 715 checkUnnamed1267(o.errors); |
716 checkUnnamed1272(o.rowStatus); | 716 checkUnnamed1268(o.rowStatus); |
717 } | 717 } |
718 buildCounterUploadStatus--; | 718 buildCounterUploadStatus--; |
719 } | 719 } |
720 | 720 |
721 | |
722 main() { | 721 main() { |
723 unittest.group("obj-schema-DownloadLineItemsRequest", () { | 722 unittest.group("obj-schema-DownloadLineItemsRequest", () { |
724 unittest.test("to-json--from-json", () { | 723 unittest.test("to-json--from-json", () { |
725 var o = buildDownloadLineItemsRequest(); | 724 var o = buildDownloadLineItemsRequest(); |
726 var od = new api.DownloadLineItemsRequest.fromJson(o.toJson()); | 725 var od = new api.DownloadLineItemsRequest.fromJson(o.toJson()); |
727 checkDownloadLineItemsRequest(od); | 726 checkDownloadLineItemsRequest(od); |
728 }); | 727 }); |
729 }); | 728 }); |
730 | 729 |
731 | |
732 unittest.group("obj-schema-DownloadLineItemsResponse", () { | 730 unittest.group("obj-schema-DownloadLineItemsResponse", () { |
733 unittest.test("to-json--from-json", () { | 731 unittest.test("to-json--from-json", () { |
734 var o = buildDownloadLineItemsResponse(); | 732 var o = buildDownloadLineItemsResponse(); |
735 var od = new api.DownloadLineItemsResponse.fromJson(o.toJson()); | 733 var od = new api.DownloadLineItemsResponse.fromJson(o.toJson()); |
736 checkDownloadLineItemsResponse(od); | 734 checkDownloadLineItemsResponse(od); |
737 }); | 735 }); |
738 }); | 736 }); |
739 | 737 |
740 | |
741 unittest.group("obj-schema-DownloadRequest", () { | 738 unittest.group("obj-schema-DownloadRequest", () { |
742 unittest.test("to-json--from-json", () { | 739 unittest.test("to-json--from-json", () { |
743 var o = buildDownloadRequest(); | 740 var o = buildDownloadRequest(); |
744 var od = new api.DownloadRequest.fromJson(o.toJson()); | 741 var od = new api.DownloadRequest.fromJson(o.toJson()); |
745 checkDownloadRequest(od); | 742 checkDownloadRequest(od); |
746 }); | 743 }); |
747 }); | 744 }); |
748 | 745 |
749 | |
750 unittest.group("obj-schema-DownloadResponse", () { | 746 unittest.group("obj-schema-DownloadResponse", () { |
751 unittest.test("to-json--from-json", () { | 747 unittest.test("to-json--from-json", () { |
752 var o = buildDownloadResponse(); | 748 var o = buildDownloadResponse(); |
753 var od = new api.DownloadResponse.fromJson(o.toJson()); | 749 var od = new api.DownloadResponse.fromJson(o.toJson()); |
754 checkDownloadResponse(od); | 750 checkDownloadResponse(od); |
755 }); | 751 }); |
756 }); | 752 }); |
757 | 753 |
758 | |
759 unittest.group("obj-schema-FilterPair", () { | 754 unittest.group("obj-schema-FilterPair", () { |
760 unittest.test("to-json--from-json", () { | 755 unittest.test("to-json--from-json", () { |
761 var o = buildFilterPair(); | 756 var o = buildFilterPair(); |
762 var od = new api.FilterPair.fromJson(o.toJson()); | 757 var od = new api.FilterPair.fromJson(o.toJson()); |
763 checkFilterPair(od); | 758 checkFilterPair(od); |
764 }); | 759 }); |
765 }); | 760 }); |
766 | 761 |
767 | |
768 unittest.group("obj-schema-ListQueriesResponse", () { | 762 unittest.group("obj-schema-ListQueriesResponse", () { |
769 unittest.test("to-json--from-json", () { | 763 unittest.test("to-json--from-json", () { |
770 var o = buildListQueriesResponse(); | 764 var o = buildListQueriesResponse(); |
771 var od = new api.ListQueriesResponse.fromJson(o.toJson()); | 765 var od = new api.ListQueriesResponse.fromJson(o.toJson()); |
772 checkListQueriesResponse(od); | 766 checkListQueriesResponse(od); |
773 }); | 767 }); |
774 }); | 768 }); |
775 | 769 |
776 | |
777 unittest.group("obj-schema-ListReportsResponse", () { | 770 unittest.group("obj-schema-ListReportsResponse", () { |
778 unittest.test("to-json--from-json", () { | 771 unittest.test("to-json--from-json", () { |
779 var o = buildListReportsResponse(); | 772 var o = buildListReportsResponse(); |
780 var od = new api.ListReportsResponse.fromJson(o.toJson()); | 773 var od = new api.ListReportsResponse.fromJson(o.toJson()); |
781 checkListReportsResponse(od); | 774 checkListReportsResponse(od); |
782 }); | 775 }); |
783 }); | 776 }); |
784 | 777 |
785 | |
786 unittest.group("obj-schema-Parameters", () { | 778 unittest.group("obj-schema-Parameters", () { |
787 unittest.test("to-json--from-json", () { | 779 unittest.test("to-json--from-json", () { |
788 var o = buildParameters(); | 780 var o = buildParameters(); |
789 var od = new api.Parameters.fromJson(o.toJson()); | 781 var od = new api.Parameters.fromJson(o.toJson()); |
790 checkParameters(od); | 782 checkParameters(od); |
791 }); | 783 }); |
792 }); | 784 }); |
793 | 785 |
794 | |
795 unittest.group("obj-schema-Query", () { | 786 unittest.group("obj-schema-Query", () { |
796 unittest.test("to-json--from-json", () { | 787 unittest.test("to-json--from-json", () { |
797 var o = buildQuery(); | 788 var o = buildQuery(); |
798 var od = new api.Query.fromJson(o.toJson()); | 789 var od = new api.Query.fromJson(o.toJson()); |
799 checkQuery(od); | 790 checkQuery(od); |
800 }); | 791 }); |
801 }); | 792 }); |
802 | 793 |
803 | |
804 unittest.group("obj-schema-QueryMetadata", () { | 794 unittest.group("obj-schema-QueryMetadata", () { |
805 unittest.test("to-json--from-json", () { | 795 unittest.test("to-json--from-json", () { |
806 var o = buildQueryMetadata(); | 796 var o = buildQueryMetadata(); |
807 var od = new api.QueryMetadata.fromJson(o.toJson()); | 797 var od = new api.QueryMetadata.fromJson(o.toJson()); |
808 checkQueryMetadata(od); | 798 checkQueryMetadata(od); |
809 }); | 799 }); |
810 }); | 800 }); |
811 | 801 |
812 | |
813 unittest.group("obj-schema-QuerySchedule", () { | 802 unittest.group("obj-schema-QuerySchedule", () { |
814 unittest.test("to-json--from-json", () { | 803 unittest.test("to-json--from-json", () { |
815 var o = buildQuerySchedule(); | 804 var o = buildQuerySchedule(); |
816 var od = new api.QuerySchedule.fromJson(o.toJson()); | 805 var od = new api.QuerySchedule.fromJson(o.toJson()); |
817 checkQuerySchedule(od); | 806 checkQuerySchedule(od); |
818 }); | 807 }); |
819 }); | 808 }); |
820 | 809 |
821 | |
822 unittest.group("obj-schema-Report", () { | 810 unittest.group("obj-schema-Report", () { |
823 unittest.test("to-json--from-json", () { | 811 unittest.test("to-json--from-json", () { |
824 var o = buildReport(); | 812 var o = buildReport(); |
825 var od = new api.Report.fromJson(o.toJson()); | 813 var od = new api.Report.fromJson(o.toJson()); |
826 checkReport(od); | 814 checkReport(od); |
827 }); | 815 }); |
828 }); | 816 }); |
829 | 817 |
830 | |
831 unittest.group("obj-schema-ReportFailure", () { | 818 unittest.group("obj-schema-ReportFailure", () { |
832 unittest.test("to-json--from-json", () { | 819 unittest.test("to-json--from-json", () { |
833 var o = buildReportFailure(); | 820 var o = buildReportFailure(); |
834 var od = new api.ReportFailure.fromJson(o.toJson()); | 821 var od = new api.ReportFailure.fromJson(o.toJson()); |
835 checkReportFailure(od); | 822 checkReportFailure(od); |
836 }); | 823 }); |
837 }); | 824 }); |
838 | 825 |
839 | |
840 unittest.group("obj-schema-ReportKey", () { | 826 unittest.group("obj-schema-ReportKey", () { |
841 unittest.test("to-json--from-json", () { | 827 unittest.test("to-json--from-json", () { |
842 var o = buildReportKey(); | 828 var o = buildReportKey(); |
843 var od = new api.ReportKey.fromJson(o.toJson()); | 829 var od = new api.ReportKey.fromJson(o.toJson()); |
844 checkReportKey(od); | 830 checkReportKey(od); |
845 }); | 831 }); |
846 }); | 832 }); |
847 | 833 |
848 | |
849 unittest.group("obj-schema-ReportMetadata", () { | 834 unittest.group("obj-schema-ReportMetadata", () { |
850 unittest.test("to-json--from-json", () { | 835 unittest.test("to-json--from-json", () { |
851 var o = buildReportMetadata(); | 836 var o = buildReportMetadata(); |
852 var od = new api.ReportMetadata.fromJson(o.toJson()); | 837 var od = new api.ReportMetadata.fromJson(o.toJson()); |
853 checkReportMetadata(od); | 838 checkReportMetadata(od); |
854 }); | 839 }); |
855 }); | 840 }); |
856 | 841 |
857 | |
858 unittest.group("obj-schema-ReportStatus", () { | 842 unittest.group("obj-schema-ReportStatus", () { |
859 unittest.test("to-json--from-json", () { | 843 unittest.test("to-json--from-json", () { |
860 var o = buildReportStatus(); | 844 var o = buildReportStatus(); |
861 var od = new api.ReportStatus.fromJson(o.toJson()); | 845 var od = new api.ReportStatus.fromJson(o.toJson()); |
862 checkReportStatus(od); | 846 checkReportStatus(od); |
863 }); | 847 }); |
864 }); | 848 }); |
865 | 849 |
866 | |
867 unittest.group("obj-schema-RowStatus", () { | 850 unittest.group("obj-schema-RowStatus", () { |
868 unittest.test("to-json--from-json", () { | 851 unittest.test("to-json--from-json", () { |
869 var o = buildRowStatus(); | 852 var o = buildRowStatus(); |
870 var od = new api.RowStatus.fromJson(o.toJson()); | 853 var od = new api.RowStatus.fromJson(o.toJson()); |
871 checkRowStatus(od); | 854 checkRowStatus(od); |
872 }); | 855 }); |
873 }); | 856 }); |
874 | 857 |
875 | |
876 unittest.group("obj-schema-RunQueryRequest", () { | 858 unittest.group("obj-schema-RunQueryRequest", () { |
877 unittest.test("to-json--from-json", () { | 859 unittest.test("to-json--from-json", () { |
878 var o = buildRunQueryRequest(); | 860 var o = buildRunQueryRequest(); |
879 var od = new api.RunQueryRequest.fromJson(o.toJson()); | 861 var od = new api.RunQueryRequest.fromJson(o.toJson()); |
880 checkRunQueryRequest(od); | 862 checkRunQueryRequest(od); |
881 }); | 863 }); |
882 }); | 864 }); |
883 | 865 |
884 | |
885 unittest.group("obj-schema-UploadLineItemsRequest", () { | 866 unittest.group("obj-schema-UploadLineItemsRequest", () { |
886 unittest.test("to-json--from-json", () { | 867 unittest.test("to-json--from-json", () { |
887 var o = buildUploadLineItemsRequest(); | 868 var o = buildUploadLineItemsRequest(); |
888 var od = new api.UploadLineItemsRequest.fromJson(o.toJson()); | 869 var od = new api.UploadLineItemsRequest.fromJson(o.toJson()); |
889 checkUploadLineItemsRequest(od); | 870 checkUploadLineItemsRequest(od); |
890 }); | 871 }); |
891 }); | 872 }); |
892 | 873 |
893 | |
894 unittest.group("obj-schema-UploadLineItemsResponse", () { | 874 unittest.group("obj-schema-UploadLineItemsResponse", () { |
895 unittest.test("to-json--from-json", () { | 875 unittest.test("to-json--from-json", () { |
896 var o = buildUploadLineItemsResponse(); | 876 var o = buildUploadLineItemsResponse(); |
897 var od = new api.UploadLineItemsResponse.fromJson(o.toJson()); | 877 var od = new api.UploadLineItemsResponse.fromJson(o.toJson()); |
898 checkUploadLineItemsResponse(od); | 878 checkUploadLineItemsResponse(od); |
899 }); | 879 }); |
900 }); | 880 }); |
901 | 881 |
902 | |
903 unittest.group("obj-schema-UploadStatus", () { | 882 unittest.group("obj-schema-UploadStatus", () { |
904 unittest.test("to-json--from-json", () { | 883 unittest.test("to-json--from-json", () { |
905 var o = buildUploadStatus(); | 884 var o = buildUploadStatus(); |
906 var od = new api.UploadStatus.fromJson(o.toJson()); | 885 var od = new api.UploadStatus.fromJson(o.toJson()); |
907 checkUploadStatus(od); | 886 checkUploadStatus(od); |
908 }); | 887 }); |
909 }); | 888 }); |
910 | 889 |
911 | |
912 unittest.group("resource-LineitemsResourceApi", () { | 890 unittest.group("resource-LineitemsResourceApi", () { |
913 unittest.test("method--downloadlineitems", () { | 891 unittest.test("method--downloadlineitems", () { |
914 | |
915 var mock = new HttpServerMock(); | 892 var mock = new HttpServerMock(); |
916 api.LineitemsResourceApi res = new api.DoubleclickbidmanagerApi(mock).line
items; | 893 api.LineitemsResourceApi res = |
| 894 new api.DoubleclickbidmanagerApi(mock).lineitems; |
917 var arg_request = buildDownloadLineItemsRequest(); | 895 var arg_request = buildDownloadLineItemsRequest(); |
918 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 896 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
919 var obj = new api.DownloadLineItemsRequest.fromJson(json); | 897 var obj = new api.DownloadLineItemsRequest.fromJson(json); |
920 checkDownloadLineItemsRequest(obj); | 898 checkDownloadLineItemsRequest(obj); |
921 | 899 |
922 var path = (req.url).path; | 900 var path = (req.url).path; |
923 var pathOffset = 0; | 901 var pathOffset = 0; |
924 var index; | 902 var index; |
925 var subPart; | 903 var subPart; |
926 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 904 unittest.expect( |
| 905 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
927 pathOffset += 1; | 906 pathOffset += 1; |
928 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 907 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 908 unittest.equals("doubleclickbidmanager/v1/")); |
929 pathOffset += 25; | 909 pathOffset += 25; |
930 unittest.expect(path.substring(pathOffset, pathOffset + 27), unittest.eq
uals("lineitems/downloadlineitems")); | 910 unittest.expect(path.substring(pathOffset, pathOffset + 27), |
| 911 unittest.equals("lineitems/downloadlineitems")); |
931 pathOffset += 27; | 912 pathOffset += 27; |
932 | 913 |
933 var query = (req.url).query; | 914 var query = (req.url).query; |
934 var queryOffset = 0; | 915 var queryOffset = 0; |
935 var queryMap = {}; | 916 var queryMap = {}; |
936 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 917 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
937 parseBool(n) { | 918 parseBool(n) { |
938 if (n == "true") return true; | 919 if (n == "true") return true; |
939 if (n == "false") return false; | 920 if (n == "false") return false; |
940 if (n == null) return null; | 921 if (n == null) return null; |
941 throw new core.ArgumentError("Invalid boolean: $n"); | 922 throw new core.ArgumentError("Invalid boolean: $n"); |
942 } | 923 } |
| 924 |
943 if (query.length > 0) { | 925 if (query.length > 0) { |
944 for (var part in query.split("&")) { | 926 for (var part in query.split("&")) { |
945 var keyvalue = part.split("="); | 927 var keyvalue = part.split("="); |
946 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 928 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 929 core.Uri.decodeQueryComponent(keyvalue[1])); |
947 } | 930 } |
948 } | 931 } |
949 | 932 |
950 | |
951 var h = { | 933 var h = { |
952 "content-type" : "application/json; charset=utf-8", | 934 "content-type": "application/json; charset=utf-8", |
953 }; | 935 }; |
954 var resp = convert.JSON.encode(buildDownloadLineItemsResponse()); | 936 var resp = convert.JSON.encode(buildDownloadLineItemsResponse()); |
955 return new async.Future.value(stringResponse(200, h, resp)); | 937 return new async.Future.value(stringResponse(200, h, resp)); |
956 }), true); | 938 }), true); |
957 res.downloadlineitems(arg_request).then(unittest.expectAsync1(((api.Downlo
adLineItemsResponse response) { | 939 res.downloadlineitems(arg_request).then( |
| 940 unittest.expectAsync1(((api.DownloadLineItemsResponse response) { |
958 checkDownloadLineItemsResponse(response); | 941 checkDownloadLineItemsResponse(response); |
959 }))); | 942 }))); |
960 }); | 943 }); |
961 | 944 |
962 unittest.test("method--uploadlineitems", () { | 945 unittest.test("method--uploadlineitems", () { |
963 | |
964 var mock = new HttpServerMock(); | 946 var mock = new HttpServerMock(); |
965 api.LineitemsResourceApi res = new api.DoubleclickbidmanagerApi(mock).line
items; | 947 api.LineitemsResourceApi res = |
| 948 new api.DoubleclickbidmanagerApi(mock).lineitems; |
966 var arg_request = buildUploadLineItemsRequest(); | 949 var arg_request = buildUploadLineItemsRequest(); |
967 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 950 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
968 var obj = new api.UploadLineItemsRequest.fromJson(json); | 951 var obj = new api.UploadLineItemsRequest.fromJson(json); |
969 checkUploadLineItemsRequest(obj); | 952 checkUploadLineItemsRequest(obj); |
970 | 953 |
971 var path = (req.url).path; | 954 var path = (req.url).path; |
972 var pathOffset = 0; | 955 var pathOffset = 0; |
973 var index; | 956 var index; |
974 var subPart; | 957 var subPart; |
975 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 958 unittest.expect( |
| 959 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
976 pathOffset += 1; | 960 pathOffset += 1; |
977 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 961 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 962 unittest.equals("doubleclickbidmanager/v1/")); |
978 pathOffset += 25; | 963 pathOffset += 25; |
979 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("lineitems/uploadlineitems")); | 964 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 965 unittest.equals("lineitems/uploadlineitems")); |
980 pathOffset += 25; | 966 pathOffset += 25; |
981 | 967 |
982 var query = (req.url).query; | 968 var query = (req.url).query; |
983 var queryOffset = 0; | 969 var queryOffset = 0; |
984 var queryMap = {}; | 970 var queryMap = {}; |
985 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 971 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
986 parseBool(n) { | 972 parseBool(n) { |
987 if (n == "true") return true; | 973 if (n == "true") return true; |
988 if (n == "false") return false; | 974 if (n == "false") return false; |
989 if (n == null) return null; | 975 if (n == null) return null; |
990 throw new core.ArgumentError("Invalid boolean: $n"); | 976 throw new core.ArgumentError("Invalid boolean: $n"); |
991 } | 977 } |
| 978 |
992 if (query.length > 0) { | 979 if (query.length > 0) { |
993 for (var part in query.split("&")) { | 980 for (var part in query.split("&")) { |
994 var keyvalue = part.split("="); | 981 var keyvalue = part.split("="); |
995 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 982 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 983 core.Uri.decodeQueryComponent(keyvalue[1])); |
996 } | 984 } |
997 } | 985 } |
998 | 986 |
999 | |
1000 var h = { | 987 var h = { |
1001 "content-type" : "application/json; charset=utf-8", | 988 "content-type": "application/json; charset=utf-8", |
1002 }; | 989 }; |
1003 var resp = convert.JSON.encode(buildUploadLineItemsResponse()); | 990 var resp = convert.JSON.encode(buildUploadLineItemsResponse()); |
1004 return new async.Future.value(stringResponse(200, h, resp)); | 991 return new async.Future.value(stringResponse(200, h, resp)); |
1005 }), true); | 992 }), true); |
1006 res.uploadlineitems(arg_request).then(unittest.expectAsync1(((api.UploadLi
neItemsResponse response) { | 993 res |
| 994 .uploadlineitems(arg_request) |
| 995 .then(unittest.expectAsync1(((api.UploadLineItemsResponse response) { |
1007 checkUploadLineItemsResponse(response); | 996 checkUploadLineItemsResponse(response); |
1008 }))); | 997 }))); |
1009 }); | 998 }); |
1010 | |
1011 }); | 999 }); |
1012 | 1000 |
1013 | |
1014 unittest.group("resource-QueriesResourceApi", () { | 1001 unittest.group("resource-QueriesResourceApi", () { |
1015 unittest.test("method--createquery", () { | 1002 unittest.test("method--createquery", () { |
1016 | |
1017 var mock = new HttpServerMock(); | 1003 var mock = new HttpServerMock(); |
1018 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1004 api.QueriesResourceApi res = |
| 1005 new api.DoubleclickbidmanagerApi(mock).queries; |
1019 var arg_request = buildQuery(); | 1006 var arg_request = buildQuery(); |
1020 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1007 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1021 var obj = new api.Query.fromJson(json); | 1008 var obj = new api.Query.fromJson(json); |
1022 checkQuery(obj); | 1009 checkQuery(obj); |
1023 | 1010 |
1024 var path = (req.url).path; | 1011 var path = (req.url).path; |
1025 var pathOffset = 0; | 1012 var pathOffset = 0; |
1026 var index; | 1013 var index; |
1027 var subPart; | 1014 var subPart; |
1028 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1015 unittest.expect( |
| 1016 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1029 pathOffset += 1; | 1017 pathOffset += 1; |
1030 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1018 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1019 unittest.equals("doubleclickbidmanager/v1/")); |
1031 pathOffset += 25; | 1020 pathOffset += 25; |
1032 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("query")); | 1021 unittest.expect(path.substring(pathOffset, pathOffset + 5), |
| 1022 unittest.equals("query")); |
1033 pathOffset += 5; | 1023 pathOffset += 5; |
1034 | 1024 |
1035 var query = (req.url).query; | 1025 var query = (req.url).query; |
1036 var queryOffset = 0; | 1026 var queryOffset = 0; |
1037 var queryMap = {}; | 1027 var queryMap = {}; |
1038 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1028 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1039 parseBool(n) { | 1029 parseBool(n) { |
1040 if (n == "true") return true; | 1030 if (n == "true") return true; |
1041 if (n == "false") return false; | 1031 if (n == "false") return false; |
1042 if (n == null) return null; | 1032 if (n == null) return null; |
1043 throw new core.ArgumentError("Invalid boolean: $n"); | 1033 throw new core.ArgumentError("Invalid boolean: $n"); |
1044 } | 1034 } |
| 1035 |
1045 if (query.length > 0) { | 1036 if (query.length > 0) { |
1046 for (var part in query.split("&")) { | 1037 for (var part in query.split("&")) { |
1047 var keyvalue = part.split("="); | 1038 var keyvalue = part.split("="); |
1048 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1039 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1040 core.Uri.decodeQueryComponent(keyvalue[1])); |
1049 } | 1041 } |
1050 } | 1042 } |
1051 | 1043 |
1052 | |
1053 var h = { | 1044 var h = { |
1054 "content-type" : "application/json; charset=utf-8", | 1045 "content-type": "application/json; charset=utf-8", |
1055 }; | 1046 }; |
1056 var resp = convert.JSON.encode(buildQuery()); | 1047 var resp = convert.JSON.encode(buildQuery()); |
1057 return new async.Future.value(stringResponse(200, h, resp)); | 1048 return new async.Future.value(stringResponse(200, h, resp)); |
1058 }), true); | 1049 }), true); |
1059 res.createquery(arg_request).then(unittest.expectAsync1(((api.Query respon
se) { | 1050 res |
| 1051 .createquery(arg_request) |
| 1052 .then(unittest.expectAsync1(((api.Query response) { |
1060 checkQuery(response); | 1053 checkQuery(response); |
1061 }))); | 1054 }))); |
1062 }); | 1055 }); |
1063 | 1056 |
1064 unittest.test("method--deletequery", () { | 1057 unittest.test("method--deletequery", () { |
1065 | |
1066 var mock = new HttpServerMock(); | 1058 var mock = new HttpServerMock(); |
1067 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1059 api.QueriesResourceApi res = |
| 1060 new api.DoubleclickbidmanagerApi(mock).queries; |
1068 var arg_queryId = "foo"; | 1061 var arg_queryId = "foo"; |
1069 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1062 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1070 var path = (req.url).path; | 1063 var path = (req.url).path; |
1071 var pathOffset = 0; | 1064 var pathOffset = 0; |
1072 var index; | 1065 var index; |
1073 var subPart; | 1066 var subPart; |
1074 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1067 unittest.expect( |
| 1068 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1075 pathOffset += 1; | 1069 pathOffset += 1; |
1076 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1070 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1071 unittest.equals("doubleclickbidmanager/v1/")); |
1077 pathOffset += 25; | 1072 pathOffset += 25; |
1078 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("query/")); | 1073 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 1074 unittest.equals("query/")); |
1079 pathOffset += 6; | 1075 pathOffset += 6; |
1080 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1076 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1081 pathOffset = path.length; | 1077 pathOffset = path.length; |
1082 unittest.expect(subPart, unittest.equals("$arg_queryId")); | 1078 unittest.expect(subPart, unittest.equals("$arg_queryId")); |
1083 | 1079 |
1084 var query = (req.url).query; | 1080 var query = (req.url).query; |
1085 var queryOffset = 0; | 1081 var queryOffset = 0; |
1086 var queryMap = {}; | 1082 var queryMap = {}; |
1087 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1083 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1088 parseBool(n) { | 1084 parseBool(n) { |
1089 if (n == "true") return true; | 1085 if (n == "true") return true; |
1090 if (n == "false") return false; | 1086 if (n == "false") return false; |
1091 if (n == null) return null; | 1087 if (n == null) return null; |
1092 throw new core.ArgumentError("Invalid boolean: $n"); | 1088 throw new core.ArgumentError("Invalid boolean: $n"); |
1093 } | 1089 } |
| 1090 |
1094 if (query.length > 0) { | 1091 if (query.length > 0) { |
1095 for (var part in query.split("&")) { | 1092 for (var part in query.split("&")) { |
1096 var keyvalue = part.split("="); | 1093 var keyvalue = part.split("="); |
1097 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1094 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1095 core.Uri.decodeQueryComponent(keyvalue[1])); |
1098 } | 1096 } |
1099 } | 1097 } |
1100 | 1098 |
1101 | |
1102 var h = { | 1099 var h = { |
1103 "content-type" : "application/json; charset=utf-8", | 1100 "content-type": "application/json; charset=utf-8", |
1104 }; | 1101 }; |
1105 var resp = ""; | 1102 var resp = ""; |
1106 return new async.Future.value(stringResponse(200, h, resp)); | 1103 return new async.Future.value(stringResponse(200, h, resp)); |
1107 }), true); | 1104 }), true); |
1108 res.deletequery(arg_queryId).then(unittest.expectAsync1((_) {})); | 1105 res.deletequery(arg_queryId).then(unittest.expectAsync1((_) {})); |
1109 }); | 1106 }); |
1110 | 1107 |
1111 unittest.test("method--getquery", () { | 1108 unittest.test("method--getquery", () { |
1112 | |
1113 var mock = new HttpServerMock(); | 1109 var mock = new HttpServerMock(); |
1114 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1110 api.QueriesResourceApi res = |
| 1111 new api.DoubleclickbidmanagerApi(mock).queries; |
1115 var arg_queryId = "foo"; | 1112 var arg_queryId = "foo"; |
1116 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1113 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1117 var path = (req.url).path; | 1114 var path = (req.url).path; |
1118 var pathOffset = 0; | 1115 var pathOffset = 0; |
1119 var index; | 1116 var index; |
1120 var subPart; | 1117 var subPart; |
1121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1118 unittest.expect( |
| 1119 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1122 pathOffset += 1; | 1120 pathOffset += 1; |
1123 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1121 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1122 unittest.equals("doubleclickbidmanager/v1/")); |
1124 pathOffset += 25; | 1123 pathOffset += 25; |
1125 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("query/")); | 1124 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 1125 unittest.equals("query/")); |
1126 pathOffset += 6; | 1126 pathOffset += 6; |
1127 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1127 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1128 pathOffset = path.length; | 1128 pathOffset = path.length; |
1129 unittest.expect(subPart, unittest.equals("$arg_queryId")); | 1129 unittest.expect(subPart, unittest.equals("$arg_queryId")); |
1130 | 1130 |
1131 var query = (req.url).query; | 1131 var query = (req.url).query; |
1132 var queryOffset = 0; | 1132 var queryOffset = 0; |
1133 var queryMap = {}; | 1133 var queryMap = {}; |
1134 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1134 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1135 parseBool(n) { | 1135 parseBool(n) { |
1136 if (n == "true") return true; | 1136 if (n == "true") return true; |
1137 if (n == "false") return false; | 1137 if (n == "false") return false; |
1138 if (n == null) return null; | 1138 if (n == null) return null; |
1139 throw new core.ArgumentError("Invalid boolean: $n"); | 1139 throw new core.ArgumentError("Invalid boolean: $n"); |
1140 } | 1140 } |
| 1141 |
1141 if (query.length > 0) { | 1142 if (query.length > 0) { |
1142 for (var part in query.split("&")) { | 1143 for (var part in query.split("&")) { |
1143 var keyvalue = part.split("="); | 1144 var keyvalue = part.split("="); |
1144 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1145 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1146 core.Uri.decodeQueryComponent(keyvalue[1])); |
1145 } | 1147 } |
1146 } | 1148 } |
1147 | 1149 |
1148 | |
1149 var h = { | 1150 var h = { |
1150 "content-type" : "application/json; charset=utf-8", | 1151 "content-type": "application/json; charset=utf-8", |
1151 }; | 1152 }; |
1152 var resp = convert.JSON.encode(buildQuery()); | 1153 var resp = convert.JSON.encode(buildQuery()); |
1153 return new async.Future.value(stringResponse(200, h, resp)); | 1154 return new async.Future.value(stringResponse(200, h, resp)); |
1154 }), true); | 1155 }), true); |
1155 res.getquery(arg_queryId).then(unittest.expectAsync1(((api.Query response)
{ | 1156 res |
| 1157 .getquery(arg_queryId) |
| 1158 .then(unittest.expectAsync1(((api.Query response) { |
1156 checkQuery(response); | 1159 checkQuery(response); |
1157 }))); | 1160 }))); |
1158 }); | 1161 }); |
1159 | 1162 |
1160 unittest.test("method--listqueries", () { | 1163 unittest.test("method--listqueries", () { |
1161 | |
1162 var mock = new HttpServerMock(); | 1164 var mock = new HttpServerMock(); |
1163 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1165 api.QueriesResourceApi res = |
| 1166 new api.DoubleclickbidmanagerApi(mock).queries; |
1164 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1167 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1165 var path = (req.url).path; | 1168 var path = (req.url).path; |
1166 var pathOffset = 0; | 1169 var pathOffset = 0; |
1167 var index; | 1170 var index; |
1168 var subPart; | 1171 var subPart; |
1169 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1172 unittest.expect( |
| 1173 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1170 pathOffset += 1; | 1174 pathOffset += 1; |
1171 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1175 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1176 unittest.equals("doubleclickbidmanager/v1/")); |
1172 pathOffset += 25; | 1177 pathOffset += 25; |
1173 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("queries")); | 1178 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 1179 unittest.equals("queries")); |
1174 pathOffset += 7; | 1180 pathOffset += 7; |
1175 | 1181 |
1176 var query = (req.url).query; | 1182 var query = (req.url).query; |
1177 var queryOffset = 0; | 1183 var queryOffset = 0; |
1178 var queryMap = {}; | 1184 var queryMap = {}; |
1179 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1185 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1180 parseBool(n) { | 1186 parseBool(n) { |
1181 if (n == "true") return true; | 1187 if (n == "true") return true; |
1182 if (n == "false") return false; | 1188 if (n == "false") return false; |
1183 if (n == null) return null; | 1189 if (n == null) return null; |
1184 throw new core.ArgumentError("Invalid boolean: $n"); | 1190 throw new core.ArgumentError("Invalid boolean: $n"); |
1185 } | 1191 } |
| 1192 |
1186 if (query.length > 0) { | 1193 if (query.length > 0) { |
1187 for (var part in query.split("&")) { | 1194 for (var part in query.split("&")) { |
1188 var keyvalue = part.split("="); | 1195 var keyvalue = part.split("="); |
1189 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1196 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1197 core.Uri.decodeQueryComponent(keyvalue[1])); |
1190 } | 1198 } |
1191 } | 1199 } |
1192 | 1200 |
1193 | |
1194 var h = { | 1201 var h = { |
1195 "content-type" : "application/json; charset=utf-8", | 1202 "content-type": "application/json; charset=utf-8", |
1196 }; | 1203 }; |
1197 var resp = convert.JSON.encode(buildListQueriesResponse()); | 1204 var resp = convert.JSON.encode(buildListQueriesResponse()); |
1198 return new async.Future.value(stringResponse(200, h, resp)); | 1205 return new async.Future.value(stringResponse(200, h, resp)); |
1199 }), true); | 1206 }), true); |
1200 res.listqueries().then(unittest.expectAsync1(((api.ListQueriesResponse res
ponse) { | 1207 res |
| 1208 .listqueries() |
| 1209 .then(unittest.expectAsync1(((api.ListQueriesResponse response) { |
1201 checkListQueriesResponse(response); | 1210 checkListQueriesResponse(response); |
1202 }))); | 1211 }))); |
1203 }); | 1212 }); |
1204 | 1213 |
1205 unittest.test("method--runquery", () { | 1214 unittest.test("method--runquery", () { |
1206 | |
1207 var mock = new HttpServerMock(); | 1215 var mock = new HttpServerMock(); |
1208 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1216 api.QueriesResourceApi res = |
| 1217 new api.DoubleclickbidmanagerApi(mock).queries; |
1209 var arg_request = buildRunQueryRequest(); | 1218 var arg_request = buildRunQueryRequest(); |
1210 var arg_queryId = "foo"; | 1219 var arg_queryId = "foo"; |
1211 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1220 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1212 var obj = new api.RunQueryRequest.fromJson(json); | 1221 var obj = new api.RunQueryRequest.fromJson(json); |
1213 checkRunQueryRequest(obj); | 1222 checkRunQueryRequest(obj); |
1214 | 1223 |
1215 var path = (req.url).path; | 1224 var path = (req.url).path; |
1216 var pathOffset = 0; | 1225 var pathOffset = 0; |
1217 var index; | 1226 var index; |
1218 var subPart; | 1227 var subPart; |
1219 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1228 unittest.expect( |
| 1229 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1220 pathOffset += 1; | 1230 pathOffset += 1; |
1221 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1231 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1232 unittest.equals("doubleclickbidmanager/v1/")); |
1222 pathOffset += 25; | 1233 pathOffset += 25; |
1223 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("query/")); | 1234 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 1235 unittest.equals("query/")); |
1224 pathOffset += 6; | 1236 pathOffset += 6; |
1225 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1237 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1226 pathOffset = path.length; | 1238 pathOffset = path.length; |
1227 unittest.expect(subPart, unittest.equals("$arg_queryId")); | 1239 unittest.expect(subPart, unittest.equals("$arg_queryId")); |
1228 | 1240 |
1229 var query = (req.url).query; | 1241 var query = (req.url).query; |
1230 var queryOffset = 0; | 1242 var queryOffset = 0; |
1231 var queryMap = {}; | 1243 var queryMap = {}; |
1232 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1244 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1233 parseBool(n) { | 1245 parseBool(n) { |
1234 if (n == "true") return true; | 1246 if (n == "true") return true; |
1235 if (n == "false") return false; | 1247 if (n == "false") return false; |
1236 if (n == null) return null; | 1248 if (n == null) return null; |
1237 throw new core.ArgumentError("Invalid boolean: $n"); | 1249 throw new core.ArgumentError("Invalid boolean: $n"); |
1238 } | 1250 } |
| 1251 |
1239 if (query.length > 0) { | 1252 if (query.length > 0) { |
1240 for (var part in query.split("&")) { | 1253 for (var part in query.split("&")) { |
1241 var keyvalue = part.split("="); | 1254 var keyvalue = part.split("="); |
1242 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1255 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1256 core.Uri.decodeQueryComponent(keyvalue[1])); |
1243 } | 1257 } |
1244 } | 1258 } |
1245 | 1259 |
1246 | |
1247 var h = { | 1260 var h = { |
1248 "content-type" : "application/json; charset=utf-8", | 1261 "content-type": "application/json; charset=utf-8", |
1249 }; | 1262 }; |
1250 var resp = ""; | 1263 var resp = ""; |
1251 return new async.Future.value(stringResponse(200, h, resp)); | 1264 return new async.Future.value(stringResponse(200, h, resp)); |
1252 }), true); | 1265 }), true); |
1253 res.runquery(arg_request, arg_queryId).then(unittest.expectAsync1((_) {}))
; | 1266 res |
| 1267 .runquery(arg_request, arg_queryId) |
| 1268 .then(unittest.expectAsync1((_) {})); |
1254 }); | 1269 }); |
1255 | |
1256 }); | 1270 }); |
1257 | 1271 |
1258 | |
1259 unittest.group("resource-ReportsResourceApi", () { | 1272 unittest.group("resource-ReportsResourceApi", () { |
1260 unittest.test("method--listreports", () { | 1273 unittest.test("method--listreports", () { |
1261 | |
1262 var mock = new HttpServerMock(); | 1274 var mock = new HttpServerMock(); |
1263 api.ReportsResourceApi res = new api.DoubleclickbidmanagerApi(mock).report
s; | 1275 api.ReportsResourceApi res = |
| 1276 new api.DoubleclickbidmanagerApi(mock).reports; |
1264 var arg_queryId = "foo"; | 1277 var arg_queryId = "foo"; |
1265 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1278 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1266 var path = (req.url).path; | 1279 var path = (req.url).path; |
1267 var pathOffset = 0; | 1280 var pathOffset = 0; |
1268 var index; | 1281 var index; |
1269 var subPart; | 1282 var subPart; |
1270 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1283 unittest.expect( |
| 1284 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1271 pathOffset += 1; | 1285 pathOffset += 1; |
1272 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1286 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1287 unittest.equals("doubleclickbidmanager/v1/")); |
1273 pathOffset += 25; | 1288 pathOffset += 25; |
1274 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("queries/")); | 1289 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 1290 unittest.equals("queries/")); |
1275 pathOffset += 8; | 1291 pathOffset += 8; |
1276 index = path.indexOf("/reports", pathOffset); | 1292 index = path.indexOf("/reports", pathOffset); |
1277 unittest.expect(index >= 0, unittest.isTrue); | 1293 unittest.expect(index >= 0, unittest.isTrue); |
1278 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1294 subPart = |
| 1295 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1279 pathOffset = index; | 1296 pathOffset = index; |
1280 unittest.expect(subPart, unittest.equals("$arg_queryId")); | 1297 unittest.expect(subPart, unittest.equals("$arg_queryId")); |
1281 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/reports")); | 1298 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 1299 unittest.equals("/reports")); |
1282 pathOffset += 8; | 1300 pathOffset += 8; |
1283 | 1301 |
1284 var query = (req.url).query; | 1302 var query = (req.url).query; |
1285 var queryOffset = 0; | 1303 var queryOffset = 0; |
1286 var queryMap = {}; | 1304 var queryMap = {}; |
1287 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1305 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1288 parseBool(n) { | 1306 parseBool(n) { |
1289 if (n == "true") return true; | 1307 if (n == "true") return true; |
1290 if (n == "false") return false; | 1308 if (n == "false") return false; |
1291 if (n == null) return null; | 1309 if (n == null) return null; |
1292 throw new core.ArgumentError("Invalid boolean: $n"); | 1310 throw new core.ArgumentError("Invalid boolean: $n"); |
1293 } | 1311 } |
| 1312 |
1294 if (query.length > 0) { | 1313 if (query.length > 0) { |
1295 for (var part in query.split("&")) { | 1314 for (var part in query.split("&")) { |
1296 var keyvalue = part.split("="); | 1315 var keyvalue = part.split("="); |
1297 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1316 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1317 core.Uri.decodeQueryComponent(keyvalue[1])); |
1298 } | 1318 } |
1299 } | 1319 } |
1300 | 1320 |
1301 | |
1302 var h = { | 1321 var h = { |
1303 "content-type" : "application/json; charset=utf-8", | 1322 "content-type": "application/json; charset=utf-8", |
1304 }; | 1323 }; |
1305 var resp = convert.JSON.encode(buildListReportsResponse()); | 1324 var resp = convert.JSON.encode(buildListReportsResponse()); |
1306 return new async.Future.value(stringResponse(200, h, resp)); | 1325 return new async.Future.value(stringResponse(200, h, resp)); |
1307 }), true); | 1326 }), true); |
1308 res.listreports(arg_queryId).then(unittest.expectAsync1(((api.ListReportsR
esponse response) { | 1327 res |
| 1328 .listreports(arg_queryId) |
| 1329 .then(unittest.expectAsync1(((api.ListReportsResponse response) { |
1309 checkListReportsResponse(response); | 1330 checkListReportsResponse(response); |
1310 }))); | 1331 }))); |
1311 }); | 1332 }); |
1312 | |
1313 }); | 1333 }); |
1314 | 1334 |
1315 | |
1316 unittest.group("resource-SdfResourceApi", () { | 1335 unittest.group("resource-SdfResourceApi", () { |
1317 unittest.test("method--download", () { | 1336 unittest.test("method--download", () { |
1318 | |
1319 var mock = new HttpServerMock(); | 1337 var mock = new HttpServerMock(); |
1320 api.SdfResourceApi res = new api.DoubleclickbidmanagerApi(mock).sdf; | 1338 api.SdfResourceApi res = new api.DoubleclickbidmanagerApi(mock).sdf; |
1321 var arg_request = buildDownloadRequest(); | 1339 var arg_request = buildDownloadRequest(); |
1322 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1340 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1323 var obj = new api.DownloadRequest.fromJson(json); | 1341 var obj = new api.DownloadRequest.fromJson(json); |
1324 checkDownloadRequest(obj); | 1342 checkDownloadRequest(obj); |
1325 | 1343 |
1326 var path = (req.url).path; | 1344 var path = (req.url).path; |
1327 var pathOffset = 0; | 1345 var pathOffset = 0; |
1328 var index; | 1346 var index; |
1329 var subPart; | 1347 var subPart; |
1330 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1348 unittest.expect( |
| 1349 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1331 pathOffset += 1; | 1350 pathOffset += 1; |
1332 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1351 unittest.expect(path.substring(pathOffset, pathOffset + 25), |
| 1352 unittest.equals("doubleclickbidmanager/v1/")); |
1333 pathOffset += 25; | 1353 pathOffset += 25; |
1334 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sdf/download")); | 1354 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1355 unittest.equals("sdf/download")); |
1335 pathOffset += 12; | 1356 pathOffset += 12; |
1336 | 1357 |
1337 var query = (req.url).query; | 1358 var query = (req.url).query; |
1338 var queryOffset = 0; | 1359 var queryOffset = 0; |
1339 var queryMap = {}; | 1360 var queryMap = {}; |
1340 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1361 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1341 parseBool(n) { | 1362 parseBool(n) { |
1342 if (n == "true") return true; | 1363 if (n == "true") return true; |
1343 if (n == "false") return false; | 1364 if (n == "false") return false; |
1344 if (n == null) return null; | 1365 if (n == null) return null; |
1345 throw new core.ArgumentError("Invalid boolean: $n"); | 1366 throw new core.ArgumentError("Invalid boolean: $n"); |
1346 } | 1367 } |
| 1368 |
1347 if (query.length > 0) { | 1369 if (query.length > 0) { |
1348 for (var part in query.split("&")) { | 1370 for (var part in query.split("&")) { |
1349 var keyvalue = part.split("="); | 1371 var keyvalue = part.split("="); |
1350 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1372 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1373 core.Uri.decodeQueryComponent(keyvalue[1])); |
1351 } | 1374 } |
1352 } | 1375 } |
1353 | 1376 |
1354 | |
1355 var h = { | 1377 var h = { |
1356 "content-type" : "application/json; charset=utf-8", | 1378 "content-type": "application/json; charset=utf-8", |
1357 }; | 1379 }; |
1358 var resp = convert.JSON.encode(buildDownloadResponse()); | 1380 var resp = convert.JSON.encode(buildDownloadResponse()); |
1359 return new async.Future.value(stringResponse(200, h, resp)); | 1381 return new async.Future.value(stringResponse(200, h, resp)); |
1360 }), true); | 1382 }), true); |
1361 res.download(arg_request).then(unittest.expectAsync1(((api.DownloadRespons
e response) { | 1383 res |
| 1384 .download(arg_request) |
| 1385 .then(unittest.expectAsync1(((api.DownloadResponse response) { |
1362 checkDownloadResponse(response); | 1386 checkDownloadResponse(response); |
1363 }))); | 1387 }))); |
1364 }); | 1388 }); |
1365 | |
1366 }); | 1389 }); |
1367 | |
1368 | |
1369 } | 1390 } |
1370 | |
OLD | NEW |