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

Side by Side Diff: generated/googleapis/test/admin/reports_v1_test.dart

Issue 2936613002: Api-Roll 50: 2017-06-12 (Closed)
Patch Set: Created 3 years, 6 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.admin.reports_v1.test; 1 library googleapis.admin.reports_v1.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection; 4 import "dart:collection" as collection;
5 import "dart:async" as async; 5 import "dart:async" as async;
6 import "dart:convert" as convert; 6 import "dart:convert" as convert;
7 7
8 import 'package:http/http.dart' as http; 8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing; 9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest; 10 import 'package:test/test.dart' as unittest;
11 11
12 import 'package:googleapis/admin/reports_v1.dart' as api; 12 import 'package:googleapis/admin/reports_v1.dart' as api;
13 13
14 class HttpServerMock extends http.BaseClient { 14 class HttpServerMock extends http.BaseClient {
15 core.Function _callback; 15 core.Function _callback;
16 core.bool _expectJson; 16 core.bool _expectJson;
17 17
18 void register(core.Function callback, core.bool expectJson) { 18 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback; 19 _callback = callback;
20 _expectJson = expectJson; 20 _expectJson = expectJson;
(...skipping 18 matching lines...) Expand all
39 } else { 39 } else {
40 return stream.toBytes().then((data) { 40 return stream.toBytes().then((data) {
41 return _callback(request, data); 41 return _callback(request, data);
42 }); 42 });
43 } 43 }
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 http.StreamedResponse stringResponse( 48 http.StreamedResponse stringResponse(
49 core.int status, core.Map headers, core.String body) { 49 core.int status, core.Map<core.String, core.String> headers, core.String bod y) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 51 return new http.StreamedResponse(stream, status, headers: headers);
52 } 52 }
53 53
54 buildUnnamed619() { 54 buildUnnamed624() {
55 var o = new core.List<api.Activity>(); 55 var o = new core.List<api.Activity>();
56 o.add(buildActivity()); 56 o.add(buildActivity());
57 o.add(buildActivity()); 57 o.add(buildActivity());
58 return o; 58 return o;
59 } 59 }
60 60
61 checkUnnamed619(core.List<api.Activity> o) { 61 checkUnnamed624(core.List<api.Activity> o) {
62 unittest.expect(o, unittest.hasLength(2)); 62 unittest.expect(o, unittest.hasLength(2));
63 checkActivity(o[0]); 63 checkActivity(o[0]);
64 checkActivity(o[1]); 64 checkActivity(o[1]);
65 } 65 }
66 66
67 core.int buildCounterActivities = 0; 67 core.int buildCounterActivities = 0;
68 buildActivities() { 68 buildActivities() {
69 var o = new api.Activities(); 69 var o = new api.Activities();
70 buildCounterActivities++; 70 buildCounterActivities++;
71 if (buildCounterActivities < 3) { 71 if (buildCounterActivities < 3) {
72 o.etag = "foo"; 72 o.etag = "foo";
73 o.items = buildUnnamed619(); 73 o.items = buildUnnamed624();
74 o.kind = "foo"; 74 o.kind = "foo";
75 o.nextPageToken = "foo"; 75 o.nextPageToken = "foo";
76 } 76 }
77 buildCounterActivities--; 77 buildCounterActivities--;
78 return o; 78 return o;
79 } 79 }
80 80
81 checkActivities(api.Activities o) { 81 checkActivities(api.Activities o) {
82 buildCounterActivities++; 82 buildCounterActivities++;
83 if (buildCounterActivities < 3) { 83 if (buildCounterActivities < 3) {
84 unittest.expect(o.etag, unittest.equals('foo')); 84 unittest.expect(o.etag, unittest.equals('foo'));
85 checkUnnamed619(o.items); 85 checkUnnamed624(o.items);
86 unittest.expect(o.kind, unittest.equals('foo')); 86 unittest.expect(o.kind, unittest.equals('foo'));
87 unittest.expect(o.nextPageToken, unittest.equals('foo')); 87 unittest.expect(o.nextPageToken, unittest.equals('foo'));
88 } 88 }
89 buildCounterActivities--; 89 buildCounterActivities--;
90 } 90 }
91 91
92 core.int buildCounterActivityActor = 0; 92 core.int buildCounterActivityActor = 0;
93 buildActivityActor() { 93 buildActivityActor() {
94 var o = new api.ActivityActor(); 94 var o = new api.ActivityActor();
95 buildCounterActivityActor++; 95 buildCounterActivityActor++;
(...skipping 11 matching lines...) Expand all
107 buildCounterActivityActor++; 107 buildCounterActivityActor++;
108 if (buildCounterActivityActor < 3) { 108 if (buildCounterActivityActor < 3) {
109 unittest.expect(o.callerType, unittest.equals('foo')); 109 unittest.expect(o.callerType, unittest.equals('foo'));
110 unittest.expect(o.email, unittest.equals('foo')); 110 unittest.expect(o.email, unittest.equals('foo'));
111 unittest.expect(o.key, unittest.equals('foo')); 111 unittest.expect(o.key, unittest.equals('foo'));
112 unittest.expect(o.profileId, unittest.equals('foo')); 112 unittest.expect(o.profileId, unittest.equals('foo'));
113 } 113 }
114 buildCounterActivityActor--; 114 buildCounterActivityActor--;
115 } 115 }
116 116
117 buildUnnamed620() { 117 buildUnnamed625() {
118 var o = new core.List<core.String>(); 118 var o = new core.List<core.String>();
119 o.add("foo"); 119 o.add("foo");
120 o.add("foo"); 120 o.add("foo");
121 return o; 121 return o;
122 } 122 }
123 123
124 checkUnnamed620(core.List<core.String> o) { 124 checkUnnamed625(core.List<core.String> o) {
125 unittest.expect(o, unittest.hasLength(2)); 125 unittest.expect(o, unittest.hasLength(2));
126 unittest.expect(o[0], unittest.equals('foo')); 126 unittest.expect(o[0], unittest.equals('foo'));
127 unittest.expect(o[1], unittest.equals('foo')); 127 unittest.expect(o[1], unittest.equals('foo'));
128 } 128 }
129 129
130 buildUnnamed621() { 130 buildUnnamed626() {
131 var o = new core.List<core.String>(); 131 var o = new core.List<core.String>();
132 o.add("foo"); 132 o.add("foo");
133 o.add("foo"); 133 o.add("foo");
134 return o; 134 return o;
135 } 135 }
136 136
137 checkUnnamed621(core.List<core.String> o) { 137 checkUnnamed626(core.List<core.String> o) {
138 unittest.expect(o, unittest.hasLength(2)); 138 unittest.expect(o, unittest.hasLength(2));
139 unittest.expect(o[0], unittest.equals('foo')); 139 unittest.expect(o[0], unittest.equals('foo'));
140 unittest.expect(o[1], unittest.equals('foo')); 140 unittest.expect(o[1], unittest.equals('foo'));
141 } 141 }
142 142
143 core.int buildCounterActivityEventsParameters = 0; 143 core.int buildCounterActivityEventsParameters = 0;
144 buildActivityEventsParameters() { 144 buildActivityEventsParameters() {
145 var o = new api.ActivityEventsParameters(); 145 var o = new api.ActivityEventsParameters();
146 buildCounterActivityEventsParameters++; 146 buildCounterActivityEventsParameters++;
147 if (buildCounterActivityEventsParameters < 3) { 147 if (buildCounterActivityEventsParameters < 3) {
148 o.boolValue = true; 148 o.boolValue = true;
149 o.intValue = "foo"; 149 o.intValue = "foo";
150 o.multiIntValue = buildUnnamed620(); 150 o.multiIntValue = buildUnnamed625();
151 o.multiValue = buildUnnamed621(); 151 o.multiValue = buildUnnamed626();
152 o.name = "foo"; 152 o.name = "foo";
153 o.value = "foo"; 153 o.value = "foo";
154 } 154 }
155 buildCounterActivityEventsParameters--; 155 buildCounterActivityEventsParameters--;
156 return o; 156 return o;
157 } 157 }
158 158
159 checkActivityEventsParameters(api.ActivityEventsParameters o) { 159 checkActivityEventsParameters(api.ActivityEventsParameters o) {
160 buildCounterActivityEventsParameters++; 160 buildCounterActivityEventsParameters++;
161 if (buildCounterActivityEventsParameters < 3) { 161 if (buildCounterActivityEventsParameters < 3) {
162 unittest.expect(o.boolValue, unittest.isTrue); 162 unittest.expect(o.boolValue, unittest.isTrue);
163 unittest.expect(o.intValue, unittest.equals('foo')); 163 unittest.expect(o.intValue, unittest.equals('foo'));
164 checkUnnamed620(o.multiIntValue); 164 checkUnnamed625(o.multiIntValue);
165 checkUnnamed621(o.multiValue); 165 checkUnnamed626(o.multiValue);
166 unittest.expect(o.name, unittest.equals('foo')); 166 unittest.expect(o.name, unittest.equals('foo'));
167 unittest.expect(o.value, unittest.equals('foo')); 167 unittest.expect(o.value, unittest.equals('foo'));
168 } 168 }
169 buildCounterActivityEventsParameters--; 169 buildCounterActivityEventsParameters--;
170 } 170 }
171 171
172 buildUnnamed622() { 172 buildUnnamed627() {
173 var o = new core.List<api.ActivityEventsParameters>(); 173 var o = new core.List<api.ActivityEventsParameters>();
174 o.add(buildActivityEventsParameters()); 174 o.add(buildActivityEventsParameters());
175 o.add(buildActivityEventsParameters()); 175 o.add(buildActivityEventsParameters());
176 return o; 176 return o;
177 } 177 }
178 178
179 checkUnnamed622(core.List<api.ActivityEventsParameters> o) { 179 checkUnnamed627(core.List<api.ActivityEventsParameters> o) {
180 unittest.expect(o, unittest.hasLength(2)); 180 unittest.expect(o, unittest.hasLength(2));
181 checkActivityEventsParameters(o[0]); 181 checkActivityEventsParameters(o[0]);
182 checkActivityEventsParameters(o[1]); 182 checkActivityEventsParameters(o[1]);
183 } 183 }
184 184
185 core.int buildCounterActivityEvents = 0; 185 core.int buildCounterActivityEvents = 0;
186 buildActivityEvents() { 186 buildActivityEvents() {
187 var o = new api.ActivityEvents(); 187 var o = new api.ActivityEvents();
188 buildCounterActivityEvents++; 188 buildCounterActivityEvents++;
189 if (buildCounterActivityEvents < 3) { 189 if (buildCounterActivityEvents < 3) {
190 o.name = "foo"; 190 o.name = "foo";
191 o.parameters = buildUnnamed622(); 191 o.parameters = buildUnnamed627();
192 o.type = "foo"; 192 o.type = "foo";
193 } 193 }
194 buildCounterActivityEvents--; 194 buildCounterActivityEvents--;
195 return o; 195 return o;
196 } 196 }
197 197
198 checkActivityEvents(api.ActivityEvents o) { 198 checkActivityEvents(api.ActivityEvents o) {
199 buildCounterActivityEvents++; 199 buildCounterActivityEvents++;
200 if (buildCounterActivityEvents < 3) { 200 if (buildCounterActivityEvents < 3) {
201 unittest.expect(o.name, unittest.equals('foo')); 201 unittest.expect(o.name, unittest.equals('foo'));
202 checkUnnamed622(o.parameters); 202 checkUnnamed627(o.parameters);
203 unittest.expect(o.type, unittest.equals('foo')); 203 unittest.expect(o.type, unittest.equals('foo'));
204 } 204 }
205 buildCounterActivityEvents--; 205 buildCounterActivityEvents--;
206 } 206 }
207 207
208 buildUnnamed623() { 208 buildUnnamed628() {
209 var o = new core.List<api.ActivityEvents>(); 209 var o = new core.List<api.ActivityEvents>();
210 o.add(buildActivityEvents()); 210 o.add(buildActivityEvents());
211 o.add(buildActivityEvents()); 211 o.add(buildActivityEvents());
212 return o; 212 return o;
213 } 213 }
214 214
215 checkUnnamed623(core.List<api.ActivityEvents> o) { 215 checkUnnamed628(core.List<api.ActivityEvents> o) {
216 unittest.expect(o, unittest.hasLength(2)); 216 unittest.expect(o, unittest.hasLength(2));
217 checkActivityEvents(o[0]); 217 checkActivityEvents(o[0]);
218 checkActivityEvents(o[1]); 218 checkActivityEvents(o[1]);
219 } 219 }
220 220
221 core.int buildCounterActivityId = 0; 221 core.int buildCounterActivityId = 0;
222 buildActivityId() { 222 buildActivityId() {
223 var o = new api.ActivityId(); 223 var o = new api.ActivityId();
224 buildCounterActivityId++; 224 buildCounterActivityId++;
225 if (buildCounterActivityId < 3) { 225 if (buildCounterActivityId < 3) {
(...skipping 17 matching lines...) Expand all
243 buildCounterActivityId--; 243 buildCounterActivityId--;
244 } 244 }
245 245
246 core.int buildCounterActivity = 0; 246 core.int buildCounterActivity = 0;
247 buildActivity() { 247 buildActivity() {
248 var o = new api.Activity(); 248 var o = new api.Activity();
249 buildCounterActivity++; 249 buildCounterActivity++;
250 if (buildCounterActivity < 3) { 250 if (buildCounterActivity < 3) {
251 o.actor = buildActivityActor(); 251 o.actor = buildActivityActor();
252 o.etag = "foo"; 252 o.etag = "foo";
253 o.events = buildUnnamed623(); 253 o.events = buildUnnamed628();
254 o.id = buildActivityId(); 254 o.id = buildActivityId();
255 o.ipAddress = "foo"; 255 o.ipAddress = "foo";
256 o.kind = "foo"; 256 o.kind = "foo";
257 o.ownerDomain = "foo"; 257 o.ownerDomain = "foo";
258 } 258 }
259 buildCounterActivity--; 259 buildCounterActivity--;
260 return o; 260 return o;
261 } 261 }
262 262
263 checkActivity(api.Activity o) { 263 checkActivity(api.Activity o) {
264 buildCounterActivity++; 264 buildCounterActivity++;
265 if (buildCounterActivity < 3) { 265 if (buildCounterActivity < 3) {
266 checkActivityActor(o.actor); 266 checkActivityActor(o.actor);
267 unittest.expect(o.etag, unittest.equals('foo')); 267 unittest.expect(o.etag, unittest.equals('foo'));
268 checkUnnamed623(o.events); 268 checkUnnamed628(o.events);
269 checkActivityId(o.id); 269 checkActivityId(o.id);
270 unittest.expect(o.ipAddress, unittest.equals('foo')); 270 unittest.expect(o.ipAddress, unittest.equals('foo'));
271 unittest.expect(o.kind, unittest.equals('foo')); 271 unittest.expect(o.kind, unittest.equals('foo'));
272 unittest.expect(o.ownerDomain, unittest.equals('foo')); 272 unittest.expect(o.ownerDomain, unittest.equals('foo'));
273 } 273 }
274 buildCounterActivity--; 274 buildCounterActivity--;
275 } 275 }
276 276
277 buildUnnamed624() { 277 buildUnnamed629() {
278 var o = new core.Map<core.String, core.String>(); 278 var o = new core.Map<core.String, core.String>();
279 o["x"] = "foo"; 279 o["x"] = "foo";
280 o["y"] = "foo"; 280 o["y"] = "foo";
281 return o; 281 return o;
282 } 282 }
283 283
284 checkUnnamed624(core.Map<core.String, core.String> o) { 284 checkUnnamed629(core.Map<core.String, core.String> o) {
285 unittest.expect(o, unittest.hasLength(2)); 285 unittest.expect(o, unittest.hasLength(2));
286 unittest.expect(o["x"], unittest.equals('foo')); 286 unittest.expect(o["x"], unittest.equals('foo'));
287 unittest.expect(o["y"], unittest.equals('foo')); 287 unittest.expect(o["y"], unittest.equals('foo'));
288 } 288 }
289 289
290 core.int buildCounterChannel = 0; 290 core.int buildCounterChannel = 0;
291 buildChannel() { 291 buildChannel() {
292 var o = new api.Channel(); 292 var o = new api.Channel();
293 buildCounterChannel++; 293 buildCounterChannel++;
294 if (buildCounterChannel < 3) { 294 if (buildCounterChannel < 3) {
295 o.address = "foo"; 295 o.address = "foo";
296 o.expiration = "foo"; 296 o.expiration = "foo";
297 o.id = "foo"; 297 o.id = "foo";
298 o.kind = "foo"; 298 o.kind = "foo";
299 o.params = buildUnnamed624(); 299 o.params = buildUnnamed629();
300 o.payload = true; 300 o.payload = true;
301 o.resourceId = "foo"; 301 o.resourceId = "foo";
302 o.resourceUri = "foo"; 302 o.resourceUri = "foo";
303 o.token = "foo"; 303 o.token = "foo";
304 o.type = "foo"; 304 o.type = "foo";
305 } 305 }
306 buildCounterChannel--; 306 buildCounterChannel--;
307 return o; 307 return o;
308 } 308 }
309 309
310 checkChannel(api.Channel o) { 310 checkChannel(api.Channel o) {
311 buildCounterChannel++; 311 buildCounterChannel++;
312 if (buildCounterChannel < 3) { 312 if (buildCounterChannel < 3) {
313 unittest.expect(o.address, unittest.equals('foo')); 313 unittest.expect(o.address, unittest.equals('foo'));
314 unittest.expect(o.expiration, unittest.equals('foo')); 314 unittest.expect(o.expiration, unittest.equals('foo'));
315 unittest.expect(o.id, unittest.equals('foo')); 315 unittest.expect(o.id, unittest.equals('foo'));
316 unittest.expect(o.kind, unittest.equals('foo')); 316 unittest.expect(o.kind, unittest.equals('foo'));
317 checkUnnamed624(o.params); 317 checkUnnamed629(o.params);
318 unittest.expect(o.payload, unittest.isTrue); 318 unittest.expect(o.payload, unittest.isTrue);
319 unittest.expect(o.resourceId, unittest.equals('foo')); 319 unittest.expect(o.resourceId, unittest.equals('foo'));
320 unittest.expect(o.resourceUri, unittest.equals('foo')); 320 unittest.expect(o.resourceUri, unittest.equals('foo'));
321 unittest.expect(o.token, unittest.equals('foo')); 321 unittest.expect(o.token, unittest.equals('foo'));
322 unittest.expect(o.type, unittest.equals('foo')); 322 unittest.expect(o.type, unittest.equals('foo'));
323 } 323 }
324 buildCounterChannel--; 324 buildCounterChannel--;
325 } 325 }
326 326
327 core.int buildCounterUsageReportEntity = 0; 327 core.int buildCounterUsageReportEntity = 0;
(...skipping 14 matching lines...) Expand all
342 buildCounterUsageReportEntity++; 342 buildCounterUsageReportEntity++;
343 if (buildCounterUsageReportEntity < 3) { 343 if (buildCounterUsageReportEntity < 3) {
344 unittest.expect(o.customerId, unittest.equals('foo')); 344 unittest.expect(o.customerId, unittest.equals('foo'));
345 unittest.expect(o.profileId, unittest.equals('foo')); 345 unittest.expect(o.profileId, unittest.equals('foo'));
346 unittest.expect(o.type, unittest.equals('foo')); 346 unittest.expect(o.type, unittest.equals('foo'));
347 unittest.expect(o.userEmail, unittest.equals('foo')); 347 unittest.expect(o.userEmail, unittest.equals('foo'));
348 } 348 }
349 buildCounterUsageReportEntity--; 349 buildCounterUsageReportEntity--;
350 } 350 }
351 351
352 buildUnnamed625() { 352 buildUnnamed630() {
353 var o = new core.Map<core.String, core.Object>(); 353 var o = new core.Map<core.String, core.Object>();
354 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 354 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
355 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 355 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
356 return o; 356 return o;
357 } 357 }
358 358
359 checkUnnamed625(core.Map<core.String, core.Object> o) { 359 checkUnnamed630(core.Map<core.String, core.Object> o) {
360 unittest.expect(o, unittest.hasLength(2)); 360 unittest.expect(o, unittest.hasLength(2));
361 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); 361 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo'));
362 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); 362 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo'));
363 } 363 }
364 364
365 buildUnnamed626() { 365 buildUnnamed631() {
366 var o = new core.List<core.Map<core.String, core.Object>>(); 366 var o = new core.List<core.Map<core.String, core.Object>>();
367 o.add(buildUnnamed625()); 367 o.add(buildUnnamed630());
368 o.add(buildUnnamed625()); 368 o.add(buildUnnamed630());
369 return o; 369 return o;
370 } 370 }
371 371
372 checkUnnamed626(core.List<core.Map<core.String, core.Object>> o) { 372 checkUnnamed631(core.List<core.Map<core.String, core.Object>> o) {
373 unittest.expect(o, unittest.hasLength(2)); 373 unittest.expect(o, unittest.hasLength(2));
374 checkUnnamed625(o[0]); 374 checkUnnamed630(o[0]);
375 checkUnnamed625(o[1]); 375 checkUnnamed630(o[1]);
376 } 376 }
377 377
378 core.int buildCounterUsageReportParameters = 0; 378 core.int buildCounterUsageReportParameters = 0;
379 buildUsageReportParameters() { 379 buildUsageReportParameters() {
380 var o = new api.UsageReportParameters(); 380 var o = new api.UsageReportParameters();
381 buildCounterUsageReportParameters++; 381 buildCounterUsageReportParameters++;
382 if (buildCounterUsageReportParameters < 3) { 382 if (buildCounterUsageReportParameters < 3) {
383 o.boolValue = true; 383 o.boolValue = true;
384 o.datetimeValue = core.DateTime.parse("2002-02-27T14:01:02"); 384 o.datetimeValue = core.DateTime.parse("2002-02-27T14:01:02");
385 o.intValue = "foo"; 385 o.intValue = "foo";
386 o.msgValue = buildUnnamed626(); 386 o.msgValue = buildUnnamed631();
387 o.name = "foo"; 387 o.name = "foo";
388 o.stringValue = "foo"; 388 o.stringValue = "foo";
389 } 389 }
390 buildCounterUsageReportParameters--; 390 buildCounterUsageReportParameters--;
391 return o; 391 return o;
392 } 392 }
393 393
394 checkUsageReportParameters(api.UsageReportParameters o) { 394 checkUsageReportParameters(api.UsageReportParameters o) {
395 buildCounterUsageReportParameters++; 395 buildCounterUsageReportParameters++;
396 if (buildCounterUsageReportParameters < 3) { 396 if (buildCounterUsageReportParameters < 3) {
397 unittest.expect(o.boolValue, unittest.isTrue); 397 unittest.expect(o.boolValue, unittest.isTrue);
398 unittest.expect(o.datetimeValue, unittest.equals(core.DateTime.parse("2002-0 2-27T14:01:02"))); 398 unittest.expect(o.datetimeValue, unittest.equals(core.DateTime.parse("2002-0 2-27T14:01:02")));
399 unittest.expect(o.intValue, unittest.equals('foo')); 399 unittest.expect(o.intValue, unittest.equals('foo'));
400 checkUnnamed626(o.msgValue); 400 checkUnnamed631(o.msgValue);
401 unittest.expect(o.name, unittest.equals('foo')); 401 unittest.expect(o.name, unittest.equals('foo'));
402 unittest.expect(o.stringValue, unittest.equals('foo')); 402 unittest.expect(o.stringValue, unittest.equals('foo'));
403 } 403 }
404 buildCounterUsageReportParameters--; 404 buildCounterUsageReportParameters--;
405 } 405 }
406 406
407 buildUnnamed627() { 407 buildUnnamed632() {
408 var o = new core.List<api.UsageReportParameters>(); 408 var o = new core.List<api.UsageReportParameters>();
409 o.add(buildUsageReportParameters()); 409 o.add(buildUsageReportParameters());
410 o.add(buildUsageReportParameters()); 410 o.add(buildUsageReportParameters());
411 return o; 411 return o;
412 } 412 }
413 413
414 checkUnnamed627(core.List<api.UsageReportParameters> o) { 414 checkUnnamed632(core.List<api.UsageReportParameters> o) {
415 unittest.expect(o, unittest.hasLength(2)); 415 unittest.expect(o, unittest.hasLength(2));
416 checkUsageReportParameters(o[0]); 416 checkUsageReportParameters(o[0]);
417 checkUsageReportParameters(o[1]); 417 checkUsageReportParameters(o[1]);
418 } 418 }
419 419
420 core.int buildCounterUsageReport = 0; 420 core.int buildCounterUsageReport = 0;
421 buildUsageReport() { 421 buildUsageReport() {
422 var o = new api.UsageReport(); 422 var o = new api.UsageReport();
423 buildCounterUsageReport++; 423 buildCounterUsageReport++;
424 if (buildCounterUsageReport < 3) { 424 if (buildCounterUsageReport < 3) {
425 o.date = "foo"; 425 o.date = "foo";
426 o.entity = buildUsageReportEntity(); 426 o.entity = buildUsageReportEntity();
427 o.etag = "foo"; 427 o.etag = "foo";
428 o.kind = "foo"; 428 o.kind = "foo";
429 o.parameters = buildUnnamed627(); 429 o.parameters = buildUnnamed632();
430 } 430 }
431 buildCounterUsageReport--; 431 buildCounterUsageReport--;
432 return o; 432 return o;
433 } 433 }
434 434
435 checkUsageReport(api.UsageReport o) { 435 checkUsageReport(api.UsageReport o) {
436 buildCounterUsageReport++; 436 buildCounterUsageReport++;
437 if (buildCounterUsageReport < 3) { 437 if (buildCounterUsageReport < 3) {
438 unittest.expect(o.date, unittest.equals('foo')); 438 unittest.expect(o.date, unittest.equals('foo'));
439 checkUsageReportEntity(o.entity); 439 checkUsageReportEntity(o.entity);
440 unittest.expect(o.etag, unittest.equals('foo')); 440 unittest.expect(o.etag, unittest.equals('foo'));
441 unittest.expect(o.kind, unittest.equals('foo')); 441 unittest.expect(o.kind, unittest.equals('foo'));
442 checkUnnamed627(o.parameters); 442 checkUnnamed632(o.parameters);
443 } 443 }
444 buildCounterUsageReport--; 444 buildCounterUsageReport--;
445 } 445 }
446 446
447 buildUnnamed628() { 447 buildUnnamed633() {
448 var o = new core.List<api.UsageReport>(); 448 var o = new core.List<api.UsageReport>();
449 o.add(buildUsageReport()); 449 o.add(buildUsageReport());
450 o.add(buildUsageReport()); 450 o.add(buildUsageReport());
451 return o; 451 return o;
452 } 452 }
453 453
454 checkUnnamed628(core.List<api.UsageReport> o) { 454 checkUnnamed633(core.List<api.UsageReport> o) {
455 unittest.expect(o, unittest.hasLength(2)); 455 unittest.expect(o, unittest.hasLength(2));
456 checkUsageReport(o[0]); 456 checkUsageReport(o[0]);
457 checkUsageReport(o[1]); 457 checkUsageReport(o[1]);
458 } 458 }
459 459
460 core.int buildCounterUsageReportsWarningsData = 0; 460 core.int buildCounterUsageReportsWarningsData = 0;
461 buildUsageReportsWarningsData() { 461 buildUsageReportsWarningsData() {
462 var o = new api.UsageReportsWarningsData(); 462 var o = new api.UsageReportsWarningsData();
463 buildCounterUsageReportsWarningsData++; 463 buildCounterUsageReportsWarningsData++;
464 if (buildCounterUsageReportsWarningsData < 3) { 464 if (buildCounterUsageReportsWarningsData < 3) {
465 o.key = "foo"; 465 o.key = "foo";
466 o.value = "foo"; 466 o.value = "foo";
467 } 467 }
468 buildCounterUsageReportsWarningsData--; 468 buildCounterUsageReportsWarningsData--;
469 return o; 469 return o;
470 } 470 }
471 471
472 checkUsageReportsWarningsData(api.UsageReportsWarningsData o) { 472 checkUsageReportsWarningsData(api.UsageReportsWarningsData o) {
473 buildCounterUsageReportsWarningsData++; 473 buildCounterUsageReportsWarningsData++;
474 if (buildCounterUsageReportsWarningsData < 3) { 474 if (buildCounterUsageReportsWarningsData < 3) {
475 unittest.expect(o.key, unittest.equals('foo')); 475 unittest.expect(o.key, unittest.equals('foo'));
476 unittest.expect(o.value, unittest.equals('foo')); 476 unittest.expect(o.value, unittest.equals('foo'));
477 } 477 }
478 buildCounterUsageReportsWarningsData--; 478 buildCounterUsageReportsWarningsData--;
479 } 479 }
480 480
481 buildUnnamed629() { 481 buildUnnamed634() {
482 var o = new core.List<api.UsageReportsWarningsData>(); 482 var o = new core.List<api.UsageReportsWarningsData>();
483 o.add(buildUsageReportsWarningsData()); 483 o.add(buildUsageReportsWarningsData());
484 o.add(buildUsageReportsWarningsData()); 484 o.add(buildUsageReportsWarningsData());
485 return o; 485 return o;
486 } 486 }
487 487
488 checkUnnamed629(core.List<api.UsageReportsWarningsData> o) { 488 checkUnnamed634(core.List<api.UsageReportsWarningsData> o) {
489 unittest.expect(o, unittest.hasLength(2)); 489 unittest.expect(o, unittest.hasLength(2));
490 checkUsageReportsWarningsData(o[0]); 490 checkUsageReportsWarningsData(o[0]);
491 checkUsageReportsWarningsData(o[1]); 491 checkUsageReportsWarningsData(o[1]);
492 } 492 }
493 493
494 core.int buildCounterUsageReportsWarnings = 0; 494 core.int buildCounterUsageReportsWarnings = 0;
495 buildUsageReportsWarnings() { 495 buildUsageReportsWarnings() {
496 var o = new api.UsageReportsWarnings(); 496 var o = new api.UsageReportsWarnings();
497 buildCounterUsageReportsWarnings++; 497 buildCounterUsageReportsWarnings++;
498 if (buildCounterUsageReportsWarnings < 3) { 498 if (buildCounterUsageReportsWarnings < 3) {
499 o.code = "foo"; 499 o.code = "foo";
500 o.data = buildUnnamed629(); 500 o.data = buildUnnamed634();
501 o.message = "foo"; 501 o.message = "foo";
502 } 502 }
503 buildCounterUsageReportsWarnings--; 503 buildCounterUsageReportsWarnings--;
504 return o; 504 return o;
505 } 505 }
506 506
507 checkUsageReportsWarnings(api.UsageReportsWarnings o) { 507 checkUsageReportsWarnings(api.UsageReportsWarnings o) {
508 buildCounterUsageReportsWarnings++; 508 buildCounterUsageReportsWarnings++;
509 if (buildCounterUsageReportsWarnings < 3) { 509 if (buildCounterUsageReportsWarnings < 3) {
510 unittest.expect(o.code, unittest.equals('foo')); 510 unittest.expect(o.code, unittest.equals('foo'));
511 checkUnnamed629(o.data); 511 checkUnnamed634(o.data);
512 unittest.expect(o.message, unittest.equals('foo')); 512 unittest.expect(o.message, unittest.equals('foo'));
513 } 513 }
514 buildCounterUsageReportsWarnings--; 514 buildCounterUsageReportsWarnings--;
515 } 515 }
516 516
517 buildUnnamed630() { 517 buildUnnamed635() {
518 var o = new core.List<api.UsageReportsWarnings>(); 518 var o = new core.List<api.UsageReportsWarnings>();
519 o.add(buildUsageReportsWarnings()); 519 o.add(buildUsageReportsWarnings());
520 o.add(buildUsageReportsWarnings()); 520 o.add(buildUsageReportsWarnings());
521 return o; 521 return o;
522 } 522 }
523 523
524 checkUnnamed630(core.List<api.UsageReportsWarnings> o) { 524 checkUnnamed635(core.List<api.UsageReportsWarnings> o) {
525 unittest.expect(o, unittest.hasLength(2)); 525 unittest.expect(o, unittest.hasLength(2));
526 checkUsageReportsWarnings(o[0]); 526 checkUsageReportsWarnings(o[0]);
527 checkUsageReportsWarnings(o[1]); 527 checkUsageReportsWarnings(o[1]);
528 } 528 }
529 529
530 core.int buildCounterUsageReports = 0; 530 core.int buildCounterUsageReports = 0;
531 buildUsageReports() { 531 buildUsageReports() {
532 var o = new api.UsageReports(); 532 var o = new api.UsageReports();
533 buildCounterUsageReports++; 533 buildCounterUsageReports++;
534 if (buildCounterUsageReports < 3) { 534 if (buildCounterUsageReports < 3) {
535 o.etag = "foo"; 535 o.etag = "foo";
536 o.kind = "foo"; 536 o.kind = "foo";
537 o.nextPageToken = "foo"; 537 o.nextPageToken = "foo";
538 o.usageReports = buildUnnamed628(); 538 o.usageReports = buildUnnamed633();
539 o.warnings = buildUnnamed630(); 539 o.warnings = buildUnnamed635();
540 } 540 }
541 buildCounterUsageReports--; 541 buildCounterUsageReports--;
542 return o; 542 return o;
543 } 543 }
544 544
545 checkUsageReports(api.UsageReports o) { 545 checkUsageReports(api.UsageReports o) {
546 buildCounterUsageReports++; 546 buildCounterUsageReports++;
547 if (buildCounterUsageReports < 3) { 547 if (buildCounterUsageReports < 3) {
548 unittest.expect(o.etag, unittest.equals('foo')); 548 unittest.expect(o.etag, unittest.equals('foo'));
549 unittest.expect(o.kind, unittest.equals('foo')); 549 unittest.expect(o.kind, unittest.equals('foo'));
550 unittest.expect(o.nextPageToken, unittest.equals('foo')); 550 unittest.expect(o.nextPageToken, unittest.equals('foo'));
551 checkUnnamed628(o.usageReports); 551 checkUnnamed633(o.usageReports);
552 checkUnnamed630(o.warnings); 552 checkUnnamed635(o.warnings);
553 } 553 }
554 buildCounterUsageReports--; 554 buildCounterUsageReports--;
555 } 555 }
556 556
557 557
558 main() { 558 main() {
559 unittest.group("obj-schema-Activities", () { 559 unittest.group("obj-schema-Activities", () {
560 unittest.test("to-json--from-json", () { 560 unittest.test("to-json--from-json", () {
561 var o = buildActivities(); 561 var o = buildActivities();
562 var od = new api.Activities.fromJson(o.toJson()); 562 var od = new api.Activities.fromJson(o.toJson());
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 var arg_userKey = "foo"; 681 var arg_userKey = "foo";
682 var arg_applicationName = "foo"; 682 var arg_applicationName = "foo";
683 var arg_actorIpAddress = "foo"; 683 var arg_actorIpAddress = "foo";
684 var arg_customerId = "foo"; 684 var arg_customerId = "foo";
685 var arg_endTime = "foo"; 685 var arg_endTime = "foo";
686 var arg_eventName = "foo"; 686 var arg_eventName = "foo";
687 var arg_filters = "foo"; 687 var arg_filters = "foo";
688 var arg_maxResults = 42; 688 var arg_maxResults = 42;
689 var arg_pageToken = "foo"; 689 var arg_pageToken = "foo";
690 var arg_startTime = "foo"; 690 var arg_startTime = "foo";
691 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 691 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
692 var path = (req.url).path; 692 var path = (req.url).path;
693 var pathOffset = 0; 693 var pathOffset = 0;
694 var index; 694 var index;
695 var subPart; 695 var subPart;
696 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 696 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
697 pathOffset += 1; 697 pathOffset += 1;
698 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/")); 698 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/"));
699 pathOffset += 17; 699 pathOffset += 17;
700 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq uals("activity/users/")); 700 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq uals("activity/users/"));
701 pathOffset += 15; 701 pathOffset += 15;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 735 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
736 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi me)); 736 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi me));
737 737
738 738
739 var h = { 739 var h = {
740 "content-type" : "application/json; charset=utf-8", 740 "content-type" : "application/json; charset=utf-8",
741 }; 741 };
742 var resp = convert.JSON.encode(buildActivities()); 742 var resp = convert.JSON.encode(buildActivities());
743 return new async.Future.value(stringResponse(200, h, resp)); 743 return new async.Future.value(stringResponse(200, h, resp));
744 }), true); 744 }), true);
745 res.list(arg_userKey, arg_applicationName, actorIpAddress: arg_actorIpAddr ess, customerId: arg_customerId, endTime: arg_endTime, eventName: arg_eventName, filters: arg_filters, maxResults: arg_maxResults, pageToken: arg_pageToken, sta rtTime: arg_startTime).then(unittest.expectAsync(((api.Activities response) { 745 res.list(arg_userKey, arg_applicationName, actorIpAddress: arg_actorIpAddr ess, customerId: arg_customerId, endTime: arg_endTime, eventName: arg_eventName, filters: arg_filters, maxResults: arg_maxResults, pageToken: arg_pageToken, sta rtTime: arg_startTime).then(unittest.expectAsync1(((api.Activities response) {
746 checkActivities(response); 746 checkActivities(response);
747 }))); 747 })));
748 }); 748 });
749 749
750 unittest.test("method--watch", () { 750 unittest.test("method--watch", () {
751 751
752 var mock = new HttpServerMock(); 752 var mock = new HttpServerMock();
753 api.ActivitiesResourceApi res = new api.AdminApi(mock).activities; 753 api.ActivitiesResourceApi res = new api.AdminApi(mock).activities;
754 var arg_request = buildChannel(); 754 var arg_request = buildChannel();
755 var arg_userKey = "foo"; 755 var arg_userKey = "foo";
756 var arg_applicationName = "foo"; 756 var arg_applicationName = "foo";
757 var arg_actorIpAddress = "foo"; 757 var arg_actorIpAddress = "foo";
758 var arg_customerId = "foo"; 758 var arg_customerId = "foo";
759 var arg_endTime = "foo"; 759 var arg_endTime = "foo";
760 var arg_eventName = "foo"; 760 var arg_eventName = "foo";
761 var arg_filters = "foo"; 761 var arg_filters = "foo";
762 var arg_maxResults = 42; 762 var arg_maxResults = 42;
763 var arg_pageToken = "foo"; 763 var arg_pageToken = "foo";
764 var arg_startTime = "foo"; 764 var arg_startTime = "foo";
765 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 765 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
766 var obj = new api.Channel.fromJson(json); 766 var obj = new api.Channel.fromJson(json);
767 checkChannel(obj); 767 checkChannel(obj);
768 768
769 var path = (req.url).path; 769 var path = (req.url).path;
770 var pathOffset = 0; 770 var pathOffset = 0;
771 var index; 771 var index;
772 var subPart; 772 var subPart;
773 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 773 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
774 pathOffset += 1; 774 pathOffset += 1;
775 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/")); 775 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/"));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 816 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
817 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi me)); 817 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi me));
818 818
819 819
820 var h = { 820 var h = {
821 "content-type" : "application/json; charset=utf-8", 821 "content-type" : "application/json; charset=utf-8",
822 }; 822 };
823 var resp = convert.JSON.encode(buildChannel()); 823 var resp = convert.JSON.encode(buildChannel());
824 return new async.Future.value(stringResponse(200, h, resp)); 824 return new async.Future.value(stringResponse(200, h, resp));
825 }), true); 825 }), true);
826 res.watch(arg_request, arg_userKey, arg_applicationName, actorIpAddress: a rg_actorIpAddress, customerId: arg_customerId, endTime: arg_endTime, eventName: arg_eventName, filters: arg_filters, maxResults: arg_maxResults, pageToken: arg_ pageToken, startTime: arg_startTime).then(unittest.expectAsync(((api.Channel res ponse) { 826 res.watch(arg_request, arg_userKey, arg_applicationName, actorIpAddress: a rg_actorIpAddress, customerId: arg_customerId, endTime: arg_endTime, eventName: arg_eventName, filters: arg_filters, maxResults: arg_maxResults, pageToken: arg_ pageToken, startTime: arg_startTime).then(unittest.expectAsync1(((api.Channel re sponse) {
827 checkChannel(response); 827 checkChannel(response);
828 }))); 828 })));
829 }); 829 });
830 830
831 }); 831 });
832 832
833 833
834 unittest.group("resource-ChannelsResourceApi", () { 834 unittest.group("resource-ChannelsResourceApi", () {
835 unittest.test("method--stop", () { 835 unittest.test("method--stop", () {
836 836
837 var mock = new HttpServerMock(); 837 var mock = new HttpServerMock();
838 api.ChannelsResourceApi res = new api.AdminApi(mock).channels; 838 api.ChannelsResourceApi res = new api.AdminApi(mock).channels;
839 var arg_request = buildChannel(); 839 var arg_request = buildChannel();
840 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 840 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
841 var obj = new api.Channel.fromJson(json); 841 var obj = new api.Channel.fromJson(json);
842 checkChannel(obj); 842 checkChannel(obj);
843 843
844 var path = (req.url).path; 844 var path = (req.url).path;
845 var pathOffset = 0; 845 var pathOffset = 0;
846 var index; 846 var index;
847 var subPart; 847 var subPart;
848 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 848 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
849 pathOffset += 1; 849 pathOffset += 1;
850 unittest.expect(path.substring(pathOffset, pathOffset + 30), unittest.eq uals("admin/reports_v1/channels/stop")); 850 unittest.expect(path.substring(pathOffset, pathOffset + 30), unittest.eq uals("admin/reports_v1/channels/stop"));
(...skipping 16 matching lines...) Expand all
867 } 867 }
868 } 868 }
869 869
870 870
871 var h = { 871 var h = {
872 "content-type" : "application/json; charset=utf-8", 872 "content-type" : "application/json; charset=utf-8",
873 }; 873 };
874 var resp = ""; 874 var resp = "";
875 return new async.Future.value(stringResponse(200, h, resp)); 875 return new async.Future.value(stringResponse(200, h, resp));
876 }), true); 876 }), true);
877 res.stop(arg_request).then(unittest.expectAsync((_) {})); 877 res.stop(arg_request).then(unittest.expectAsync1((_) {}));
878 }); 878 });
879 879
880 }); 880 });
881 881
882 882
883 unittest.group("resource-CustomerUsageReportsResourceApi", () { 883 unittest.group("resource-CustomerUsageReportsResourceApi", () {
884 unittest.test("method--get", () { 884 unittest.test("method--get", () {
885 885
886 var mock = new HttpServerMock(); 886 var mock = new HttpServerMock();
887 api.CustomerUsageReportsResourceApi res = new api.AdminApi(mock).customerU sageReports; 887 api.CustomerUsageReportsResourceApi res = new api.AdminApi(mock).customerU sageReports;
888 var arg_date = "foo"; 888 var arg_date = "foo";
889 var arg_customerId = "foo"; 889 var arg_customerId = "foo";
890 var arg_pageToken = "foo"; 890 var arg_pageToken = "foo";
891 var arg_parameters = "foo"; 891 var arg_parameters = "foo";
892 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 892 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
893 var path = (req.url).path; 893 var path = (req.url).path;
894 var pathOffset = 0; 894 var pathOffset = 0;
895 var index; 895 var index;
896 var subPart; 896 var subPart;
897 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 897 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
898 pathOffset += 1; 898 pathOffset += 1;
899 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/")); 899 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/"));
900 pathOffset += 17; 900 pathOffset += 17;
901 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("usage/dates/")); 901 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("usage/dates/"));
902 pathOffset += 12; 902 pathOffset += 12;
(...skipping 21 matching lines...) Expand all
924 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 924 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
925 unittest.expect(queryMap["parameters"].first, unittest.equals(arg_parame ters)); 925 unittest.expect(queryMap["parameters"].first, unittest.equals(arg_parame ters));
926 926
927 927
928 var h = { 928 var h = {
929 "content-type" : "application/json; charset=utf-8", 929 "content-type" : "application/json; charset=utf-8",
930 }; 930 };
931 var resp = convert.JSON.encode(buildUsageReports()); 931 var resp = convert.JSON.encode(buildUsageReports());
932 return new async.Future.value(stringResponse(200, h, resp)); 932 return new async.Future.value(stringResponse(200, h, resp));
933 }), true); 933 }), true);
934 res.get(arg_date, customerId: arg_customerId, pageToken: arg_pageToken, pa rameters: arg_parameters).then(unittest.expectAsync(((api.UsageReports response) { 934 res.get(arg_date, customerId: arg_customerId, pageToken: arg_pageToken, pa rameters: arg_parameters).then(unittest.expectAsync1(((api.UsageReports response ) {
935 checkUsageReports(response); 935 checkUsageReports(response);
936 }))); 936 })));
937 }); 937 });
938 938
939 }); 939 });
940 940
941 941
942 unittest.group("resource-UserUsageReportResourceApi", () { 942 unittest.group("resource-UserUsageReportResourceApi", () {
943 unittest.test("method--get", () { 943 unittest.test("method--get", () {
944 944
945 var mock = new HttpServerMock(); 945 var mock = new HttpServerMock();
946 api.UserUsageReportResourceApi res = new api.AdminApi(mock).userUsageRepor t; 946 api.UserUsageReportResourceApi res = new api.AdminApi(mock).userUsageRepor t;
947 var arg_userKey = "foo"; 947 var arg_userKey = "foo";
948 var arg_date = "foo"; 948 var arg_date = "foo";
949 var arg_customerId = "foo"; 949 var arg_customerId = "foo";
950 var arg_filters = "foo"; 950 var arg_filters = "foo";
951 var arg_maxResults = 42; 951 var arg_maxResults = 42;
952 var arg_pageToken = "foo"; 952 var arg_pageToken = "foo";
953 var arg_parameters = "foo"; 953 var arg_parameters = "foo";
954 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 954 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
955 var path = (req.url).path; 955 var path = (req.url).path;
956 var pathOffset = 0; 956 var pathOffset = 0;
957 var index; 957 var index;
958 var subPart; 958 var subPart;
959 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 959 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
960 pathOffset += 1; 960 pathOffset += 1;
961 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/")); 961 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("admin/reports/v1/"));
962 pathOffset += 17; 962 pathOffset += 17;
963 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("usage/users/")); 963 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("usage/users/"));
964 pathOffset += 12; 964 pathOffset += 12;
(...skipping 30 matching lines...) Expand all
995 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 995 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
996 unittest.expect(queryMap["parameters"].first, unittest.equals(arg_parame ters)); 996 unittest.expect(queryMap["parameters"].first, unittest.equals(arg_parame ters));
997 997
998 998
999 var h = { 999 var h = {
1000 "content-type" : "application/json; charset=utf-8", 1000 "content-type" : "application/json; charset=utf-8",
1001 }; 1001 };
1002 var resp = convert.JSON.encode(buildUsageReports()); 1002 var resp = convert.JSON.encode(buildUsageReports());
1003 return new async.Future.value(stringResponse(200, h, resp)); 1003 return new async.Future.value(stringResponse(200, h, resp));
1004 }), true); 1004 }), true);
1005 res.get(arg_userKey, arg_date, customerId: arg_customerId, filters: arg_fi lters, maxResults: arg_maxResults, pageToken: arg_pageToken, parameters: arg_par ameters).then(unittest.expectAsync(((api.UsageReports response) { 1005 res.get(arg_userKey, arg_date, customerId: arg_customerId, filters: arg_fi lters, maxResults: arg_maxResults, pageToken: arg_pageToken, parameters: arg_par ameters).then(unittest.expectAsync1(((api.UsageReports response) {
1006 checkUsageReports(response); 1006 checkUsageReports(response);
1007 }))); 1007 })));
1008 }); 1008 });
1009 1009
1010 }); 1010 });
1011 1011
1012 1012
1013 } 1013 }
1014 1014
OLDNEW
« no previous file with comments | « generated/googleapis/test/admin/directory_v1_test.dart ('k') | generated/googleapis/test/analytics/v3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698