OLD | NEW |
1 library googleapis.consumersurveys.v2.test; | 1 library googleapis.surveys.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; |
11 | 11 |
12 import 'package:googleapis/consumersurveys/v2.dart' as api; | 12 import 'package:googleapis/surveys/v2.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; |
21 } | 21 } |
22 | 22 |
(...skipping 21 matching lines...) Expand all Loading... |
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 buildUnnamed21() { | 54 buildUnnamed2202() { |
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 checkUnnamed21(core.List<api.FieldMask> o) { | 61 checkUnnamed2202(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 = buildUnnamed21(); | 72 o.fields = buildUnnamed2202(); |
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 checkUnnamed21(o.fields); | 82 checkUnnamed2202(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() { | 88 buildUnnamed2203() { |
89 var o = new core.List<core.String>(); | 89 var o = new core.List<core.String>(); |
90 o.add("foo"); | 90 o.add("foo"); |
91 o.add("foo"); | 91 o.add("foo"); |
92 return o; | 92 return o; |
93 } | 93 } |
94 | 94 |
95 checkUnnamed22(core.List<core.String> o) { | 95 checkUnnamed2203(core.List<core.String> o) { |
96 unittest.expect(o, unittest.hasLength(2)); | 96 unittest.expect(o, unittest.hasLength(2)); |
97 unittest.expect(o[0], unittest.equals('foo')); | 97 unittest.expect(o[0], unittest.equals('foo')); |
98 unittest.expect(o[1], unittest.equals('foo')); | 98 unittest.expect(o[1], unittest.equals('foo')); |
99 } | 99 } |
100 | 100 |
101 core.int buildCounterMobileAppPanel = 0; | 101 core.int buildCounterMobileAppPanel = 0; |
102 buildMobileAppPanel() { | 102 buildMobileAppPanel() { |
103 var o = new api.MobileAppPanel(); | 103 var o = new api.MobileAppPanel(); |
104 buildCounterMobileAppPanel++; | 104 buildCounterMobileAppPanel++; |
105 if (buildCounterMobileAppPanel < 3) { | 105 if (buildCounterMobileAppPanel < 3) { |
106 o.country = "foo"; | 106 o.country = "foo"; |
107 o.isPublicPanel = true; | 107 o.isPublicPanel = true; |
108 o.language = "foo"; | 108 o.language = "foo"; |
109 o.mobileAppPanelId = "foo"; | 109 o.mobileAppPanelId = "foo"; |
110 o.name = "foo"; | 110 o.name = "foo"; |
111 o.owners = buildUnnamed22(); | 111 o.owners = buildUnnamed2203(); |
112 } | 112 } |
113 buildCounterMobileAppPanel--; | 113 buildCounterMobileAppPanel--; |
114 return o; | 114 return o; |
115 } | 115 } |
116 | 116 |
117 checkMobileAppPanel(api.MobileAppPanel o) { | 117 checkMobileAppPanel(api.MobileAppPanel o) { |
118 buildCounterMobileAppPanel++; | 118 buildCounterMobileAppPanel++; |
119 if (buildCounterMobileAppPanel < 3) { | 119 if (buildCounterMobileAppPanel < 3) { |
120 unittest.expect(o.country, unittest.equals('foo')); | 120 unittest.expect(o.country, unittest.equals('foo')); |
121 unittest.expect(o.isPublicPanel, unittest.isTrue); | 121 unittest.expect(o.isPublicPanel, unittest.isTrue); |
122 unittest.expect(o.language, unittest.equals('foo')); | 122 unittest.expect(o.language, unittest.equals('foo')); |
123 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); | 123 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); |
124 unittest.expect(o.name, unittest.equals('foo')); | 124 unittest.expect(o.name, unittest.equals('foo')); |
125 checkUnnamed22(o.owners); | 125 checkUnnamed2203(o.owners); |
126 } | 126 } |
127 buildCounterMobileAppPanel--; | 127 buildCounterMobileAppPanel--; |
128 } | 128 } |
129 | 129 |
130 buildUnnamed23() { | 130 buildUnnamed2204() { |
131 var o = new core.List<api.MobileAppPanel>(); | 131 var o = new core.List<api.MobileAppPanel>(); |
132 o.add(buildMobileAppPanel()); | 132 o.add(buildMobileAppPanel()); |
133 o.add(buildMobileAppPanel()); | 133 o.add(buildMobileAppPanel()); |
134 return o; | 134 return o; |
135 } | 135 } |
136 | 136 |
137 checkUnnamed23(core.List<api.MobileAppPanel> o) { | 137 checkUnnamed2204(core.List<api.MobileAppPanel> o) { |
138 unittest.expect(o, unittest.hasLength(2)); | 138 unittest.expect(o, unittest.hasLength(2)); |
139 checkMobileAppPanel(o[0]); | 139 checkMobileAppPanel(o[0]); |
140 checkMobileAppPanel(o[1]); | 140 checkMobileAppPanel(o[1]); |
141 } | 141 } |
142 | 142 |
143 core.int buildCounterMobileAppPanelsListResponse = 0; | 143 core.int buildCounterMobileAppPanelsListResponse = 0; |
144 buildMobileAppPanelsListResponse() { | 144 buildMobileAppPanelsListResponse() { |
145 var o = new api.MobileAppPanelsListResponse(); | 145 var o = new api.MobileAppPanelsListResponse(); |
146 buildCounterMobileAppPanelsListResponse++; | 146 buildCounterMobileAppPanelsListResponse++; |
147 if (buildCounterMobileAppPanelsListResponse < 3) { | 147 if (buildCounterMobileAppPanelsListResponse < 3) { |
148 o.pageInfo = buildPageInfo(); | 148 o.pageInfo = buildPageInfo(); |
149 o.requestId = "foo"; | 149 o.requestId = "foo"; |
150 o.resources = buildUnnamed23(); | 150 o.resources = buildUnnamed2204(); |
151 o.tokenPagination = buildTokenPagination(); | 151 o.tokenPagination = buildTokenPagination(); |
152 } | 152 } |
153 buildCounterMobileAppPanelsListResponse--; | 153 buildCounterMobileAppPanelsListResponse--; |
154 return o; | 154 return o; |
155 } | 155 } |
156 | 156 |
157 checkMobileAppPanelsListResponse(api.MobileAppPanelsListResponse o) { | 157 checkMobileAppPanelsListResponse(api.MobileAppPanelsListResponse o) { |
158 buildCounterMobileAppPanelsListResponse++; | 158 buildCounterMobileAppPanelsListResponse++; |
159 if (buildCounterMobileAppPanelsListResponse < 3) { | 159 if (buildCounterMobileAppPanelsListResponse < 3) { |
160 checkPageInfo(o.pageInfo); | 160 checkPageInfo(o.pageInfo); |
161 unittest.expect(o.requestId, unittest.equals('foo')); | 161 unittest.expect(o.requestId, unittest.equals('foo')); |
162 checkUnnamed23(o.resources); | 162 checkUnnamed2204(o.resources); |
163 checkTokenPagination(o.tokenPagination); | 163 checkTokenPagination(o.tokenPagination); |
164 } | 164 } |
165 buildCounterMobileAppPanelsListResponse--; | 165 buildCounterMobileAppPanelsListResponse--; |
166 } | 166 } |
167 | 167 |
168 core.int buildCounterPageInfo = 0; | 168 core.int buildCounterPageInfo = 0; |
169 buildPageInfo() { | 169 buildPageInfo() { |
170 var o = new api.PageInfo(); | 170 var o = new api.PageInfo(); |
171 buildCounterPageInfo++; | 171 buildCounterPageInfo++; |
172 if (buildCounterPageInfo < 3) { | 172 if (buildCounterPageInfo < 3) { |
(...skipping 27 matching lines...) Expand all Loading... |
200 } | 200 } |
201 | 201 |
202 checkResultsGetRequest(api.ResultsGetRequest o) { | 202 checkResultsGetRequest(api.ResultsGetRequest o) { |
203 buildCounterResultsGetRequest++; | 203 buildCounterResultsGetRequest++; |
204 if (buildCounterResultsGetRequest < 3) { | 204 if (buildCounterResultsGetRequest < 3) { |
205 checkResultsMask(o.resultMask); | 205 checkResultsMask(o.resultMask); |
206 } | 206 } |
207 buildCounterResultsGetRequest--; | 207 buildCounterResultsGetRequest--; |
208 } | 208 } |
209 | 209 |
210 buildUnnamed24() { | 210 buildUnnamed2205() { |
211 var o = new core.List<api.FieldMask>(); | 211 var o = new core.List<api.FieldMask>(); |
212 o.add(buildFieldMask()); | 212 o.add(buildFieldMask()); |
213 o.add(buildFieldMask()); | 213 o.add(buildFieldMask()); |
214 return o; | 214 return o; |
215 } | 215 } |
216 | 216 |
217 checkUnnamed24(core.List<api.FieldMask> o) { | 217 checkUnnamed2205(core.List<api.FieldMask> o) { |
218 unittest.expect(o, unittest.hasLength(2)); | 218 unittest.expect(o, unittest.hasLength(2)); |
219 checkFieldMask(o[0]); | 219 checkFieldMask(o[0]); |
220 checkFieldMask(o[1]); | 220 checkFieldMask(o[1]); |
221 } | 221 } |
222 | 222 |
223 core.int buildCounterResultsMask = 0; | 223 core.int buildCounterResultsMask = 0; |
224 buildResultsMask() { | 224 buildResultsMask() { |
225 var o = new api.ResultsMask(); | 225 var o = new api.ResultsMask(); |
226 buildCounterResultsMask++; | 226 buildCounterResultsMask++; |
227 if (buildCounterResultsMask < 3) { | 227 if (buildCounterResultsMask < 3) { |
228 o.fields = buildUnnamed24(); | 228 o.fields = buildUnnamed2205(); |
229 o.projection = "foo"; | 229 o.projection = "foo"; |
230 } | 230 } |
231 buildCounterResultsMask--; | 231 buildCounterResultsMask--; |
232 return o; | 232 return o; |
233 } | 233 } |
234 | 234 |
235 checkResultsMask(api.ResultsMask o) { | 235 checkResultsMask(api.ResultsMask o) { |
236 buildCounterResultsMask++; | 236 buildCounterResultsMask++; |
237 if (buildCounterResultsMask < 3) { | 237 if (buildCounterResultsMask < 3) { |
238 checkUnnamed24(o.fields); | 238 checkUnnamed2205(o.fields); |
239 unittest.expect(o.projection, unittest.equals('foo')); | 239 unittest.expect(o.projection, unittest.equals('foo')); |
240 } | 240 } |
241 buildCounterResultsMask--; | 241 buildCounterResultsMask--; |
242 } | 242 } |
243 | 243 |
244 buildUnnamed25() { | 244 buildUnnamed2206() { |
245 var o = new core.List<core.String>(); | 245 var o = new core.List<core.String>(); |
246 o.add("foo"); | 246 o.add("foo"); |
247 o.add("foo"); | 247 o.add("foo"); |
248 return o; | 248 return o; |
249 } | 249 } |
250 | 250 |
251 checkUnnamed25(core.List<core.String> o) { | 251 checkUnnamed2206(core.List<core.String> o) { |
252 unittest.expect(o, unittest.hasLength(2)); | 252 unittest.expect(o, unittest.hasLength(2)); |
253 unittest.expect(o[0], unittest.equals('foo')); | 253 unittest.expect(o[0], unittest.equals('foo')); |
254 unittest.expect(o[1], unittest.equals('foo')); | 254 unittest.expect(o[1], unittest.equals('foo')); |
255 } | 255 } |
256 | 256 |
257 buildUnnamed26() { | 257 buildUnnamed2207() { |
258 var o = new core.List<api.SurveyQuestion>(); | 258 var o = new core.List<api.SurveyQuestion>(); |
259 o.add(buildSurveyQuestion()); | 259 o.add(buildSurveyQuestion()); |
260 o.add(buildSurveyQuestion()); | 260 o.add(buildSurveyQuestion()); |
261 return o; | 261 return o; |
262 } | 262 } |
263 | 263 |
264 checkUnnamed26(core.List<api.SurveyQuestion> o) { | 264 checkUnnamed2207(core.List<api.SurveyQuestion> o) { |
265 unittest.expect(o, unittest.hasLength(2)); | 265 unittest.expect(o, unittest.hasLength(2)); |
266 checkSurveyQuestion(o[0]); | 266 checkSurveyQuestion(o[0]); |
267 checkSurveyQuestion(o[1]); | 267 checkSurveyQuestion(o[1]); |
268 } | 268 } |
269 | 269 |
270 core.int buildCounterSurvey = 0; | 270 core.int buildCounterSurvey = 0; |
271 buildSurvey() { | 271 buildSurvey() { |
272 var o = new api.Survey(); | 272 var o = new api.Survey(); |
273 buildCounterSurvey++; | 273 buildCounterSurvey++; |
274 if (buildCounterSurvey < 3) { | 274 if (buildCounterSurvey < 3) { |
275 o.audience = buildSurveyAudience(); | 275 o.audience = buildSurveyAudience(); |
276 o.cost = buildSurveyCost(); | 276 o.cost = buildSurveyCost(); |
277 o.customerData = "foo"; | 277 o.customerData = "foo"; |
278 o.description = "foo"; | 278 o.description = "foo"; |
279 o.owners = buildUnnamed25(); | 279 o.owners = buildUnnamed2206(); |
280 o.questions = buildUnnamed26(); | 280 o.questions = buildUnnamed2207(); |
| 281 o.rejectionReason = buildSurveyRejection(); |
281 o.state = "foo"; | 282 o.state = "foo"; |
282 o.surveyUrlId = "foo"; | 283 o.surveyUrlId = "foo"; |
283 o.title = "foo"; | 284 o.title = "foo"; |
284 o.wantedResponseCount = 42; | 285 o.wantedResponseCount = 42; |
285 } | 286 } |
286 buildCounterSurvey--; | 287 buildCounterSurvey--; |
287 return o; | 288 return o; |
288 } | 289 } |
289 | 290 |
290 checkSurvey(api.Survey o) { | 291 checkSurvey(api.Survey o) { |
291 buildCounterSurvey++; | 292 buildCounterSurvey++; |
292 if (buildCounterSurvey < 3) { | 293 if (buildCounterSurvey < 3) { |
293 checkSurveyAudience(o.audience); | 294 checkSurveyAudience(o.audience); |
294 checkSurveyCost(o.cost); | 295 checkSurveyCost(o.cost); |
295 unittest.expect(o.customerData, unittest.equals('foo')); | 296 unittest.expect(o.customerData, unittest.equals('foo')); |
296 unittest.expect(o.description, unittest.equals('foo')); | 297 unittest.expect(o.description, unittest.equals('foo')); |
297 checkUnnamed25(o.owners); | 298 checkUnnamed2206(o.owners); |
298 checkUnnamed26(o.questions); | 299 checkUnnamed2207(o.questions); |
| 300 checkSurveyRejection(o.rejectionReason); |
299 unittest.expect(o.state, unittest.equals('foo')); | 301 unittest.expect(o.state, unittest.equals('foo')); |
300 unittest.expect(o.surveyUrlId, unittest.equals('foo')); | 302 unittest.expect(o.surveyUrlId, unittest.equals('foo')); |
301 unittest.expect(o.title, unittest.equals('foo')); | 303 unittest.expect(o.title, unittest.equals('foo')); |
302 unittest.expect(o.wantedResponseCount, unittest.equals(42)); | 304 unittest.expect(o.wantedResponseCount, unittest.equals(42)); |
303 } | 305 } |
304 buildCounterSurvey--; | 306 buildCounterSurvey--; |
305 } | 307 } |
306 | 308 |
307 buildUnnamed27() { | 309 buildUnnamed2208() { |
308 var o = new core.List<core.String>(); | 310 var o = new core.List<core.String>(); |
309 o.add("foo"); | 311 o.add("foo"); |
310 o.add("foo"); | 312 o.add("foo"); |
311 return o; | 313 return o; |
312 } | 314 } |
313 | 315 |
314 checkUnnamed27(core.List<core.String> o) { | 316 checkUnnamed2208(core.List<core.String> o) { |
315 unittest.expect(o, unittest.hasLength(2)); | 317 unittest.expect(o, unittest.hasLength(2)); |
316 unittest.expect(o[0], unittest.equals('foo')); | 318 unittest.expect(o[0], unittest.equals('foo')); |
317 unittest.expect(o[1], unittest.equals('foo')); | 319 unittest.expect(o[1], unittest.equals('foo')); |
318 } | 320 } |
319 | 321 |
320 buildUnnamed28() { | 322 buildUnnamed2209() { |
321 var o = new core.List<core.String>(); | 323 var o = new core.List<core.String>(); |
322 o.add("foo"); | 324 o.add("foo"); |
323 o.add("foo"); | 325 o.add("foo"); |
324 return o; | 326 return o; |
325 } | 327 } |
326 | 328 |
327 checkUnnamed28(core.List<core.String> o) { | 329 checkUnnamed2209(core.List<core.String> o) { |
328 unittest.expect(o, unittest.hasLength(2)); | 330 unittest.expect(o, unittest.hasLength(2)); |
329 unittest.expect(o[0], unittest.equals('foo')); | 331 unittest.expect(o[0], unittest.equals('foo')); |
330 unittest.expect(o[1], unittest.equals('foo')); | 332 unittest.expect(o[1], unittest.equals('foo')); |
331 } | 333 } |
332 | 334 |
333 core.int buildCounterSurveyAudience = 0; | 335 core.int buildCounterSurveyAudience = 0; |
334 buildSurveyAudience() { | 336 buildSurveyAudience() { |
335 var o = new api.SurveyAudience(); | 337 var o = new api.SurveyAudience(); |
336 buildCounterSurveyAudience++; | 338 buildCounterSurveyAudience++; |
337 if (buildCounterSurveyAudience < 3) { | 339 if (buildCounterSurveyAudience < 3) { |
338 o.ages = buildUnnamed27(); | 340 o.ages = buildUnnamed2208(); |
339 o.country = "foo"; | 341 o.country = "foo"; |
340 o.countrySubdivision = "foo"; | 342 o.countrySubdivision = "foo"; |
341 o.gender = "foo"; | 343 o.gender = "foo"; |
342 o.languages = buildUnnamed28(); | 344 o.languages = buildUnnamed2209(); |
343 o.mobileAppPanelId = "foo"; | 345 o.mobileAppPanelId = "foo"; |
344 o.populationSource = "foo"; | 346 o.populationSource = "foo"; |
345 } | 347 } |
346 buildCounterSurveyAudience--; | 348 buildCounterSurveyAudience--; |
347 return o; | 349 return o; |
348 } | 350 } |
349 | 351 |
350 checkSurveyAudience(api.SurveyAudience o) { | 352 checkSurveyAudience(api.SurveyAudience o) { |
351 buildCounterSurveyAudience++; | 353 buildCounterSurveyAudience++; |
352 if (buildCounterSurveyAudience < 3) { | 354 if (buildCounterSurveyAudience < 3) { |
353 checkUnnamed27(o.ages); | 355 checkUnnamed2208(o.ages); |
354 unittest.expect(o.country, unittest.equals('foo')); | 356 unittest.expect(o.country, unittest.equals('foo')); |
355 unittest.expect(o.countrySubdivision, unittest.equals('foo')); | 357 unittest.expect(o.countrySubdivision, unittest.equals('foo')); |
356 unittest.expect(o.gender, unittest.equals('foo')); | 358 unittest.expect(o.gender, unittest.equals('foo')); |
357 checkUnnamed28(o.languages); | 359 checkUnnamed2209(o.languages); |
358 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); | 360 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); |
359 unittest.expect(o.populationSource, unittest.equals('foo')); | 361 unittest.expect(o.populationSource, unittest.equals('foo')); |
360 } | 362 } |
361 buildCounterSurveyAudience--; | 363 buildCounterSurveyAudience--; |
362 } | 364 } |
363 | 365 |
364 core.int buildCounterSurveyCost = 0; | 366 core.int buildCounterSurveyCost = 0; |
365 buildSurveyCost() { | 367 buildSurveyCost() { |
366 var o = new api.SurveyCost(); | 368 var o = new api.SurveyCost(); |
367 buildCounterSurveyCost++; | 369 buildCounterSurveyCost++; |
(...skipping 11 matching lines...) Expand all Loading... |
379 buildCounterSurveyCost++; | 381 buildCounterSurveyCost++; |
380 if (buildCounterSurveyCost < 3) { | 382 if (buildCounterSurveyCost < 3) { |
381 unittest.expect(o.costPerResponseNanos, unittest.equals('foo')); | 383 unittest.expect(o.costPerResponseNanos, unittest.equals('foo')); |
382 unittest.expect(o.currencyCode, unittest.equals('foo')); | 384 unittest.expect(o.currencyCode, unittest.equals('foo')); |
383 unittest.expect(o.maxCostPerResponseNanos, unittest.equals('foo')); | 385 unittest.expect(o.maxCostPerResponseNanos, unittest.equals('foo')); |
384 unittest.expect(o.nanos, unittest.equals('foo')); | 386 unittest.expect(o.nanos, unittest.equals('foo')); |
385 } | 387 } |
386 buildCounterSurveyCost--; | 388 buildCounterSurveyCost--; |
387 } | 389 } |
388 | 390 |
389 buildUnnamed29() { | 391 buildUnnamed2210() { |
390 var o = new core.List<core.String>(); | 392 var o = new core.List<core.String>(); |
391 o.add("foo"); | 393 o.add("foo"); |
392 o.add("foo"); | 394 o.add("foo"); |
393 return o; | 395 return o; |
394 } | 396 } |
395 | 397 |
396 checkUnnamed29(core.List<core.String> o) { | 398 checkUnnamed2210(core.List<core.String> o) { |
397 unittest.expect(o, unittest.hasLength(2)); | 399 unittest.expect(o, unittest.hasLength(2)); |
398 unittest.expect(o[0], unittest.equals('foo')); | 400 unittest.expect(o[0], unittest.equals('foo')); |
399 unittest.expect(o[1], unittest.equals('foo')); | 401 unittest.expect(o[1], unittest.equals('foo')); |
400 } | 402 } |
401 | 403 |
402 buildUnnamed30() { | 404 buildUnnamed2211() { |
403 var o = new core.List<api.SurveyQuestionImage>(); | 405 var o = new core.List<api.SurveyQuestionImage>(); |
404 o.add(buildSurveyQuestionImage()); | 406 o.add(buildSurveyQuestionImage()); |
405 o.add(buildSurveyQuestionImage()); | 407 o.add(buildSurveyQuestionImage()); |
406 return o; | 408 return o; |
407 } | 409 } |
408 | 410 |
409 checkUnnamed30(core.List<api.SurveyQuestionImage> o) { | 411 checkUnnamed2211(core.List<api.SurveyQuestionImage> o) { |
410 unittest.expect(o, unittest.hasLength(2)); | 412 unittest.expect(o, unittest.hasLength(2)); |
411 checkSurveyQuestionImage(o[0]); | 413 checkSurveyQuestionImage(o[0]); |
412 checkSurveyQuestionImage(o[1]); | 414 checkSurveyQuestionImage(o[1]); |
413 } | 415 } |
414 | 416 |
415 buildUnnamed31() { | 417 buildUnnamed2212() { |
416 var o = new core.List<core.String>(); | 418 var o = new core.List<core.String>(); |
417 o.add("foo"); | 419 o.add("foo"); |
418 o.add("foo"); | 420 o.add("foo"); |
419 return o; | 421 return o; |
420 } | 422 } |
421 | 423 |
422 checkUnnamed31(core.List<core.String> o) { | 424 checkUnnamed2212(core.List<core.String> o) { |
423 unittest.expect(o, unittest.hasLength(2)); | 425 unittest.expect(o, unittest.hasLength(2)); |
424 unittest.expect(o[0], unittest.equals('foo')); | 426 unittest.expect(o[0], unittest.equals('foo')); |
425 unittest.expect(o[1], unittest.equals('foo')); | 427 unittest.expect(o[1], unittest.equals('foo')); |
426 } | 428 } |
427 | 429 |
428 buildUnnamed32() { | 430 buildUnnamed2213() { |
429 var o = new core.List<core.String>(); | 431 var o = new core.List<core.String>(); |
430 o.add("foo"); | 432 o.add("foo"); |
431 o.add("foo"); | 433 o.add("foo"); |
432 return o; | 434 return o; |
433 } | 435 } |
434 | 436 |
435 checkUnnamed32(core.List<core.String> o) { | 437 checkUnnamed2213(core.List<core.String> o) { |
436 unittest.expect(o, unittest.hasLength(2)); | 438 unittest.expect(o, unittest.hasLength(2)); |
437 unittest.expect(o[0], unittest.equals('foo')); | 439 unittest.expect(o[0], unittest.equals('foo')); |
438 unittest.expect(o[1], unittest.equals('foo')); | 440 unittest.expect(o[1], unittest.equals('foo')); |
439 } | 441 } |
440 | 442 |
441 core.int buildCounterSurveyQuestion = 0; | 443 core.int buildCounterSurveyQuestion = 0; |
442 buildSurveyQuestion() { | 444 buildSurveyQuestion() { |
443 var o = new api.SurveyQuestion(); | 445 var o = new api.SurveyQuestion(); |
444 buildCounterSurveyQuestion++; | 446 buildCounterSurveyQuestion++; |
445 if (buildCounterSurveyQuestion < 3) { | 447 if (buildCounterSurveyQuestion < 3) { |
446 o.answerOrder = "foo"; | 448 o.answerOrder = "foo"; |
447 o.answers = buildUnnamed29(); | 449 o.answers = buildUnnamed2210(); |
448 o.hasOther = true; | 450 o.hasOther = true; |
449 o.highValueLabel = "foo"; | 451 o.highValueLabel = "foo"; |
450 o.images = buildUnnamed30(); | 452 o.images = buildUnnamed2211(); |
451 o.lastAnswerPositionPinned = true; | 453 o.lastAnswerPositionPinned = true; |
452 o.lowValueLabel = "foo"; | 454 o.lowValueLabel = "foo"; |
453 o.mustPickSuggestion = true; | 455 o.mustPickSuggestion = true; |
454 o.numStars = "foo"; | 456 o.numStars = "foo"; |
455 o.openTextPlaceholder = "foo"; | 457 o.openTextPlaceholder = "foo"; |
456 o.openTextSuggestions = buildUnnamed31(); | 458 o.openTextSuggestions = buildUnnamed2212(); |
457 o.question = "foo"; | 459 o.question = "foo"; |
458 o.sentimentText = "foo"; | 460 o.sentimentText = "foo"; |
459 o.singleLineResponse = true; | 461 o.singleLineResponse = true; |
460 o.thresholdAnswers = buildUnnamed32(); | 462 o.thresholdAnswers = buildUnnamed2213(); |
461 o.type = "foo"; | 463 o.type = "foo"; |
462 o.unitOfMeasurementLabel = "foo"; | 464 o.unitOfMeasurementLabel = "foo"; |
463 o.videoId = "foo"; | 465 o.videoId = "foo"; |
464 } | 466 } |
465 buildCounterSurveyQuestion--; | 467 buildCounterSurveyQuestion--; |
466 return o; | 468 return o; |
467 } | 469 } |
468 | 470 |
469 checkSurveyQuestion(api.SurveyQuestion o) { | 471 checkSurveyQuestion(api.SurveyQuestion o) { |
470 buildCounterSurveyQuestion++; | 472 buildCounterSurveyQuestion++; |
471 if (buildCounterSurveyQuestion < 3) { | 473 if (buildCounterSurveyQuestion < 3) { |
472 unittest.expect(o.answerOrder, unittest.equals('foo')); | 474 unittest.expect(o.answerOrder, unittest.equals('foo')); |
473 checkUnnamed29(o.answers); | 475 checkUnnamed2210(o.answers); |
474 unittest.expect(o.hasOther, unittest.isTrue); | 476 unittest.expect(o.hasOther, unittest.isTrue); |
475 unittest.expect(o.highValueLabel, unittest.equals('foo')); | 477 unittest.expect(o.highValueLabel, unittest.equals('foo')); |
476 checkUnnamed30(o.images); | 478 checkUnnamed2211(o.images); |
477 unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue); | 479 unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue); |
478 unittest.expect(o.lowValueLabel, unittest.equals('foo')); | 480 unittest.expect(o.lowValueLabel, unittest.equals('foo')); |
479 unittest.expect(o.mustPickSuggestion, unittest.isTrue); | 481 unittest.expect(o.mustPickSuggestion, unittest.isTrue); |
480 unittest.expect(o.numStars, unittest.equals('foo')); | 482 unittest.expect(o.numStars, unittest.equals('foo')); |
481 unittest.expect(o.openTextPlaceholder, unittest.equals('foo')); | 483 unittest.expect(o.openTextPlaceholder, unittest.equals('foo')); |
482 checkUnnamed31(o.openTextSuggestions); | 484 checkUnnamed2212(o.openTextSuggestions); |
483 unittest.expect(o.question, unittest.equals('foo')); | 485 unittest.expect(o.question, unittest.equals('foo')); |
484 unittest.expect(o.sentimentText, unittest.equals('foo')); | 486 unittest.expect(o.sentimentText, unittest.equals('foo')); |
485 unittest.expect(o.singleLineResponse, unittest.isTrue); | 487 unittest.expect(o.singleLineResponse, unittest.isTrue); |
486 checkUnnamed32(o.thresholdAnswers); | 488 checkUnnamed2213(o.thresholdAnswers); |
487 unittest.expect(o.type, unittest.equals('foo')); | 489 unittest.expect(o.type, unittest.equals('foo')); |
488 unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo')); | 490 unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo')); |
489 unittest.expect(o.videoId, unittest.equals('foo')); | 491 unittest.expect(o.videoId, unittest.equals('foo')); |
490 } | 492 } |
491 buildCounterSurveyQuestion--; | 493 buildCounterSurveyQuestion--; |
492 } | 494 } |
493 | 495 |
494 core.int buildCounterSurveyQuestionImage = 0; | 496 core.int buildCounterSurveyQuestionImage = 0; |
495 buildSurveyQuestionImage() { | 497 buildSurveyQuestionImage() { |
496 var o = new api.SurveyQuestionImage(); | 498 var o = new api.SurveyQuestionImage(); |
(...skipping 10 matching lines...) Expand all Loading... |
507 checkSurveyQuestionImage(api.SurveyQuestionImage o) { | 509 checkSurveyQuestionImage(api.SurveyQuestionImage o) { |
508 buildCounterSurveyQuestionImage++; | 510 buildCounterSurveyQuestionImage++; |
509 if (buildCounterSurveyQuestionImage < 3) { | 511 if (buildCounterSurveyQuestionImage < 3) { |
510 unittest.expect(o.altText, unittest.equals('foo')); | 512 unittest.expect(o.altText, unittest.equals('foo')); |
511 unittest.expect(o.data, unittest.equals('foo')); | 513 unittest.expect(o.data, unittest.equals('foo')); |
512 unittest.expect(o.url, unittest.equals('foo')); | 514 unittest.expect(o.url, unittest.equals('foo')); |
513 } | 515 } |
514 buildCounterSurveyQuestionImage--; | 516 buildCounterSurveyQuestionImage--; |
515 } | 517 } |
516 | 518 |
| 519 core.int buildCounterSurveyRejection = 0; |
| 520 buildSurveyRejection() { |
| 521 var o = new api.SurveyRejection(); |
| 522 buildCounterSurveyRejection++; |
| 523 if (buildCounterSurveyRejection < 3) { |
| 524 o.explanation = "foo"; |
| 525 o.type = "foo"; |
| 526 } |
| 527 buildCounterSurveyRejection--; |
| 528 return o; |
| 529 } |
| 530 |
| 531 checkSurveyRejection(api.SurveyRejection o) { |
| 532 buildCounterSurveyRejection++; |
| 533 if (buildCounterSurveyRejection < 3) { |
| 534 unittest.expect(o.explanation, unittest.equals('foo')); |
| 535 unittest.expect(o.type, unittest.equals('foo')); |
| 536 } |
| 537 buildCounterSurveyRejection--; |
| 538 } |
| 539 |
517 core.int buildCounterSurveyResults = 0; | 540 core.int buildCounterSurveyResults = 0; |
518 buildSurveyResults() { | 541 buildSurveyResults() { |
519 var o = new api.SurveyResults(); | 542 var o = new api.SurveyResults(); |
520 buildCounterSurveyResults++; | 543 buildCounterSurveyResults++; |
521 if (buildCounterSurveyResults < 3) { | 544 if (buildCounterSurveyResults < 3) { |
522 o.status = "foo"; | 545 o.status = "foo"; |
523 o.surveyUrlId = "foo"; | 546 o.surveyUrlId = "foo"; |
524 } | 547 } |
525 buildCounterSurveyResults--; | 548 buildCounterSurveyResults--; |
526 return o; | 549 return o; |
(...skipping 20 matching lines...) Expand all Loading... |
547 } | 570 } |
548 | 571 |
549 checkSurveysDeleteResponse(api.SurveysDeleteResponse o) { | 572 checkSurveysDeleteResponse(api.SurveysDeleteResponse o) { |
550 buildCounterSurveysDeleteResponse++; | 573 buildCounterSurveysDeleteResponse++; |
551 if (buildCounterSurveysDeleteResponse < 3) { | 574 if (buildCounterSurveysDeleteResponse < 3) { |
552 unittest.expect(o.requestId, unittest.equals('foo')); | 575 unittest.expect(o.requestId, unittest.equals('foo')); |
553 } | 576 } |
554 buildCounterSurveysDeleteResponse--; | 577 buildCounterSurveysDeleteResponse--; |
555 } | 578 } |
556 | 579 |
557 buildUnnamed33() { | 580 buildUnnamed2214() { |
558 var o = new core.List<api.Survey>(); | 581 var o = new core.List<api.Survey>(); |
559 o.add(buildSurvey()); | 582 o.add(buildSurvey()); |
560 o.add(buildSurvey()); | 583 o.add(buildSurvey()); |
561 return o; | 584 return o; |
562 } | 585 } |
563 | 586 |
564 checkUnnamed33(core.List<api.Survey> o) { | 587 checkUnnamed2214(core.List<api.Survey> o) { |
565 unittest.expect(o, unittest.hasLength(2)); | 588 unittest.expect(o, unittest.hasLength(2)); |
566 checkSurvey(o[0]); | 589 checkSurvey(o[0]); |
567 checkSurvey(o[1]); | 590 checkSurvey(o[1]); |
568 } | 591 } |
569 | 592 |
570 core.int buildCounterSurveysListResponse = 0; | 593 core.int buildCounterSurveysListResponse = 0; |
571 buildSurveysListResponse() { | 594 buildSurveysListResponse() { |
572 var o = new api.SurveysListResponse(); | 595 var o = new api.SurveysListResponse(); |
573 buildCounterSurveysListResponse++; | 596 buildCounterSurveysListResponse++; |
574 if (buildCounterSurveysListResponse < 3) { | 597 if (buildCounterSurveysListResponse < 3) { |
575 o.pageInfo = buildPageInfo(); | 598 o.pageInfo = buildPageInfo(); |
576 o.requestId = "foo"; | 599 o.requestId = "foo"; |
577 o.resources = buildUnnamed33(); | 600 o.resources = buildUnnamed2214(); |
578 o.tokenPagination = buildTokenPagination(); | 601 o.tokenPagination = buildTokenPagination(); |
579 } | 602 } |
580 buildCounterSurveysListResponse--; | 603 buildCounterSurveysListResponse--; |
581 return o; | 604 return o; |
582 } | 605 } |
583 | 606 |
584 checkSurveysListResponse(api.SurveysListResponse o) { | 607 checkSurveysListResponse(api.SurveysListResponse o) { |
585 buildCounterSurveysListResponse++; | 608 buildCounterSurveysListResponse++; |
586 if (buildCounterSurveysListResponse < 3) { | 609 if (buildCounterSurveysListResponse < 3) { |
587 checkPageInfo(o.pageInfo); | 610 checkPageInfo(o.pageInfo); |
588 unittest.expect(o.requestId, unittest.equals('foo')); | 611 unittest.expect(o.requestId, unittest.equals('foo')); |
589 checkUnnamed33(o.resources); | 612 checkUnnamed2214(o.resources); |
590 checkTokenPagination(o.tokenPagination); | 613 checkTokenPagination(o.tokenPagination); |
591 } | 614 } |
592 buildCounterSurveysListResponse--; | 615 buildCounterSurveysListResponse--; |
593 } | 616 } |
594 | 617 |
595 core.int buildCounterSurveysStartRequest = 0; | 618 core.int buildCounterSurveysStartRequest = 0; |
596 buildSurveysStartRequest() { | 619 buildSurveysStartRequest() { |
597 var o = new api.SurveysStartRequest(); | 620 var o = new api.SurveysStartRequest(); |
598 buildCounterSurveysStartRequest++; | 621 buildCounterSurveysStartRequest++; |
599 if (buildCounterSurveysStartRequest < 3) { | 622 if (buildCounterSurveysStartRequest < 3) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 791 |
769 unittest.group("obj-schema-SurveyQuestionImage", () { | 792 unittest.group("obj-schema-SurveyQuestionImage", () { |
770 unittest.test("to-json--from-json", () { | 793 unittest.test("to-json--from-json", () { |
771 var o = buildSurveyQuestionImage(); | 794 var o = buildSurveyQuestionImage(); |
772 var od = new api.SurveyQuestionImage.fromJson(o.toJson()); | 795 var od = new api.SurveyQuestionImage.fromJson(o.toJson()); |
773 checkSurveyQuestionImage(od); | 796 checkSurveyQuestionImage(od); |
774 }); | 797 }); |
775 }); | 798 }); |
776 | 799 |
777 | 800 |
| 801 unittest.group("obj-schema-SurveyRejection", () { |
| 802 unittest.test("to-json--from-json", () { |
| 803 var o = buildSurveyRejection(); |
| 804 var od = new api.SurveyRejection.fromJson(o.toJson()); |
| 805 checkSurveyRejection(od); |
| 806 }); |
| 807 }); |
| 808 |
| 809 |
778 unittest.group("obj-schema-SurveyResults", () { | 810 unittest.group("obj-schema-SurveyResults", () { |
779 unittest.test("to-json--from-json", () { | 811 unittest.test("to-json--from-json", () { |
780 var o = buildSurveyResults(); | 812 var o = buildSurveyResults(); |
781 var od = new api.SurveyResults.fromJson(o.toJson()); | 813 var od = new api.SurveyResults.fromJson(o.toJson()); |
782 checkSurveyResults(od); | 814 checkSurveyResults(od); |
783 }); | 815 }); |
784 }); | 816 }); |
785 | 817 |
786 | 818 |
787 unittest.group("obj-schema-SurveysDeleteResponse", () { | 819 unittest.group("obj-schema-SurveysDeleteResponse", () { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 var od = new api.TokenPagination.fromJson(o.toJson()); | 867 var od = new api.TokenPagination.fromJson(o.toJson()); |
836 checkTokenPagination(od); | 868 checkTokenPagination(od); |
837 }); | 869 }); |
838 }); | 870 }); |
839 | 871 |
840 | 872 |
841 unittest.group("resource-MobileapppanelsResourceApi", () { | 873 unittest.group("resource-MobileapppanelsResourceApi", () { |
842 unittest.test("method--get", () { | 874 unittest.test("method--get", () { |
843 | 875 |
844 var mock = new HttpServerMock(); | 876 var mock = new HttpServerMock(); |
845 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; | 877 api.MobileapppanelsResourceApi res = new api.SurveysApi(mock).mobileapppan
els; |
846 var arg_panelId = "foo"; | 878 var arg_panelId = "foo"; |
847 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 879 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
848 var path = (req.url).path; | 880 var path = (req.url).path; |
849 var pathOffset = 0; | 881 var pathOffset = 0; |
850 var index; | 882 var index; |
851 var subPart; | 883 var subPart; |
852 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 884 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
853 pathOffset += 1; | 885 pathOffset += 1; |
854 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 886 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
855 pathOffset += 19; | 887 pathOffset += 11; |
856 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("mobileAppPanels/")); | 888 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("mobileAppPanels/")); |
857 pathOffset += 16; | 889 pathOffset += 16; |
858 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 890 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
859 pathOffset = path.length; | 891 pathOffset = path.length; |
860 unittest.expect(subPart, unittest.equals("$arg_panelId")); | 892 unittest.expect(subPart, unittest.equals("$arg_panelId")); |
861 | 893 |
862 var query = (req.url).query; | 894 var query = (req.url).query; |
863 var queryOffset = 0; | 895 var queryOffset = 0; |
864 var queryMap = {}; | 896 var queryMap = {}; |
865 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 897 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 18 matching lines...) Expand all Loading... |
884 return new async.Future.value(stringResponse(200, h, resp)); | 916 return new async.Future.value(stringResponse(200, h, resp)); |
885 }), true); | 917 }), true); |
886 res.get(arg_panelId).then(unittest.expectAsync(((api.MobileAppPanel respon
se) { | 918 res.get(arg_panelId).then(unittest.expectAsync(((api.MobileAppPanel respon
se) { |
887 checkMobileAppPanel(response); | 919 checkMobileAppPanel(response); |
888 }))); | 920 }))); |
889 }); | 921 }); |
890 | 922 |
891 unittest.test("method--list", () { | 923 unittest.test("method--list", () { |
892 | 924 |
893 var mock = new HttpServerMock(); | 925 var mock = new HttpServerMock(); |
894 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; | 926 api.MobileapppanelsResourceApi res = new api.SurveysApi(mock).mobileapppan
els; |
895 var arg_maxResults = 42; | 927 var arg_maxResults = 42; |
896 var arg_startIndex = 42; | 928 var arg_startIndex = 42; |
897 var arg_token = "foo"; | 929 var arg_token = "foo"; |
898 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 930 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
899 var path = (req.url).path; | 931 var path = (req.url).path; |
900 var pathOffset = 0; | 932 var pathOffset = 0; |
901 var index; | 933 var index; |
902 var subPart; | 934 var subPart; |
903 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 935 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
904 pathOffset += 1; | 936 pathOffset += 1; |
905 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 937 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
906 pathOffset += 19; | 938 pathOffset += 11; |
907 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("mobileAppPanels")); | 939 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("mobileAppPanels")); |
908 pathOffset += 15; | 940 pathOffset += 15; |
909 | 941 |
910 var query = (req.url).query; | 942 var query = (req.url).query; |
911 var queryOffset = 0; | 943 var queryOffset = 0; |
912 var queryMap = {}; | 944 var queryMap = {}; |
913 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 945 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
914 parseBool(n) { | 946 parseBool(n) { |
915 if (n == "true") return true; | 947 if (n == "true") return true; |
916 if (n == "false") return false; | 948 if (n == "false") return false; |
(...skipping 18 matching lines...) Expand all Loading... |
935 return new async.Future.value(stringResponse(200, h, resp)); | 967 return new async.Future.value(stringResponse(200, h, resp)); |
936 }), true); | 968 }), true); |
937 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync(((api.MobileAppPanelsListResponse response) { | 969 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync(((api.MobileAppPanelsListResponse response) { |
938 checkMobileAppPanelsListResponse(response); | 970 checkMobileAppPanelsListResponse(response); |
939 }))); | 971 }))); |
940 }); | 972 }); |
941 | 973 |
942 unittest.test("method--update", () { | 974 unittest.test("method--update", () { |
943 | 975 |
944 var mock = new HttpServerMock(); | 976 var mock = new HttpServerMock(); |
945 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; | 977 api.MobileapppanelsResourceApi res = new api.SurveysApi(mock).mobileapppan
els; |
946 var arg_request = buildMobileAppPanel(); | 978 var arg_request = buildMobileAppPanel(); |
947 var arg_panelId = "foo"; | 979 var arg_panelId = "foo"; |
948 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 980 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
949 var obj = new api.MobileAppPanel.fromJson(json); | 981 var obj = new api.MobileAppPanel.fromJson(json); |
950 checkMobileAppPanel(obj); | 982 checkMobileAppPanel(obj); |
951 | 983 |
952 var path = (req.url).path; | 984 var path = (req.url).path; |
953 var pathOffset = 0; | 985 var pathOffset = 0; |
954 var index; | 986 var index; |
955 var subPart; | 987 var subPart; |
956 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 988 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
957 pathOffset += 1; | 989 pathOffset += 1; |
958 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 990 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
959 pathOffset += 19; | 991 pathOffset += 11; |
960 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("mobileAppPanels/")); | 992 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("mobileAppPanels/")); |
961 pathOffset += 16; | 993 pathOffset += 16; |
962 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 994 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
963 pathOffset = path.length; | 995 pathOffset = path.length; |
964 unittest.expect(subPart, unittest.equals("$arg_panelId")); | 996 unittest.expect(subPart, unittest.equals("$arg_panelId")); |
965 | 997 |
966 var query = (req.url).query; | 998 var query = (req.url).query; |
967 var queryOffset = 0; | 999 var queryOffset = 0; |
968 var queryMap = {}; | 1000 var queryMap = {}; |
969 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1001 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 24 matching lines...) Expand all Loading... |
994 | 1026 |
995 }); | 1027 }); |
996 | 1028 |
997 | 1029 |
998 unittest.group("resource-ResultsResourceApi", () { | 1030 unittest.group("resource-ResultsResourceApi", () { |
999 unittest.test("method--get", () { | 1031 unittest.test("method--get", () { |
1000 // TODO: Implement tests for media upload; | 1032 // TODO: Implement tests for media upload; |
1001 // TODO: Implement tests for media download; | 1033 // TODO: Implement tests for media download; |
1002 | 1034 |
1003 var mock = new HttpServerMock(); | 1035 var mock = new HttpServerMock(); |
1004 api.ResultsResourceApi res = new api.ConsumersurveysApi(mock).results; | 1036 api.ResultsResourceApi res = new api.SurveysApi(mock).results; |
1005 var arg_request = buildResultsGetRequest(); | 1037 var arg_request = buildResultsGetRequest(); |
1006 var arg_surveyUrlId = "foo"; | 1038 var arg_surveyUrlId = "foo"; |
1007 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1039 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1008 var obj = new api.ResultsGetRequest.fromJson(json); | 1040 var obj = new api.ResultsGetRequest.fromJson(json); |
1009 checkResultsGetRequest(obj); | 1041 checkResultsGetRequest(obj); |
1010 | 1042 |
1011 var path = (req.url).path; | 1043 var path = (req.url).path; |
1012 var pathOffset = 0; | 1044 var pathOffset = 0; |
1013 var index; | 1045 var index; |
1014 var subPart; | 1046 var subPart; |
1015 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1047 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1016 pathOffset += 1; | 1048 pathOffset += 1; |
1017 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1049 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1018 pathOffset += 19; | 1050 pathOffset += 11; |
1019 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1051 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
1020 pathOffset += 8; | 1052 pathOffset += 8; |
1021 index = path.indexOf("/results", pathOffset); | 1053 index = path.indexOf("/results", pathOffset); |
1022 unittest.expect(index >= 0, unittest.isTrue); | 1054 unittest.expect(index >= 0, unittest.isTrue); |
1023 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1055 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1024 pathOffset = index; | 1056 pathOffset = index; |
1025 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); | 1057 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); |
1026 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/results")); | 1058 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/results")); |
1027 pathOffset += 8; | 1059 pathOffset += 8; |
1028 | 1060 |
(...skipping 26 matching lines...) Expand all Loading... |
1055 }))); | 1087 }))); |
1056 }); | 1088 }); |
1057 | 1089 |
1058 }); | 1090 }); |
1059 | 1091 |
1060 | 1092 |
1061 unittest.group("resource-SurveysResourceApi", () { | 1093 unittest.group("resource-SurveysResourceApi", () { |
1062 unittest.test("method--delete", () { | 1094 unittest.test("method--delete", () { |
1063 | 1095 |
1064 var mock = new HttpServerMock(); | 1096 var mock = new HttpServerMock(); |
1065 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1097 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1066 var arg_surveyUrlId = "foo"; | 1098 var arg_surveyUrlId = "foo"; |
1067 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1099 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1068 var path = (req.url).path; | 1100 var path = (req.url).path; |
1069 var pathOffset = 0; | 1101 var pathOffset = 0; |
1070 var index; | 1102 var index; |
1071 var subPart; | 1103 var subPart; |
1072 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1104 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1073 pathOffset += 1; | 1105 pathOffset += 1; |
1074 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1106 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1075 pathOffset += 19; | 1107 pathOffset += 11; |
1076 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1108 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
1077 pathOffset += 8; | 1109 pathOffset += 8; |
1078 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1110 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1079 pathOffset = path.length; | 1111 pathOffset = path.length; |
1080 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); | 1112 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); |
1081 | 1113 |
1082 var query = (req.url).query; | 1114 var query = (req.url).query; |
1083 var queryOffset = 0; | 1115 var queryOffset = 0; |
1084 var queryMap = {}; | 1116 var queryMap = {}; |
1085 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1117 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 18 matching lines...) Expand all Loading... |
1104 return new async.Future.value(stringResponse(200, h, resp)); | 1136 return new async.Future.value(stringResponse(200, h, resp)); |
1105 }), true); | 1137 }), true); |
1106 res.delete(arg_surveyUrlId).then(unittest.expectAsync(((api.SurveysDeleteR
esponse response) { | 1138 res.delete(arg_surveyUrlId).then(unittest.expectAsync(((api.SurveysDeleteR
esponse response) { |
1107 checkSurveysDeleteResponse(response); | 1139 checkSurveysDeleteResponse(response); |
1108 }))); | 1140 }))); |
1109 }); | 1141 }); |
1110 | 1142 |
1111 unittest.test("method--get", () { | 1143 unittest.test("method--get", () { |
1112 | 1144 |
1113 var mock = new HttpServerMock(); | 1145 var mock = new HttpServerMock(); |
1114 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1146 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1115 var arg_surveyUrlId = "foo"; | 1147 var arg_surveyUrlId = "foo"; |
1116 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1148 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1117 var path = (req.url).path; | 1149 var path = (req.url).path; |
1118 var pathOffset = 0; | 1150 var pathOffset = 0; |
1119 var index; | 1151 var index; |
1120 var subPart; | 1152 var subPart; |
1121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1153 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1122 pathOffset += 1; | 1154 pathOffset += 1; |
1123 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1155 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1124 pathOffset += 19; | 1156 pathOffset += 11; |
1125 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1157 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
1126 pathOffset += 8; | 1158 pathOffset += 8; |
1127 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1159 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1128 pathOffset = path.length; | 1160 pathOffset = path.length; |
1129 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); | 1161 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); |
1130 | 1162 |
1131 var query = (req.url).query; | 1163 var query = (req.url).query; |
1132 var queryOffset = 0; | 1164 var queryOffset = 0; |
1133 var queryMap = {}; | 1165 var queryMap = {}; |
1134 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1166 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 18 matching lines...) Expand all Loading... |
1153 return new async.Future.value(stringResponse(200, h, resp)); | 1185 return new async.Future.value(stringResponse(200, h, resp)); |
1154 }), true); | 1186 }), true); |
1155 res.get(arg_surveyUrlId).then(unittest.expectAsync(((api.Survey response)
{ | 1187 res.get(arg_surveyUrlId).then(unittest.expectAsync(((api.Survey response)
{ |
1156 checkSurvey(response); | 1188 checkSurvey(response); |
1157 }))); | 1189 }))); |
1158 }); | 1190 }); |
1159 | 1191 |
1160 unittest.test("method--insert", () { | 1192 unittest.test("method--insert", () { |
1161 | 1193 |
1162 var mock = new HttpServerMock(); | 1194 var mock = new HttpServerMock(); |
1163 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1195 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1164 var arg_request = buildSurvey(); | 1196 var arg_request = buildSurvey(); |
1165 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1197 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1166 var obj = new api.Survey.fromJson(json); | 1198 var obj = new api.Survey.fromJson(json); |
1167 checkSurvey(obj); | 1199 checkSurvey(obj); |
1168 | 1200 |
1169 var path = (req.url).path; | 1201 var path = (req.url).path; |
1170 var pathOffset = 0; | 1202 var pathOffset = 0; |
1171 var index; | 1203 var index; |
1172 var subPart; | 1204 var subPart; |
1173 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1205 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1174 pathOffset += 1; | 1206 pathOffset += 1; |
1175 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1207 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1176 pathOffset += 19; | 1208 pathOffset += 11; |
1177 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("surveys")); | 1209 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("surveys")); |
1178 pathOffset += 7; | 1210 pathOffset += 7; |
1179 | 1211 |
1180 var query = (req.url).query; | 1212 var query = (req.url).query; |
1181 var queryOffset = 0; | 1213 var queryOffset = 0; |
1182 var queryMap = {}; | 1214 var queryMap = {}; |
1183 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1215 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1184 parseBool(n) { | 1216 parseBool(n) { |
1185 if (n == "true") return true; | 1217 if (n == "true") return true; |
1186 if (n == "false") return false; | 1218 if (n == "false") return false; |
(...skipping 15 matching lines...) Expand all Loading... |
1202 return new async.Future.value(stringResponse(200, h, resp)); | 1234 return new async.Future.value(stringResponse(200, h, resp)); |
1203 }), true); | 1235 }), true); |
1204 res.insert(arg_request).then(unittest.expectAsync(((api.Survey response) { | 1236 res.insert(arg_request).then(unittest.expectAsync(((api.Survey response) { |
1205 checkSurvey(response); | 1237 checkSurvey(response); |
1206 }))); | 1238 }))); |
1207 }); | 1239 }); |
1208 | 1240 |
1209 unittest.test("method--list", () { | 1241 unittest.test("method--list", () { |
1210 | 1242 |
1211 var mock = new HttpServerMock(); | 1243 var mock = new HttpServerMock(); |
1212 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1244 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1213 var arg_maxResults = 42; | 1245 var arg_maxResults = 42; |
1214 var arg_startIndex = 42; | 1246 var arg_startIndex = 42; |
1215 var arg_token = "foo"; | 1247 var arg_token = "foo"; |
1216 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1248 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1217 var path = (req.url).path; | 1249 var path = (req.url).path; |
1218 var pathOffset = 0; | 1250 var pathOffset = 0; |
1219 var index; | 1251 var index; |
1220 var subPart; | 1252 var subPart; |
1221 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1253 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1222 pathOffset += 1; | 1254 pathOffset += 1; |
1223 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1255 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1224 pathOffset += 19; | 1256 pathOffset += 11; |
1225 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("surveys")); | 1257 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("surveys")); |
1226 pathOffset += 7; | 1258 pathOffset += 7; |
1227 | 1259 |
1228 var query = (req.url).query; | 1260 var query = (req.url).query; |
1229 var queryOffset = 0; | 1261 var queryOffset = 0; |
1230 var queryMap = {}; | 1262 var queryMap = {}; |
1231 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1263 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1232 parseBool(n) { | 1264 parseBool(n) { |
1233 if (n == "true") return true; | 1265 if (n == "true") return true; |
1234 if (n == "false") return false; | 1266 if (n == "false") return false; |
(...skipping 18 matching lines...) Expand all Loading... |
1253 return new async.Future.value(stringResponse(200, h, resp)); | 1285 return new async.Future.value(stringResponse(200, h, resp)); |
1254 }), true); | 1286 }), true); |
1255 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync(((api.SurveysListResponse response) { | 1287 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync(((api.SurveysListResponse response) { |
1256 checkSurveysListResponse(response); | 1288 checkSurveysListResponse(response); |
1257 }))); | 1289 }))); |
1258 }); | 1290 }); |
1259 | 1291 |
1260 unittest.test("method--start", () { | 1292 unittest.test("method--start", () { |
1261 | 1293 |
1262 var mock = new HttpServerMock(); | 1294 var mock = new HttpServerMock(); |
1263 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1295 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1264 var arg_request = buildSurveysStartRequest(); | 1296 var arg_request = buildSurveysStartRequest(); |
1265 var arg_resourceId = "foo"; | 1297 var arg_resourceId = "foo"; |
1266 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1298 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1267 var obj = new api.SurveysStartRequest.fromJson(json); | 1299 var obj = new api.SurveysStartRequest.fromJson(json); |
1268 checkSurveysStartRequest(obj); | 1300 checkSurveysStartRequest(obj); |
1269 | 1301 |
1270 var path = (req.url).path; | 1302 var path = (req.url).path; |
1271 var pathOffset = 0; | 1303 var pathOffset = 0; |
1272 var index; | 1304 var index; |
1273 var subPart; | 1305 var subPart; |
1274 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1306 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1275 pathOffset += 1; | 1307 pathOffset += 1; |
1276 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1308 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1277 pathOffset += 19; | 1309 pathOffset += 11; |
1278 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1310 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
1279 pathOffset += 8; | 1311 pathOffset += 8; |
1280 index = path.indexOf("/start", pathOffset); | 1312 index = path.indexOf("/start", pathOffset); |
1281 unittest.expect(index >= 0, unittest.isTrue); | 1313 unittest.expect(index >= 0, unittest.isTrue); |
1282 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1314 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1283 pathOffset = index; | 1315 pathOffset = index; |
1284 unittest.expect(subPart, unittest.equals("$arg_resourceId")); | 1316 unittest.expect(subPart, unittest.equals("$arg_resourceId")); |
1285 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/start")); | 1317 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/start")); |
1286 pathOffset += 6; | 1318 pathOffset += 6; |
1287 | 1319 |
(...skipping 22 matching lines...) Expand all Loading... |
1310 return new async.Future.value(stringResponse(200, h, resp)); | 1342 return new async.Future.value(stringResponse(200, h, resp)); |
1311 }), true); | 1343 }), true); |
1312 res.start(arg_request, arg_resourceId).then(unittest.expectAsync(((api.Sur
veysStartResponse response) { | 1344 res.start(arg_request, arg_resourceId).then(unittest.expectAsync(((api.Sur
veysStartResponse response) { |
1313 checkSurveysStartResponse(response); | 1345 checkSurveysStartResponse(response); |
1314 }))); | 1346 }))); |
1315 }); | 1347 }); |
1316 | 1348 |
1317 unittest.test("method--stop", () { | 1349 unittest.test("method--stop", () { |
1318 | 1350 |
1319 var mock = new HttpServerMock(); | 1351 var mock = new HttpServerMock(); |
1320 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1352 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1321 var arg_resourceId = "foo"; | 1353 var arg_resourceId = "foo"; |
1322 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1354 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1323 var path = (req.url).path; | 1355 var path = (req.url).path; |
1324 var pathOffset = 0; | 1356 var pathOffset = 0; |
1325 var index; | 1357 var index; |
1326 var subPart; | 1358 var subPart; |
1327 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1359 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1328 pathOffset += 1; | 1360 pathOffset += 1; |
1329 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1361 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1330 pathOffset += 19; | 1362 pathOffset += 11; |
1331 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1363 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
1332 pathOffset += 8; | 1364 pathOffset += 8; |
1333 index = path.indexOf("/stop", pathOffset); | 1365 index = path.indexOf("/stop", pathOffset); |
1334 unittest.expect(index >= 0, unittest.isTrue); | 1366 unittest.expect(index >= 0, unittest.isTrue); |
1335 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1367 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1336 pathOffset = index; | 1368 pathOffset = index; |
1337 unittest.expect(subPart, unittest.equals("$arg_resourceId")); | 1369 unittest.expect(subPart, unittest.equals("$arg_resourceId")); |
1338 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/stop")); | 1370 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/stop")); |
1339 pathOffset += 5; | 1371 pathOffset += 5; |
1340 | 1372 |
(...skipping 22 matching lines...) Expand all Loading... |
1363 return new async.Future.value(stringResponse(200, h, resp)); | 1395 return new async.Future.value(stringResponse(200, h, resp)); |
1364 }), true); | 1396 }), true); |
1365 res.stop(arg_resourceId).then(unittest.expectAsync(((api.SurveysStopRespon
se response) { | 1397 res.stop(arg_resourceId).then(unittest.expectAsync(((api.SurveysStopRespon
se response) { |
1366 checkSurveysStopResponse(response); | 1398 checkSurveysStopResponse(response); |
1367 }))); | 1399 }))); |
1368 }); | 1400 }); |
1369 | 1401 |
1370 unittest.test("method--update", () { | 1402 unittest.test("method--update", () { |
1371 | 1403 |
1372 var mock = new HttpServerMock(); | 1404 var mock = new HttpServerMock(); |
1373 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1405 api.SurveysResourceApi res = new api.SurveysApi(mock).surveys; |
1374 var arg_request = buildSurvey(); | 1406 var arg_request = buildSurvey(); |
1375 var arg_surveyUrlId = "foo"; | 1407 var arg_surveyUrlId = "foo"; |
1376 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1408 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1377 var obj = new api.Survey.fromJson(json); | 1409 var obj = new api.Survey.fromJson(json); |
1378 checkSurvey(obj); | 1410 checkSurvey(obj); |
1379 | 1411 |
1380 var path = (req.url).path; | 1412 var path = (req.url).path; |
1381 var pathOffset = 0; | 1413 var pathOffset = 0; |
1382 var index; | 1414 var index; |
1383 var subPart; | 1415 var subPart; |
1384 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1416 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1385 pathOffset += 1; | 1417 pathOffset += 1; |
1386 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1418 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("surveys/v2/")); |
1387 pathOffset += 19; | 1419 pathOffset += 11; |
1388 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1420 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
1389 pathOffset += 8; | 1421 pathOffset += 8; |
1390 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1422 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1391 pathOffset = path.length; | 1423 pathOffset = path.length; |
1392 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); | 1424 unittest.expect(subPart, unittest.equals("$arg_surveyUrlId")); |
1393 | 1425 |
1394 var query = (req.url).query; | 1426 var query = (req.url).query; |
1395 var queryOffset = 0; | 1427 var queryOffset = 0; |
1396 var queryMap = {}; | 1428 var queryMap = {}; |
1397 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1429 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 20 matching lines...) Expand all Loading... |
1418 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S
urvey response) { | 1450 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S
urvey response) { |
1419 checkSurvey(response); | 1451 checkSurvey(response); |
1420 }))); | 1452 }))); |
1421 }); | 1453 }); |
1422 | 1454 |
1423 }); | 1455 }); |
1424 | 1456 |
1425 | 1457 |
1426 } | 1458 } |
1427 | 1459 |
OLD | NEW |