Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1424)

Side by Side Diff: generated/googleapis/test/doubleclicksearch/v2_test.dart

Issue 3006323002: Api-Roll 54: 2017-09-11 (Closed)
Patch Set: use 2.0.0-dev.infinity sdk constraint in pubspecs Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 library googleapis.doubleclicksearch.v2.test; 1 library googleapis.doubleclicksearch.v2.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/doubleclicksearch/v2.dart' as api; 10 import 'package:googleapis/doubleclicksearch/v2.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 core.int buildCounterAvailability = 0; 53 core.int buildCounterAvailability = 0;
55 buildAvailability() { 54 buildAvailability() {
56 var o = new api.Availability(); 55 var o = new api.Availability();
57 buildCounterAvailability++; 56 buildCounterAvailability++;
58 if (buildCounterAvailability < 3) { 57 if (buildCounterAvailability < 3) {
59 o.advertiserId = "foo"; 58 o.advertiserId = "foo";
(...skipping 13 matching lines...) Expand all
73 unittest.expect(o.advertiserId, unittest.equals('foo')); 72 unittest.expect(o.advertiserId, unittest.equals('foo'));
74 unittest.expect(o.agencyId, unittest.equals('foo')); 73 unittest.expect(o.agencyId, unittest.equals('foo'));
75 unittest.expect(o.availabilityTimestamp, unittest.equals('foo')); 74 unittest.expect(o.availabilityTimestamp, unittest.equals('foo'));
76 unittest.expect(o.segmentationId, unittest.equals('foo')); 75 unittest.expect(o.segmentationId, unittest.equals('foo'));
77 unittest.expect(o.segmentationName, unittest.equals('foo')); 76 unittest.expect(o.segmentationName, unittest.equals('foo'));
78 unittest.expect(o.segmentationType, unittest.equals('foo')); 77 unittest.expect(o.segmentationType, unittest.equals('foo'));
79 } 78 }
80 buildCounterAvailability--; 79 buildCounterAvailability--;
81 } 80 }
82 81
83 buildUnnamed1443() { 82 buildUnnamed1433() {
84 var o = new core.List<api.CustomDimension>(); 83 var o = new core.List<api.CustomDimension>();
85 o.add(buildCustomDimension()); 84 o.add(buildCustomDimension());
86 o.add(buildCustomDimension()); 85 o.add(buildCustomDimension());
87 return o; 86 return o;
88 } 87 }
89 88
90 checkUnnamed1443(core.List<api.CustomDimension> o) { 89 checkUnnamed1433(core.List<api.CustomDimension> o) {
91 unittest.expect(o, unittest.hasLength(2)); 90 unittest.expect(o, unittest.hasLength(2));
92 checkCustomDimension(o[0]); 91 checkCustomDimension(o[0]);
93 checkCustomDimension(o[1]); 92 checkCustomDimension(o[1]);
94 } 93 }
95 94
96 buildUnnamed1444() { 95 buildUnnamed1434() {
97 var o = new core.List<api.CustomMetric>(); 96 var o = new core.List<api.CustomMetric>();
98 o.add(buildCustomMetric()); 97 o.add(buildCustomMetric());
99 o.add(buildCustomMetric()); 98 o.add(buildCustomMetric());
100 return o; 99 return o;
101 } 100 }
102 101
103 checkUnnamed1444(core.List<api.CustomMetric> o) { 102 checkUnnamed1434(core.List<api.CustomMetric> o) {
104 unittest.expect(o, unittest.hasLength(2)); 103 unittest.expect(o, unittest.hasLength(2));
105 checkCustomMetric(o[0]); 104 checkCustomMetric(o[0]);
106 checkCustomMetric(o[1]); 105 checkCustomMetric(o[1]);
107 } 106 }
108 107
109 core.int buildCounterConversion = 0; 108 core.int buildCounterConversion = 0;
110 buildConversion() { 109 buildConversion() {
111 var o = new api.Conversion(); 110 var o = new api.Conversion();
112 buildCounterConversion++; 111 buildCounterConversion++;
113 if (buildCounterConversion < 3) { 112 if (buildCounterConversion < 3) {
114 o.adGroupId = "foo"; 113 o.adGroupId = "foo";
115 o.adId = "foo"; 114 o.adId = "foo";
116 o.advertiserId = "foo"; 115 o.advertiserId = "foo";
117 o.agencyId = "foo"; 116 o.agencyId = "foo";
118 o.attributionModel = "foo"; 117 o.attributionModel = "foo";
119 o.campaignId = "foo"; 118 o.campaignId = "foo";
120 o.channel = "foo"; 119 o.channel = "foo";
121 o.clickId = "foo"; 120 o.clickId = "foo";
122 o.conversionId = "foo"; 121 o.conversionId = "foo";
123 o.conversionModifiedTimestamp = "foo"; 122 o.conversionModifiedTimestamp = "foo";
124 o.conversionTimestamp = "foo"; 123 o.conversionTimestamp = "foo";
125 o.countMillis = "foo"; 124 o.countMillis = "foo";
126 o.criterionId = "foo"; 125 o.criterionId = "foo";
127 o.currencyCode = "foo"; 126 o.currencyCode = "foo";
128 o.customDimension = buildUnnamed1443(); 127 o.customDimension = buildUnnamed1433();
129 o.customMetric = buildUnnamed1444(); 128 o.customMetric = buildUnnamed1434();
130 o.deviceType = "foo"; 129 o.deviceType = "foo";
131 o.dsConversionId = "foo"; 130 o.dsConversionId = "foo";
132 o.engineAccountId = "foo"; 131 o.engineAccountId = "foo";
133 o.floodlightOrderId = "foo"; 132 o.floodlightOrderId = "foo";
134 o.inventoryAccountId = "foo"; 133 o.inventoryAccountId = "foo";
135 o.productCountry = "foo"; 134 o.productCountry = "foo";
136 o.productGroupId = "foo"; 135 o.productGroupId = "foo";
137 o.productId = "foo"; 136 o.productId = "foo";
138 o.productLanguage = "foo"; 137 o.productLanguage = "foo";
139 o.quantityMillis = "foo"; 138 o.quantityMillis = "foo";
(...skipping 19 matching lines...) Expand all
159 unittest.expect(o.attributionModel, unittest.equals('foo')); 158 unittest.expect(o.attributionModel, unittest.equals('foo'));
160 unittest.expect(o.campaignId, unittest.equals('foo')); 159 unittest.expect(o.campaignId, unittest.equals('foo'));
161 unittest.expect(o.channel, unittest.equals('foo')); 160 unittest.expect(o.channel, unittest.equals('foo'));
162 unittest.expect(o.clickId, unittest.equals('foo')); 161 unittest.expect(o.clickId, unittest.equals('foo'));
163 unittest.expect(o.conversionId, unittest.equals('foo')); 162 unittest.expect(o.conversionId, unittest.equals('foo'));
164 unittest.expect(o.conversionModifiedTimestamp, unittest.equals('foo')); 163 unittest.expect(o.conversionModifiedTimestamp, unittest.equals('foo'));
165 unittest.expect(o.conversionTimestamp, unittest.equals('foo')); 164 unittest.expect(o.conversionTimestamp, unittest.equals('foo'));
166 unittest.expect(o.countMillis, unittest.equals('foo')); 165 unittest.expect(o.countMillis, unittest.equals('foo'));
167 unittest.expect(o.criterionId, unittest.equals('foo')); 166 unittest.expect(o.criterionId, unittest.equals('foo'));
168 unittest.expect(o.currencyCode, unittest.equals('foo')); 167 unittest.expect(o.currencyCode, unittest.equals('foo'));
169 checkUnnamed1443(o.customDimension); 168 checkUnnamed1433(o.customDimension);
170 checkUnnamed1444(o.customMetric); 169 checkUnnamed1434(o.customMetric);
171 unittest.expect(o.deviceType, unittest.equals('foo')); 170 unittest.expect(o.deviceType, unittest.equals('foo'));
172 unittest.expect(o.dsConversionId, unittest.equals('foo')); 171 unittest.expect(o.dsConversionId, unittest.equals('foo'));
173 unittest.expect(o.engineAccountId, unittest.equals('foo')); 172 unittest.expect(o.engineAccountId, unittest.equals('foo'));
174 unittest.expect(o.floodlightOrderId, unittest.equals('foo')); 173 unittest.expect(o.floodlightOrderId, unittest.equals('foo'));
175 unittest.expect(o.inventoryAccountId, unittest.equals('foo')); 174 unittest.expect(o.inventoryAccountId, unittest.equals('foo'));
176 unittest.expect(o.productCountry, unittest.equals('foo')); 175 unittest.expect(o.productCountry, unittest.equals('foo'));
177 unittest.expect(o.productGroupId, unittest.equals('foo')); 176 unittest.expect(o.productGroupId, unittest.equals('foo'));
178 unittest.expect(o.productId, unittest.equals('foo')); 177 unittest.expect(o.productId, unittest.equals('foo'));
179 unittest.expect(o.productLanguage, unittest.equals('foo')); 178 unittest.expect(o.productLanguage, unittest.equals('foo'));
180 unittest.expect(o.quantityMillis, unittest.equals('foo')); 179 unittest.expect(o.quantityMillis, unittest.equals('foo'));
181 unittest.expect(o.revenueMicros, unittest.equals('foo')); 180 unittest.expect(o.revenueMicros, unittest.equals('foo'));
182 unittest.expect(o.segmentationId, unittest.equals('foo')); 181 unittest.expect(o.segmentationId, unittest.equals('foo'));
183 unittest.expect(o.segmentationName, unittest.equals('foo')); 182 unittest.expect(o.segmentationName, unittest.equals('foo'));
184 unittest.expect(o.segmentationType, unittest.equals('foo')); 183 unittest.expect(o.segmentationType, unittest.equals('foo'));
185 unittest.expect(o.state, unittest.equals('foo')); 184 unittest.expect(o.state, unittest.equals('foo'));
186 unittest.expect(o.storeId, unittest.equals('foo')); 185 unittest.expect(o.storeId, unittest.equals('foo'));
187 unittest.expect(o.type, unittest.equals('foo')); 186 unittest.expect(o.type, unittest.equals('foo'));
188 } 187 }
189 buildCounterConversion--; 188 buildCounterConversion--;
190 } 189 }
191 190
192 buildUnnamed1445() { 191 buildUnnamed1435() {
193 var o = new core.List<api.Conversion>(); 192 var o = new core.List<api.Conversion>();
194 o.add(buildConversion()); 193 o.add(buildConversion());
195 o.add(buildConversion()); 194 o.add(buildConversion());
196 return o; 195 return o;
197 } 196 }
198 197
199 checkUnnamed1445(core.List<api.Conversion> o) { 198 checkUnnamed1435(core.List<api.Conversion> o) {
200 unittest.expect(o, unittest.hasLength(2)); 199 unittest.expect(o, unittest.hasLength(2));
201 checkConversion(o[0]); 200 checkConversion(o[0]);
202 checkConversion(o[1]); 201 checkConversion(o[1]);
203 } 202 }
204 203
205 core.int buildCounterConversionList = 0; 204 core.int buildCounterConversionList = 0;
206 buildConversionList() { 205 buildConversionList() {
207 var o = new api.ConversionList(); 206 var o = new api.ConversionList();
208 buildCounterConversionList++; 207 buildCounterConversionList++;
209 if (buildCounterConversionList < 3) { 208 if (buildCounterConversionList < 3) {
210 o.conversion = buildUnnamed1445(); 209 o.conversion = buildUnnamed1435();
211 o.kind = "foo"; 210 o.kind = "foo";
212 } 211 }
213 buildCounterConversionList--; 212 buildCounterConversionList--;
214 return o; 213 return o;
215 } 214 }
216 215
217 checkConversionList(api.ConversionList o) { 216 checkConversionList(api.ConversionList o) {
218 buildCounterConversionList++; 217 buildCounterConversionList++;
219 if (buildCounterConversionList < 3) { 218 if (buildCounterConversionList < 3) {
220 checkUnnamed1445(o.conversion); 219 checkUnnamed1435(o.conversion);
221 unittest.expect(o.kind, unittest.equals('foo')); 220 unittest.expect(o.kind, unittest.equals('foo'));
222 } 221 }
223 buildCounterConversionList--; 222 buildCounterConversionList--;
224 } 223 }
225 224
226 core.int buildCounterCustomDimension = 0; 225 core.int buildCounterCustomDimension = 0;
227 buildCustomDimension() { 226 buildCustomDimension() {
228 var o = new api.CustomDimension(); 227 var o = new api.CustomDimension();
229 buildCounterCustomDimension++; 228 buildCounterCustomDimension++;
230 if (buildCounterCustomDimension < 3) { 229 if (buildCounterCustomDimension < 3) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 278
280 checkReportFiles(api.ReportFiles o) { 279 checkReportFiles(api.ReportFiles o) {
281 buildCounterReportFiles++; 280 buildCounterReportFiles++;
282 if (buildCounterReportFiles < 3) { 281 if (buildCounterReportFiles < 3) {
283 unittest.expect(o.byteCount, unittest.equals('foo')); 282 unittest.expect(o.byteCount, unittest.equals('foo'));
284 unittest.expect(o.url, unittest.equals('foo')); 283 unittest.expect(o.url, unittest.equals('foo'));
285 } 284 }
286 buildCounterReportFiles--; 285 buildCounterReportFiles--;
287 } 286 }
288 287
289 buildUnnamed1446() { 288 buildUnnamed1436() {
290 var o = new core.List<api.ReportFiles>(); 289 var o = new core.List<api.ReportFiles>();
291 o.add(buildReportFiles()); 290 o.add(buildReportFiles());
292 o.add(buildReportFiles()); 291 o.add(buildReportFiles());
293 return o; 292 return o;
294 } 293 }
295 294
296 checkUnnamed1446(core.List<api.ReportFiles> o) { 295 checkUnnamed1436(core.List<api.ReportFiles> o) {
297 unittest.expect(o, unittest.hasLength(2)); 296 unittest.expect(o, unittest.hasLength(2));
298 checkReportFiles(o[0]); 297 checkReportFiles(o[0]);
299 checkReportFiles(o[1]); 298 checkReportFiles(o[1]);
300 } 299 }
301 300
302 buildUnnamed1447() { 301 buildUnnamed1437() {
303 var o = new core.List<api.ReportRow>(); 302 var o = new core.List<api.ReportRow>();
304 o.add(buildReportRow()); 303 o.add(buildReportRow());
305 o.add(buildReportRow()); 304 o.add(buildReportRow());
306 return o; 305 return o;
307 } 306 }
308 307
309 checkUnnamed1447(core.List<api.ReportRow> o) { 308 checkUnnamed1437(core.List<api.ReportRow> o) {
310 unittest.expect(o, unittest.hasLength(2)); 309 unittest.expect(o, unittest.hasLength(2));
311 checkReportRow(o[0]); 310 checkReportRow(o[0]);
312 checkReportRow(o[1]); 311 checkReportRow(o[1]);
313 } 312 }
314 313
315 core.int buildCounterReport = 0; 314 core.int buildCounterReport = 0;
316 buildReport() { 315 buildReport() {
317 var o = new api.Report(); 316 var o = new api.Report();
318 buildCounterReport++; 317 buildCounterReport++;
319 if (buildCounterReport < 3) { 318 if (buildCounterReport < 3) {
320 o.files = buildUnnamed1446(); 319 o.files = buildUnnamed1436();
321 o.id = "foo"; 320 o.id = "foo";
322 o.isReportReady = true; 321 o.isReportReady = true;
323 o.kind = "foo"; 322 o.kind = "foo";
324 o.request = buildReportRequest(); 323 o.request = buildReportRequest();
325 o.rowCount = 42; 324 o.rowCount = 42;
326 o.rows = buildUnnamed1447(); 325 o.rows = buildUnnamed1437();
327 o.statisticsCurrencyCode = "foo"; 326 o.statisticsCurrencyCode = "foo";
328 o.statisticsTimeZone = "foo"; 327 o.statisticsTimeZone = "foo";
329 } 328 }
330 buildCounterReport--; 329 buildCounterReport--;
331 return o; 330 return o;
332 } 331 }
333 332
334 checkReport(api.Report o) { 333 checkReport(api.Report o) {
335 buildCounterReport++; 334 buildCounterReport++;
336 if (buildCounterReport < 3) { 335 if (buildCounterReport < 3) {
337 checkUnnamed1446(o.files); 336 checkUnnamed1436(o.files);
338 unittest.expect(o.id, unittest.equals('foo')); 337 unittest.expect(o.id, unittest.equals('foo'));
339 unittest.expect(o.isReportReady, unittest.isTrue); 338 unittest.expect(o.isReportReady, unittest.isTrue);
340 unittest.expect(o.kind, unittest.equals('foo')); 339 unittest.expect(o.kind, unittest.equals('foo'));
341 checkReportRequest(o.request); 340 checkReportRequest(o.request);
342 unittest.expect(o.rowCount, unittest.equals(42)); 341 unittest.expect(o.rowCount, unittest.equals(42));
343 checkUnnamed1447(o.rows); 342 checkUnnamed1437(o.rows);
344 unittest.expect(o.statisticsCurrencyCode, unittest.equals('foo')); 343 unittest.expect(o.statisticsCurrencyCode, unittest.equals('foo'));
345 unittest.expect(o.statisticsTimeZone, unittest.equals('foo')); 344 unittest.expect(o.statisticsTimeZone, unittest.equals('foo'));
346 } 345 }
347 buildCounterReport--; 346 buildCounterReport--;
348 } 347 }
349 348
350 core.int buildCounterReportApiColumnSpec = 0; 349 core.int buildCounterReportApiColumnSpec = 0;
351 buildReportApiColumnSpec() { 350 buildReportApiColumnSpec() {
352 var o = new api.ReportApiColumnSpec(); 351 var o = new api.ReportApiColumnSpec();
353 buildCounterReportApiColumnSpec++; 352 buildCounterReportApiColumnSpec++;
(...skipping 23 matching lines...) Expand all
377 unittest.expect(o.groupByColumn, unittest.isTrue); 376 unittest.expect(o.groupByColumn, unittest.isTrue);
378 unittest.expect(o.headerText, unittest.equals('foo')); 377 unittest.expect(o.headerText, unittest.equals('foo'));
379 unittest.expect(o.platformSource, unittest.equals('foo')); 378 unittest.expect(o.platformSource, unittest.equals('foo'));
380 unittest.expect(o.productReportPerspective, unittest.equals('foo')); 379 unittest.expect(o.productReportPerspective, unittest.equals('foo'));
381 unittest.expect(o.savedColumnName, unittest.equals('foo')); 380 unittest.expect(o.savedColumnName, unittest.equals('foo'));
382 unittest.expect(o.startDate, unittest.equals('foo')); 381 unittest.expect(o.startDate, unittest.equals('foo'));
383 } 382 }
384 buildCounterReportApiColumnSpec--; 383 buildCounterReportApiColumnSpec--;
385 } 384 }
386 385
387 buildUnnamed1448() { 386 buildUnnamed1438() {
388 var o = new core.List<api.ReportApiColumnSpec>(); 387 var o = new core.List<api.ReportApiColumnSpec>();
389 o.add(buildReportApiColumnSpec()); 388 o.add(buildReportApiColumnSpec());
390 o.add(buildReportApiColumnSpec()); 389 o.add(buildReportApiColumnSpec());
391 return o; 390 return o;
392 } 391 }
393 392
394 checkUnnamed1448(core.List<api.ReportApiColumnSpec> o) { 393 checkUnnamed1438(core.List<api.ReportApiColumnSpec> o) {
395 unittest.expect(o, unittest.hasLength(2)); 394 unittest.expect(o, unittest.hasLength(2));
396 checkReportApiColumnSpec(o[0]); 395 checkReportApiColumnSpec(o[0]);
397 checkReportApiColumnSpec(o[1]); 396 checkReportApiColumnSpec(o[1]);
398 } 397 }
399 398
400 buildUnnamed1449() { 399 buildUnnamed1439() {
401 var o = new core.List<core.Object>(); 400 var o = new core.List<core.Object>();
402 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 401 o.add({
403 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 402 'list': [1, 2, 3],
403 'bool': true,
404 'string': 'foo'
405 });
406 o.add({
407 'list': [1, 2, 3],
408 'bool': true,
409 'string': 'foo'
410 });
404 return o; 411 return o;
405 } 412 }
406 413
407 checkUnnamed1449(core.List<core.Object> o) { 414 checkUnnamed1439(core.List<core.Object> o) {
408 unittest.expect(o, unittest.hasLength(2)); 415 unittest.expect(o, unittest.hasLength(2));
409 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')); 416 var casted1 = (o[0]) as core.Map;
410 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')); 417 unittest.expect(casted1, unittest.hasLength(3));
418 unittest.expect(casted1["list"], unittest.equals([1, 2, 3]));
419 unittest.expect(casted1["bool"], unittest.equals(true));
420 unittest.expect(casted1["string"], unittest.equals('foo'));
421 var casted2 = (o[1]) as core.Map;
422 unittest.expect(casted2, unittest.hasLength(3));
423 unittest.expect(casted2["list"], unittest.equals([1, 2, 3]));
424 unittest.expect(casted2["bool"], unittest.equals(true));
425 unittest.expect(casted2["string"], unittest.equals('foo'));
411 } 426 }
412 427
413 core.int buildCounterReportRequestFilters = 0; 428 core.int buildCounterReportRequestFilters = 0;
414 buildReportRequestFilters() { 429 buildReportRequestFilters() {
415 var o = new api.ReportRequestFilters(); 430 var o = new api.ReportRequestFilters();
416 buildCounterReportRequestFilters++; 431 buildCounterReportRequestFilters++;
417 if (buildCounterReportRequestFilters < 3) { 432 if (buildCounterReportRequestFilters < 3) {
418 o.column = buildReportApiColumnSpec(); 433 o.column = buildReportApiColumnSpec();
419 o.operator = "foo"; 434 o.operator = "foo";
420 o.values = buildUnnamed1449(); 435 o.values = buildUnnamed1439();
421 } 436 }
422 buildCounterReportRequestFilters--; 437 buildCounterReportRequestFilters--;
423 return o; 438 return o;
424 } 439 }
425 440
426 checkReportRequestFilters(api.ReportRequestFilters o) { 441 checkReportRequestFilters(api.ReportRequestFilters o) {
427 buildCounterReportRequestFilters++; 442 buildCounterReportRequestFilters++;
428 if (buildCounterReportRequestFilters < 3) { 443 if (buildCounterReportRequestFilters < 3) {
429 checkReportApiColumnSpec(o.column); 444 checkReportApiColumnSpec(o.column);
430 unittest.expect(o.operator, unittest.equals('foo')); 445 unittest.expect(o.operator, unittest.equals('foo'));
431 checkUnnamed1449(o.values); 446 checkUnnamed1439(o.values);
432 } 447 }
433 buildCounterReportRequestFilters--; 448 buildCounterReportRequestFilters--;
434 } 449 }
435 450
436 buildUnnamed1450() { 451 buildUnnamed1440() {
437 var o = new core.List<api.ReportRequestFilters>(); 452 var o = new core.List<api.ReportRequestFilters>();
438 o.add(buildReportRequestFilters()); 453 o.add(buildReportRequestFilters());
439 o.add(buildReportRequestFilters()); 454 o.add(buildReportRequestFilters());
440 return o; 455 return o;
441 } 456 }
442 457
443 checkUnnamed1450(core.List<api.ReportRequestFilters> o) { 458 checkUnnamed1440(core.List<api.ReportRequestFilters> o) {
444 unittest.expect(o, unittest.hasLength(2)); 459 unittest.expect(o, unittest.hasLength(2));
445 checkReportRequestFilters(o[0]); 460 checkReportRequestFilters(o[0]);
446 checkReportRequestFilters(o[1]); 461 checkReportRequestFilters(o[1]);
447 } 462 }
448 463
449 core.int buildCounterReportRequestOrderBy = 0; 464 core.int buildCounterReportRequestOrderBy = 0;
450 buildReportRequestOrderBy() { 465 buildReportRequestOrderBy() {
451 var o = new api.ReportRequestOrderBy(); 466 var o = new api.ReportRequestOrderBy();
452 buildCounterReportRequestOrderBy++; 467 buildCounterReportRequestOrderBy++;
453 if (buildCounterReportRequestOrderBy < 3) { 468 if (buildCounterReportRequestOrderBy < 3) {
454 o.column = buildReportApiColumnSpec(); 469 o.column = buildReportApiColumnSpec();
455 o.sortOrder = "foo"; 470 o.sortOrder = "foo";
456 } 471 }
457 buildCounterReportRequestOrderBy--; 472 buildCounterReportRequestOrderBy--;
458 return o; 473 return o;
459 } 474 }
460 475
461 checkReportRequestOrderBy(api.ReportRequestOrderBy o) { 476 checkReportRequestOrderBy(api.ReportRequestOrderBy o) {
462 buildCounterReportRequestOrderBy++; 477 buildCounterReportRequestOrderBy++;
463 if (buildCounterReportRequestOrderBy < 3) { 478 if (buildCounterReportRequestOrderBy < 3) {
464 checkReportApiColumnSpec(o.column); 479 checkReportApiColumnSpec(o.column);
465 unittest.expect(o.sortOrder, unittest.equals('foo')); 480 unittest.expect(o.sortOrder, unittest.equals('foo'));
466 } 481 }
467 buildCounterReportRequestOrderBy--; 482 buildCounterReportRequestOrderBy--;
468 } 483 }
469 484
470 buildUnnamed1451() { 485 buildUnnamed1441() {
471 var o = new core.List<api.ReportRequestOrderBy>(); 486 var o = new core.List<api.ReportRequestOrderBy>();
472 o.add(buildReportRequestOrderBy()); 487 o.add(buildReportRequestOrderBy());
473 o.add(buildReportRequestOrderBy()); 488 o.add(buildReportRequestOrderBy());
474 return o; 489 return o;
475 } 490 }
476 491
477 checkUnnamed1451(core.List<api.ReportRequestOrderBy> o) { 492 checkUnnamed1441(core.List<api.ReportRequestOrderBy> o) {
478 unittest.expect(o, unittest.hasLength(2)); 493 unittest.expect(o, unittest.hasLength(2));
479 checkReportRequestOrderBy(o[0]); 494 checkReportRequestOrderBy(o[0]);
480 checkReportRequestOrderBy(o[1]); 495 checkReportRequestOrderBy(o[1]);
481 } 496 }
482 497
483 core.int buildCounterReportRequestReportScope = 0; 498 core.int buildCounterReportRequestReportScope = 0;
484 buildReportRequestReportScope() { 499 buildReportRequestReportScope() {
485 var o = new api.ReportRequestReportScope(); 500 var o = new api.ReportRequestReportScope();
486 buildCounterReportRequestReportScope++; 501 buildCounterReportRequestReportScope++;
487 if (buildCounterReportRequestReportScope < 3) { 502 if (buildCounterReportRequestReportScope < 3) {
(...skipping 21 matching lines...) Expand all
509 unittest.expect(o.keywordId, unittest.equals('foo')); 524 unittest.expect(o.keywordId, unittest.equals('foo'));
510 } 525 }
511 buildCounterReportRequestReportScope--; 526 buildCounterReportRequestReportScope--;
512 } 527 }
513 528
514 core.int buildCounterReportRequestTimeRange = 0; 529 core.int buildCounterReportRequestTimeRange = 0;
515 buildReportRequestTimeRange() { 530 buildReportRequestTimeRange() {
516 var o = new api.ReportRequestTimeRange(); 531 var o = new api.ReportRequestTimeRange();
517 buildCounterReportRequestTimeRange++; 532 buildCounterReportRequestTimeRange++;
518 if (buildCounterReportRequestTimeRange < 3) { 533 if (buildCounterReportRequestTimeRange < 3) {
519 o.changedAttributesSinceTimestamp = core.DateTime.parse("2002-02-27T14:01:02 "); 534 o.changedAttributesSinceTimestamp =
535 core.DateTime.parse("2002-02-27T14:01:02");
520 o.changedMetricsSinceTimestamp = core.DateTime.parse("2002-02-27T14:01:02"); 536 o.changedMetricsSinceTimestamp = core.DateTime.parse("2002-02-27T14:01:02");
521 o.endDate = "foo"; 537 o.endDate = "foo";
522 o.startDate = "foo"; 538 o.startDate = "foo";
523 } 539 }
524 buildCounterReportRequestTimeRange--; 540 buildCounterReportRequestTimeRange--;
525 return o; 541 return o;
526 } 542 }
527 543
528 checkReportRequestTimeRange(api.ReportRequestTimeRange o) { 544 checkReportRequestTimeRange(api.ReportRequestTimeRange o) {
529 buildCounterReportRequestTimeRange++; 545 buildCounterReportRequestTimeRange++;
530 if (buildCounterReportRequestTimeRange < 3) { 546 if (buildCounterReportRequestTimeRange < 3) {
531 unittest.expect(o.changedAttributesSinceTimestamp, unittest.equals(core.Date Time.parse("2002-02-27T14:01:02"))); 547 unittest.expect(o.changedAttributesSinceTimestamp,
532 unittest.expect(o.changedMetricsSinceTimestamp, unittest.equals(core.DateTim e.parse("2002-02-27T14:01:02"))); 548 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02")));
549 unittest.expect(o.changedMetricsSinceTimestamp,
550 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02")));
533 unittest.expect(o.endDate, unittest.equals('foo')); 551 unittest.expect(o.endDate, unittest.equals('foo'));
534 unittest.expect(o.startDate, unittest.equals('foo')); 552 unittest.expect(o.startDate, unittest.equals('foo'));
535 } 553 }
536 buildCounterReportRequestTimeRange--; 554 buildCounterReportRequestTimeRange--;
537 } 555 }
538 556
539 core.int buildCounterReportRequest = 0; 557 core.int buildCounterReportRequest = 0;
540 buildReportRequest() { 558 buildReportRequest() {
541 var o = new api.ReportRequest(); 559 var o = new api.ReportRequest();
542 buildCounterReportRequest++; 560 buildCounterReportRequest++;
543 if (buildCounterReportRequest < 3) { 561 if (buildCounterReportRequest < 3) {
544 o.columns = buildUnnamed1448(); 562 o.columns = buildUnnamed1438();
545 o.downloadFormat = "foo"; 563 o.downloadFormat = "foo";
546 o.filters = buildUnnamed1450(); 564 o.filters = buildUnnamed1440();
547 o.includeDeletedEntities = true; 565 o.includeDeletedEntities = true;
548 o.includeRemovedEntities = true; 566 o.includeRemovedEntities = true;
549 o.maxRowsPerFile = 42; 567 o.maxRowsPerFile = 42;
550 o.orderBy = buildUnnamed1451(); 568 o.orderBy = buildUnnamed1441();
551 o.reportScope = buildReportRequestReportScope(); 569 o.reportScope = buildReportRequestReportScope();
552 o.reportType = "foo"; 570 o.reportType = "foo";
553 o.rowCount = 42; 571 o.rowCount = 42;
554 o.startRow = 42; 572 o.startRow = 42;
555 o.statisticsCurrency = "foo"; 573 o.statisticsCurrency = "foo";
556 o.timeRange = buildReportRequestTimeRange(); 574 o.timeRange = buildReportRequestTimeRange();
557 o.verifySingleTimeZone = true; 575 o.verifySingleTimeZone = true;
558 } 576 }
559 buildCounterReportRequest--; 577 buildCounterReportRequest--;
560 return o; 578 return o;
561 } 579 }
562 580
563 checkReportRequest(api.ReportRequest o) { 581 checkReportRequest(api.ReportRequest o) {
564 buildCounterReportRequest++; 582 buildCounterReportRequest++;
565 if (buildCounterReportRequest < 3) { 583 if (buildCounterReportRequest < 3) {
566 checkUnnamed1448(o.columns); 584 checkUnnamed1438(o.columns);
567 unittest.expect(o.downloadFormat, unittest.equals('foo')); 585 unittest.expect(o.downloadFormat, unittest.equals('foo'));
568 checkUnnamed1450(o.filters); 586 checkUnnamed1440(o.filters);
569 unittest.expect(o.includeDeletedEntities, unittest.isTrue); 587 unittest.expect(o.includeDeletedEntities, unittest.isTrue);
570 unittest.expect(o.includeRemovedEntities, unittest.isTrue); 588 unittest.expect(o.includeRemovedEntities, unittest.isTrue);
571 unittest.expect(o.maxRowsPerFile, unittest.equals(42)); 589 unittest.expect(o.maxRowsPerFile, unittest.equals(42));
572 checkUnnamed1451(o.orderBy); 590 checkUnnamed1441(o.orderBy);
573 checkReportRequestReportScope(o.reportScope); 591 checkReportRequestReportScope(o.reportScope);
574 unittest.expect(o.reportType, unittest.equals('foo')); 592 unittest.expect(o.reportType, unittest.equals('foo'));
575 unittest.expect(o.rowCount, unittest.equals(42)); 593 unittest.expect(o.rowCount, unittest.equals(42));
576 unittest.expect(o.startRow, unittest.equals(42)); 594 unittest.expect(o.startRow, unittest.equals(42));
577 unittest.expect(o.statisticsCurrency, unittest.equals('foo')); 595 unittest.expect(o.statisticsCurrency, unittest.equals('foo'));
578 checkReportRequestTimeRange(o.timeRange); 596 checkReportRequestTimeRange(o.timeRange);
579 unittest.expect(o.verifySingleTimeZone, unittest.isTrue); 597 unittest.expect(o.verifySingleTimeZone, unittest.isTrue);
580 } 598 }
581 buildCounterReportRequest--; 599 buildCounterReportRequest--;
582 } 600 }
583 601
584 buildReportRow() { 602 buildReportRow() {
585 var o = new api.ReportRow(); 603 var o = new api.ReportRow();
586 o["a"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 604 o["a"] = {
587 o["b"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 605 'list': [1, 2, 3],
606 'bool': true,
607 'string': 'foo'
608 };
609 o["b"] = {
610 'list': [1, 2, 3],
611 'bool': true,
612 'string': 'foo'
613 };
588 return o; 614 return o;
589 } 615 }
590 616
591 checkReportRow(api.ReportRow o) { 617 checkReportRow(api.ReportRow o) {
592 unittest.expect(o, unittest.hasLength(2)); 618 unittest.expect(o, unittest.hasLength(2));
593 var casted3 = (o["a"]) as core.Map; unittest.expect(casted3, unittest.hasLengt h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); 619 var casted3 = (o["a"]) as core.Map;
594 var casted4 = (o["b"]) as core.Map; unittest.expect(casted4, unittest.hasLengt h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); 620 unittest.expect(casted3, unittest.hasLength(3));
621 unittest.expect(casted3["list"], unittest.equals([1, 2, 3]));
622 unittest.expect(casted3["bool"], unittest.equals(true));
623 unittest.expect(casted3["string"], unittest.equals('foo'));
624 var casted4 = (o["b"]) as core.Map;
625 unittest.expect(casted4, unittest.hasLength(3));
626 unittest.expect(casted4["list"], unittest.equals([1, 2, 3]));
627 unittest.expect(casted4["bool"], unittest.equals(true));
628 unittest.expect(casted4["string"], unittest.equals('foo'));
595 } 629 }
596 630
597 core.int buildCounterSavedColumn = 0; 631 core.int buildCounterSavedColumn = 0;
598 buildSavedColumn() { 632 buildSavedColumn() {
599 var o = new api.SavedColumn(); 633 var o = new api.SavedColumn();
600 buildCounterSavedColumn++; 634 buildCounterSavedColumn++;
601 if (buildCounterSavedColumn < 3) { 635 if (buildCounterSavedColumn < 3) {
602 o.kind = "foo"; 636 o.kind = "foo";
603 o.savedColumnName = "foo"; 637 o.savedColumnName = "foo";
604 o.type = "foo"; 638 o.type = "foo";
605 } 639 }
606 buildCounterSavedColumn--; 640 buildCounterSavedColumn--;
607 return o; 641 return o;
608 } 642 }
609 643
610 checkSavedColumn(api.SavedColumn o) { 644 checkSavedColumn(api.SavedColumn o) {
611 buildCounterSavedColumn++; 645 buildCounterSavedColumn++;
612 if (buildCounterSavedColumn < 3) { 646 if (buildCounterSavedColumn < 3) {
613 unittest.expect(o.kind, unittest.equals('foo')); 647 unittest.expect(o.kind, unittest.equals('foo'));
614 unittest.expect(o.savedColumnName, unittest.equals('foo')); 648 unittest.expect(o.savedColumnName, unittest.equals('foo'));
615 unittest.expect(o.type, unittest.equals('foo')); 649 unittest.expect(o.type, unittest.equals('foo'));
616 } 650 }
617 buildCounterSavedColumn--; 651 buildCounterSavedColumn--;
618 } 652 }
619 653
620 buildUnnamed1452() { 654 buildUnnamed1442() {
621 var o = new core.List<api.SavedColumn>(); 655 var o = new core.List<api.SavedColumn>();
622 o.add(buildSavedColumn()); 656 o.add(buildSavedColumn());
623 o.add(buildSavedColumn()); 657 o.add(buildSavedColumn());
624 return o; 658 return o;
625 } 659 }
626 660
627 checkUnnamed1452(core.List<api.SavedColumn> o) { 661 checkUnnamed1442(core.List<api.SavedColumn> o) {
628 unittest.expect(o, unittest.hasLength(2)); 662 unittest.expect(o, unittest.hasLength(2));
629 checkSavedColumn(o[0]); 663 checkSavedColumn(o[0]);
630 checkSavedColumn(o[1]); 664 checkSavedColumn(o[1]);
631 } 665 }
632 666
633 core.int buildCounterSavedColumnList = 0; 667 core.int buildCounterSavedColumnList = 0;
634 buildSavedColumnList() { 668 buildSavedColumnList() {
635 var o = new api.SavedColumnList(); 669 var o = new api.SavedColumnList();
636 buildCounterSavedColumnList++; 670 buildCounterSavedColumnList++;
637 if (buildCounterSavedColumnList < 3) { 671 if (buildCounterSavedColumnList < 3) {
638 o.items = buildUnnamed1452(); 672 o.items = buildUnnamed1442();
639 o.kind = "foo"; 673 o.kind = "foo";
640 } 674 }
641 buildCounterSavedColumnList--; 675 buildCounterSavedColumnList--;
642 return o; 676 return o;
643 } 677 }
644 678
645 checkSavedColumnList(api.SavedColumnList o) { 679 checkSavedColumnList(api.SavedColumnList o) {
646 buildCounterSavedColumnList++; 680 buildCounterSavedColumnList++;
647 if (buildCounterSavedColumnList < 3) { 681 if (buildCounterSavedColumnList < 3) {
648 checkUnnamed1452(o.items); 682 checkUnnamed1442(o.items);
649 unittest.expect(o.kind, unittest.equals('foo')); 683 unittest.expect(o.kind, unittest.equals('foo'));
650 } 684 }
651 buildCounterSavedColumnList--; 685 buildCounterSavedColumnList--;
652 } 686 }
653 687
654 buildUnnamed1453() { 688 buildUnnamed1443() {
655 var o = new core.List<api.Availability>(); 689 var o = new core.List<api.Availability>();
656 o.add(buildAvailability()); 690 o.add(buildAvailability());
657 o.add(buildAvailability()); 691 o.add(buildAvailability());
658 return o; 692 return o;
659 } 693 }
660 694
661 checkUnnamed1453(core.List<api.Availability> o) { 695 checkUnnamed1443(core.List<api.Availability> o) {
662 unittest.expect(o, unittest.hasLength(2)); 696 unittest.expect(o, unittest.hasLength(2));
663 checkAvailability(o[0]); 697 checkAvailability(o[0]);
664 checkAvailability(o[1]); 698 checkAvailability(o[1]);
665 } 699 }
666 700
667 core.int buildCounterUpdateAvailabilityRequest = 0; 701 core.int buildCounterUpdateAvailabilityRequest = 0;
668 buildUpdateAvailabilityRequest() { 702 buildUpdateAvailabilityRequest() {
669 var o = new api.UpdateAvailabilityRequest(); 703 var o = new api.UpdateAvailabilityRequest();
670 buildCounterUpdateAvailabilityRequest++; 704 buildCounterUpdateAvailabilityRequest++;
671 if (buildCounterUpdateAvailabilityRequest < 3) { 705 if (buildCounterUpdateAvailabilityRequest < 3) {
672 o.availabilities = buildUnnamed1453(); 706 o.availabilities = buildUnnamed1443();
673 } 707 }
674 buildCounterUpdateAvailabilityRequest--; 708 buildCounterUpdateAvailabilityRequest--;
675 return o; 709 return o;
676 } 710 }
677 711
678 checkUpdateAvailabilityRequest(api.UpdateAvailabilityRequest o) { 712 checkUpdateAvailabilityRequest(api.UpdateAvailabilityRequest o) {
679 buildCounterUpdateAvailabilityRequest++; 713 buildCounterUpdateAvailabilityRequest++;
680 if (buildCounterUpdateAvailabilityRequest < 3) { 714 if (buildCounterUpdateAvailabilityRequest < 3) {
681 checkUnnamed1453(o.availabilities); 715 checkUnnamed1443(o.availabilities);
682 } 716 }
683 buildCounterUpdateAvailabilityRequest--; 717 buildCounterUpdateAvailabilityRequest--;
684 } 718 }
685 719
686 buildUnnamed1454() { 720 buildUnnamed1444() {
687 var o = new core.List<api.Availability>(); 721 var o = new core.List<api.Availability>();
688 o.add(buildAvailability()); 722 o.add(buildAvailability());
689 o.add(buildAvailability()); 723 o.add(buildAvailability());
690 return o; 724 return o;
691 } 725 }
692 726
693 checkUnnamed1454(core.List<api.Availability> o) { 727 checkUnnamed1444(core.List<api.Availability> o) {
694 unittest.expect(o, unittest.hasLength(2)); 728 unittest.expect(o, unittest.hasLength(2));
695 checkAvailability(o[0]); 729 checkAvailability(o[0]);
696 checkAvailability(o[1]); 730 checkAvailability(o[1]);
697 } 731 }
698 732
699 core.int buildCounterUpdateAvailabilityResponse = 0; 733 core.int buildCounterUpdateAvailabilityResponse = 0;
700 buildUpdateAvailabilityResponse() { 734 buildUpdateAvailabilityResponse() {
701 var o = new api.UpdateAvailabilityResponse(); 735 var o = new api.UpdateAvailabilityResponse();
702 buildCounterUpdateAvailabilityResponse++; 736 buildCounterUpdateAvailabilityResponse++;
703 if (buildCounterUpdateAvailabilityResponse < 3) { 737 if (buildCounterUpdateAvailabilityResponse < 3) {
704 o.availabilities = buildUnnamed1454(); 738 o.availabilities = buildUnnamed1444();
705 } 739 }
706 buildCounterUpdateAvailabilityResponse--; 740 buildCounterUpdateAvailabilityResponse--;
707 return o; 741 return o;
708 } 742 }
709 743
710 checkUpdateAvailabilityResponse(api.UpdateAvailabilityResponse o) { 744 checkUpdateAvailabilityResponse(api.UpdateAvailabilityResponse o) {
711 buildCounterUpdateAvailabilityResponse++; 745 buildCounterUpdateAvailabilityResponse++;
712 if (buildCounterUpdateAvailabilityResponse < 3) { 746 if (buildCounterUpdateAvailabilityResponse < 3) {
713 checkUnnamed1454(o.availabilities); 747 checkUnnamed1444(o.availabilities);
714 } 748 }
715 buildCounterUpdateAvailabilityResponse--; 749 buildCounterUpdateAvailabilityResponse--;
716 } 750 }
717 751
718
719 main() { 752 main() {
720 unittest.group("obj-schema-Availability", () { 753 unittest.group("obj-schema-Availability", () {
721 unittest.test("to-json--from-json", () { 754 unittest.test("to-json--from-json", () {
722 var o = buildAvailability(); 755 var o = buildAvailability();
723 var od = new api.Availability.fromJson(o.toJson()); 756 var od = new api.Availability.fromJson(o.toJson());
724 checkAvailability(od); 757 checkAvailability(od);
725 }); 758 });
726 }); 759 });
727 760
728
729 unittest.group("obj-schema-Conversion", () { 761 unittest.group("obj-schema-Conversion", () {
730 unittest.test("to-json--from-json", () { 762 unittest.test("to-json--from-json", () {
731 var o = buildConversion(); 763 var o = buildConversion();
732 var od = new api.Conversion.fromJson(o.toJson()); 764 var od = new api.Conversion.fromJson(o.toJson());
733 checkConversion(od); 765 checkConversion(od);
734 }); 766 });
735 }); 767 });
736 768
737
738 unittest.group("obj-schema-ConversionList", () { 769 unittest.group("obj-schema-ConversionList", () {
739 unittest.test("to-json--from-json", () { 770 unittest.test("to-json--from-json", () {
740 var o = buildConversionList(); 771 var o = buildConversionList();
741 var od = new api.ConversionList.fromJson(o.toJson()); 772 var od = new api.ConversionList.fromJson(o.toJson());
742 checkConversionList(od); 773 checkConversionList(od);
743 }); 774 });
744 }); 775 });
745 776
746
747 unittest.group("obj-schema-CustomDimension", () { 777 unittest.group("obj-schema-CustomDimension", () {
748 unittest.test("to-json--from-json", () { 778 unittest.test("to-json--from-json", () {
749 var o = buildCustomDimension(); 779 var o = buildCustomDimension();
750 var od = new api.CustomDimension.fromJson(o.toJson()); 780 var od = new api.CustomDimension.fromJson(o.toJson());
751 checkCustomDimension(od); 781 checkCustomDimension(od);
752 }); 782 });
753 }); 783 });
754 784
755
756 unittest.group("obj-schema-CustomMetric", () { 785 unittest.group("obj-schema-CustomMetric", () {
757 unittest.test("to-json--from-json", () { 786 unittest.test("to-json--from-json", () {
758 var o = buildCustomMetric(); 787 var o = buildCustomMetric();
759 var od = new api.CustomMetric.fromJson(o.toJson()); 788 var od = new api.CustomMetric.fromJson(o.toJson());
760 checkCustomMetric(od); 789 checkCustomMetric(od);
761 }); 790 });
762 }); 791 });
763 792
764
765 unittest.group("obj-schema-ReportFiles", () { 793 unittest.group("obj-schema-ReportFiles", () {
766 unittest.test("to-json--from-json", () { 794 unittest.test("to-json--from-json", () {
767 var o = buildReportFiles(); 795 var o = buildReportFiles();
768 var od = new api.ReportFiles.fromJson(o.toJson()); 796 var od = new api.ReportFiles.fromJson(o.toJson());
769 checkReportFiles(od); 797 checkReportFiles(od);
770 }); 798 });
771 }); 799 });
772 800
773
774 unittest.group("obj-schema-Report", () { 801 unittest.group("obj-schema-Report", () {
775 unittest.test("to-json--from-json", () { 802 unittest.test("to-json--from-json", () {
776 var o = buildReport(); 803 var o = buildReport();
777 var od = new api.Report.fromJson(o.toJson()); 804 var od = new api.Report.fromJson(o.toJson());
778 checkReport(od); 805 checkReport(od);
779 }); 806 });
780 }); 807 });
781 808
782
783 unittest.group("obj-schema-ReportApiColumnSpec", () { 809 unittest.group("obj-schema-ReportApiColumnSpec", () {
784 unittest.test("to-json--from-json", () { 810 unittest.test("to-json--from-json", () {
785 var o = buildReportApiColumnSpec(); 811 var o = buildReportApiColumnSpec();
786 var od = new api.ReportApiColumnSpec.fromJson(o.toJson()); 812 var od = new api.ReportApiColumnSpec.fromJson(o.toJson());
787 checkReportApiColumnSpec(od); 813 checkReportApiColumnSpec(od);
788 }); 814 });
789 }); 815 });
790 816
791
792 unittest.group("obj-schema-ReportRequestFilters", () { 817 unittest.group("obj-schema-ReportRequestFilters", () {
793 unittest.test("to-json--from-json", () { 818 unittest.test("to-json--from-json", () {
794 var o = buildReportRequestFilters(); 819 var o = buildReportRequestFilters();
795 var od = new api.ReportRequestFilters.fromJson(o.toJson()); 820 var od = new api.ReportRequestFilters.fromJson(o.toJson());
796 checkReportRequestFilters(od); 821 checkReportRequestFilters(od);
797 }); 822 });
798 }); 823 });
799 824
800
801 unittest.group("obj-schema-ReportRequestOrderBy", () { 825 unittest.group("obj-schema-ReportRequestOrderBy", () {
802 unittest.test("to-json--from-json", () { 826 unittest.test("to-json--from-json", () {
803 var o = buildReportRequestOrderBy(); 827 var o = buildReportRequestOrderBy();
804 var od = new api.ReportRequestOrderBy.fromJson(o.toJson()); 828 var od = new api.ReportRequestOrderBy.fromJson(o.toJson());
805 checkReportRequestOrderBy(od); 829 checkReportRequestOrderBy(od);
806 }); 830 });
807 }); 831 });
808 832
809
810 unittest.group("obj-schema-ReportRequestReportScope", () { 833 unittest.group("obj-schema-ReportRequestReportScope", () {
811 unittest.test("to-json--from-json", () { 834 unittest.test("to-json--from-json", () {
812 var o = buildReportRequestReportScope(); 835 var o = buildReportRequestReportScope();
813 var od = new api.ReportRequestReportScope.fromJson(o.toJson()); 836 var od = new api.ReportRequestReportScope.fromJson(o.toJson());
814 checkReportRequestReportScope(od); 837 checkReportRequestReportScope(od);
815 }); 838 });
816 }); 839 });
817 840
818
819 unittest.group("obj-schema-ReportRequestTimeRange", () { 841 unittest.group("obj-schema-ReportRequestTimeRange", () {
820 unittest.test("to-json--from-json", () { 842 unittest.test("to-json--from-json", () {
821 var o = buildReportRequestTimeRange(); 843 var o = buildReportRequestTimeRange();
822 var od = new api.ReportRequestTimeRange.fromJson(o.toJson()); 844 var od = new api.ReportRequestTimeRange.fromJson(o.toJson());
823 checkReportRequestTimeRange(od); 845 checkReportRequestTimeRange(od);
824 }); 846 });
825 }); 847 });
826 848
827
828 unittest.group("obj-schema-ReportRequest", () { 849 unittest.group("obj-schema-ReportRequest", () {
829 unittest.test("to-json--from-json", () { 850 unittest.test("to-json--from-json", () {
830 var o = buildReportRequest(); 851 var o = buildReportRequest();
831 var od = new api.ReportRequest.fromJson(o.toJson()); 852 var od = new api.ReportRequest.fromJson(o.toJson());
832 checkReportRequest(od); 853 checkReportRequest(od);
833 }); 854 });
834 }); 855 });
835 856
836
837 unittest.group("obj-schema-ReportRow", () { 857 unittest.group("obj-schema-ReportRow", () {
838 unittest.test("to-json--from-json", () { 858 unittest.test("to-json--from-json", () {
839 var o = buildReportRow(); 859 var o = buildReportRow();
840 var od = new api.ReportRow.fromJson(o.toJson()); 860 var od = new api.ReportRow.fromJson(o.toJson());
841 checkReportRow(od); 861 checkReportRow(od);
842 }); 862 });
843 }); 863 });
844 864
845
846 unittest.group("obj-schema-SavedColumn", () { 865 unittest.group("obj-schema-SavedColumn", () {
847 unittest.test("to-json--from-json", () { 866 unittest.test("to-json--from-json", () {
848 var o = buildSavedColumn(); 867 var o = buildSavedColumn();
849 var od = new api.SavedColumn.fromJson(o.toJson()); 868 var od = new api.SavedColumn.fromJson(o.toJson());
850 checkSavedColumn(od); 869 checkSavedColumn(od);
851 }); 870 });
852 }); 871 });
853 872
854
855 unittest.group("obj-schema-SavedColumnList", () { 873 unittest.group("obj-schema-SavedColumnList", () {
856 unittest.test("to-json--from-json", () { 874 unittest.test("to-json--from-json", () {
857 var o = buildSavedColumnList(); 875 var o = buildSavedColumnList();
858 var od = new api.SavedColumnList.fromJson(o.toJson()); 876 var od = new api.SavedColumnList.fromJson(o.toJson());
859 checkSavedColumnList(od); 877 checkSavedColumnList(od);
860 }); 878 });
861 }); 879 });
862 880
863
864 unittest.group("obj-schema-UpdateAvailabilityRequest", () { 881 unittest.group("obj-schema-UpdateAvailabilityRequest", () {
865 unittest.test("to-json--from-json", () { 882 unittest.test("to-json--from-json", () {
866 var o = buildUpdateAvailabilityRequest(); 883 var o = buildUpdateAvailabilityRequest();
867 var od = new api.UpdateAvailabilityRequest.fromJson(o.toJson()); 884 var od = new api.UpdateAvailabilityRequest.fromJson(o.toJson());
868 checkUpdateAvailabilityRequest(od); 885 checkUpdateAvailabilityRequest(od);
869 }); 886 });
870 }); 887 });
871 888
872
873 unittest.group("obj-schema-UpdateAvailabilityResponse", () { 889 unittest.group("obj-schema-UpdateAvailabilityResponse", () {
874 unittest.test("to-json--from-json", () { 890 unittest.test("to-json--from-json", () {
875 var o = buildUpdateAvailabilityResponse(); 891 var o = buildUpdateAvailabilityResponse();
876 var od = new api.UpdateAvailabilityResponse.fromJson(o.toJson()); 892 var od = new api.UpdateAvailabilityResponse.fromJson(o.toJson());
877 checkUpdateAvailabilityResponse(od); 893 checkUpdateAvailabilityResponse(od);
878 }); 894 });
879 }); 895 });
880 896
881
882 unittest.group("resource-ConversionResourceApi", () { 897 unittest.group("resource-ConversionResourceApi", () {
883 unittest.test("method--get", () { 898 unittest.test("method--get", () {
884
885 var mock = new HttpServerMock(); 899 var mock = new HttpServerMock();
886 api.ConversionResourceApi res = new api.DoubleclicksearchApi(mock).convers ion; 900 api.ConversionResourceApi res =
901 new api.DoubleclicksearchApi(mock).conversion;
887 var arg_agencyId = "foo"; 902 var arg_agencyId = "foo";
888 var arg_advertiserId = "foo"; 903 var arg_advertiserId = "foo";
889 var arg_engineAccountId = "foo"; 904 var arg_engineAccountId = "foo";
890 var arg_endDate = 42; 905 var arg_endDate = 42;
891 var arg_rowCount = 42; 906 var arg_rowCount = 42;
892 var arg_startDate = 42; 907 var arg_startDate = 42;
893 var arg_startRow = 42; 908 var arg_startRow = 42;
894 var arg_adGroupId = "foo"; 909 var arg_adGroupId = "foo";
895 var arg_adId = "foo"; 910 var arg_adId = "foo";
896 var arg_campaignId = "foo"; 911 var arg_campaignId = "foo";
897 var arg_criterionId = "foo"; 912 var arg_criterionId = "foo";
898 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 913 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
899 var path = (req.url).path; 914 var path = (req.url).path;
900 var pathOffset = 0; 915 var pathOffset = 0;
901 var index; 916 var index;
902 var subPart; 917 var subPart;
903 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 918 unittest.expect(
919 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
904 pathOffset += 1; 920 pathOffset += 1;
905 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 921 unittest.expect(path.substring(pathOffset, pathOffset + 21),
922 unittest.equals("doubleclicksearch/v2/"));
906 pathOffset += 21; 923 pathOffset += 21;
907 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("agency/")); 924 unittest.expect(path.substring(pathOffset, pathOffset + 7),
925 unittest.equals("agency/"));
908 pathOffset += 7; 926 pathOffset += 7;
909 index = path.indexOf("/advertiser/", pathOffset); 927 index = path.indexOf("/advertiser/", pathOffset);
910 unittest.expect(index >= 0, unittest.isTrue); 928 unittest.expect(index >= 0, unittest.isTrue);
911 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 929 subPart =
930 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
912 pathOffset = index; 931 pathOffset = index;
913 unittest.expect(subPart, unittest.equals("$arg_agencyId")); 932 unittest.expect(subPart, unittest.equals("$arg_agencyId"));
914 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("/advertiser/")); 933 unittest.expect(path.substring(pathOffset, pathOffset + 12),
934 unittest.equals("/advertiser/"));
915 pathOffset += 12; 935 pathOffset += 12;
916 index = path.indexOf("/engine/", pathOffset); 936 index = path.indexOf("/engine/", pathOffset);
917 unittest.expect(index >= 0, unittest.isTrue); 937 unittest.expect(index >= 0, unittest.isTrue);
918 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 938 subPart =
939 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
919 pathOffset = index; 940 pathOffset = index;
920 unittest.expect(subPart, unittest.equals("$arg_advertiserId")); 941 unittest.expect(subPart, unittest.equals("$arg_advertiserId"));
921 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("/engine/")); 942 unittest.expect(path.substring(pathOffset, pathOffset + 8),
943 unittest.equals("/engine/"));
922 pathOffset += 8; 944 pathOffset += 8;
923 index = path.indexOf("/conversion", pathOffset); 945 index = path.indexOf("/conversion", pathOffset);
924 unittest.expect(index >= 0, unittest.isTrue); 946 unittest.expect(index >= 0, unittest.isTrue);
925 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 947 subPart =
948 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
926 pathOffset = index; 949 pathOffset = index;
927 unittest.expect(subPart, unittest.equals("$arg_engineAccountId")); 950 unittest.expect(subPart, unittest.equals("$arg_engineAccountId"));
928 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/conversion")); 951 unittest.expect(path.substring(pathOffset, pathOffset + 11),
952 unittest.equals("/conversion"));
929 pathOffset += 11; 953 pathOffset += 11;
930 954
931 var query = (req.url).query; 955 var query = (req.url).query;
932 var queryOffset = 0; 956 var queryOffset = 0;
933 var queryMap = {}; 957 var queryMap = {};
934 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 958 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
935 parseBool(n) { 959 parseBool(n) {
936 if (n == "true") return true; 960 if (n == "true") return true;
937 if (n == "false") return false; 961 if (n == "false") return false;
938 if (n == null) return null; 962 if (n == null) return null;
939 throw new core.ArgumentError("Invalid boolean: $n"); 963 throw new core.ArgumentError("Invalid boolean: $n");
940 } 964 }
965
941 if (query.length > 0) { 966 if (query.length > 0) {
942 for (var part in query.split("&")) { 967 for (var part in query.split("&")) {
943 var keyvalue = part.split("="); 968 var keyvalue = part.split("=");
944 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 969 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
970 core.Uri.decodeQueryComponent(keyvalue[1]));
945 } 971 }
946 } 972 }
947 unittest.expect(core.int.parse(queryMap["endDate"].first), unittest.equa ls(arg_endDate)); 973 unittest.expect(core.int.parse(queryMap["endDate"].first),
948 unittest.expect(core.int.parse(queryMap["rowCount"].first), unittest.equ als(arg_rowCount)); 974 unittest.equals(arg_endDate));
949 unittest.expect(core.int.parse(queryMap["startDate"].first), unittest.eq uals(arg_startDate)); 975 unittest.expect(core.int.parse(queryMap["rowCount"].first),
950 unittest.expect(core.int.parse(queryMap["startRow"].first), unittest.equ als(arg_startRow)); 976 unittest.equals(arg_rowCount));
951 unittest.expect(queryMap["adGroupId"].first, unittest.equals(arg_adGroup Id)); 977 unittest.expect(core.int.parse(queryMap["startDate"].first),
978 unittest.equals(arg_startDate));
979 unittest.expect(core.int.parse(queryMap["startRow"].first),
980 unittest.equals(arg_startRow));
981 unittest.expect(
982 queryMap["adGroupId"].first, unittest.equals(arg_adGroupId));
952 unittest.expect(queryMap["adId"].first, unittest.equals(arg_adId)); 983 unittest.expect(queryMap["adId"].first, unittest.equals(arg_adId));
953 unittest.expect(queryMap["campaignId"].first, unittest.equals(arg_campai gnId)); 984 unittest.expect(
954 unittest.expect(queryMap["criterionId"].first, unittest.equals(arg_crite rionId)); 985 queryMap["campaignId"].first, unittest.equals(arg_campaignId));
955 986 unittest.expect(
987 queryMap["criterionId"].first, unittest.equals(arg_criterionId));
956 988
957 var h = { 989 var h = {
958 "content-type" : "application/json; charset=utf-8", 990 "content-type": "application/json; charset=utf-8",
959 }; 991 };
960 var resp = convert.JSON.encode(buildConversionList()); 992 var resp = convert.JSON.encode(buildConversionList());
961 return new async.Future.value(stringResponse(200, h, resp)); 993 return new async.Future.value(stringResponse(200, h, resp));
962 }), true); 994 }), true);
963 res.get(arg_agencyId, arg_advertiserId, arg_engineAccountId, arg_endDate, arg_rowCount, arg_startDate, arg_startRow, adGroupId: arg_adGroupId, adId: arg_a dId, campaignId: arg_campaignId, criterionId: arg_criterionId).then(unittest.exp ectAsync1(((api.ConversionList response) { 995 res
996 .get(arg_agencyId, arg_advertiserId, arg_engineAccountId, arg_endDate,
997 arg_rowCount, arg_startDate, arg_startRow,
998 adGroupId: arg_adGroupId,
999 adId: arg_adId,
1000 campaignId: arg_campaignId,
1001 criterionId: arg_criterionId)
1002 .then(unittest.expectAsync1(((api.ConversionList response) {
964 checkConversionList(response); 1003 checkConversionList(response);
965 }))); 1004 })));
966 }); 1005 });
967 1006
968 unittest.test("method--insert", () { 1007 unittest.test("method--insert", () {
969
970 var mock = new HttpServerMock(); 1008 var mock = new HttpServerMock();
971 api.ConversionResourceApi res = new api.DoubleclicksearchApi(mock).convers ion; 1009 api.ConversionResourceApi res =
1010 new api.DoubleclicksearchApi(mock).conversion;
972 var arg_request = buildConversionList(); 1011 var arg_request = buildConversionList();
973 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1012 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
974 var obj = new api.ConversionList.fromJson(json); 1013 var obj = new api.ConversionList.fromJson(json);
975 checkConversionList(obj); 1014 checkConversionList(obj);
976 1015
977 var path = (req.url).path; 1016 var path = (req.url).path;
978 var pathOffset = 0; 1017 var pathOffset = 0;
979 var index; 1018 var index;
980 var subPart; 1019 var subPart;
981 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1020 unittest.expect(
1021 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
982 pathOffset += 1; 1022 pathOffset += 1;
983 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1023 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1024 unittest.equals("doubleclicksearch/v2/"));
984 pathOffset += 21; 1025 pathOffset += 21;
985 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("conversion")); 1026 unittest.expect(path.substring(pathOffset, pathOffset + 10),
1027 unittest.equals("conversion"));
986 pathOffset += 10; 1028 pathOffset += 10;
987 1029
988 var query = (req.url).query; 1030 var query = (req.url).query;
989 var queryOffset = 0; 1031 var queryOffset = 0;
990 var queryMap = {}; 1032 var queryMap = {};
991 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1033 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
992 parseBool(n) { 1034 parseBool(n) {
993 if (n == "true") return true; 1035 if (n == "true") return true;
994 if (n == "false") return false; 1036 if (n == "false") return false;
995 if (n == null) return null; 1037 if (n == null) return null;
996 throw new core.ArgumentError("Invalid boolean: $n"); 1038 throw new core.ArgumentError("Invalid boolean: $n");
997 } 1039 }
1040
998 if (query.length > 0) { 1041 if (query.length > 0) {
999 for (var part in query.split("&")) { 1042 for (var part in query.split("&")) {
1000 var keyvalue = part.split("="); 1043 var keyvalue = part.split("=");
1001 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1044 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1045 core.Uri.decodeQueryComponent(keyvalue[1]));
1002 } 1046 }
1003 } 1047 }
1004 1048
1005
1006 var h = { 1049 var h = {
1007 "content-type" : "application/json; charset=utf-8", 1050 "content-type": "application/json; charset=utf-8",
1008 }; 1051 };
1009 var resp = convert.JSON.encode(buildConversionList()); 1052 var resp = convert.JSON.encode(buildConversionList());
1010 return new async.Future.value(stringResponse(200, h, resp)); 1053 return new async.Future.value(stringResponse(200, h, resp));
1011 }), true); 1054 }), true);
1012 res.insert(arg_request).then(unittest.expectAsync1(((api.ConversionList re sponse) { 1055 res
1056 .insert(arg_request)
1057 .then(unittest.expectAsync1(((api.ConversionList response) {
1013 checkConversionList(response); 1058 checkConversionList(response);
1014 }))); 1059 })));
1015 }); 1060 });
1016 1061
1017 unittest.test("method--patch", () { 1062 unittest.test("method--patch", () {
1018
1019 var mock = new HttpServerMock(); 1063 var mock = new HttpServerMock();
1020 api.ConversionResourceApi res = new api.DoubleclicksearchApi(mock).convers ion; 1064 api.ConversionResourceApi res =
1065 new api.DoubleclicksearchApi(mock).conversion;
1021 var arg_request = buildConversionList(); 1066 var arg_request = buildConversionList();
1022 var arg_advertiserId = "foo"; 1067 var arg_advertiserId = "foo";
1023 var arg_agencyId = "foo"; 1068 var arg_agencyId = "foo";
1024 var arg_endDate = 42; 1069 var arg_endDate = 42;
1025 var arg_engineAccountId = "foo"; 1070 var arg_engineAccountId = "foo";
1026 var arg_rowCount = 42; 1071 var arg_rowCount = 42;
1027 var arg_startDate = 42; 1072 var arg_startDate = 42;
1028 var arg_startRow = 42; 1073 var arg_startRow = 42;
1029 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1074 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1030 var obj = new api.ConversionList.fromJson(json); 1075 var obj = new api.ConversionList.fromJson(json);
1031 checkConversionList(obj); 1076 checkConversionList(obj);
1032 1077
1033 var path = (req.url).path; 1078 var path = (req.url).path;
1034 var pathOffset = 0; 1079 var pathOffset = 0;
1035 var index; 1080 var index;
1036 var subPart; 1081 var subPart;
1037 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1082 unittest.expect(
1083 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1038 pathOffset += 1; 1084 pathOffset += 1;
1039 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1085 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1086 unittest.equals("doubleclicksearch/v2/"));
1040 pathOffset += 21; 1087 pathOffset += 21;
1041 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("conversion")); 1088 unittest.expect(path.substring(pathOffset, pathOffset + 10),
1089 unittest.equals("conversion"));
1042 pathOffset += 10; 1090 pathOffset += 10;
1043 1091
1044 var query = (req.url).query; 1092 var query = (req.url).query;
1045 var queryOffset = 0; 1093 var queryOffset = 0;
1046 var queryMap = {}; 1094 var queryMap = {};
1047 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1095 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1048 parseBool(n) { 1096 parseBool(n) {
1049 if (n == "true") return true; 1097 if (n == "true") return true;
1050 if (n == "false") return false; 1098 if (n == "false") return false;
1051 if (n == null) return null; 1099 if (n == null) return null;
1052 throw new core.ArgumentError("Invalid boolean: $n"); 1100 throw new core.ArgumentError("Invalid boolean: $n");
1053 } 1101 }
1102
1054 if (query.length > 0) { 1103 if (query.length > 0) {
1055 for (var part in query.split("&")) { 1104 for (var part in query.split("&")) {
1056 var keyvalue = part.split("="); 1105 var keyvalue = part.split("=");
1057 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1106 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1107 core.Uri.decodeQueryComponent(keyvalue[1]));
1058 } 1108 }
1059 } 1109 }
1060 unittest.expect(queryMap["advertiserId"].first, unittest.equals(arg_adve rtiserId)); 1110 unittest.expect(
1061 unittest.expect(queryMap["agencyId"].first, unittest.equals(arg_agencyId )); 1111 queryMap["advertiserId"].first, unittest.equals(arg_advertiserId));
1062 unittest.expect(core.int.parse(queryMap["endDate"].first), unittest.equa ls(arg_endDate)); 1112 unittest.expect(
1063 unittest.expect(queryMap["engineAccountId"].first, unittest.equals(arg_e ngineAccountId)); 1113 queryMap["agencyId"].first, unittest.equals(arg_agencyId));
1064 unittest.expect(core.int.parse(queryMap["rowCount"].first), unittest.equ als(arg_rowCount)); 1114 unittest.expect(core.int.parse(queryMap["endDate"].first),
1065 unittest.expect(core.int.parse(queryMap["startDate"].first), unittest.eq uals(arg_startDate)); 1115 unittest.equals(arg_endDate));
1066 unittest.expect(core.int.parse(queryMap["startRow"].first), unittest.equ als(arg_startRow)); 1116 unittest.expect(queryMap["engineAccountId"].first,
1067 1117 unittest.equals(arg_engineAccountId));
1118 unittest.expect(core.int.parse(queryMap["rowCount"].first),
1119 unittest.equals(arg_rowCount));
1120 unittest.expect(core.int.parse(queryMap["startDate"].first),
1121 unittest.equals(arg_startDate));
1122 unittest.expect(core.int.parse(queryMap["startRow"].first),
1123 unittest.equals(arg_startRow));
1068 1124
1069 var h = { 1125 var h = {
1070 "content-type" : "application/json; charset=utf-8", 1126 "content-type": "application/json; charset=utf-8",
1071 }; 1127 };
1072 var resp = convert.JSON.encode(buildConversionList()); 1128 var resp = convert.JSON.encode(buildConversionList());
1073 return new async.Future.value(stringResponse(200, h, resp)); 1129 return new async.Future.value(stringResponse(200, h, resp));
1074 }), true); 1130 }), true);
1075 res.patch(arg_request, arg_advertiserId, arg_agencyId, arg_endDate, arg_en gineAccountId, arg_rowCount, arg_startDate, arg_startRow).then(unittest.expectAs ync1(((api.ConversionList response) { 1131 res
1132 .patch(arg_request, arg_advertiserId, arg_agencyId, arg_endDate,
1133 arg_engineAccountId, arg_rowCount, arg_startDate, arg_startRow)
1134 .then(unittest.expectAsync1(((api.ConversionList response) {
1076 checkConversionList(response); 1135 checkConversionList(response);
1077 }))); 1136 })));
1078 }); 1137 });
1079 1138
1080 unittest.test("method--update", () { 1139 unittest.test("method--update", () {
1081
1082 var mock = new HttpServerMock(); 1140 var mock = new HttpServerMock();
1083 api.ConversionResourceApi res = new api.DoubleclicksearchApi(mock).convers ion; 1141 api.ConversionResourceApi res =
1142 new api.DoubleclicksearchApi(mock).conversion;
1084 var arg_request = buildConversionList(); 1143 var arg_request = buildConversionList();
1085 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1144 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1086 var obj = new api.ConversionList.fromJson(json); 1145 var obj = new api.ConversionList.fromJson(json);
1087 checkConversionList(obj); 1146 checkConversionList(obj);
1088 1147
1089 var path = (req.url).path; 1148 var path = (req.url).path;
1090 var pathOffset = 0; 1149 var pathOffset = 0;
1091 var index; 1150 var index;
1092 var subPart; 1151 var subPart;
1093 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1152 unittest.expect(
1153 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1094 pathOffset += 1; 1154 pathOffset += 1;
1095 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1155 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1156 unittest.equals("doubleclicksearch/v2/"));
1096 pathOffset += 21; 1157 pathOffset += 21;
1097 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("conversion")); 1158 unittest.expect(path.substring(pathOffset, pathOffset + 10),
1159 unittest.equals("conversion"));
1098 pathOffset += 10; 1160 pathOffset += 10;
1099 1161
1100 var query = (req.url).query; 1162 var query = (req.url).query;
1101 var queryOffset = 0; 1163 var queryOffset = 0;
1102 var queryMap = {}; 1164 var queryMap = {};
1103 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1165 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1104 parseBool(n) { 1166 parseBool(n) {
1105 if (n == "true") return true; 1167 if (n == "true") return true;
1106 if (n == "false") return false; 1168 if (n == "false") return false;
1107 if (n == null) return null; 1169 if (n == null) return null;
1108 throw new core.ArgumentError("Invalid boolean: $n"); 1170 throw new core.ArgumentError("Invalid boolean: $n");
1109 } 1171 }
1172
1110 if (query.length > 0) { 1173 if (query.length > 0) {
1111 for (var part in query.split("&")) { 1174 for (var part in query.split("&")) {
1112 var keyvalue = part.split("="); 1175 var keyvalue = part.split("=");
1113 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1176 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1177 core.Uri.decodeQueryComponent(keyvalue[1]));
1114 } 1178 }
1115 } 1179 }
1116 1180
1117
1118 var h = { 1181 var h = {
1119 "content-type" : "application/json; charset=utf-8", 1182 "content-type": "application/json; charset=utf-8",
1120 }; 1183 };
1121 var resp = convert.JSON.encode(buildConversionList()); 1184 var resp = convert.JSON.encode(buildConversionList());
1122 return new async.Future.value(stringResponse(200, h, resp)); 1185 return new async.Future.value(stringResponse(200, h, resp));
1123 }), true); 1186 }), true);
1124 res.update(arg_request).then(unittest.expectAsync1(((api.ConversionList re sponse) { 1187 res
1188 .update(arg_request)
1189 .then(unittest.expectAsync1(((api.ConversionList response) {
1125 checkConversionList(response); 1190 checkConversionList(response);
1126 }))); 1191 })));
1127 }); 1192 });
1128 1193
1129 unittest.test("method--updateAvailability", () { 1194 unittest.test("method--updateAvailability", () {
1130
1131 var mock = new HttpServerMock(); 1195 var mock = new HttpServerMock();
1132 api.ConversionResourceApi res = new api.DoubleclicksearchApi(mock).convers ion; 1196 api.ConversionResourceApi res =
1197 new api.DoubleclicksearchApi(mock).conversion;
1133 var arg_request = buildUpdateAvailabilityRequest(); 1198 var arg_request = buildUpdateAvailabilityRequest();
1134 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1199 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1135 var obj = new api.UpdateAvailabilityRequest.fromJson(json); 1200 var obj = new api.UpdateAvailabilityRequest.fromJson(json);
1136 checkUpdateAvailabilityRequest(obj); 1201 checkUpdateAvailabilityRequest(obj);
1137 1202
1138 var path = (req.url).path; 1203 var path = (req.url).path;
1139 var pathOffset = 0; 1204 var pathOffset = 0;
1140 var index; 1205 var index;
1141 var subPart; 1206 var subPart;
1142 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1207 unittest.expect(
1208 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1143 pathOffset += 1; 1209 pathOffset += 1;
1144 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1210 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1211 unittest.equals("doubleclicksearch/v2/"));
1145 pathOffset += 21; 1212 pathOffset += 21;
1146 unittest.expect(path.substring(pathOffset, pathOffset + 29), unittest.eq uals("conversion/updateAvailability")); 1213 unittest.expect(path.substring(pathOffset, pathOffset + 29),
1214 unittest.equals("conversion/updateAvailability"));
1147 pathOffset += 29; 1215 pathOffset += 29;
1148 1216
1149 var query = (req.url).query; 1217 var query = (req.url).query;
1150 var queryOffset = 0; 1218 var queryOffset = 0;
1151 var queryMap = {}; 1219 var queryMap = {};
1152 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1220 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1153 parseBool(n) { 1221 parseBool(n) {
1154 if (n == "true") return true; 1222 if (n == "true") return true;
1155 if (n == "false") return false; 1223 if (n == "false") return false;
1156 if (n == null) return null; 1224 if (n == null) return null;
1157 throw new core.ArgumentError("Invalid boolean: $n"); 1225 throw new core.ArgumentError("Invalid boolean: $n");
1158 } 1226 }
1227
1159 if (query.length > 0) { 1228 if (query.length > 0) {
1160 for (var part in query.split("&")) { 1229 for (var part in query.split("&")) {
1161 var keyvalue = part.split("="); 1230 var keyvalue = part.split("=");
1162 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1231 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1232 core.Uri.decodeQueryComponent(keyvalue[1]));
1163 } 1233 }
1164 } 1234 }
1165 1235
1166
1167 var h = { 1236 var h = {
1168 "content-type" : "application/json; charset=utf-8", 1237 "content-type": "application/json; charset=utf-8",
1169 }; 1238 };
1170 var resp = convert.JSON.encode(buildUpdateAvailabilityResponse()); 1239 var resp = convert.JSON.encode(buildUpdateAvailabilityResponse());
1171 return new async.Future.value(stringResponse(200, h, resp)); 1240 return new async.Future.value(stringResponse(200, h, resp));
1172 }), true); 1241 }), true);
1173 res.updateAvailability(arg_request).then(unittest.expectAsync1(((api.Updat eAvailabilityResponse response) { 1242 res.updateAvailability(arg_request).then(
1243 unittest.expectAsync1(((api.UpdateAvailabilityResponse response) {
1174 checkUpdateAvailabilityResponse(response); 1244 checkUpdateAvailabilityResponse(response);
1175 }))); 1245 })));
1176 }); 1246 });
1177
1178 }); 1247 });
1179 1248
1180
1181 unittest.group("resource-ReportsResourceApi", () { 1249 unittest.group("resource-ReportsResourceApi", () {
1182 unittest.test("method--generate", () { 1250 unittest.test("method--generate", () {
1183
1184 var mock = new HttpServerMock(); 1251 var mock = new HttpServerMock();
1185 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports; 1252 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports;
1186 var arg_request_1 = buildReportRequest(); 1253 var arg_request_1 = buildReportRequest();
1187 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1254 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1188 var obj = new api.ReportRequest.fromJson(json); 1255 var obj = new api.ReportRequest.fromJson(json);
1189 checkReportRequest(obj); 1256 checkReportRequest(obj);
1190 1257
1191 var path = (req.url).path; 1258 var path = (req.url).path;
1192 var pathOffset = 0; 1259 var pathOffset = 0;
1193 var index; 1260 var index;
1194 var subPart; 1261 var subPart;
1195 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1262 unittest.expect(
1263 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1196 pathOffset += 1; 1264 pathOffset += 1;
1197 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1265 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1266 unittest.equals("doubleclicksearch/v2/"));
1198 pathOffset += 21; 1267 pathOffset += 21;
1199 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq uals("reports/generate")); 1268 unittest.expect(path.substring(pathOffset, pathOffset + 16),
1269 unittest.equals("reports/generate"));
1200 pathOffset += 16; 1270 pathOffset += 16;
1201 1271
1202 var query = (req.url).query; 1272 var query = (req.url).query;
1203 var queryOffset = 0; 1273 var queryOffset = 0;
1204 var queryMap = {}; 1274 var queryMap = {};
1205 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1275 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1206 parseBool(n) { 1276 parseBool(n) {
1207 if (n == "true") return true; 1277 if (n == "true") return true;
1208 if (n == "false") return false; 1278 if (n == "false") return false;
1209 if (n == null) return null; 1279 if (n == null) return null;
1210 throw new core.ArgumentError("Invalid boolean: $n"); 1280 throw new core.ArgumentError("Invalid boolean: $n");
1211 } 1281 }
1282
1212 if (query.length > 0) { 1283 if (query.length > 0) {
1213 for (var part in query.split("&")) { 1284 for (var part in query.split("&")) {
1214 var keyvalue = part.split("="); 1285 var keyvalue = part.split("=");
1215 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1286 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1287 core.Uri.decodeQueryComponent(keyvalue[1]));
1216 } 1288 }
1217 } 1289 }
1218 1290
1219
1220 var h = { 1291 var h = {
1221 "content-type" : "application/json; charset=utf-8", 1292 "content-type": "application/json; charset=utf-8",
1222 }; 1293 };
1223 var resp = convert.JSON.encode(buildReport()); 1294 var resp = convert.JSON.encode(buildReport());
1224 return new async.Future.value(stringResponse(200, h, resp)); 1295 return new async.Future.value(stringResponse(200, h, resp));
1225 }), true); 1296 }), true);
1226 res.generate(arg_request_1).then(unittest.expectAsync1(((api.Report respon se) { 1297 res
1298 .generate(arg_request_1)
1299 .then(unittest.expectAsync1(((api.Report response) {
1227 checkReport(response); 1300 checkReport(response);
1228 }))); 1301 })));
1229 }); 1302 });
1230 1303
1231 unittest.test("method--get", () { 1304 unittest.test("method--get", () {
1232
1233 var mock = new HttpServerMock(); 1305 var mock = new HttpServerMock();
1234 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports; 1306 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports;
1235 var arg_reportId = "foo"; 1307 var arg_reportId = "foo";
1236 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1308 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1237 var path = (req.url).path; 1309 var path = (req.url).path;
1238 var pathOffset = 0; 1310 var pathOffset = 0;
1239 var index; 1311 var index;
1240 var subPart; 1312 var subPart;
1241 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1313 unittest.expect(
1314 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1242 pathOffset += 1; 1315 pathOffset += 1;
1243 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1316 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1317 unittest.equals("doubleclicksearch/v2/"));
1244 pathOffset += 21; 1318 pathOffset += 21;
1245 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("reports/")); 1319 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1320 unittest.equals("reports/"));
1246 pathOffset += 8; 1321 pathOffset += 8;
1247 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 1322 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1248 pathOffset = path.length; 1323 pathOffset = path.length;
1249 unittest.expect(subPart, unittest.equals("$arg_reportId")); 1324 unittest.expect(subPart, unittest.equals("$arg_reportId"));
1250 1325
1251 var query = (req.url).query; 1326 var query = (req.url).query;
1252 var queryOffset = 0; 1327 var queryOffset = 0;
1253 var queryMap = {}; 1328 var queryMap = {};
1254 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1329 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1255 parseBool(n) { 1330 parseBool(n) {
1256 if (n == "true") return true; 1331 if (n == "true") return true;
1257 if (n == "false") return false; 1332 if (n == "false") return false;
1258 if (n == null) return null; 1333 if (n == null) return null;
1259 throw new core.ArgumentError("Invalid boolean: $n"); 1334 throw new core.ArgumentError("Invalid boolean: $n");
1260 } 1335 }
1336
1261 if (query.length > 0) { 1337 if (query.length > 0) {
1262 for (var part in query.split("&")) { 1338 for (var part in query.split("&")) {
1263 var keyvalue = part.split("="); 1339 var keyvalue = part.split("=");
1264 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1340 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1341 core.Uri.decodeQueryComponent(keyvalue[1]));
1265 } 1342 }
1266 } 1343 }
1267 1344
1268
1269 var h = { 1345 var h = {
1270 "content-type" : "application/json; charset=utf-8", 1346 "content-type": "application/json; charset=utf-8",
1271 }; 1347 };
1272 var resp = convert.JSON.encode(buildReport()); 1348 var resp = convert.JSON.encode(buildReport());
1273 return new async.Future.value(stringResponse(200, h, resp)); 1349 return new async.Future.value(stringResponse(200, h, resp));
1274 }), true); 1350 }), true);
1275 res.get(arg_reportId).then(unittest.expectAsync1(((api.Report response) { 1351 res.get(arg_reportId).then(unittest.expectAsync1(((api.Report response) {
1276 checkReport(response); 1352 checkReport(response);
1277 }))); 1353 })));
1278 }); 1354 });
1279 1355
1280 unittest.test("method--getFile", () { 1356 unittest.test("method--getFile", () {
1281 // TODO: Implement tests for media upload; 1357 // TODO: Implement tests for media upload;
1282 // TODO: Implement tests for media download; 1358 // TODO: Implement tests for media download;
1283 1359
1284 var mock = new HttpServerMock(); 1360 var mock = new HttpServerMock();
1285 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports; 1361 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports;
1286 var arg_reportId = "foo"; 1362 var arg_reportId = "foo";
1287 var arg_reportFragment = 42; 1363 var arg_reportFragment = 42;
1288 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1364 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1289 var path = (req.url).path; 1365 var path = (req.url).path;
1290 var pathOffset = 0; 1366 var pathOffset = 0;
1291 var index; 1367 var index;
1292 var subPart; 1368 var subPart;
1293 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1369 unittest.expect(
1370 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1294 pathOffset += 1; 1371 pathOffset += 1;
1295 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1372 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1373 unittest.equals("doubleclicksearch/v2/"));
1296 pathOffset += 21; 1374 pathOffset += 21;
1297 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("reports/")); 1375 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1376 unittest.equals("reports/"));
1298 pathOffset += 8; 1377 pathOffset += 8;
1299 index = path.indexOf("/files/", pathOffset); 1378 index = path.indexOf("/files/", pathOffset);
1300 unittest.expect(index >= 0, unittest.isTrue); 1379 unittest.expect(index >= 0, unittest.isTrue);
1301 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 1380 subPart =
1381 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
1302 pathOffset = index; 1382 pathOffset = index;
1303 unittest.expect(subPart, unittest.equals("$arg_reportId")); 1383 unittest.expect(subPart, unittest.equals("$arg_reportId"));
1304 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("/files/")); 1384 unittest.expect(path.substring(pathOffset, pathOffset + 7),
1385 unittest.equals("/files/"));
1305 pathOffset += 7; 1386 pathOffset += 7;
1306 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 1387 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1307 pathOffset = path.length; 1388 pathOffset = path.length;
1308 unittest.expect(subPart, unittest.equals("$arg_reportFragment")); 1389 unittest.expect(subPart, unittest.equals("$arg_reportFragment"));
1309 1390
1310 var query = (req.url).query; 1391 var query = (req.url).query;
1311 var queryOffset = 0; 1392 var queryOffset = 0;
1312 var queryMap = {}; 1393 var queryMap = {};
1313 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1394 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1314 parseBool(n) { 1395 parseBool(n) {
1315 if (n == "true") return true; 1396 if (n == "true") return true;
1316 if (n == "false") return false; 1397 if (n == "false") return false;
1317 if (n == null) return null; 1398 if (n == null) return null;
1318 throw new core.ArgumentError("Invalid boolean: $n"); 1399 throw new core.ArgumentError("Invalid boolean: $n");
1319 } 1400 }
1401
1320 if (query.length > 0) { 1402 if (query.length > 0) {
1321 for (var part in query.split("&")) { 1403 for (var part in query.split("&")) {
1322 var keyvalue = part.split("="); 1404 var keyvalue = part.split("=");
1323 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1405 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1406 core.Uri.decodeQueryComponent(keyvalue[1]));
1324 } 1407 }
1325 } 1408 }
1326 1409
1327
1328 var h = { 1410 var h = {
1329 "content-type" : "application/json; charset=utf-8", 1411 "content-type": "application/json; charset=utf-8",
1330 }; 1412 };
1331 var resp = ""; 1413 var resp = "";
1332 return new async.Future.value(stringResponse(200, h, resp)); 1414 return new async.Future.value(stringResponse(200, h, resp));
1333 }), true); 1415 }), true);
1334 res.getFile(arg_reportId, arg_reportFragment).then(unittest.expectAsync1(( _) {})); 1416 res
1417 .getFile(arg_reportId, arg_reportFragment)
1418 .then(unittest.expectAsync1((_) {}));
1335 }); 1419 });
1336 1420
1337 unittest.test("method--request", () { 1421 unittest.test("method--request", () {
1338
1339 var mock = new HttpServerMock(); 1422 var mock = new HttpServerMock();
1340 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports; 1423 api.ReportsResourceApi res = new api.DoubleclicksearchApi(mock).reports;
1341 var arg_request_1 = buildReportRequest(); 1424 var arg_request_1 = buildReportRequest();
1342 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1425 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1343 var obj = new api.ReportRequest.fromJson(json); 1426 var obj = new api.ReportRequest.fromJson(json);
1344 checkReportRequest(obj); 1427 checkReportRequest(obj);
1345 1428
1346 var path = (req.url).path; 1429 var path = (req.url).path;
1347 var pathOffset = 0; 1430 var pathOffset = 0;
1348 var index; 1431 var index;
1349 var subPart; 1432 var subPart;
1350 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1433 unittest.expect(
1434 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1351 pathOffset += 1; 1435 pathOffset += 1;
1352 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1436 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1437 unittest.equals("doubleclicksearch/v2/"));
1353 pathOffset += 21; 1438 pathOffset += 21;
1354 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("reports")); 1439 unittest.expect(path.substring(pathOffset, pathOffset + 7),
1440 unittest.equals("reports"));
1355 pathOffset += 7; 1441 pathOffset += 7;
1356 1442
1357 var query = (req.url).query; 1443 var query = (req.url).query;
1358 var queryOffset = 0; 1444 var queryOffset = 0;
1359 var queryMap = {}; 1445 var queryMap = {};
1360 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1446 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1361 parseBool(n) { 1447 parseBool(n) {
1362 if (n == "true") return true; 1448 if (n == "true") return true;
1363 if (n == "false") return false; 1449 if (n == "false") return false;
1364 if (n == null) return null; 1450 if (n == null) return null;
1365 throw new core.ArgumentError("Invalid boolean: $n"); 1451 throw new core.ArgumentError("Invalid boolean: $n");
1366 } 1452 }
1453
1367 if (query.length > 0) { 1454 if (query.length > 0) {
1368 for (var part in query.split("&")) { 1455 for (var part in query.split("&")) {
1369 var keyvalue = part.split("="); 1456 var keyvalue = part.split("=");
1370 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1457 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1458 core.Uri.decodeQueryComponent(keyvalue[1]));
1371 } 1459 }
1372 } 1460 }
1373 1461
1374
1375 var h = { 1462 var h = {
1376 "content-type" : "application/json; charset=utf-8", 1463 "content-type": "application/json; charset=utf-8",
1377 }; 1464 };
1378 var resp = convert.JSON.encode(buildReport()); 1465 var resp = convert.JSON.encode(buildReport());
1379 return new async.Future.value(stringResponse(200, h, resp)); 1466 return new async.Future.value(stringResponse(200, h, resp));
1380 }), true); 1467 }), true);
1381 res.request(arg_request_1).then(unittest.expectAsync1(((api.Report respons e) { 1468 res
1469 .request(arg_request_1)
1470 .then(unittest.expectAsync1(((api.Report response) {
1382 checkReport(response); 1471 checkReport(response);
1383 }))); 1472 })));
1384 }); 1473 });
1385
1386 }); 1474 });
1387 1475
1388
1389 unittest.group("resource-SavedColumnsResourceApi", () { 1476 unittest.group("resource-SavedColumnsResourceApi", () {
1390 unittest.test("method--list", () { 1477 unittest.test("method--list", () {
1391
1392 var mock = new HttpServerMock(); 1478 var mock = new HttpServerMock();
1393 api.SavedColumnsResourceApi res = new api.DoubleclicksearchApi(mock).saved Columns; 1479 api.SavedColumnsResourceApi res =
1480 new api.DoubleclicksearchApi(mock).savedColumns;
1394 var arg_agencyId = "foo"; 1481 var arg_agencyId = "foo";
1395 var arg_advertiserId = "foo"; 1482 var arg_advertiserId = "foo";
1396 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1483 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1397 var path = (req.url).path; 1484 var path = (req.url).path;
1398 var pathOffset = 0; 1485 var pathOffset = 0;
1399 var index; 1486 var index;
1400 var subPart; 1487 var subPart;
1401 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1488 unittest.expect(
1489 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1402 pathOffset += 1; 1490 pathOffset += 1;
1403 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq uals("doubleclicksearch/v2/")); 1491 unittest.expect(path.substring(pathOffset, pathOffset + 21),
1492 unittest.equals("doubleclicksearch/v2/"));
1404 pathOffset += 21; 1493 pathOffset += 21;
1405 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("agency/")); 1494 unittest.expect(path.substring(pathOffset, pathOffset + 7),
1495 unittest.equals("agency/"));
1406 pathOffset += 7; 1496 pathOffset += 7;
1407 index = path.indexOf("/advertiser/", pathOffset); 1497 index = path.indexOf("/advertiser/", pathOffset);
1408 unittest.expect(index >= 0, unittest.isTrue); 1498 unittest.expect(index >= 0, unittest.isTrue);
1409 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 1499 subPart =
1500 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
1410 pathOffset = index; 1501 pathOffset = index;
1411 unittest.expect(subPart, unittest.equals("$arg_agencyId")); 1502 unittest.expect(subPart, unittest.equals("$arg_agencyId"));
1412 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("/advertiser/")); 1503 unittest.expect(path.substring(pathOffset, pathOffset + 12),
1504 unittest.equals("/advertiser/"));
1413 pathOffset += 12; 1505 pathOffset += 12;
1414 index = path.indexOf("/savedcolumns", pathOffset); 1506 index = path.indexOf("/savedcolumns", pathOffset);
1415 unittest.expect(index >= 0, unittest.isTrue); 1507 unittest.expect(index >= 0, unittest.isTrue);
1416 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 1508 subPart =
1509 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
1417 pathOffset = index; 1510 pathOffset = index;
1418 unittest.expect(subPart, unittest.equals("$arg_advertiserId")); 1511 unittest.expect(subPart, unittest.equals("$arg_advertiserId"));
1419 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("/savedcolumns")); 1512 unittest.expect(path.substring(pathOffset, pathOffset + 13),
1513 unittest.equals("/savedcolumns"));
1420 pathOffset += 13; 1514 pathOffset += 13;
1421 1515
1422 var query = (req.url).query; 1516 var query = (req.url).query;
1423 var queryOffset = 0; 1517 var queryOffset = 0;
1424 var queryMap = {}; 1518 var queryMap = {};
1425 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1519 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1426 parseBool(n) { 1520 parseBool(n) {
1427 if (n == "true") return true; 1521 if (n == "true") return true;
1428 if (n == "false") return false; 1522 if (n == "false") return false;
1429 if (n == null) return null; 1523 if (n == null) return null;
1430 throw new core.ArgumentError("Invalid boolean: $n"); 1524 throw new core.ArgumentError("Invalid boolean: $n");
1431 } 1525 }
1526
1432 if (query.length > 0) { 1527 if (query.length > 0) {
1433 for (var part in query.split("&")) { 1528 for (var part in query.split("&")) {
1434 var keyvalue = part.split("="); 1529 var keyvalue = part.split("=");
1435 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1530 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1531 core.Uri.decodeQueryComponent(keyvalue[1]));
1436 } 1532 }
1437 } 1533 }
1438 1534
1439
1440 var h = { 1535 var h = {
1441 "content-type" : "application/json; charset=utf-8", 1536 "content-type": "application/json; charset=utf-8",
1442 }; 1537 };
1443 var resp = convert.JSON.encode(buildSavedColumnList()); 1538 var resp = convert.JSON.encode(buildSavedColumnList());
1444 return new async.Future.value(stringResponse(200, h, resp)); 1539 return new async.Future.value(stringResponse(200, h, resp));
1445 }), true); 1540 }), true);
1446 res.list(arg_agencyId, arg_advertiserId).then(unittest.expectAsync1(((api. SavedColumnList response) { 1541 res
1542 .list(arg_agencyId, arg_advertiserId)
1543 .then(unittest.expectAsync1(((api.SavedColumnList response) {
1447 checkSavedColumnList(response); 1544 checkSavedColumnList(response);
1448 }))); 1545 })));
1449 }); 1546 });
1450
1451 }); 1547 });
1452
1453
1454 } 1548 }
1455
OLDNEW
« no previous file with comments | « generated/googleapis/test/doubleclickbidmanager/v1_test.dart ('k') | generated/googleapis/test/drive/v2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698