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

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

Issue 2039113004: Api-roll 37: 2016-06-06 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 4 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.consumersurveys.v2.test; 1 library googleapis.consumersurveys.v2.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection; 4 import "dart:collection" as collection;
5 import "dart:async" as async; 5 import "dart:async" as async;
6 import "dart:convert" as convert; 6 import "dart:convert" as convert;
7 7
8 import 'package:http/http.dart' as http; 8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing; 9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest; 10 import 'package:unittest/unittest.dart' as unittest;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 headers, core.String body) {
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 buildUnnamed817() { 54 buildUnnamed21() {
55 var o = new core.List<api.FieldMask>(); 55 var o = new core.List<api.FieldMask>();
56 o.add(buildFieldMask()); 56 o.add(buildFieldMask());
57 o.add(buildFieldMask()); 57 o.add(buildFieldMask());
58 return o; 58 return o;
59 } 59 }
60 60
61 checkUnnamed817(core.List<api.FieldMask> o) { 61 checkUnnamed21(core.List<api.FieldMask> o) {
62 unittest.expect(o, unittest.hasLength(2)); 62 unittest.expect(o, unittest.hasLength(2));
63 checkFieldMask(o[0]); 63 checkFieldMask(o[0]);
64 checkFieldMask(o[1]); 64 checkFieldMask(o[1]);
65 } 65 }
66 66
67 core.int buildCounterFieldMask = 0; 67 core.int buildCounterFieldMask = 0;
68 buildFieldMask() { 68 buildFieldMask() {
69 var o = new api.FieldMask(); 69 var o = new api.FieldMask();
70 buildCounterFieldMask++; 70 buildCounterFieldMask++;
71 if (buildCounterFieldMask < 3) { 71 if (buildCounterFieldMask < 3) {
72 o.fields = buildUnnamed817(); 72 o.fields = buildUnnamed21();
73 o.id = 42; 73 o.id = 42;
74 } 74 }
75 buildCounterFieldMask--; 75 buildCounterFieldMask--;
76 return o; 76 return o;
77 } 77 }
78 78
79 checkFieldMask(api.FieldMask o) { 79 checkFieldMask(api.FieldMask o) {
80 buildCounterFieldMask++; 80 buildCounterFieldMask++;
81 if (buildCounterFieldMask < 3) { 81 if (buildCounterFieldMask < 3) {
82 checkUnnamed817(o.fields); 82 checkUnnamed21(o.fields);
83 unittest.expect(o.id, unittest.equals(42)); 83 unittest.expect(o.id, unittest.equals(42));
84 } 84 }
85 buildCounterFieldMask--; 85 buildCounterFieldMask--;
86 } 86 }
87 87
88 buildUnnamed22() {
89 var o = new core.List<core.String>();
90 o.add("foo");
91 o.add("foo");
92 return o;
93 }
94
95 checkUnnamed22(core.List<core.String> o) {
96 unittest.expect(o, unittest.hasLength(2));
97 unittest.expect(o[0], unittest.equals('foo'));
98 unittest.expect(o[1], unittest.equals('foo'));
99 }
100
101 core.int buildCounterMobileAppPanel = 0;
102 buildMobileAppPanel() {
103 var o = new api.MobileAppPanel();
104 buildCounterMobileAppPanel++;
105 if (buildCounterMobileAppPanel < 3) {
106 o.country = "foo";
107 o.isPublicPanel = true;
108 o.language = "foo";
109 o.mobileAppPanelId = "foo";
110 o.name = "foo";
111 o.owners = buildUnnamed22();
112 }
113 buildCounterMobileAppPanel--;
114 return o;
115 }
116
117 checkMobileAppPanel(api.MobileAppPanel o) {
118 buildCounterMobileAppPanel++;
119 if (buildCounterMobileAppPanel < 3) {
120 unittest.expect(o.country, unittest.equals('foo'));
121 unittest.expect(o.isPublicPanel, unittest.isTrue);
122 unittest.expect(o.language, unittest.equals('foo'));
123 unittest.expect(o.mobileAppPanelId, unittest.equals('foo'));
124 unittest.expect(o.name, unittest.equals('foo'));
125 checkUnnamed22(o.owners);
126 }
127 buildCounterMobileAppPanel--;
128 }
129
130 buildUnnamed23() {
131 var o = new core.List<api.MobileAppPanel>();
132 o.add(buildMobileAppPanel());
133 o.add(buildMobileAppPanel());
134 return o;
135 }
136
137 checkUnnamed23(core.List<api.MobileAppPanel> o) {
138 unittest.expect(o, unittest.hasLength(2));
139 checkMobileAppPanel(o[0]);
140 checkMobileAppPanel(o[1]);
141 }
142
143 core.int buildCounterMobileAppPanelsListResponse = 0;
144 buildMobileAppPanelsListResponse() {
145 var o = new api.MobileAppPanelsListResponse();
146 buildCounterMobileAppPanelsListResponse++;
147 if (buildCounterMobileAppPanelsListResponse < 3) {
148 o.pageInfo = buildPageInfo();
149 o.requestId = "foo";
150 o.resources = buildUnnamed23();
151 o.tokenPagination = buildTokenPagination();
152 }
153 buildCounterMobileAppPanelsListResponse--;
154 return o;
155 }
156
157 checkMobileAppPanelsListResponse(api.MobileAppPanelsListResponse o) {
158 buildCounterMobileAppPanelsListResponse++;
159 if (buildCounterMobileAppPanelsListResponse < 3) {
160 checkPageInfo(o.pageInfo);
161 unittest.expect(o.requestId, unittest.equals('foo'));
162 checkUnnamed23(o.resources);
163 checkTokenPagination(o.tokenPagination);
164 }
165 buildCounterMobileAppPanelsListResponse--;
166 }
167
88 core.int buildCounterPageInfo = 0; 168 core.int buildCounterPageInfo = 0;
89 buildPageInfo() { 169 buildPageInfo() {
90 var o = new api.PageInfo(); 170 var o = new api.PageInfo();
91 buildCounterPageInfo++; 171 buildCounterPageInfo++;
92 if (buildCounterPageInfo < 3) { 172 if (buildCounterPageInfo < 3) {
93 o.resultPerPage = 42; 173 o.resultPerPage = 42;
94 o.startIndex = 42; 174 o.startIndex = 42;
95 o.totalResults = 42; 175 o.totalResults = 42;
96 } 176 }
97 buildCounterPageInfo--; 177 buildCounterPageInfo--;
(...skipping 22 matching lines...) Expand all
120 } 200 }
121 201
122 checkResultsGetRequest(api.ResultsGetRequest o) { 202 checkResultsGetRequest(api.ResultsGetRequest o) {
123 buildCounterResultsGetRequest++; 203 buildCounterResultsGetRequest++;
124 if (buildCounterResultsGetRequest < 3) { 204 if (buildCounterResultsGetRequest < 3) {
125 checkResultsMask(o.resultMask); 205 checkResultsMask(o.resultMask);
126 } 206 }
127 buildCounterResultsGetRequest--; 207 buildCounterResultsGetRequest--;
128 } 208 }
129 209
130 buildUnnamed818() { 210 buildUnnamed24() {
131 var o = new core.List<api.FieldMask>(); 211 var o = new core.List<api.FieldMask>();
132 o.add(buildFieldMask()); 212 o.add(buildFieldMask());
133 o.add(buildFieldMask()); 213 o.add(buildFieldMask());
134 return o; 214 return o;
135 } 215 }
136 216
137 checkUnnamed818(core.List<api.FieldMask> o) { 217 checkUnnamed24(core.List<api.FieldMask> o) {
138 unittest.expect(o, unittest.hasLength(2)); 218 unittest.expect(o, unittest.hasLength(2));
139 checkFieldMask(o[0]); 219 checkFieldMask(o[0]);
140 checkFieldMask(o[1]); 220 checkFieldMask(o[1]);
141 } 221 }
142 222
143 core.int buildCounterResultsMask = 0; 223 core.int buildCounterResultsMask = 0;
144 buildResultsMask() { 224 buildResultsMask() {
145 var o = new api.ResultsMask(); 225 var o = new api.ResultsMask();
146 buildCounterResultsMask++; 226 buildCounterResultsMask++;
147 if (buildCounterResultsMask < 3) { 227 if (buildCounterResultsMask < 3) {
148 o.fields = buildUnnamed818(); 228 o.fields = buildUnnamed24();
149 o.projection = "foo"; 229 o.projection = "foo";
150 } 230 }
151 buildCounterResultsMask--; 231 buildCounterResultsMask--;
152 return o; 232 return o;
153 } 233 }
154 234
155 checkResultsMask(api.ResultsMask o) { 235 checkResultsMask(api.ResultsMask o) {
156 buildCounterResultsMask++; 236 buildCounterResultsMask++;
157 if (buildCounterResultsMask < 3) { 237 if (buildCounterResultsMask < 3) {
158 checkUnnamed818(o.fields); 238 checkUnnamed24(o.fields);
159 unittest.expect(o.projection, unittest.equals('foo')); 239 unittest.expect(o.projection, unittest.equals('foo'));
160 } 240 }
161 buildCounterResultsMask--; 241 buildCounterResultsMask--;
162 } 242 }
163 243
164 buildUnnamed819() { 244 buildUnnamed25() {
165 var o = new core.List<core.String>(); 245 var o = new core.List<core.String>();
166 o.add("foo"); 246 o.add("foo");
167 o.add("foo"); 247 o.add("foo");
168 return o; 248 return o;
169 } 249 }
170 250
171 checkUnnamed819(core.List<core.String> o) { 251 checkUnnamed25(core.List<core.String> o) {
172 unittest.expect(o, unittest.hasLength(2)); 252 unittest.expect(o, unittest.hasLength(2));
173 unittest.expect(o[0], unittest.equals('foo')); 253 unittest.expect(o[0], unittest.equals('foo'));
174 unittest.expect(o[1], unittest.equals('foo')); 254 unittest.expect(o[1], unittest.equals('foo'));
175 } 255 }
176 256
177 buildUnnamed820() { 257 buildUnnamed26() {
178 var o = new core.List<api.SurveyQuestion>(); 258 var o = new core.List<api.SurveyQuestion>();
179 o.add(buildSurveyQuestion()); 259 o.add(buildSurveyQuestion());
180 o.add(buildSurveyQuestion()); 260 o.add(buildSurveyQuestion());
181 return o; 261 return o;
182 } 262 }
183 263
184 checkUnnamed820(core.List<api.SurveyQuestion> o) { 264 checkUnnamed26(core.List<api.SurveyQuestion> o) {
185 unittest.expect(o, unittest.hasLength(2)); 265 unittest.expect(o, unittest.hasLength(2));
186 checkSurveyQuestion(o[0]); 266 checkSurveyQuestion(o[0]);
187 checkSurveyQuestion(o[1]); 267 checkSurveyQuestion(o[1]);
188 } 268 }
189 269
190 core.int buildCounterSurvey = 0; 270 core.int buildCounterSurvey = 0;
191 buildSurvey() { 271 buildSurvey() {
192 var o = new api.Survey(); 272 var o = new api.Survey();
193 buildCounterSurvey++; 273 buildCounterSurvey++;
194 if (buildCounterSurvey < 3) { 274 if (buildCounterSurvey < 3) {
195 o.audience = buildSurveyAudience(); 275 o.audience = buildSurveyAudience();
196 o.cost = buildSurveyCost(); 276 o.cost = buildSurveyCost();
197 o.customerData = "foo"; 277 o.customerData = "foo";
198 o.description = "foo"; 278 o.description = "foo";
199 o.owners = buildUnnamed819(); 279 o.owners = buildUnnamed25();
200 o.questions = buildUnnamed820(); 280 o.questions = buildUnnamed26();
201 o.state = "foo"; 281 o.state = "foo";
202 o.surveyUrlId = "foo"; 282 o.surveyUrlId = "foo";
203 o.title = "foo"; 283 o.title = "foo";
204 o.wantedResponseCount = 42; 284 o.wantedResponseCount = 42;
205 } 285 }
206 buildCounterSurvey--; 286 buildCounterSurvey--;
207 return o; 287 return o;
208 } 288 }
209 289
210 checkSurvey(api.Survey o) { 290 checkSurvey(api.Survey o) {
211 buildCounterSurvey++; 291 buildCounterSurvey++;
212 if (buildCounterSurvey < 3) { 292 if (buildCounterSurvey < 3) {
213 checkSurveyAudience(o.audience); 293 checkSurveyAudience(o.audience);
214 checkSurveyCost(o.cost); 294 checkSurveyCost(o.cost);
215 unittest.expect(o.customerData, unittest.equals('foo')); 295 unittest.expect(o.customerData, unittest.equals('foo'));
216 unittest.expect(o.description, unittest.equals('foo')); 296 unittest.expect(o.description, unittest.equals('foo'));
217 checkUnnamed819(o.owners); 297 checkUnnamed25(o.owners);
218 checkUnnamed820(o.questions); 298 checkUnnamed26(o.questions);
219 unittest.expect(o.state, unittest.equals('foo')); 299 unittest.expect(o.state, unittest.equals('foo'));
220 unittest.expect(o.surveyUrlId, unittest.equals('foo')); 300 unittest.expect(o.surveyUrlId, unittest.equals('foo'));
221 unittest.expect(o.title, unittest.equals('foo')); 301 unittest.expect(o.title, unittest.equals('foo'));
222 unittest.expect(o.wantedResponseCount, unittest.equals(42)); 302 unittest.expect(o.wantedResponseCount, unittest.equals(42));
223 } 303 }
224 buildCounterSurvey--; 304 buildCounterSurvey--;
225 } 305 }
226 306
227 buildUnnamed821() { 307 buildUnnamed27() {
228 var o = new core.List<core.String>(); 308 var o = new core.List<core.String>();
229 o.add("foo"); 309 o.add("foo");
230 o.add("foo"); 310 o.add("foo");
231 return o; 311 return o;
232 } 312 }
233 313
234 checkUnnamed821(core.List<core.String> o) { 314 checkUnnamed27(core.List<core.String> o) {
235 unittest.expect(o, unittest.hasLength(2)); 315 unittest.expect(o, unittest.hasLength(2));
236 unittest.expect(o[0], unittest.equals('foo')); 316 unittest.expect(o[0], unittest.equals('foo'));
237 unittest.expect(o[1], unittest.equals('foo')); 317 unittest.expect(o[1], unittest.equals('foo'));
238 } 318 }
239 319
240 buildUnnamed822() { 320 buildUnnamed28() {
241 var o = new core.List<core.String>(); 321 var o = new core.List<core.String>();
242 o.add("foo"); 322 o.add("foo");
243 o.add("foo"); 323 o.add("foo");
244 return o; 324 return o;
245 } 325 }
246 326
247 checkUnnamed822(core.List<core.String> o) { 327 checkUnnamed28(core.List<core.String> o) {
248 unittest.expect(o, unittest.hasLength(2)); 328 unittest.expect(o, unittest.hasLength(2));
249 unittest.expect(o[0], unittest.equals('foo')); 329 unittest.expect(o[0], unittest.equals('foo'));
250 unittest.expect(o[1], unittest.equals('foo')); 330 unittest.expect(o[1], unittest.equals('foo'));
251 } 331 }
252 332
253 core.int buildCounterSurveyAudience = 0; 333 core.int buildCounterSurveyAudience = 0;
254 buildSurveyAudience() { 334 buildSurveyAudience() {
255 var o = new api.SurveyAudience(); 335 var o = new api.SurveyAudience();
256 buildCounterSurveyAudience++; 336 buildCounterSurveyAudience++;
257 if (buildCounterSurveyAudience < 3) { 337 if (buildCounterSurveyAudience < 3) {
258 o.ages = buildUnnamed821(); 338 o.ages = buildUnnamed27();
259 o.country = "foo"; 339 o.country = "foo";
260 o.countrySubdivision = "foo"; 340 o.countrySubdivision = "foo";
261 o.gender = "foo"; 341 o.gender = "foo";
262 o.languages = buildUnnamed822(); 342 o.languages = buildUnnamed28();
263 o.mobileAppPanelId = "foo"; 343 o.mobileAppPanelId = "foo";
264 o.populationSource = "foo"; 344 o.populationSource = "foo";
265 } 345 }
266 buildCounterSurveyAudience--; 346 buildCounterSurveyAudience--;
267 return o; 347 return o;
268 } 348 }
269 349
270 checkSurveyAudience(api.SurveyAudience o) { 350 checkSurveyAudience(api.SurveyAudience o) {
271 buildCounterSurveyAudience++; 351 buildCounterSurveyAudience++;
272 if (buildCounterSurveyAudience < 3) { 352 if (buildCounterSurveyAudience < 3) {
273 checkUnnamed821(o.ages); 353 checkUnnamed27(o.ages);
274 unittest.expect(o.country, unittest.equals('foo')); 354 unittest.expect(o.country, unittest.equals('foo'));
275 unittest.expect(o.countrySubdivision, unittest.equals('foo')); 355 unittest.expect(o.countrySubdivision, unittest.equals('foo'));
276 unittest.expect(o.gender, unittest.equals('foo')); 356 unittest.expect(o.gender, unittest.equals('foo'));
277 checkUnnamed822(o.languages); 357 checkUnnamed28(o.languages);
278 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); 358 unittest.expect(o.mobileAppPanelId, unittest.equals('foo'));
279 unittest.expect(o.populationSource, unittest.equals('foo')); 359 unittest.expect(o.populationSource, unittest.equals('foo'));
280 } 360 }
281 buildCounterSurveyAudience--; 361 buildCounterSurveyAudience--;
282 } 362 }
283 363
284 core.int buildCounterSurveyCost = 0; 364 core.int buildCounterSurveyCost = 0;
285 buildSurveyCost() { 365 buildSurveyCost() {
286 var o = new api.SurveyCost(); 366 var o = new api.SurveyCost();
287 buildCounterSurveyCost++; 367 buildCounterSurveyCost++;
288 if (buildCounterSurveyCost < 3) { 368 if (buildCounterSurveyCost < 3) {
289 o.autostartMaxCostPerResponse = "foo";
290 o.costPerResponseNanos = "foo"; 369 o.costPerResponseNanos = "foo";
291 o.currencyCode = "foo"; 370 o.currencyCode = "foo";
371 o.maxCostPerResponseNanos = "foo";
292 o.nanos = "foo"; 372 o.nanos = "foo";
293 } 373 }
294 buildCounterSurveyCost--; 374 buildCounterSurveyCost--;
295 return o; 375 return o;
296 } 376 }
297 377
298 checkSurveyCost(api.SurveyCost o) { 378 checkSurveyCost(api.SurveyCost o) {
299 buildCounterSurveyCost++; 379 buildCounterSurveyCost++;
300 if (buildCounterSurveyCost < 3) { 380 if (buildCounterSurveyCost < 3) {
301 unittest.expect(o.autostartMaxCostPerResponse, unittest.equals('foo'));
302 unittest.expect(o.costPerResponseNanos, unittest.equals('foo')); 381 unittest.expect(o.costPerResponseNanos, unittest.equals('foo'));
303 unittest.expect(o.currencyCode, unittest.equals('foo')); 382 unittest.expect(o.currencyCode, unittest.equals('foo'));
383 unittest.expect(o.maxCostPerResponseNanos, unittest.equals('foo'));
304 unittest.expect(o.nanos, unittest.equals('foo')); 384 unittest.expect(o.nanos, unittest.equals('foo'));
305 } 385 }
306 buildCounterSurveyCost--; 386 buildCounterSurveyCost--;
307 } 387 }
308 388
309 buildUnnamed823() { 389 buildUnnamed29() {
310 var o = new core.List<core.String>(); 390 var o = new core.List<core.String>();
311 o.add("foo"); 391 o.add("foo");
312 o.add("foo"); 392 o.add("foo");
313 return o; 393 return o;
314 } 394 }
315 395
316 checkUnnamed823(core.List<core.String> o) { 396 checkUnnamed29(core.List<core.String> o) {
317 unittest.expect(o, unittest.hasLength(2)); 397 unittest.expect(o, unittest.hasLength(2));
318 unittest.expect(o[0], unittest.equals('foo')); 398 unittest.expect(o[0], unittest.equals('foo'));
319 unittest.expect(o[1], unittest.equals('foo')); 399 unittest.expect(o[1], unittest.equals('foo'));
320 } 400 }
321 401
322 buildUnnamed824() { 402 buildUnnamed30() {
323 var o = new core.List<api.SurveyQuestionImage>(); 403 var o = new core.List<api.SurveyQuestionImage>();
324 o.add(buildSurveyQuestionImage()); 404 o.add(buildSurveyQuestionImage());
325 o.add(buildSurveyQuestionImage()); 405 o.add(buildSurveyQuestionImage());
326 return o; 406 return o;
327 } 407 }
328 408
329 checkUnnamed824(core.List<api.SurveyQuestionImage> o) { 409 checkUnnamed30(core.List<api.SurveyQuestionImage> o) {
330 unittest.expect(o, unittest.hasLength(2)); 410 unittest.expect(o, unittest.hasLength(2));
331 checkSurveyQuestionImage(o[0]); 411 checkSurveyQuestionImage(o[0]);
332 checkSurveyQuestionImage(o[1]); 412 checkSurveyQuestionImage(o[1]);
333 } 413 }
334 414
335 buildUnnamed825() { 415 buildUnnamed31() {
336 var o = new core.List<core.String>(); 416 var o = new core.List<core.String>();
337 o.add("foo"); 417 o.add("foo");
338 o.add("foo"); 418 o.add("foo");
339 return o; 419 return o;
340 } 420 }
341 421
342 checkUnnamed825(core.List<core.String> o) { 422 checkUnnamed31(core.List<core.String> o) {
343 unittest.expect(o, unittest.hasLength(2)); 423 unittest.expect(o, unittest.hasLength(2));
344 unittest.expect(o[0], unittest.equals('foo')); 424 unittest.expect(o[0], unittest.equals('foo'));
345 unittest.expect(o[1], unittest.equals('foo')); 425 unittest.expect(o[1], unittest.equals('foo'));
346 } 426 }
347 427
348 buildUnnamed826() { 428 buildUnnamed32() {
349 var o = new core.List<core.String>(); 429 var o = new core.List<core.String>();
350 o.add("foo"); 430 o.add("foo");
351 o.add("foo"); 431 o.add("foo");
352 return o; 432 return o;
353 } 433 }
354 434
355 checkUnnamed826(core.List<core.String> o) { 435 checkUnnamed32(core.List<core.String> o) {
356 unittest.expect(o, unittest.hasLength(2)); 436 unittest.expect(o, unittest.hasLength(2));
357 unittest.expect(o[0], unittest.equals('foo')); 437 unittest.expect(o[0], unittest.equals('foo'));
358 unittest.expect(o[1], unittest.equals('foo')); 438 unittest.expect(o[1], unittest.equals('foo'));
359 } 439 }
360 440
361 core.int buildCounterSurveyQuestion = 0; 441 core.int buildCounterSurveyQuestion = 0;
362 buildSurveyQuestion() { 442 buildSurveyQuestion() {
363 var o = new api.SurveyQuestion(); 443 var o = new api.SurveyQuestion();
364 buildCounterSurveyQuestion++; 444 buildCounterSurveyQuestion++;
365 if (buildCounterSurveyQuestion < 3) { 445 if (buildCounterSurveyQuestion < 3) {
366 o.answerOrder = "foo"; 446 o.answerOrder = "foo";
367 o.answers = buildUnnamed823(); 447 o.answers = buildUnnamed29();
368 o.hasOther = true; 448 o.hasOther = true;
369 o.highValueLabel = "foo"; 449 o.highValueLabel = "foo";
370 o.images = buildUnnamed824(); 450 o.images = buildUnnamed30();
371 o.lastAnswerPositionPinned = true; 451 o.lastAnswerPositionPinned = true;
372 o.lowValueLabel = "foo"; 452 o.lowValueLabel = "foo";
373 o.mustPickSuggestion = true; 453 o.mustPickSuggestion = true;
374 o.numStars = "foo"; 454 o.numStars = "foo";
375 o.openTextPlaceholder = "foo"; 455 o.openTextPlaceholder = "foo";
376 o.openTextSuggestions = buildUnnamed825(); 456 o.openTextSuggestions = buildUnnamed31();
377 o.question = "foo"; 457 o.question = "foo";
378 o.sentimentText = "foo"; 458 o.sentimentText = "foo";
379 o.singleLineResponse = true; 459 o.singleLineResponse = true;
380 o.thresholdAnswers = buildUnnamed826(); 460 o.thresholdAnswers = buildUnnamed32();
381 o.type = "foo"; 461 o.type = "foo";
382 o.unitOfMeasurementLabel = "foo"; 462 o.unitOfMeasurementLabel = "foo";
383 o.videoId = "foo"; 463 o.videoId = "foo";
384 } 464 }
385 buildCounterSurveyQuestion--; 465 buildCounterSurveyQuestion--;
386 return o; 466 return o;
387 } 467 }
388 468
389 checkSurveyQuestion(api.SurveyQuestion o) { 469 checkSurveyQuestion(api.SurveyQuestion o) {
390 buildCounterSurveyQuestion++; 470 buildCounterSurveyQuestion++;
391 if (buildCounterSurveyQuestion < 3) { 471 if (buildCounterSurveyQuestion < 3) {
392 unittest.expect(o.answerOrder, unittest.equals('foo')); 472 unittest.expect(o.answerOrder, unittest.equals('foo'));
393 checkUnnamed823(o.answers); 473 checkUnnamed29(o.answers);
394 unittest.expect(o.hasOther, unittest.isTrue); 474 unittest.expect(o.hasOther, unittest.isTrue);
395 unittest.expect(o.highValueLabel, unittest.equals('foo')); 475 unittest.expect(o.highValueLabel, unittest.equals('foo'));
396 checkUnnamed824(o.images); 476 checkUnnamed30(o.images);
397 unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue); 477 unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue);
398 unittest.expect(o.lowValueLabel, unittest.equals('foo')); 478 unittest.expect(o.lowValueLabel, unittest.equals('foo'));
399 unittest.expect(o.mustPickSuggestion, unittest.isTrue); 479 unittest.expect(o.mustPickSuggestion, unittest.isTrue);
400 unittest.expect(o.numStars, unittest.equals('foo')); 480 unittest.expect(o.numStars, unittest.equals('foo'));
401 unittest.expect(o.openTextPlaceholder, unittest.equals('foo')); 481 unittest.expect(o.openTextPlaceholder, unittest.equals('foo'));
402 checkUnnamed825(o.openTextSuggestions); 482 checkUnnamed31(o.openTextSuggestions);
403 unittest.expect(o.question, unittest.equals('foo')); 483 unittest.expect(o.question, unittest.equals('foo'));
404 unittest.expect(o.sentimentText, unittest.equals('foo')); 484 unittest.expect(o.sentimentText, unittest.equals('foo'));
405 unittest.expect(o.singleLineResponse, unittest.isTrue); 485 unittest.expect(o.singleLineResponse, unittest.isTrue);
406 checkUnnamed826(o.thresholdAnswers); 486 checkUnnamed32(o.thresholdAnswers);
407 unittest.expect(o.type, unittest.equals('foo')); 487 unittest.expect(o.type, unittest.equals('foo'));
408 unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo')); 488 unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo'));
409 unittest.expect(o.videoId, unittest.equals('foo')); 489 unittest.expect(o.videoId, unittest.equals('foo'));
410 } 490 }
411 buildCounterSurveyQuestion--; 491 buildCounterSurveyQuestion--;
412 } 492 }
413 493
414 core.int buildCounterSurveyQuestionImage = 0; 494 core.int buildCounterSurveyQuestionImage = 0;
415 buildSurveyQuestionImage() { 495 buildSurveyQuestionImage() {
416 var o = new api.SurveyQuestionImage(); 496 var o = new api.SurveyQuestionImage();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 528
449 checkSurveyResults(api.SurveyResults o) { 529 checkSurveyResults(api.SurveyResults o) {
450 buildCounterSurveyResults++; 530 buildCounterSurveyResults++;
451 if (buildCounterSurveyResults < 3) { 531 if (buildCounterSurveyResults < 3) {
452 unittest.expect(o.status, unittest.equals('foo')); 532 unittest.expect(o.status, unittest.equals('foo'));
453 unittest.expect(o.surveyUrlId, unittest.equals('foo')); 533 unittest.expect(o.surveyUrlId, unittest.equals('foo'));
454 } 534 }
455 buildCounterSurveyResults--; 535 buildCounterSurveyResults--;
456 } 536 }
457 537
458 buildUnnamed827() { 538 buildUnnamed33() {
459 var o = new core.List<api.Survey>(); 539 var o = new core.List<api.Survey>();
460 o.add(buildSurvey()); 540 o.add(buildSurvey());
461 o.add(buildSurvey()); 541 o.add(buildSurvey());
462 return o; 542 return o;
463 } 543 }
464 544
465 checkUnnamed827(core.List<api.Survey> o) { 545 checkUnnamed33(core.List<api.Survey> o) {
466 unittest.expect(o, unittest.hasLength(2)); 546 unittest.expect(o, unittest.hasLength(2));
467 checkSurvey(o[0]); 547 checkSurvey(o[0]);
468 checkSurvey(o[1]); 548 checkSurvey(o[1]);
469 } 549 }
470 550
471 core.int buildCounterSurveysListResponse = 0; 551 core.int buildCounterSurveysListResponse = 0;
472 buildSurveysListResponse() { 552 buildSurveysListResponse() {
473 var o = new api.SurveysListResponse(); 553 var o = new api.SurveysListResponse();
474 buildCounterSurveysListResponse++; 554 buildCounterSurveysListResponse++;
475 if (buildCounterSurveysListResponse < 3) { 555 if (buildCounterSurveysListResponse < 3) {
476 o.pageInfo = buildPageInfo(); 556 o.pageInfo = buildPageInfo();
477 o.requestId = "foo"; 557 o.requestId = "foo";
478 o.resources = buildUnnamed827(); 558 o.resources = buildUnnamed33();
479 o.tokenPagination = buildTokenPagination(); 559 o.tokenPagination = buildTokenPagination();
480 } 560 }
481 buildCounterSurveysListResponse--; 561 buildCounterSurveysListResponse--;
482 return o; 562 return o;
483 } 563 }
484 564
485 checkSurveysListResponse(api.SurveysListResponse o) { 565 checkSurveysListResponse(api.SurveysListResponse o) {
486 buildCounterSurveysListResponse++; 566 buildCounterSurveysListResponse++;
487 if (buildCounterSurveysListResponse < 3) { 567 if (buildCounterSurveysListResponse < 3) {
488 checkPageInfo(o.pageInfo); 568 checkPageInfo(o.pageInfo);
489 unittest.expect(o.requestId, unittest.equals('foo')); 569 unittest.expect(o.requestId, unittest.equals('foo'));
490 checkUnnamed827(o.resources); 570 checkUnnamed33(o.resources);
491 checkTokenPagination(o.tokenPagination); 571 checkTokenPagination(o.tokenPagination);
492 } 572 }
493 buildCounterSurveysListResponse--; 573 buildCounterSurveysListResponse--;
494 } 574 }
495 575
496 core.int buildCounterSurveysStartRequest = 0; 576 core.int buildCounterSurveysStartRequest = 0;
497 buildSurveysStartRequest() { 577 buildSurveysStartRequest() {
498 var o = new api.SurveysStartRequest(); 578 var o = new api.SurveysStartRequest();
499 buildCounterSurveysStartRequest++; 579 buildCounterSurveysStartRequest++;
500 if (buildCounterSurveysStartRequest < 3) { 580 if (buildCounterSurveysStartRequest < 3) {
501 o.autostartMaxCostPerResponse = "foo"; 581 o.maxCostPerResponseNanos = "foo";
502 } 582 }
503 buildCounterSurveysStartRequest--; 583 buildCounterSurveysStartRequest--;
504 return o; 584 return o;
505 } 585 }
506 586
507 checkSurveysStartRequest(api.SurveysStartRequest o) { 587 checkSurveysStartRequest(api.SurveysStartRequest o) {
508 buildCounterSurveysStartRequest++; 588 buildCounterSurveysStartRequest++;
509 if (buildCounterSurveysStartRequest < 3) { 589 if (buildCounterSurveysStartRequest < 3) {
510 unittest.expect(o.autostartMaxCostPerResponse, unittest.equals('foo')); 590 unittest.expect(o.maxCostPerResponseNanos, unittest.equals('foo'));
511 } 591 }
512 buildCounterSurveysStartRequest--; 592 buildCounterSurveysStartRequest--;
513 } 593 }
514 594
515 core.int buildCounterSurveysStartResponse = 0; 595 core.int buildCounterSurveysStartResponse = 0;
516 buildSurveysStartResponse() { 596 buildSurveysStartResponse() {
517 var o = new api.SurveysStartResponse(); 597 var o = new api.SurveysStartResponse();
518 buildCounterSurveysStartResponse++; 598 buildCounterSurveysStartResponse++;
519 if (buildCounterSurveysStartResponse < 3) { 599 if (buildCounterSurveysStartResponse < 3) {
520 o.requestId = "foo"; 600 o.requestId = "foo";
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 main() { 659 main() {
580 unittest.group("obj-schema-FieldMask", () { 660 unittest.group("obj-schema-FieldMask", () {
581 unittest.test("to-json--from-json", () { 661 unittest.test("to-json--from-json", () {
582 var o = buildFieldMask(); 662 var o = buildFieldMask();
583 var od = new api.FieldMask.fromJson(o.toJson()); 663 var od = new api.FieldMask.fromJson(o.toJson());
584 checkFieldMask(od); 664 checkFieldMask(od);
585 }); 665 });
586 }); 666 });
587 667
588 668
669 unittest.group("obj-schema-MobileAppPanel", () {
670 unittest.test("to-json--from-json", () {
671 var o = buildMobileAppPanel();
672 var od = new api.MobileAppPanel.fromJson(o.toJson());
673 checkMobileAppPanel(od);
674 });
675 });
676
677
678 unittest.group("obj-schema-MobileAppPanelsListResponse", () {
679 unittest.test("to-json--from-json", () {
680 var o = buildMobileAppPanelsListResponse();
681 var od = new api.MobileAppPanelsListResponse.fromJson(o.toJson());
682 checkMobileAppPanelsListResponse(od);
683 });
684 });
685
686
589 unittest.group("obj-schema-PageInfo", () { 687 unittest.group("obj-schema-PageInfo", () {
590 unittest.test("to-json--from-json", () { 688 unittest.test("to-json--from-json", () {
591 var o = buildPageInfo(); 689 var o = buildPageInfo();
592 var od = new api.PageInfo.fromJson(o.toJson()); 690 var od = new api.PageInfo.fromJson(o.toJson());
593 checkPageInfo(od); 691 checkPageInfo(od);
594 }); 692 });
595 }); 693 });
596 694
597 695
598 unittest.group("obj-schema-ResultsGetRequest", () { 696 unittest.group("obj-schema-ResultsGetRequest", () {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 803
706 unittest.group("obj-schema-TokenPagination", () { 804 unittest.group("obj-schema-TokenPagination", () {
707 unittest.test("to-json--from-json", () { 805 unittest.test("to-json--from-json", () {
708 var o = buildTokenPagination(); 806 var o = buildTokenPagination();
709 var od = new api.TokenPagination.fromJson(o.toJson()); 807 var od = new api.TokenPagination.fromJson(o.toJson());
710 checkTokenPagination(od); 808 checkTokenPagination(od);
711 }); 809 });
712 }); 810 });
713 811
714 812
813 unittest.group("resource-MobileapppanelsResourceApi", () {
814 unittest.test("method--get", () {
815
816 var mock = new HttpServerMock();
817 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi leapppanels;
818 var arg_panelId = "foo";
819 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
820 var path = (req.url).path;
821 var pathOffset = 0;
822 var index;
823 var subPart;
824 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
825 pathOffset += 1;
826 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq uals("consumersurveys/v2/"));
827 pathOffset += 19;
828 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq uals("mobileAppPanels/"));
829 pathOffset += 16;
830 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
831 pathOffset = path.length;
832 unittest.expect(subPart, unittest.equals("$arg_panelId"));
833
834 var query = (req.url).query;
835 var queryOffset = 0;
836 var queryMap = {};
837 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
838 parseBool(n) {
839 if (n == "true") return true;
840 if (n == "false") return false;
841 if (n == null) return null;
842 throw new core.ArgumentError("Invalid boolean: $n");
843 }
844 if (query.length > 0) {
845 for (var part in query.split("&")) {
846 var keyvalue = part.split("=");
847 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
848 }
849 }
850
851
852 var h = {
853 "content-type" : "application/json; charset=utf-8",
854 };
855 var resp = convert.JSON.encode(buildMobileAppPanel());
856 return new async.Future.value(stringResponse(200, h, resp));
857 }), true);
858 res.get(arg_panelId).then(unittest.expectAsync(((api.MobileAppPanel respon se) {
859 checkMobileAppPanel(response);
860 })));
861 });
862
863 unittest.test("method--list", () {
864
865 var mock = new HttpServerMock();
866 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi leapppanels;
867 var arg_maxResults = 42;
868 var arg_startIndex = 42;
869 var arg_token = "foo";
870 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
871 var path = (req.url).path;
872 var pathOffset = 0;
873 var index;
874 var subPart;
875 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
876 pathOffset += 1;
877 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq uals("consumersurveys/v2/"));
878 pathOffset += 19;
879 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq uals("mobileAppPanels"));
880 pathOffset += 15;
881
882 var query = (req.url).query;
883 var queryOffset = 0;
884 var queryMap = {};
885 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
886 parseBool(n) {
887 if (n == "true") return true;
888 if (n == "false") return false;
889 if (n == null) return null;
890 throw new core.ArgumentError("Invalid boolean: $n");
891 }
892 if (query.length > 0) {
893 for (var part in query.split("&")) {
894 var keyvalue = part.split("=");
895 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
896 }
897 }
898 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
899 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e quals(arg_startIndex));
900 unittest.expect(queryMap["token"].first, unittest.equals(arg_token));
901
902
903 var h = {
904 "content-type" : "application/json; charset=utf-8",
905 };
906 var resp = convert.JSON.encode(buildMobileAppPanelsListResponse());
907 return new async.Future.value(stringResponse(200, h, resp));
908 }), true);
909 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar g_token).then(unittest.expectAsync(((api.MobileAppPanelsListResponse response) {
910 checkMobileAppPanelsListResponse(response);
911 })));
912 });
913
914 unittest.test("method--update", () {
915
916 var mock = new HttpServerMock();
917 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi leapppanels;
918 var arg_request = buildMobileAppPanel();
919 var arg_panelId = "foo";
920 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
921 var obj = new api.MobileAppPanel.fromJson(json);
922 checkMobileAppPanel(obj);
923
924 var path = (req.url).path;
925 var pathOffset = 0;
926 var index;
927 var subPart;
928 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
929 pathOffset += 1;
930 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq uals("consumersurveys/v2/"));
931 pathOffset += 19;
932 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq uals("mobileAppPanels/"));
933 pathOffset += 16;
934 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
935 pathOffset = path.length;
936 unittest.expect(subPart, unittest.equals("$arg_panelId"));
937
938 var query = (req.url).query;
939 var queryOffset = 0;
940 var queryMap = {};
941 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
942 parseBool(n) {
943 if (n == "true") return true;
944 if (n == "false") return false;
945 if (n == null) return null;
946 throw new core.ArgumentError("Invalid boolean: $n");
947 }
948 if (query.length > 0) {
949 for (var part in query.split("&")) {
950 var keyvalue = part.split("=");
951 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
952 }
953 }
954
955
956 var h = {
957 "content-type" : "application/json; charset=utf-8",
958 };
959 var resp = convert.JSON.encode(buildMobileAppPanel());
960 return new async.Future.value(stringResponse(200, h, resp));
961 }), true);
962 res.update(arg_request, arg_panelId).then(unittest.expectAsync(((api.Mobil eAppPanel response) {
963 checkMobileAppPanel(response);
964 })));
965 });
966
967 });
968
969
715 unittest.group("resource-ResultsResourceApi", () { 970 unittest.group("resource-ResultsResourceApi", () {
716 unittest.test("method--get", () { 971 unittest.test("method--get", () {
717 // TODO: Implement tests for media upload; 972 // TODO: Implement tests for media upload;
718 // TODO: Implement tests for media download; 973 // TODO: Implement tests for media download;
719 974
720 var mock = new HttpServerMock(); 975 var mock = new HttpServerMock();
721 api.ResultsResourceApi res = new api.ConsumersurveysApi(mock).results; 976 api.ResultsResourceApi res = new api.ConsumersurveysApi(mock).results;
722 var arg_request = buildResultsGetRequest(); 977 var arg_request = buildResultsGetRequest();
723 var arg_surveyUrlId = "foo"; 978 var arg_surveyUrlId = "foo";
724 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 979 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S urvey response) { 1341 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S urvey response) {
1087 checkSurvey(response); 1342 checkSurvey(response);
1088 }))); 1343 })));
1089 }); 1344 });
1090 1345
1091 }); 1346 });
1092 1347
1093 1348
1094 } 1349 }
1095 1350
OLDNEW
« no previous file with comments | « generated/googleapis/test/compute/v1_test.dart ('k') | generated/googleapis/test/container/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698