| OLD | NEW |
| 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:test/test.dart' as unittest; |
| 11 | 11 |
| 12 import 'package:googleapis/consumersurveys/v2.dart' as api; | 12 import 'package:googleapis/consumersurveys/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; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 } else { | 39 } else { |
| 40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 41 return _callback(request, data); |
| 42 }); | 42 }); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed39() { | 54 buildUnnamed41() { |
| 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 checkUnnamed39(core.List<api.FieldMask> o) { | 61 checkUnnamed41(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 = buildUnnamed39(); | 72 o.fields = buildUnnamed41(); |
| 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 checkUnnamed39(o.fields); | 82 checkUnnamed41(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 buildUnnamed40() { | 88 buildUnnamed42() { |
| 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 checkUnnamed40(core.List<core.String> o) { | 95 checkUnnamed42(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 = buildUnnamed40(); | 111 o.owners = buildUnnamed42(); |
| 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 checkUnnamed40(o.owners); | 125 checkUnnamed42(o.owners); |
| 126 } | 126 } |
| 127 buildCounterMobileAppPanel--; | 127 buildCounterMobileAppPanel--; |
| 128 } | 128 } |
| 129 | 129 |
| 130 buildUnnamed41() { | 130 buildUnnamed43() { |
| 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 checkUnnamed41(core.List<api.MobileAppPanel> o) { | 137 checkUnnamed43(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 = buildUnnamed41(); | 150 o.resources = buildUnnamed43(); |
| 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 checkUnnamed41(o.resources); | 162 checkUnnamed43(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 buildUnnamed42() { | 210 buildUnnamed44() { |
| 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 checkUnnamed42(core.List<api.FieldMask> o) { | 217 checkUnnamed44(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 = buildUnnamed42(); | 228 o.fields = buildUnnamed44(); |
| 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 checkUnnamed42(o.fields); | 238 checkUnnamed44(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 buildUnnamed43() { | 244 buildUnnamed45() { |
| 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 checkUnnamed43(core.List<core.String> o) { | 251 checkUnnamed45(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 buildUnnamed44() { | 257 buildUnnamed46() { |
| 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 checkUnnamed44(core.List<api.SurveyQuestion> o) { | 264 checkUnnamed46(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 = buildUnnamed43(); | 279 o.owners = buildUnnamed45(); |
| 280 o.questions = buildUnnamed44(); | 280 o.questions = buildUnnamed46(); |
| 281 o.rejectionReason = buildSurveyRejection(); | 281 o.rejectionReason = buildSurveyRejection(); |
| 282 o.state = "foo"; | 282 o.state = "foo"; |
| 283 o.surveyUrlId = "foo"; | 283 o.surveyUrlId = "foo"; |
| 284 o.title = "foo"; | 284 o.title = "foo"; |
| 285 o.wantedResponseCount = 42; | 285 o.wantedResponseCount = 42; |
| 286 } | 286 } |
| 287 buildCounterSurvey--; | 287 buildCounterSurvey--; |
| 288 return o; | 288 return o; |
| 289 } | 289 } |
| 290 | 290 |
| 291 checkSurvey(api.Survey o) { | 291 checkSurvey(api.Survey o) { |
| 292 buildCounterSurvey++; | 292 buildCounterSurvey++; |
| 293 if (buildCounterSurvey < 3) { | 293 if (buildCounterSurvey < 3) { |
| 294 checkSurveyAudience(o.audience); | 294 checkSurveyAudience(o.audience); |
| 295 checkSurveyCost(o.cost); | 295 checkSurveyCost(o.cost); |
| 296 unittest.expect(o.customerData, unittest.equals('foo')); | 296 unittest.expect(o.customerData, unittest.equals('foo')); |
| 297 unittest.expect(o.description, unittest.equals('foo')); | 297 unittest.expect(o.description, unittest.equals('foo')); |
| 298 checkUnnamed43(o.owners); | 298 checkUnnamed45(o.owners); |
| 299 checkUnnamed44(o.questions); | 299 checkUnnamed46(o.questions); |
| 300 checkSurveyRejection(o.rejectionReason); | 300 checkSurveyRejection(o.rejectionReason); |
| 301 unittest.expect(o.state, unittest.equals('foo')); | 301 unittest.expect(o.state, unittest.equals('foo')); |
| 302 unittest.expect(o.surveyUrlId, unittest.equals('foo')); | 302 unittest.expect(o.surveyUrlId, unittest.equals('foo')); |
| 303 unittest.expect(o.title, unittest.equals('foo')); | 303 unittest.expect(o.title, unittest.equals('foo')); |
| 304 unittest.expect(o.wantedResponseCount, unittest.equals(42)); | 304 unittest.expect(o.wantedResponseCount, unittest.equals(42)); |
| 305 } | 305 } |
| 306 buildCounterSurvey--; | 306 buildCounterSurvey--; |
| 307 } | 307 } |
| 308 | 308 |
| 309 buildUnnamed45() { | 309 buildUnnamed47() { |
| 310 var o = new core.List<core.String>(); | 310 var o = new core.List<core.String>(); |
| 311 o.add("foo"); | 311 o.add("foo"); |
| 312 o.add("foo"); | 312 o.add("foo"); |
| 313 return o; | 313 return o; |
| 314 } | 314 } |
| 315 | 315 |
| 316 checkUnnamed45(core.List<core.String> o) { | 316 checkUnnamed47(core.List<core.String> o) { |
| 317 unittest.expect(o, unittest.hasLength(2)); | 317 unittest.expect(o, unittest.hasLength(2)); |
| 318 unittest.expect(o[0], unittest.equals('foo')); | 318 unittest.expect(o[0], unittest.equals('foo')); |
| 319 unittest.expect(o[1], unittest.equals('foo')); | 319 unittest.expect(o[1], unittest.equals('foo')); |
| 320 } | 320 } |
| 321 | 321 |
| 322 buildUnnamed46() { | 322 buildUnnamed48() { |
| 323 var o = new core.List<core.String>(); | 323 var o = new core.List<core.String>(); |
| 324 o.add("foo"); | 324 o.add("foo"); |
| 325 o.add("foo"); | 325 o.add("foo"); |
| 326 return o; | 326 return o; |
| 327 } | 327 } |
| 328 | 328 |
| 329 checkUnnamed46(core.List<core.String> o) { | 329 checkUnnamed48(core.List<core.String> o) { |
| 330 unittest.expect(o, unittest.hasLength(2)); | 330 unittest.expect(o, unittest.hasLength(2)); |
| 331 unittest.expect(o[0], unittest.equals('foo')); | 331 unittest.expect(o[0], unittest.equals('foo')); |
| 332 unittest.expect(o[1], unittest.equals('foo')); | 332 unittest.expect(o[1], unittest.equals('foo')); |
| 333 } | 333 } |
| 334 | 334 |
| 335 core.int buildCounterSurveyAudience = 0; | 335 core.int buildCounterSurveyAudience = 0; |
| 336 buildSurveyAudience() { | 336 buildSurveyAudience() { |
| 337 var o = new api.SurveyAudience(); | 337 var o = new api.SurveyAudience(); |
| 338 buildCounterSurveyAudience++; | 338 buildCounterSurveyAudience++; |
| 339 if (buildCounterSurveyAudience < 3) { | 339 if (buildCounterSurveyAudience < 3) { |
| 340 o.ages = buildUnnamed45(); | 340 o.ages = buildUnnamed47(); |
| 341 o.country = "foo"; | 341 o.country = "foo"; |
| 342 o.countrySubdivision = "foo"; | 342 o.countrySubdivision = "foo"; |
| 343 o.gender = "foo"; | 343 o.gender = "foo"; |
| 344 o.languages = buildUnnamed46(); | 344 o.languages = buildUnnamed48(); |
| 345 o.mobileAppPanelId = "foo"; | 345 o.mobileAppPanelId = "foo"; |
| 346 o.populationSource = "foo"; | 346 o.populationSource = "foo"; |
| 347 } | 347 } |
| 348 buildCounterSurveyAudience--; | 348 buildCounterSurveyAudience--; |
| 349 return o; | 349 return o; |
| 350 } | 350 } |
| 351 | 351 |
| 352 checkSurveyAudience(api.SurveyAudience o) { | 352 checkSurveyAudience(api.SurveyAudience o) { |
| 353 buildCounterSurveyAudience++; | 353 buildCounterSurveyAudience++; |
| 354 if (buildCounterSurveyAudience < 3) { | 354 if (buildCounterSurveyAudience < 3) { |
| 355 checkUnnamed45(o.ages); | 355 checkUnnamed47(o.ages); |
| 356 unittest.expect(o.country, unittest.equals('foo')); | 356 unittest.expect(o.country, unittest.equals('foo')); |
| 357 unittest.expect(o.countrySubdivision, unittest.equals('foo')); | 357 unittest.expect(o.countrySubdivision, unittest.equals('foo')); |
| 358 unittest.expect(o.gender, unittest.equals('foo')); | 358 unittest.expect(o.gender, unittest.equals('foo')); |
| 359 checkUnnamed46(o.languages); | 359 checkUnnamed48(o.languages); |
| 360 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); | 360 unittest.expect(o.mobileAppPanelId, unittest.equals('foo')); |
| 361 unittest.expect(o.populationSource, unittest.equals('foo')); | 361 unittest.expect(o.populationSource, unittest.equals('foo')); |
| 362 } | 362 } |
| 363 buildCounterSurveyAudience--; | 363 buildCounterSurveyAudience--; |
| 364 } | 364 } |
| 365 | 365 |
| 366 core.int buildCounterSurveyCost = 0; | 366 core.int buildCounterSurveyCost = 0; |
| 367 buildSurveyCost() { | 367 buildSurveyCost() { |
| 368 var o = new api.SurveyCost(); | 368 var o = new api.SurveyCost(); |
| 369 buildCounterSurveyCost++; | 369 buildCounterSurveyCost++; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 381 buildCounterSurveyCost++; | 381 buildCounterSurveyCost++; |
| 382 if (buildCounterSurveyCost < 3) { | 382 if (buildCounterSurveyCost < 3) { |
| 383 unittest.expect(o.costPerResponseNanos, unittest.equals('foo')); | 383 unittest.expect(o.costPerResponseNanos, unittest.equals('foo')); |
| 384 unittest.expect(o.currencyCode, unittest.equals('foo')); | 384 unittest.expect(o.currencyCode, unittest.equals('foo')); |
| 385 unittest.expect(o.maxCostPerResponseNanos, unittest.equals('foo')); | 385 unittest.expect(o.maxCostPerResponseNanos, unittest.equals('foo')); |
| 386 unittest.expect(o.nanos, unittest.equals('foo')); | 386 unittest.expect(o.nanos, unittest.equals('foo')); |
| 387 } | 387 } |
| 388 buildCounterSurveyCost--; | 388 buildCounterSurveyCost--; |
| 389 } | 389 } |
| 390 | 390 |
| 391 buildUnnamed47() { | |
| 392 var o = new core.List<core.String>(); | |
| 393 o.add("foo"); | |
| 394 o.add("foo"); | |
| 395 return o; | |
| 396 } | |
| 397 | |
| 398 checkUnnamed47(core.List<core.String> o) { | |
| 399 unittest.expect(o, unittest.hasLength(2)); | |
| 400 unittest.expect(o[0], unittest.equals('foo')); | |
| 401 unittest.expect(o[1], unittest.equals('foo')); | |
| 402 } | |
| 403 | |
| 404 buildUnnamed48() { | |
| 405 var o = new core.List<api.SurveyQuestionImage>(); | |
| 406 o.add(buildSurveyQuestionImage()); | |
| 407 o.add(buildSurveyQuestionImage()); | |
| 408 return o; | |
| 409 } | |
| 410 | |
| 411 checkUnnamed48(core.List<api.SurveyQuestionImage> o) { | |
| 412 unittest.expect(o, unittest.hasLength(2)); | |
| 413 checkSurveyQuestionImage(o[0]); | |
| 414 checkSurveyQuestionImage(o[1]); | |
| 415 } | |
| 416 | |
| 417 buildUnnamed49() { | 391 buildUnnamed49() { |
| 418 var o = new core.List<core.String>(); | 392 var o = new core.List<core.String>(); |
| 419 o.add("foo"); | 393 o.add("foo"); |
| 420 o.add("foo"); | 394 o.add("foo"); |
| 421 return o; | 395 return o; |
| 422 } | 396 } |
| 423 | 397 |
| 424 checkUnnamed49(core.List<core.String> o) { | 398 checkUnnamed49(core.List<core.String> o) { |
| 425 unittest.expect(o, unittest.hasLength(2)); | 399 unittest.expect(o, unittest.hasLength(2)); |
| 426 unittest.expect(o[0], unittest.equals('foo')); | 400 unittest.expect(o[0], unittest.equals('foo')); |
| 427 unittest.expect(o[1], unittest.equals('foo')); | 401 unittest.expect(o[1], unittest.equals('foo')); |
| 428 } | 402 } |
| 429 | 403 |
| 430 buildUnnamed50() { | 404 buildUnnamed50() { |
| 405 var o = new core.List<api.SurveyQuestionImage>(); |
| 406 o.add(buildSurveyQuestionImage()); |
| 407 o.add(buildSurveyQuestionImage()); |
| 408 return o; |
| 409 } |
| 410 |
| 411 checkUnnamed50(core.List<api.SurveyQuestionImage> o) { |
| 412 unittest.expect(o, unittest.hasLength(2)); |
| 413 checkSurveyQuestionImage(o[0]); |
| 414 checkSurveyQuestionImage(o[1]); |
| 415 } |
| 416 |
| 417 buildUnnamed51() { |
| 431 var o = new core.List<core.String>(); | 418 var o = new core.List<core.String>(); |
| 432 o.add("foo"); | 419 o.add("foo"); |
| 433 o.add("foo"); | 420 o.add("foo"); |
| 434 return o; | 421 return o; |
| 435 } | 422 } |
| 436 | 423 |
| 437 checkUnnamed50(core.List<core.String> o) { | 424 checkUnnamed51(core.List<core.String> o) { |
| 438 unittest.expect(o, unittest.hasLength(2)); | 425 unittest.expect(o, unittest.hasLength(2)); |
| 439 unittest.expect(o[0], unittest.equals('foo')); | 426 unittest.expect(o[0], unittest.equals('foo')); |
| 440 unittest.expect(o[1], unittest.equals('foo')); | 427 unittest.expect(o[1], unittest.equals('foo')); |
| 428 } |
| 429 |
| 430 buildUnnamed52() { |
| 431 var o = new core.List<core.String>(); |
| 432 o.add("foo"); |
| 433 o.add("foo"); |
| 434 return o; |
| 435 } |
| 436 |
| 437 checkUnnamed52(core.List<core.String> o) { |
| 438 unittest.expect(o, unittest.hasLength(2)); |
| 439 unittest.expect(o[0], unittest.equals('foo')); |
| 440 unittest.expect(o[1], unittest.equals('foo')); |
| 441 } | 441 } |
| 442 | 442 |
| 443 core.int buildCounterSurveyQuestion = 0; | 443 core.int buildCounterSurveyQuestion = 0; |
| 444 buildSurveyQuestion() { | 444 buildSurveyQuestion() { |
| 445 var o = new api.SurveyQuestion(); | 445 var o = new api.SurveyQuestion(); |
| 446 buildCounterSurveyQuestion++; | 446 buildCounterSurveyQuestion++; |
| 447 if (buildCounterSurveyQuestion < 3) { | 447 if (buildCounterSurveyQuestion < 3) { |
| 448 o.answerOrder = "foo"; | 448 o.answerOrder = "foo"; |
| 449 o.answers = buildUnnamed47(); | 449 o.answers = buildUnnamed49(); |
| 450 o.hasOther = true; | 450 o.hasOther = true; |
| 451 o.highValueLabel = "foo"; | 451 o.highValueLabel = "foo"; |
| 452 o.images = buildUnnamed48(); | 452 o.images = buildUnnamed50(); |
| 453 o.lastAnswerPositionPinned = true; | 453 o.lastAnswerPositionPinned = true; |
| 454 o.lowValueLabel = "foo"; | 454 o.lowValueLabel = "foo"; |
| 455 o.mustPickSuggestion = true; | 455 o.mustPickSuggestion = true; |
| 456 o.numStars = "foo"; | 456 o.numStars = "foo"; |
| 457 o.openTextPlaceholder = "foo"; | 457 o.openTextPlaceholder = "foo"; |
| 458 o.openTextSuggestions = buildUnnamed49(); | 458 o.openTextSuggestions = buildUnnamed51(); |
| 459 o.question = "foo"; | 459 o.question = "foo"; |
| 460 o.sentimentText = "foo"; | 460 o.sentimentText = "foo"; |
| 461 o.singleLineResponse = true; | 461 o.singleLineResponse = true; |
| 462 o.thresholdAnswers = buildUnnamed50(); | 462 o.thresholdAnswers = buildUnnamed52(); |
| 463 o.type = "foo"; | 463 o.type = "foo"; |
| 464 o.unitOfMeasurementLabel = "foo"; | 464 o.unitOfMeasurementLabel = "foo"; |
| 465 o.videoId = "foo"; | 465 o.videoId = "foo"; |
| 466 } | 466 } |
| 467 buildCounterSurveyQuestion--; | 467 buildCounterSurveyQuestion--; |
| 468 return o; | 468 return o; |
| 469 } | 469 } |
| 470 | 470 |
| 471 checkSurveyQuestion(api.SurveyQuestion o) { | 471 checkSurveyQuestion(api.SurveyQuestion o) { |
| 472 buildCounterSurveyQuestion++; | 472 buildCounterSurveyQuestion++; |
| 473 if (buildCounterSurveyQuestion < 3) { | 473 if (buildCounterSurveyQuestion < 3) { |
| 474 unittest.expect(o.answerOrder, unittest.equals('foo')); | 474 unittest.expect(o.answerOrder, unittest.equals('foo')); |
| 475 checkUnnamed47(o.answers); | 475 checkUnnamed49(o.answers); |
| 476 unittest.expect(o.hasOther, unittest.isTrue); | 476 unittest.expect(o.hasOther, unittest.isTrue); |
| 477 unittest.expect(o.highValueLabel, unittest.equals('foo')); | 477 unittest.expect(o.highValueLabel, unittest.equals('foo')); |
| 478 checkUnnamed48(o.images); | 478 checkUnnamed50(o.images); |
| 479 unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue); | 479 unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue); |
| 480 unittest.expect(o.lowValueLabel, unittest.equals('foo')); | 480 unittest.expect(o.lowValueLabel, unittest.equals('foo')); |
| 481 unittest.expect(o.mustPickSuggestion, unittest.isTrue); | 481 unittest.expect(o.mustPickSuggestion, unittest.isTrue); |
| 482 unittest.expect(o.numStars, unittest.equals('foo')); | 482 unittest.expect(o.numStars, unittest.equals('foo')); |
| 483 unittest.expect(o.openTextPlaceholder, unittest.equals('foo')); | 483 unittest.expect(o.openTextPlaceholder, unittest.equals('foo')); |
| 484 checkUnnamed49(o.openTextSuggestions); | 484 checkUnnamed51(o.openTextSuggestions); |
| 485 unittest.expect(o.question, unittest.equals('foo')); | 485 unittest.expect(o.question, unittest.equals('foo')); |
| 486 unittest.expect(o.sentimentText, unittest.equals('foo')); | 486 unittest.expect(o.sentimentText, unittest.equals('foo')); |
| 487 unittest.expect(o.singleLineResponse, unittest.isTrue); | 487 unittest.expect(o.singleLineResponse, unittest.isTrue); |
| 488 checkUnnamed50(o.thresholdAnswers); | 488 checkUnnamed52(o.thresholdAnswers); |
| 489 unittest.expect(o.type, unittest.equals('foo')); | 489 unittest.expect(o.type, unittest.equals('foo')); |
| 490 unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo')); | 490 unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo')); |
| 491 unittest.expect(o.videoId, unittest.equals('foo')); | 491 unittest.expect(o.videoId, unittest.equals('foo')); |
| 492 } | 492 } |
| 493 buildCounterSurveyQuestion--; | 493 buildCounterSurveyQuestion--; |
| 494 } | 494 } |
| 495 | 495 |
| 496 core.int buildCounterSurveyQuestionImage = 0; | 496 core.int buildCounterSurveyQuestionImage = 0; |
| 497 buildSurveyQuestionImage() { | 497 buildSurveyQuestionImage() { |
| 498 var o = new api.SurveyQuestionImage(); | 498 var o = new api.SurveyQuestionImage(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 } | 570 } |
| 571 | 571 |
| 572 checkSurveysDeleteResponse(api.SurveysDeleteResponse o) { | 572 checkSurveysDeleteResponse(api.SurveysDeleteResponse o) { |
| 573 buildCounterSurveysDeleteResponse++; | 573 buildCounterSurveysDeleteResponse++; |
| 574 if (buildCounterSurveysDeleteResponse < 3) { | 574 if (buildCounterSurveysDeleteResponse < 3) { |
| 575 unittest.expect(o.requestId, unittest.equals('foo')); | 575 unittest.expect(o.requestId, unittest.equals('foo')); |
| 576 } | 576 } |
| 577 buildCounterSurveysDeleteResponse--; | 577 buildCounterSurveysDeleteResponse--; |
| 578 } | 578 } |
| 579 | 579 |
| 580 buildUnnamed51() { | 580 buildUnnamed53() { |
| 581 var o = new core.List<api.Survey>(); | 581 var o = new core.List<api.Survey>(); |
| 582 o.add(buildSurvey()); | 582 o.add(buildSurvey()); |
| 583 o.add(buildSurvey()); | 583 o.add(buildSurvey()); |
| 584 return o; | 584 return o; |
| 585 } | 585 } |
| 586 | 586 |
| 587 checkUnnamed51(core.List<api.Survey> o) { | 587 checkUnnamed53(core.List<api.Survey> o) { |
| 588 unittest.expect(o, unittest.hasLength(2)); | 588 unittest.expect(o, unittest.hasLength(2)); |
| 589 checkSurvey(o[0]); | 589 checkSurvey(o[0]); |
| 590 checkSurvey(o[1]); | 590 checkSurvey(o[1]); |
| 591 } | 591 } |
| 592 | 592 |
| 593 core.int buildCounterSurveysListResponse = 0; | 593 core.int buildCounterSurveysListResponse = 0; |
| 594 buildSurveysListResponse() { | 594 buildSurveysListResponse() { |
| 595 var o = new api.SurveysListResponse(); | 595 var o = new api.SurveysListResponse(); |
| 596 buildCounterSurveysListResponse++; | 596 buildCounterSurveysListResponse++; |
| 597 if (buildCounterSurveysListResponse < 3) { | 597 if (buildCounterSurveysListResponse < 3) { |
| 598 o.pageInfo = buildPageInfo(); | 598 o.pageInfo = buildPageInfo(); |
| 599 o.requestId = "foo"; | 599 o.requestId = "foo"; |
| 600 o.resources = buildUnnamed51(); | 600 o.resources = buildUnnamed53(); |
| 601 o.tokenPagination = buildTokenPagination(); | 601 o.tokenPagination = buildTokenPagination(); |
| 602 } | 602 } |
| 603 buildCounterSurveysListResponse--; | 603 buildCounterSurveysListResponse--; |
| 604 return o; | 604 return o; |
| 605 } | 605 } |
| 606 | 606 |
| 607 checkSurveysListResponse(api.SurveysListResponse o) { | 607 checkSurveysListResponse(api.SurveysListResponse o) { |
| 608 buildCounterSurveysListResponse++; | 608 buildCounterSurveysListResponse++; |
| 609 if (buildCounterSurveysListResponse < 3) { | 609 if (buildCounterSurveysListResponse < 3) { |
| 610 checkPageInfo(o.pageInfo); | 610 checkPageInfo(o.pageInfo); |
| 611 unittest.expect(o.requestId, unittest.equals('foo')); | 611 unittest.expect(o.requestId, unittest.equals('foo')); |
| 612 checkUnnamed51(o.resources); | 612 checkUnnamed53(o.resources); |
| 613 checkTokenPagination(o.tokenPagination); | 613 checkTokenPagination(o.tokenPagination); |
| 614 } | 614 } |
| 615 buildCounterSurveysListResponse--; | 615 buildCounterSurveysListResponse--; |
| 616 } | 616 } |
| 617 | 617 |
| 618 core.int buildCounterSurveysStartRequest = 0; | 618 core.int buildCounterSurveysStartRequest = 0; |
| 619 buildSurveysStartRequest() { | 619 buildSurveysStartRequest() { |
| 620 var o = new api.SurveysStartRequest(); | 620 var o = new api.SurveysStartRequest(); |
| 621 buildCounterSurveysStartRequest++; | 621 buildCounterSurveysStartRequest++; |
| 622 if (buildCounterSurveysStartRequest < 3) { | 622 if (buildCounterSurveysStartRequest < 3) { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 }); | 865 }); |
| 866 }); | 866 }); |
| 867 | 867 |
| 868 | 868 |
| 869 unittest.group("resource-MobileapppanelsResourceApi", () { | 869 unittest.group("resource-MobileapppanelsResourceApi", () { |
| 870 unittest.test("method--get", () { | 870 unittest.test("method--get", () { |
| 871 | 871 |
| 872 var mock = new HttpServerMock(); | 872 var mock = new HttpServerMock(); |
| 873 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; | 873 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; |
| 874 var arg_panelId = "foo"; | 874 var arg_panelId = "foo"; |
| 875 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 875 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 876 var path = (req.url).path; | 876 var path = (req.url).path; |
| 877 var pathOffset = 0; | 877 var pathOffset = 0; |
| 878 var index; | 878 var index; |
| 879 var subPart; | 879 var subPart; |
| 880 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 880 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 881 pathOffset += 1; | 881 pathOffset += 1; |
| 882 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 882 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| 883 pathOffset += 19; | 883 pathOffset += 19; |
| 884 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("mobileAppPanels/")); | 884 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("mobileAppPanels/")); |
| 885 pathOffset += 16; | 885 pathOffset += 16; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 904 } | 904 } |
| 905 } | 905 } |
| 906 | 906 |
| 907 | 907 |
| 908 var h = { | 908 var h = { |
| 909 "content-type" : "application/json; charset=utf-8", | 909 "content-type" : "application/json; charset=utf-8", |
| 910 }; | 910 }; |
| 911 var resp = convert.JSON.encode(buildMobileAppPanel()); | 911 var resp = convert.JSON.encode(buildMobileAppPanel()); |
| 912 return new async.Future.value(stringResponse(200, h, resp)); | 912 return new async.Future.value(stringResponse(200, h, resp)); |
| 913 }), true); | 913 }), true); |
| 914 res.get(arg_panelId).then(unittest.expectAsync(((api.MobileAppPanel respon
se) { | 914 res.get(arg_panelId).then(unittest.expectAsync1(((api.MobileAppPanel respo
nse) { |
| 915 checkMobileAppPanel(response); | 915 checkMobileAppPanel(response); |
| 916 }))); | 916 }))); |
| 917 }); | 917 }); |
| 918 | 918 |
| 919 unittest.test("method--list", () { | 919 unittest.test("method--list", () { |
| 920 | 920 |
| 921 var mock = new HttpServerMock(); | 921 var mock = new HttpServerMock(); |
| 922 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; | 922 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; |
| 923 var arg_maxResults = 42; | 923 var arg_maxResults = 42; |
| 924 var arg_startIndex = 42; | 924 var arg_startIndex = 42; |
| 925 var arg_token = "foo"; | 925 var arg_token = "foo"; |
| 926 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 926 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 927 var path = (req.url).path; | 927 var path = (req.url).path; |
| 928 var pathOffset = 0; | 928 var pathOffset = 0; |
| 929 var index; | 929 var index; |
| 930 var subPart; | 930 var subPart; |
| 931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 932 pathOffset += 1; | 932 pathOffset += 1; |
| 933 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 933 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| 934 pathOffset += 19; | 934 pathOffset += 19; |
| 935 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("mobileAppPanels")); | 935 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("mobileAppPanels")); |
| 936 pathOffset += 15; | 936 pathOffset += 15; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 955 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | 955 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); |
| 956 unittest.expect(queryMap["token"].first, unittest.equals(arg_token)); | 956 unittest.expect(queryMap["token"].first, unittest.equals(arg_token)); |
| 957 | 957 |
| 958 | 958 |
| 959 var h = { | 959 var h = { |
| 960 "content-type" : "application/json; charset=utf-8", | 960 "content-type" : "application/json; charset=utf-8", |
| 961 }; | 961 }; |
| 962 var resp = convert.JSON.encode(buildMobileAppPanelsListResponse()); | 962 var resp = convert.JSON.encode(buildMobileAppPanelsListResponse()); |
| 963 return new async.Future.value(stringResponse(200, h, resp)); | 963 return new async.Future.value(stringResponse(200, h, resp)); |
| 964 }), true); | 964 }), true); |
| 965 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync(((api.MobileAppPanelsListResponse response) { | 965 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync1(((api.MobileAppPanelsListResponse response)
{ |
| 966 checkMobileAppPanelsListResponse(response); | 966 checkMobileAppPanelsListResponse(response); |
| 967 }))); | 967 }))); |
| 968 }); | 968 }); |
| 969 | 969 |
| 970 unittest.test("method--update", () { | 970 unittest.test("method--update", () { |
| 971 | 971 |
| 972 var mock = new HttpServerMock(); | 972 var mock = new HttpServerMock(); |
| 973 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; | 973 api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobi
leapppanels; |
| 974 var arg_request = buildMobileAppPanel(); | 974 var arg_request = buildMobileAppPanel(); |
| 975 var arg_panelId = "foo"; | 975 var arg_panelId = "foo"; |
| 976 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 976 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 977 var obj = new api.MobileAppPanel.fromJson(json); | 977 var obj = new api.MobileAppPanel.fromJson(json); |
| 978 checkMobileAppPanel(obj); | 978 checkMobileAppPanel(obj); |
| 979 | 979 |
| 980 var path = (req.url).path; | 980 var path = (req.url).path; |
| 981 var pathOffset = 0; | 981 var pathOffset = 0; |
| 982 var index; | 982 var index; |
| 983 var subPart; | 983 var subPart; |
| 984 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 984 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 985 pathOffset += 1; | 985 pathOffset += 1; |
| 986 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 986 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1008 } | 1008 } |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 | 1011 |
| 1012 var h = { | 1012 var h = { |
| 1013 "content-type" : "application/json; charset=utf-8", | 1013 "content-type" : "application/json; charset=utf-8", |
| 1014 }; | 1014 }; |
| 1015 var resp = convert.JSON.encode(buildMobileAppPanel()); | 1015 var resp = convert.JSON.encode(buildMobileAppPanel()); |
| 1016 return new async.Future.value(stringResponse(200, h, resp)); | 1016 return new async.Future.value(stringResponse(200, h, resp)); |
| 1017 }), true); | 1017 }), true); |
| 1018 res.update(arg_request, arg_panelId).then(unittest.expectAsync(((api.Mobil
eAppPanel response) { | 1018 res.update(arg_request, arg_panelId).then(unittest.expectAsync1(((api.Mobi
leAppPanel response) { |
| 1019 checkMobileAppPanel(response); | 1019 checkMobileAppPanel(response); |
| 1020 }))); | 1020 }))); |
| 1021 }); | 1021 }); |
| 1022 | 1022 |
| 1023 }); | 1023 }); |
| 1024 | 1024 |
| 1025 | 1025 |
| 1026 unittest.group("resource-ResultsResourceApi", () { | 1026 unittest.group("resource-ResultsResourceApi", () { |
| 1027 unittest.test("method--get", () { | 1027 unittest.test("method--get", () { |
| 1028 // TODO: Implement tests for media upload; | 1028 // TODO: Implement tests for media upload; |
| 1029 // TODO: Implement tests for media download; | 1029 // TODO: Implement tests for media download; |
| 1030 | 1030 |
| 1031 var mock = new HttpServerMock(); | 1031 var mock = new HttpServerMock(); |
| 1032 api.ResultsResourceApi res = new api.ConsumersurveysApi(mock).results; | 1032 api.ResultsResourceApi res = new api.ConsumersurveysApi(mock).results; |
| 1033 var arg_request = buildResultsGetRequest(); | 1033 var arg_request = buildResultsGetRequest(); |
| 1034 var arg_surveyUrlId = "foo"; | 1034 var arg_surveyUrlId = "foo"; |
| 1035 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1035 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1036 var obj = new api.ResultsGetRequest.fromJson(json); | 1036 var obj = new api.ResultsGetRequest.fromJson(json); |
| 1037 checkResultsGetRequest(obj); | 1037 checkResultsGetRequest(obj); |
| 1038 | 1038 |
| 1039 var path = (req.url).path; | 1039 var path = (req.url).path; |
| 1040 var pathOffset = 0; | 1040 var pathOffset = 0; |
| 1041 var index; | 1041 var index; |
| 1042 var subPart; | 1042 var subPart; |
| 1043 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1043 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1044 pathOffset += 1; | 1044 pathOffset += 1; |
| 1045 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1045 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1071 } | 1071 } |
| 1072 } | 1072 } |
| 1073 | 1073 |
| 1074 | 1074 |
| 1075 var h = { | 1075 var h = { |
| 1076 "content-type" : "application/json; charset=utf-8", | 1076 "content-type" : "application/json; charset=utf-8", |
| 1077 }; | 1077 }; |
| 1078 var resp = convert.JSON.encode(buildSurveyResults()); | 1078 var resp = convert.JSON.encode(buildSurveyResults()); |
| 1079 return new async.Future.value(stringResponse(200, h, resp)); | 1079 return new async.Future.value(stringResponse(200, h, resp)); |
| 1080 }), true); | 1080 }), true); |
| 1081 res.get(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.Surv
eyResults response) { | 1081 res.get(arg_request, arg_surveyUrlId).then(unittest.expectAsync1(((api.Sur
veyResults response) { |
| 1082 checkSurveyResults(response); | 1082 checkSurveyResults(response); |
| 1083 }))); | 1083 }))); |
| 1084 }); | 1084 }); |
| 1085 | 1085 |
| 1086 }); | 1086 }); |
| 1087 | 1087 |
| 1088 | 1088 |
| 1089 unittest.group("resource-SurveysResourceApi", () { | 1089 unittest.group("resource-SurveysResourceApi", () { |
| 1090 unittest.test("method--delete", () { | 1090 unittest.test("method--delete", () { |
| 1091 | 1091 |
| 1092 var mock = new HttpServerMock(); | 1092 var mock = new HttpServerMock(); |
| 1093 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1093 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1094 var arg_surveyUrlId = "foo"; | 1094 var arg_surveyUrlId = "foo"; |
| 1095 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1095 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1096 var path = (req.url).path; | 1096 var path = (req.url).path; |
| 1097 var pathOffset = 0; | 1097 var pathOffset = 0; |
| 1098 var index; | 1098 var index; |
| 1099 var subPart; | 1099 var subPart; |
| 1100 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1100 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1101 pathOffset += 1; | 1101 pathOffset += 1; |
| 1102 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1102 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| 1103 pathOffset += 19; | 1103 pathOffset += 19; |
| 1104 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1104 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
| 1105 pathOffset += 8; | 1105 pathOffset += 8; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1124 } | 1124 } |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 | 1127 |
| 1128 var h = { | 1128 var h = { |
| 1129 "content-type" : "application/json; charset=utf-8", | 1129 "content-type" : "application/json; charset=utf-8", |
| 1130 }; | 1130 }; |
| 1131 var resp = convert.JSON.encode(buildSurveysDeleteResponse()); | 1131 var resp = convert.JSON.encode(buildSurveysDeleteResponse()); |
| 1132 return new async.Future.value(stringResponse(200, h, resp)); | 1132 return new async.Future.value(stringResponse(200, h, resp)); |
| 1133 }), true); | 1133 }), true); |
| 1134 res.delete(arg_surveyUrlId).then(unittest.expectAsync(((api.SurveysDeleteR
esponse response) { | 1134 res.delete(arg_surveyUrlId).then(unittest.expectAsync1(((api.SurveysDelete
Response response) { |
| 1135 checkSurveysDeleteResponse(response); | 1135 checkSurveysDeleteResponse(response); |
| 1136 }))); | 1136 }))); |
| 1137 }); | 1137 }); |
| 1138 | 1138 |
| 1139 unittest.test("method--get", () { | 1139 unittest.test("method--get", () { |
| 1140 | 1140 |
| 1141 var mock = new HttpServerMock(); | 1141 var mock = new HttpServerMock(); |
| 1142 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1142 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1143 var arg_surveyUrlId = "foo"; | 1143 var arg_surveyUrlId = "foo"; |
| 1144 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1144 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1145 var path = (req.url).path; | 1145 var path = (req.url).path; |
| 1146 var pathOffset = 0; | 1146 var pathOffset = 0; |
| 1147 var index; | 1147 var index; |
| 1148 var subPart; | 1148 var subPart; |
| 1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1150 pathOffset += 1; | 1150 pathOffset += 1; |
| 1151 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1151 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| 1152 pathOffset += 19; | 1152 pathOffset += 19; |
| 1153 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1153 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
| 1154 pathOffset += 8; | 1154 pathOffset += 8; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1173 } | 1173 } |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 | 1176 |
| 1177 var h = { | 1177 var h = { |
| 1178 "content-type" : "application/json; charset=utf-8", | 1178 "content-type" : "application/json; charset=utf-8", |
| 1179 }; | 1179 }; |
| 1180 var resp = convert.JSON.encode(buildSurvey()); | 1180 var resp = convert.JSON.encode(buildSurvey()); |
| 1181 return new async.Future.value(stringResponse(200, h, resp)); | 1181 return new async.Future.value(stringResponse(200, h, resp)); |
| 1182 }), true); | 1182 }), true); |
| 1183 res.get(arg_surveyUrlId).then(unittest.expectAsync(((api.Survey response)
{ | 1183 res.get(arg_surveyUrlId).then(unittest.expectAsync1(((api.Survey response)
{ |
| 1184 checkSurvey(response); | 1184 checkSurvey(response); |
| 1185 }))); | 1185 }))); |
| 1186 }); | 1186 }); |
| 1187 | 1187 |
| 1188 unittest.test("method--insert", () { | 1188 unittest.test("method--insert", () { |
| 1189 | 1189 |
| 1190 var mock = new HttpServerMock(); | 1190 var mock = new HttpServerMock(); |
| 1191 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1191 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1192 var arg_request = buildSurvey(); | 1192 var arg_request = buildSurvey(); |
| 1193 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1193 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1194 var obj = new api.Survey.fromJson(json); | 1194 var obj = new api.Survey.fromJson(json); |
| 1195 checkSurvey(obj); | 1195 checkSurvey(obj); |
| 1196 | 1196 |
| 1197 var path = (req.url).path; | 1197 var path = (req.url).path; |
| 1198 var pathOffset = 0; | 1198 var pathOffset = 0; |
| 1199 var index; | 1199 var index; |
| 1200 var subPart; | 1200 var subPart; |
| 1201 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1201 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1202 pathOffset += 1; | 1202 pathOffset += 1; |
| 1203 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1203 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1222 } | 1222 } |
| 1223 } | 1223 } |
| 1224 | 1224 |
| 1225 | 1225 |
| 1226 var h = { | 1226 var h = { |
| 1227 "content-type" : "application/json; charset=utf-8", | 1227 "content-type" : "application/json; charset=utf-8", |
| 1228 }; | 1228 }; |
| 1229 var resp = convert.JSON.encode(buildSurvey()); | 1229 var resp = convert.JSON.encode(buildSurvey()); |
| 1230 return new async.Future.value(stringResponse(200, h, resp)); | 1230 return new async.Future.value(stringResponse(200, h, resp)); |
| 1231 }), true); | 1231 }), true); |
| 1232 res.insert(arg_request).then(unittest.expectAsync(((api.Survey response) { | 1232 res.insert(arg_request).then(unittest.expectAsync1(((api.Survey response)
{ |
| 1233 checkSurvey(response); | 1233 checkSurvey(response); |
| 1234 }))); | 1234 }))); |
| 1235 }); | 1235 }); |
| 1236 | 1236 |
| 1237 unittest.test("method--list", () { | 1237 unittest.test("method--list", () { |
| 1238 | 1238 |
| 1239 var mock = new HttpServerMock(); | 1239 var mock = new HttpServerMock(); |
| 1240 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1240 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1241 var arg_maxResults = 42; | 1241 var arg_maxResults = 42; |
| 1242 var arg_startIndex = 42; | 1242 var arg_startIndex = 42; |
| 1243 var arg_token = "foo"; | 1243 var arg_token = "foo"; |
| 1244 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1244 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1245 var path = (req.url).path; | 1245 var path = (req.url).path; |
| 1246 var pathOffset = 0; | 1246 var pathOffset = 0; |
| 1247 var index; | 1247 var index; |
| 1248 var subPart; | 1248 var subPart; |
| 1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1250 pathOffset += 1; | 1250 pathOffset += 1; |
| 1251 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1251 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| 1252 pathOffset += 19; | 1252 pathOffset += 19; |
| 1253 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("surveys")); | 1253 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("surveys")); |
| 1254 pathOffset += 7; | 1254 pathOffset += 7; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1273 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); | 1273 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e
quals(arg_startIndex)); |
| 1274 unittest.expect(queryMap["token"].first, unittest.equals(arg_token)); | 1274 unittest.expect(queryMap["token"].first, unittest.equals(arg_token)); |
| 1275 | 1275 |
| 1276 | 1276 |
| 1277 var h = { | 1277 var h = { |
| 1278 "content-type" : "application/json; charset=utf-8", | 1278 "content-type" : "application/json; charset=utf-8", |
| 1279 }; | 1279 }; |
| 1280 var resp = convert.JSON.encode(buildSurveysListResponse()); | 1280 var resp = convert.JSON.encode(buildSurveysListResponse()); |
| 1281 return new async.Future.value(stringResponse(200, h, resp)); | 1281 return new async.Future.value(stringResponse(200, h, resp)); |
| 1282 }), true); | 1282 }), true); |
| 1283 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync(((api.SurveysListResponse response) { | 1283 res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: ar
g_token).then(unittest.expectAsync1(((api.SurveysListResponse response) { |
| 1284 checkSurveysListResponse(response); | 1284 checkSurveysListResponse(response); |
| 1285 }))); | 1285 }))); |
| 1286 }); | 1286 }); |
| 1287 | 1287 |
| 1288 unittest.test("method--start", () { | 1288 unittest.test("method--start", () { |
| 1289 | 1289 |
| 1290 var mock = new HttpServerMock(); | 1290 var mock = new HttpServerMock(); |
| 1291 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1291 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1292 var arg_request = buildSurveysStartRequest(); | 1292 var arg_request = buildSurveysStartRequest(); |
| 1293 var arg_resourceId = "foo"; | 1293 var arg_resourceId = "foo"; |
| 1294 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1294 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1295 var obj = new api.SurveysStartRequest.fromJson(json); | 1295 var obj = new api.SurveysStartRequest.fromJson(json); |
| 1296 checkSurveysStartRequest(obj); | 1296 checkSurveysStartRequest(obj); |
| 1297 | 1297 |
| 1298 var path = (req.url).path; | 1298 var path = (req.url).path; |
| 1299 var pathOffset = 0; | 1299 var pathOffset = 0; |
| 1300 var index; | 1300 var index; |
| 1301 var subPart; | 1301 var subPart; |
| 1302 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1302 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1303 pathOffset += 1; | 1303 pathOffset += 1; |
| 1304 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1304 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1330 } | 1330 } |
| 1331 } | 1331 } |
| 1332 | 1332 |
| 1333 | 1333 |
| 1334 var h = { | 1334 var h = { |
| 1335 "content-type" : "application/json; charset=utf-8", | 1335 "content-type" : "application/json; charset=utf-8", |
| 1336 }; | 1336 }; |
| 1337 var resp = convert.JSON.encode(buildSurveysStartResponse()); | 1337 var resp = convert.JSON.encode(buildSurveysStartResponse()); |
| 1338 return new async.Future.value(stringResponse(200, h, resp)); | 1338 return new async.Future.value(stringResponse(200, h, resp)); |
| 1339 }), true); | 1339 }), true); |
| 1340 res.start(arg_request, arg_resourceId).then(unittest.expectAsync(((api.Sur
veysStartResponse response) { | 1340 res.start(arg_request, arg_resourceId).then(unittest.expectAsync1(((api.Su
rveysStartResponse response) { |
| 1341 checkSurveysStartResponse(response); | 1341 checkSurveysStartResponse(response); |
| 1342 }))); | 1342 }))); |
| 1343 }); | 1343 }); |
| 1344 | 1344 |
| 1345 unittest.test("method--stop", () { | 1345 unittest.test("method--stop", () { |
| 1346 | 1346 |
| 1347 var mock = new HttpServerMock(); | 1347 var mock = new HttpServerMock(); |
| 1348 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1348 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1349 var arg_resourceId = "foo"; | 1349 var arg_resourceId = "foo"; |
| 1350 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1350 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1351 var path = (req.url).path; | 1351 var path = (req.url).path; |
| 1352 var pathOffset = 0; | 1352 var pathOffset = 0; |
| 1353 var index; | 1353 var index; |
| 1354 var subPart; | 1354 var subPart; |
| 1355 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1355 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1356 pathOffset += 1; | 1356 pathOffset += 1; |
| 1357 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1357 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| 1358 pathOffset += 19; | 1358 pathOffset += 19; |
| 1359 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); | 1359 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("surveys/")); |
| 1360 pathOffset += 8; | 1360 pathOffset += 8; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1383 } | 1383 } |
| 1384 } | 1384 } |
| 1385 | 1385 |
| 1386 | 1386 |
| 1387 var h = { | 1387 var h = { |
| 1388 "content-type" : "application/json; charset=utf-8", | 1388 "content-type" : "application/json; charset=utf-8", |
| 1389 }; | 1389 }; |
| 1390 var resp = convert.JSON.encode(buildSurveysStopResponse()); | 1390 var resp = convert.JSON.encode(buildSurveysStopResponse()); |
| 1391 return new async.Future.value(stringResponse(200, h, resp)); | 1391 return new async.Future.value(stringResponse(200, h, resp)); |
| 1392 }), true); | 1392 }), true); |
| 1393 res.stop(arg_resourceId).then(unittest.expectAsync(((api.SurveysStopRespon
se response) { | 1393 res.stop(arg_resourceId).then(unittest.expectAsync1(((api.SurveysStopRespo
nse response) { |
| 1394 checkSurveysStopResponse(response); | 1394 checkSurveysStopResponse(response); |
| 1395 }))); | 1395 }))); |
| 1396 }); | 1396 }); |
| 1397 | 1397 |
| 1398 unittest.test("method--update", () { | 1398 unittest.test("method--update", () { |
| 1399 | 1399 |
| 1400 var mock = new HttpServerMock(); | 1400 var mock = new HttpServerMock(); |
| 1401 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; | 1401 api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys; |
| 1402 var arg_request = buildSurvey(); | 1402 var arg_request = buildSurvey(); |
| 1403 var arg_surveyUrlId = "foo"; | 1403 var arg_surveyUrlId = "foo"; |
| 1404 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1404 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1405 var obj = new api.Survey.fromJson(json); | 1405 var obj = new api.Survey.fromJson(json); |
| 1406 checkSurvey(obj); | 1406 checkSurvey(obj); |
| 1407 | 1407 |
| 1408 var path = (req.url).path; | 1408 var path = (req.url).path; |
| 1409 var pathOffset = 0; | 1409 var pathOffset = 0; |
| 1410 var index; | 1410 var index; |
| 1411 var subPart; | 1411 var subPart; |
| 1412 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1412 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1413 pathOffset += 1; | 1413 pathOffset += 1; |
| 1414 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); | 1414 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("consumersurveys/v2/")); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1436 } | 1436 } |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 | 1439 |
| 1440 var h = { | 1440 var h = { |
| 1441 "content-type" : "application/json; charset=utf-8", | 1441 "content-type" : "application/json; charset=utf-8", |
| 1442 }; | 1442 }; |
| 1443 var resp = convert.JSON.encode(buildSurvey()); | 1443 var resp = convert.JSON.encode(buildSurvey()); |
| 1444 return new async.Future.value(stringResponse(200, h, resp)); | 1444 return new async.Future.value(stringResponse(200, h, resp)); |
| 1445 }), true); | 1445 }), true); |
| 1446 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync(((api.S
urvey response) { | 1446 res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync1(((api.
Survey response) { |
| 1447 checkSurvey(response); | 1447 checkSurvey(response); |
| 1448 }))); | 1448 }))); |
| 1449 }); | 1449 }); |
| 1450 | 1450 |
| 1451 }); | 1451 }); |
| 1452 | 1452 |
| 1453 | 1453 |
| 1454 } | 1454 } |
| 1455 | 1455 |
| OLD | NEW |