| OLD | NEW |
| 1 library googleapis.civicinfo.v1.test; | 1 library googleapis.civicinfo.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 import 'package:googleapis/common/common.dart' as common; | 11 import 'package:googleapis/common/common.dart' as common; |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; | 12 import 'package:googleapis/src/common_internal.dart' as common_internal; |
| 13 import '../common/common_internal_test.dart' as common_test; | 13 import '../common/common_internal_test.dart' as common_test; |
| 14 | 14 |
| 15 import 'package:googleapis/civicinfo/v1.dart' as api; | 15 import 'package:googleapis/civicinfo/v2.dart' as api; |
| 16 | 16 |
| 17 | 17 |
| 18 | 18 |
| 19 buildUnnamed65() { | 19 buildUnnamed208() { |
| 20 var o = new core.List<api.Source>(); | 20 var o = new core.List<api.Source>(); |
| 21 o.add(buildSource()); | 21 o.add(buildSource()); |
| 22 o.add(buildSource()); | 22 o.add(buildSource()); |
| 23 return o; | 23 return o; |
| 24 } | 24 } |
| 25 | 25 |
| 26 checkUnnamed65(core.List<api.Source> o) { | 26 checkUnnamed208(core.List<api.Source> o) { |
| 27 unittest.expect(o, unittest.hasLength(2)); | 27 unittest.expect(o, unittest.hasLength(2)); |
| 28 checkSource(o[0]); | 28 checkSource(o[0]); |
| 29 checkSource(o[1]); | 29 checkSource(o[1]); |
| 30 } | 30 } |
| 31 | 31 |
| 32 core.int buildCounterAdministrationRegion = 0; | 32 core.int buildCounterAdministrationRegion = 0; |
| 33 buildAdministrationRegion() { | 33 buildAdministrationRegion() { |
| 34 var o = new api.AdministrationRegion(); | 34 var o = new api.AdministrationRegion(); |
| 35 buildCounterAdministrationRegion++; | 35 buildCounterAdministrationRegion++; |
| 36 if (buildCounterAdministrationRegion < 3) { | 36 if (buildCounterAdministrationRegion < 3) { |
| 37 o.electionAdministrationBody = buildAdministrativeBody(); | 37 o.electionAdministrationBody = buildAdministrativeBody(); |
| 38 o.id = "foo"; | 38 o.id = "foo"; |
| 39 o.localJurisdiction = buildAdministrationRegion(); | 39 o.localJurisdiction = buildAdministrationRegion(); |
| 40 o.name = "foo"; | 40 o.name = "foo"; |
| 41 o.sources = buildUnnamed65(); | 41 o.sources = buildUnnamed208(); |
| 42 } | 42 } |
| 43 buildCounterAdministrationRegion--; | 43 buildCounterAdministrationRegion--; |
| 44 return o; | 44 return o; |
| 45 } | 45 } |
| 46 | 46 |
| 47 checkAdministrationRegion(api.AdministrationRegion o) { | 47 checkAdministrationRegion(api.AdministrationRegion o) { |
| 48 buildCounterAdministrationRegion++; | 48 buildCounterAdministrationRegion++; |
| 49 if (buildCounterAdministrationRegion < 3) { | 49 if (buildCounterAdministrationRegion < 3) { |
| 50 checkAdministrativeBody(o.electionAdministrationBody); | 50 checkAdministrativeBody(o.electionAdministrationBody); |
| 51 unittest.expect(o.id, unittest.equals('foo')); | 51 unittest.expect(o.id, unittest.equals('foo')); |
| 52 checkAdministrationRegion(o.localJurisdiction); | 52 checkAdministrationRegion(o.localJurisdiction); |
| 53 unittest.expect(o.name, unittest.equals('foo')); | 53 unittest.expect(o.name, unittest.equals('foo')); |
| 54 checkUnnamed65(o.sources); | 54 checkUnnamed208(o.sources); |
| 55 } | 55 } |
| 56 buildCounterAdministrationRegion--; | 56 buildCounterAdministrationRegion--; |
| 57 } | 57 } |
| 58 | 58 |
| 59 buildUnnamed66() { | 59 buildUnnamed209() { |
| 60 var o = new core.List<api.ElectionOfficial>(); | 60 var o = new core.List<api.ElectionOfficial>(); |
| 61 o.add(buildElectionOfficial()); | 61 o.add(buildElectionOfficial()); |
| 62 o.add(buildElectionOfficial()); | 62 o.add(buildElectionOfficial()); |
| 63 return o; | 63 return o; |
| 64 } | 64 } |
| 65 | 65 |
| 66 checkUnnamed66(core.List<api.ElectionOfficial> o) { | 66 checkUnnamed209(core.List<api.ElectionOfficial> o) { |
| 67 unittest.expect(o, unittest.hasLength(2)); | 67 unittest.expect(o, unittest.hasLength(2)); |
| 68 checkElectionOfficial(o[0]); | 68 checkElectionOfficial(o[0]); |
| 69 checkElectionOfficial(o[1]); | 69 checkElectionOfficial(o[1]); |
| 70 } | 70 } |
| 71 | 71 |
| 72 buildUnnamed67() { | 72 buildUnnamed210() { |
| 73 var o = new core.List<core.String>(); | 73 var o = new core.List<core.String>(); |
| 74 o.add("foo"); | 74 o.add("foo"); |
| 75 o.add("foo"); | 75 o.add("foo"); |
| 76 return o; | 76 return o; |
| 77 } | 77 } |
| 78 | 78 |
| 79 checkUnnamed67(core.List<core.String> o) { | 79 checkUnnamed210(core.List<core.String> o) { |
| 80 unittest.expect(o, unittest.hasLength(2)); | 80 unittest.expect(o, unittest.hasLength(2)); |
| 81 unittest.expect(o[0], unittest.equals('foo')); | 81 unittest.expect(o[0], unittest.equals('foo')); |
| 82 unittest.expect(o[1], unittest.equals('foo')); | 82 unittest.expect(o[1], unittest.equals('foo')); |
| 83 } | 83 } |
| 84 | 84 |
| 85 core.int buildCounterAdministrativeBody = 0; | 85 core.int buildCounterAdministrativeBody = 0; |
| 86 buildAdministrativeBody() { | 86 buildAdministrativeBody() { |
| 87 var o = new api.AdministrativeBody(); | 87 var o = new api.AdministrativeBody(); |
| 88 buildCounterAdministrativeBody++; | 88 buildCounterAdministrativeBody++; |
| 89 if (buildCounterAdministrativeBody < 3) { | 89 if (buildCounterAdministrativeBody < 3) { |
| 90 o.absenteeVotingInfoUrl = "foo"; | 90 o.absenteeVotingInfoUrl = "foo"; |
| 91 o.ballotInfoUrl = "foo"; | 91 o.ballotInfoUrl = "foo"; |
| 92 o.correspondenceAddress = buildSimpleAddressType(); | 92 o.correspondenceAddress = buildSimpleAddressType(); |
| 93 o.electionInfoUrl = "foo"; | 93 o.electionInfoUrl = "foo"; |
| 94 o.electionOfficials = buildUnnamed66(); | 94 o.electionOfficials = buildUnnamed209(); |
| 95 o.electionRegistrationConfirmationUrl = "foo"; | 95 o.electionRegistrationConfirmationUrl = "foo"; |
| 96 o.electionRegistrationUrl = "foo"; | 96 o.electionRegistrationUrl = "foo"; |
| 97 o.electionRulesUrl = "foo"; | 97 o.electionRulesUrl = "foo"; |
| 98 o.hoursOfOperation = "foo"; | 98 o.hoursOfOperation = "foo"; |
| 99 o.name = "foo"; | 99 o.name = "foo"; |
| 100 o.physicalAddress = buildSimpleAddressType(); | 100 o.physicalAddress = buildSimpleAddressType(); |
| 101 o.voterServices = buildUnnamed67(); | 101 o.voterServices = buildUnnamed210(); |
| 102 o.votingLocationFinderUrl = "foo"; | 102 o.votingLocationFinderUrl = "foo"; |
| 103 } | 103 } |
| 104 buildCounterAdministrativeBody--; | 104 buildCounterAdministrativeBody--; |
| 105 return o; | 105 return o; |
| 106 } | 106 } |
| 107 | 107 |
| 108 checkAdministrativeBody(api.AdministrativeBody o) { | 108 checkAdministrativeBody(api.AdministrativeBody o) { |
| 109 buildCounterAdministrativeBody++; | 109 buildCounterAdministrativeBody++; |
| 110 if (buildCounterAdministrativeBody < 3) { | 110 if (buildCounterAdministrativeBody < 3) { |
| 111 unittest.expect(o.absenteeVotingInfoUrl, unittest.equals('foo')); | 111 unittest.expect(o.absenteeVotingInfoUrl, unittest.equals('foo')); |
| 112 unittest.expect(o.ballotInfoUrl, unittest.equals('foo')); | 112 unittest.expect(o.ballotInfoUrl, unittest.equals('foo')); |
| 113 checkSimpleAddressType(o.correspondenceAddress); | 113 checkSimpleAddressType(o.correspondenceAddress); |
| 114 unittest.expect(o.electionInfoUrl, unittest.equals('foo')); | 114 unittest.expect(o.electionInfoUrl, unittest.equals('foo')); |
| 115 checkUnnamed66(o.electionOfficials); | 115 checkUnnamed209(o.electionOfficials); |
| 116 unittest.expect(o.electionRegistrationConfirmationUrl, unittest.equals('foo'
)); | 116 unittest.expect(o.electionRegistrationConfirmationUrl, unittest.equals('foo'
)); |
| 117 unittest.expect(o.electionRegistrationUrl, unittest.equals('foo')); | 117 unittest.expect(o.electionRegistrationUrl, unittest.equals('foo')); |
| 118 unittest.expect(o.electionRulesUrl, unittest.equals('foo')); | 118 unittest.expect(o.electionRulesUrl, unittest.equals('foo')); |
| 119 unittest.expect(o.hoursOfOperation, unittest.equals('foo')); | 119 unittest.expect(o.hoursOfOperation, unittest.equals('foo')); |
| 120 unittest.expect(o.name, unittest.equals('foo')); | 120 unittest.expect(o.name, unittest.equals('foo')); |
| 121 checkSimpleAddressType(o.physicalAddress); | 121 checkSimpleAddressType(o.physicalAddress); |
| 122 checkUnnamed67(o.voterServices); | 122 checkUnnamed210(o.voterServices); |
| 123 unittest.expect(o.votingLocationFinderUrl, unittest.equals('foo')); | 123 unittest.expect(o.votingLocationFinderUrl, unittest.equals('foo')); |
| 124 } | 124 } |
| 125 buildCounterAdministrativeBody--; | 125 buildCounterAdministrativeBody--; |
| 126 } | 126 } |
| 127 | 127 |
| 128 buildUnnamed68() { | 128 buildUnnamed211() { |
| 129 var o = new core.List<api.Channel>(); | 129 var o = new core.List<api.Channel>(); |
| 130 o.add(buildChannel()); | 130 o.add(buildChannel()); |
| 131 o.add(buildChannel()); | 131 o.add(buildChannel()); |
| 132 return o; | 132 return o; |
| 133 } | 133 } |
| 134 | 134 |
| 135 checkUnnamed68(core.List<api.Channel> o) { | 135 checkUnnamed211(core.List<api.Channel> o) { |
| 136 unittest.expect(o, unittest.hasLength(2)); | 136 unittest.expect(o, unittest.hasLength(2)); |
| 137 checkChannel(o[0]); | 137 checkChannel(o[0]); |
| 138 checkChannel(o[1]); | 138 checkChannel(o[1]); |
| 139 } | 139 } |
| 140 | 140 |
| 141 core.int buildCounterCandidate = 0; | 141 core.int buildCounterCandidate = 0; |
| 142 buildCandidate() { | 142 buildCandidate() { |
| 143 var o = new api.Candidate(); | 143 var o = new api.Candidate(); |
| 144 buildCounterCandidate++; | 144 buildCounterCandidate++; |
| 145 if (buildCounterCandidate < 3) { | 145 if (buildCounterCandidate < 3) { |
| 146 o.candidateUrl = "foo"; | 146 o.candidateUrl = "foo"; |
| 147 o.channels = buildUnnamed68(); | 147 o.channels = buildUnnamed211(); |
| 148 o.email = "foo"; | 148 o.email = "foo"; |
| 149 o.name = "foo"; | 149 o.name = "foo"; |
| 150 o.orderOnBallot = "foo"; | 150 o.orderOnBallot = "foo"; |
| 151 o.party = "foo"; | 151 o.party = "foo"; |
| 152 o.phone = "foo"; | 152 o.phone = "foo"; |
| 153 o.photoUrl = "foo"; | 153 o.photoUrl = "foo"; |
| 154 } | 154 } |
| 155 buildCounterCandidate--; | 155 buildCounterCandidate--; |
| 156 return o; | 156 return o; |
| 157 } | 157 } |
| 158 | 158 |
| 159 checkCandidate(api.Candidate o) { | 159 checkCandidate(api.Candidate o) { |
| 160 buildCounterCandidate++; | 160 buildCounterCandidate++; |
| 161 if (buildCounterCandidate < 3) { | 161 if (buildCounterCandidate < 3) { |
| 162 unittest.expect(o.candidateUrl, unittest.equals('foo')); | 162 unittest.expect(o.candidateUrl, unittest.equals('foo')); |
| 163 checkUnnamed68(o.channels); | 163 checkUnnamed211(o.channels); |
| 164 unittest.expect(o.email, unittest.equals('foo')); | 164 unittest.expect(o.email, unittest.equals('foo')); |
| 165 unittest.expect(o.name, unittest.equals('foo')); | 165 unittest.expect(o.name, unittest.equals('foo')); |
| 166 unittest.expect(o.orderOnBallot, unittest.equals('foo')); | 166 unittest.expect(o.orderOnBallot, unittest.equals('foo')); |
| 167 unittest.expect(o.party, unittest.equals('foo')); | 167 unittest.expect(o.party, unittest.equals('foo')); |
| 168 unittest.expect(o.phone, unittest.equals('foo')); | 168 unittest.expect(o.phone, unittest.equals('foo')); |
| 169 unittest.expect(o.photoUrl, unittest.equals('foo')); | 169 unittest.expect(o.photoUrl, unittest.equals('foo')); |
| 170 } | 170 } |
| 171 buildCounterCandidate--; | 171 buildCounterCandidate--; |
| 172 } | 172 } |
| 173 | 173 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 185 | 185 |
| 186 checkChannel(api.Channel o) { | 186 checkChannel(api.Channel o) { |
| 187 buildCounterChannel++; | 187 buildCounterChannel++; |
| 188 if (buildCounterChannel < 3) { | 188 if (buildCounterChannel < 3) { |
| 189 unittest.expect(o.id, unittest.equals('foo')); | 189 unittest.expect(o.id, unittest.equals('foo')); |
| 190 unittest.expect(o.type, unittest.equals('foo')); | 190 unittest.expect(o.type, unittest.equals('foo')); |
| 191 } | 191 } |
| 192 buildCounterChannel--; | 192 buildCounterChannel--; |
| 193 } | 193 } |
| 194 | 194 |
| 195 buildUnnamed69() { | 195 buildUnnamed212() { |
| 196 var o = new core.List<api.Candidate>(); | 196 var o = new core.List<api.Candidate>(); |
| 197 o.add(buildCandidate()); | 197 o.add(buildCandidate()); |
| 198 o.add(buildCandidate()); | 198 o.add(buildCandidate()); |
| 199 return o; | 199 return o; |
| 200 } | 200 } |
| 201 | 201 |
| 202 checkUnnamed69(core.List<api.Candidate> o) { | 202 checkUnnamed212(core.List<api.Candidate> o) { |
| 203 unittest.expect(o, unittest.hasLength(2)); | 203 unittest.expect(o, unittest.hasLength(2)); |
| 204 checkCandidate(o[0]); | 204 checkCandidate(o[0]); |
| 205 checkCandidate(o[1]); | 205 checkCandidate(o[1]); |
| 206 } | 206 } |
| 207 | 207 |
| 208 buildUnnamed70() { | 208 buildUnnamed213() { |
| 209 var o = new core.List<core.String>(); |
| 210 o.add("foo"); |
| 211 o.add("foo"); |
| 212 return o; |
| 213 } |
| 214 |
| 215 checkUnnamed213(core.List<core.String> o) { |
| 216 unittest.expect(o, unittest.hasLength(2)); |
| 217 unittest.expect(o[0], unittest.equals('foo')); |
| 218 unittest.expect(o[1], unittest.equals('foo')); |
| 219 } |
| 220 |
| 221 buildUnnamed214() { |
| 222 var o = new core.List<core.String>(); |
| 223 o.add("foo"); |
| 224 o.add("foo"); |
| 225 return o; |
| 226 } |
| 227 |
| 228 checkUnnamed214(core.List<core.String> o) { |
| 229 unittest.expect(o, unittest.hasLength(2)); |
| 230 unittest.expect(o[0], unittest.equals('foo')); |
| 231 unittest.expect(o[1], unittest.equals('foo')); |
| 232 } |
| 233 |
| 234 buildUnnamed215() { |
| 209 var o = new core.List<api.Source>(); | 235 var o = new core.List<api.Source>(); |
| 210 o.add(buildSource()); | 236 o.add(buildSource()); |
| 211 o.add(buildSource()); | 237 o.add(buildSource()); |
| 212 return o; | 238 return o; |
| 213 } | 239 } |
| 214 | 240 |
| 215 checkUnnamed70(core.List<api.Source> o) { | 241 checkUnnamed215(core.List<api.Source> o) { |
| 216 unittest.expect(o, unittest.hasLength(2)); | 242 unittest.expect(o, unittest.hasLength(2)); |
| 217 checkSource(o[0]); | 243 checkSource(o[0]); |
| 218 checkSource(o[1]); | 244 checkSource(o[1]); |
| 219 } | 245 } |
| 220 | 246 |
| 221 core.int buildCounterContest = 0; | 247 core.int buildCounterContest = 0; |
| 222 buildContest() { | 248 buildContest() { |
| 223 var o = new api.Contest(); | 249 var o = new api.Contest(); |
| 224 buildCounterContest++; | 250 buildCounterContest++; |
| 225 if (buildCounterContest < 3) { | 251 if (buildCounterContest < 3) { |
| 226 o.ballotPlacement = "foo"; | 252 o.ballotPlacement = "foo"; |
| 227 o.candidates = buildUnnamed69(); | 253 o.candidates = buildUnnamed212(); |
| 228 o.district = buildElectoralDistrict(); | 254 o.district = buildElectoralDistrict(); |
| 229 o.electorateSpecifications = "foo"; | 255 o.electorateSpecifications = "foo"; |
| 230 o.id = "foo"; | 256 o.id = "foo"; |
| 231 o.level = "foo"; | 257 o.level = buildUnnamed213(); |
| 232 o.numberElected = "foo"; | 258 o.numberElected = "foo"; |
| 233 o.numberVotingFor = "foo"; | 259 o.numberVotingFor = "foo"; |
| 234 o.office = "foo"; | 260 o.office = "foo"; |
| 235 o.primaryParty = "foo"; | 261 o.primaryParty = "foo"; |
| 236 o.referendumSubtitle = "foo"; | 262 o.referendumSubtitle = "foo"; |
| 237 o.referendumTitle = "foo"; | 263 o.referendumTitle = "foo"; |
| 238 o.referendumUrl = "foo"; | 264 o.referendumUrl = "foo"; |
| 239 o.sources = buildUnnamed70(); | 265 o.roles = buildUnnamed214(); |
| 266 o.sources = buildUnnamed215(); |
| 240 o.special = "foo"; | 267 o.special = "foo"; |
| 241 o.type = "foo"; | 268 o.type = "foo"; |
| 242 } | 269 } |
| 243 buildCounterContest--; | 270 buildCounterContest--; |
| 244 return o; | 271 return o; |
| 245 } | 272 } |
| 246 | 273 |
| 247 checkContest(api.Contest o) { | 274 checkContest(api.Contest o) { |
| 248 buildCounterContest++; | 275 buildCounterContest++; |
| 249 if (buildCounterContest < 3) { | 276 if (buildCounterContest < 3) { |
| 250 unittest.expect(o.ballotPlacement, unittest.equals('foo')); | 277 unittest.expect(o.ballotPlacement, unittest.equals('foo')); |
| 251 checkUnnamed69(o.candidates); | 278 checkUnnamed212(o.candidates); |
| 252 checkElectoralDistrict(o.district); | 279 checkElectoralDistrict(o.district); |
| 253 unittest.expect(o.electorateSpecifications, unittest.equals('foo')); | 280 unittest.expect(o.electorateSpecifications, unittest.equals('foo')); |
| 254 unittest.expect(o.id, unittest.equals('foo')); | 281 unittest.expect(o.id, unittest.equals('foo')); |
| 255 unittest.expect(o.level, unittest.equals('foo')); | 282 checkUnnamed213(o.level); |
| 256 unittest.expect(o.numberElected, unittest.equals('foo')); | 283 unittest.expect(o.numberElected, unittest.equals('foo')); |
| 257 unittest.expect(o.numberVotingFor, unittest.equals('foo')); | 284 unittest.expect(o.numberVotingFor, unittest.equals('foo')); |
| 258 unittest.expect(o.office, unittest.equals('foo')); | 285 unittest.expect(o.office, unittest.equals('foo')); |
| 259 unittest.expect(o.primaryParty, unittest.equals('foo')); | 286 unittest.expect(o.primaryParty, unittest.equals('foo')); |
| 260 unittest.expect(o.referendumSubtitle, unittest.equals('foo')); | 287 unittest.expect(o.referendumSubtitle, unittest.equals('foo')); |
| 261 unittest.expect(o.referendumTitle, unittest.equals('foo')); | 288 unittest.expect(o.referendumTitle, unittest.equals('foo')); |
| 262 unittest.expect(o.referendumUrl, unittest.equals('foo')); | 289 unittest.expect(o.referendumUrl, unittest.equals('foo')); |
| 263 checkUnnamed70(o.sources); | 290 checkUnnamed214(o.roles); |
| 291 checkUnnamed215(o.sources); |
| 264 unittest.expect(o.special, unittest.equals('foo')); | 292 unittest.expect(o.special, unittest.equals('foo')); |
| 265 unittest.expect(o.type, unittest.equals('foo')); | 293 unittest.expect(o.type, unittest.equals('foo')); |
| 266 } | 294 } |
| 267 buildCounterContest--; | 295 buildCounterContest--; |
| 268 } | 296 } |
| 269 | 297 |
| 270 buildUnnamed71() { | 298 buildUnnamed216() { |
| 271 var o = new core.List<api.DivisionSearchResult>(); | 299 var o = new core.List<api.DivisionSearchResult>(); |
| 272 o.add(buildDivisionSearchResult()); | 300 o.add(buildDivisionSearchResult()); |
| 273 o.add(buildDivisionSearchResult()); | 301 o.add(buildDivisionSearchResult()); |
| 274 return o; | 302 return o; |
| 275 } | 303 } |
| 276 | 304 |
| 277 checkUnnamed71(core.List<api.DivisionSearchResult> o) { | 305 checkUnnamed216(core.List<api.DivisionSearchResult> o) { |
| 278 unittest.expect(o, unittest.hasLength(2)); | 306 unittest.expect(o, unittest.hasLength(2)); |
| 279 checkDivisionSearchResult(o[0]); | 307 checkDivisionSearchResult(o[0]); |
| 280 checkDivisionSearchResult(o[1]); | 308 checkDivisionSearchResult(o[1]); |
| 281 } | 309 } |
| 282 | 310 |
| 283 core.int buildCounterDivisionSearchResponse = 0; | 311 core.int buildCounterDivisionSearchResponse = 0; |
| 284 buildDivisionSearchResponse() { | 312 buildDivisionSearchResponse() { |
| 285 var o = new api.DivisionSearchResponse(); | 313 var o = new api.DivisionSearchResponse(); |
| 286 buildCounterDivisionSearchResponse++; | 314 buildCounterDivisionSearchResponse++; |
| 287 if (buildCounterDivisionSearchResponse < 3) { | 315 if (buildCounterDivisionSearchResponse < 3) { |
| 288 o.kind = "foo"; | 316 o.kind = "foo"; |
| 289 o.results = buildUnnamed71(); | 317 o.results = buildUnnamed216(); |
| 290 o.status = "foo"; | |
| 291 } | 318 } |
| 292 buildCounterDivisionSearchResponse--; | 319 buildCounterDivisionSearchResponse--; |
| 293 return o; | 320 return o; |
| 294 } | 321 } |
| 295 | 322 |
| 296 checkDivisionSearchResponse(api.DivisionSearchResponse o) { | 323 checkDivisionSearchResponse(api.DivisionSearchResponse o) { |
| 297 buildCounterDivisionSearchResponse++; | 324 buildCounterDivisionSearchResponse++; |
| 298 if (buildCounterDivisionSearchResponse < 3) { | 325 if (buildCounterDivisionSearchResponse < 3) { |
| 299 unittest.expect(o.kind, unittest.equals('foo')); | 326 unittest.expect(o.kind, unittest.equals('foo')); |
| 300 checkUnnamed71(o.results); | 327 checkUnnamed216(o.results); |
| 301 unittest.expect(o.status, unittest.equals('foo')); | |
| 302 } | 328 } |
| 303 buildCounterDivisionSearchResponse--; | 329 buildCounterDivisionSearchResponse--; |
| 304 } | 330 } |
| 305 | 331 |
| 306 buildUnnamed72() { | 332 buildUnnamed217() { |
| 307 var o = new core.List<core.String>(); | 333 var o = new core.List<core.String>(); |
| 308 o.add("foo"); | 334 o.add("foo"); |
| 309 o.add("foo"); | 335 o.add("foo"); |
| 310 return o; | 336 return o; |
| 311 } | 337 } |
| 312 | 338 |
| 313 checkUnnamed72(core.List<core.String> o) { | 339 checkUnnamed217(core.List<core.String> o) { |
| 314 unittest.expect(o, unittest.hasLength(2)); | 340 unittest.expect(o, unittest.hasLength(2)); |
| 315 unittest.expect(o[0], unittest.equals('foo')); | 341 unittest.expect(o[0], unittest.equals('foo')); |
| 316 unittest.expect(o[1], unittest.equals('foo')); | 342 unittest.expect(o[1], unittest.equals('foo')); |
| 317 } | 343 } |
| 318 | 344 |
| 319 core.int buildCounterDivisionSearchResult = 0; | 345 core.int buildCounterDivisionSearchResult = 0; |
| 320 buildDivisionSearchResult() { | 346 buildDivisionSearchResult() { |
| 321 var o = new api.DivisionSearchResult(); | 347 var o = new api.DivisionSearchResult(); |
| 322 buildCounterDivisionSearchResult++; | 348 buildCounterDivisionSearchResult++; |
| 323 if (buildCounterDivisionSearchResult < 3) { | 349 if (buildCounterDivisionSearchResult < 3) { |
| 324 o.aliases = buildUnnamed72(); | 350 o.aliases = buildUnnamed217(); |
| 325 o.name = "foo"; | 351 o.name = "foo"; |
| 326 o.ocdId = "foo"; | 352 o.ocdId = "foo"; |
| 327 } | 353 } |
| 328 buildCounterDivisionSearchResult--; | 354 buildCounterDivisionSearchResult--; |
| 329 return o; | 355 return o; |
| 330 } | 356 } |
| 331 | 357 |
| 332 checkDivisionSearchResult(api.DivisionSearchResult o) { | 358 checkDivisionSearchResult(api.DivisionSearchResult o) { |
| 333 buildCounterDivisionSearchResult++; | 359 buildCounterDivisionSearchResult++; |
| 334 if (buildCounterDivisionSearchResult < 3) { | 360 if (buildCounterDivisionSearchResult < 3) { |
| 335 checkUnnamed72(o.aliases); | 361 checkUnnamed217(o.aliases); |
| 336 unittest.expect(o.name, unittest.equals('foo')); | 362 unittest.expect(o.name, unittest.equals('foo')); |
| 337 unittest.expect(o.ocdId, unittest.equals('foo')); | 363 unittest.expect(o.ocdId, unittest.equals('foo')); |
| 338 } | 364 } |
| 339 buildCounterDivisionSearchResult--; | 365 buildCounterDivisionSearchResult--; |
| 340 } | 366 } |
| 341 | 367 |
| 342 core.int buildCounterElection = 0; | 368 core.int buildCounterElection = 0; |
| 343 buildElection() { | 369 buildElection() { |
| 344 var o = new api.Election(); | 370 var o = new api.Election(); |
| 345 buildCounterElection++; | 371 buildCounterElection++; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 if (buildCounterElectionOfficial < 3) { | 408 if (buildCounterElectionOfficial < 3) { |
| 383 unittest.expect(o.emailAddress, unittest.equals('foo')); | 409 unittest.expect(o.emailAddress, unittest.equals('foo')); |
| 384 unittest.expect(o.faxNumber, unittest.equals('foo')); | 410 unittest.expect(o.faxNumber, unittest.equals('foo')); |
| 385 unittest.expect(o.name, unittest.equals('foo')); | 411 unittest.expect(o.name, unittest.equals('foo')); |
| 386 unittest.expect(o.officePhoneNumber, unittest.equals('foo')); | 412 unittest.expect(o.officePhoneNumber, unittest.equals('foo')); |
| 387 unittest.expect(o.title, unittest.equals('foo')); | 413 unittest.expect(o.title, unittest.equals('foo')); |
| 388 } | 414 } |
| 389 buildCounterElectionOfficial--; | 415 buildCounterElectionOfficial--; |
| 390 } | 416 } |
| 391 | 417 |
| 392 buildUnnamed73() { | 418 buildUnnamed218() { |
| 393 var o = new core.List<api.Election>(); | 419 var o = new core.List<api.Election>(); |
| 394 o.add(buildElection()); | 420 o.add(buildElection()); |
| 395 o.add(buildElection()); | 421 o.add(buildElection()); |
| 396 return o; | 422 return o; |
| 397 } | 423 } |
| 398 | 424 |
| 399 checkUnnamed73(core.List<api.Election> o) { | 425 checkUnnamed218(core.List<api.Election> o) { |
| 400 unittest.expect(o, unittest.hasLength(2)); | 426 unittest.expect(o, unittest.hasLength(2)); |
| 401 checkElection(o[0]); | 427 checkElection(o[0]); |
| 402 checkElection(o[1]); | 428 checkElection(o[1]); |
| 403 } | 429 } |
| 404 | 430 |
| 405 core.int buildCounterElectionsQueryResponse = 0; | 431 core.int buildCounterElectionsQueryResponse = 0; |
| 406 buildElectionsQueryResponse() { | 432 buildElectionsQueryResponse() { |
| 407 var o = new api.ElectionsQueryResponse(); | 433 var o = new api.ElectionsQueryResponse(); |
| 408 buildCounterElectionsQueryResponse++; | 434 buildCounterElectionsQueryResponse++; |
| 409 if (buildCounterElectionsQueryResponse < 3) { | 435 if (buildCounterElectionsQueryResponse < 3) { |
| 410 o.elections = buildUnnamed73(); | 436 o.elections = buildUnnamed218(); |
| 411 o.kind = "foo"; | 437 o.kind = "foo"; |
| 412 } | 438 } |
| 413 buildCounterElectionsQueryResponse--; | 439 buildCounterElectionsQueryResponse--; |
| 414 return o; | 440 return o; |
| 415 } | 441 } |
| 416 | 442 |
| 417 checkElectionsQueryResponse(api.ElectionsQueryResponse o) { | 443 checkElectionsQueryResponse(api.ElectionsQueryResponse o) { |
| 418 buildCounterElectionsQueryResponse++; | 444 buildCounterElectionsQueryResponse++; |
| 419 if (buildCounterElectionsQueryResponse < 3) { | 445 if (buildCounterElectionsQueryResponse < 3) { |
| 420 checkUnnamed73(o.elections); | 446 checkUnnamed218(o.elections); |
| 421 unittest.expect(o.kind, unittest.equals('foo')); | 447 unittest.expect(o.kind, unittest.equals('foo')); |
| 422 } | 448 } |
| 423 buildCounterElectionsQueryResponse--; | 449 buildCounterElectionsQueryResponse--; |
| 424 } | 450 } |
| 425 | 451 |
| 426 core.int buildCounterElectoralDistrict = 0; | 452 core.int buildCounterElectoralDistrict = 0; |
| 427 buildElectoralDistrict() { | 453 buildElectoralDistrict() { |
| 428 var o = new api.ElectoralDistrict(); | 454 var o = new api.ElectoralDistrict(); |
| 429 buildCounterElectoralDistrict++; | 455 buildCounterElectoralDistrict++; |
| 430 if (buildCounterElectoralDistrict < 3) { | 456 if (buildCounterElectoralDistrict < 3) { |
| 431 o.id = "foo"; | 457 o.id = "foo"; |
| 432 o.name = "foo"; | 458 o.name = "foo"; |
| 433 o.scope = "foo"; | 459 o.scope = "foo"; |
| 434 } | 460 } |
| 435 buildCounterElectoralDistrict--; | 461 buildCounterElectoralDistrict--; |
| 436 return o; | 462 return o; |
| 437 } | 463 } |
| 438 | 464 |
| 439 checkElectoralDistrict(api.ElectoralDistrict o) { | 465 checkElectoralDistrict(api.ElectoralDistrict o) { |
| 440 buildCounterElectoralDistrict++; | 466 buildCounterElectoralDistrict++; |
| 441 if (buildCounterElectoralDistrict < 3) { | 467 if (buildCounterElectoralDistrict < 3) { |
| 442 unittest.expect(o.id, unittest.equals('foo')); | 468 unittest.expect(o.id, unittest.equals('foo')); |
| 443 unittest.expect(o.name, unittest.equals('foo')); | 469 unittest.expect(o.name, unittest.equals('foo')); |
| 444 unittest.expect(o.scope, unittest.equals('foo')); | 470 unittest.expect(o.scope, unittest.equals('foo')); |
| 445 } | 471 } |
| 446 buildCounterElectoralDistrict--; | 472 buildCounterElectoralDistrict--; |
| 447 } | 473 } |
| 448 | 474 |
| 449 buildUnnamed74() { | 475 buildUnnamed219() { |
| 450 var o = new core.List<core.String>(); | 476 var o = new core.List<core.String>(); |
| 451 o.add("foo"); | 477 o.add("foo"); |
| 452 o.add("foo"); | 478 o.add("foo"); |
| 453 return o; | 479 return o; |
| 454 } | 480 } |
| 455 | 481 |
| 456 checkUnnamed74(core.List<core.String> o) { | 482 checkUnnamed219(core.List<core.String> o) { |
| 457 unittest.expect(o, unittest.hasLength(2)); | 483 unittest.expect(o, unittest.hasLength(2)); |
| 458 unittest.expect(o[0], unittest.equals('foo')); | 484 unittest.expect(o[0], unittest.equals('foo')); |
| 459 unittest.expect(o[1], unittest.equals('foo')); | 485 unittest.expect(o[1], unittest.equals('foo')); |
| 460 } | 486 } |
| 461 | 487 |
| 462 buildUnnamed75() { | 488 buildUnnamed220() { |
| 463 var o = new core.List<core.String>(); | 489 var o = new core.List<core.int>(); |
| 464 o.add("foo"); | 490 o.add(42); |
| 465 o.add("foo"); | 491 o.add(42); |
| 466 return o; | 492 return o; |
| 467 } | 493 } |
| 468 | 494 |
| 469 checkUnnamed75(core.List<core.String> o) { | 495 checkUnnamed220(core.List<core.int> o) { |
| 470 unittest.expect(o, unittest.hasLength(2)); | 496 unittest.expect(o, unittest.hasLength(2)); |
| 471 unittest.expect(o[0], unittest.equals('foo')); | 497 unittest.expect(o[0], unittest.equals(42)); |
| 472 unittest.expect(o[1], unittest.equals('foo')); | 498 unittest.expect(o[1], unittest.equals(42)); |
| 473 } | 499 } |
| 474 | 500 |
| 475 core.int buildCounterGeographicDivision = 0; | 501 core.int buildCounterGeographicDivision = 0; |
| 476 buildGeographicDivision() { | 502 buildGeographicDivision() { |
| 477 var o = new api.GeographicDivision(); | 503 var o = new api.GeographicDivision(); |
| 478 buildCounterGeographicDivision++; | 504 buildCounterGeographicDivision++; |
| 479 if (buildCounterGeographicDivision < 3) { | 505 if (buildCounterGeographicDivision < 3) { |
| 480 o.alsoKnownAs = buildUnnamed74(); | 506 o.alsoKnownAs = buildUnnamed219(); |
| 481 o.name = "foo"; | 507 o.name = "foo"; |
| 482 o.officeIds = buildUnnamed75(); | 508 o.officeIndices = buildUnnamed220(); |
| 483 o.scope = "foo"; | |
| 484 } | 509 } |
| 485 buildCounterGeographicDivision--; | 510 buildCounterGeographicDivision--; |
| 486 return o; | 511 return o; |
| 487 } | 512 } |
| 488 | 513 |
| 489 checkGeographicDivision(api.GeographicDivision o) { | 514 checkGeographicDivision(api.GeographicDivision o) { |
| 490 buildCounterGeographicDivision++; | 515 buildCounterGeographicDivision++; |
| 491 if (buildCounterGeographicDivision < 3) { | 516 if (buildCounterGeographicDivision < 3) { |
| 492 checkUnnamed74(o.alsoKnownAs); | 517 checkUnnamed219(o.alsoKnownAs); |
| 493 unittest.expect(o.name, unittest.equals('foo')); | 518 unittest.expect(o.name, unittest.equals('foo')); |
| 494 checkUnnamed75(o.officeIds); | 519 checkUnnamed220(o.officeIndices); |
| 495 unittest.expect(o.scope, unittest.equals('foo')); | |
| 496 } | 520 } |
| 497 buildCounterGeographicDivision--; | 521 buildCounterGeographicDivision--; |
| 498 } | 522 } |
| 499 | 523 |
| 500 buildUnnamed76() { | 524 buildUnnamed221() { |
| 501 var o = new core.List<core.String>(); | 525 var o = new core.List<core.String>(); |
| 502 o.add("foo"); | 526 o.add("foo"); |
| 503 o.add("foo"); | 527 o.add("foo"); |
| 504 return o; | 528 return o; |
| 505 } | 529 } |
| 506 | 530 |
| 507 checkUnnamed76(core.List<core.String> o) { | 531 checkUnnamed221(core.List<core.String> o) { |
| 508 unittest.expect(o, unittest.hasLength(2)); | 532 unittest.expect(o, unittest.hasLength(2)); |
| 509 unittest.expect(o[0], unittest.equals('foo')); | 533 unittest.expect(o[0], unittest.equals('foo')); |
| 510 unittest.expect(o[1], unittest.equals('foo')); | 534 unittest.expect(o[1], unittest.equals('foo')); |
| 511 } | 535 } |
| 512 | 536 |
| 513 buildUnnamed77() { | 537 buildUnnamed222() { |
| 538 var o = new core.List<core.int>(); |
| 539 o.add(42); |
| 540 o.add(42); |
| 541 return o; |
| 542 } |
| 543 |
| 544 checkUnnamed222(core.List<core.int> o) { |
| 545 unittest.expect(o, unittest.hasLength(2)); |
| 546 unittest.expect(o[0], unittest.equals(42)); |
| 547 unittest.expect(o[1], unittest.equals(42)); |
| 548 } |
| 549 |
| 550 buildUnnamed223() { |
| 551 var o = new core.List<core.String>(); |
| 552 o.add("foo"); |
| 553 o.add("foo"); |
| 554 return o; |
| 555 } |
| 556 |
| 557 checkUnnamed223(core.List<core.String> o) { |
| 558 unittest.expect(o, unittest.hasLength(2)); |
| 559 unittest.expect(o[0], unittest.equals('foo')); |
| 560 unittest.expect(o[1], unittest.equals('foo')); |
| 561 } |
| 562 |
| 563 buildUnnamed224() { |
| 514 var o = new core.List<api.Source>(); | 564 var o = new core.List<api.Source>(); |
| 515 o.add(buildSource()); | 565 o.add(buildSource()); |
| 516 o.add(buildSource()); | 566 o.add(buildSource()); |
| 517 return o; | 567 return o; |
| 518 } | 568 } |
| 519 | 569 |
| 520 checkUnnamed77(core.List<api.Source> o) { | 570 checkUnnamed224(core.List<api.Source> o) { |
| 521 unittest.expect(o, unittest.hasLength(2)); | 571 unittest.expect(o, unittest.hasLength(2)); |
| 522 checkSource(o[0]); | 572 checkSource(o[0]); |
| 523 checkSource(o[1]); | 573 checkSource(o[1]); |
| 524 } | 574 } |
| 525 | 575 |
| 526 core.int buildCounterOffice = 0; | 576 core.int buildCounterOffice = 0; |
| 527 buildOffice() { | 577 buildOffice() { |
| 528 var o = new api.Office(); | 578 var o = new api.Office(); |
| 529 buildCounterOffice++; | 579 buildCounterOffice++; |
| 530 if (buildCounterOffice < 3) { | 580 if (buildCounterOffice < 3) { |
| 531 o.divisionId = "foo"; | 581 o.divisionId = "foo"; |
| 532 o.level = "foo"; | 582 o.levels = buildUnnamed221(); |
| 533 o.name = "foo"; | 583 o.name = "foo"; |
| 534 o.officialIds = buildUnnamed76(); | 584 o.officialIndices = buildUnnamed222(); |
| 535 o.sources = buildUnnamed77(); | 585 o.roles = buildUnnamed223(); |
| 586 o.sources = buildUnnamed224(); |
| 536 } | 587 } |
| 537 buildCounterOffice--; | 588 buildCounterOffice--; |
| 538 return o; | 589 return o; |
| 539 } | 590 } |
| 540 | 591 |
| 541 checkOffice(api.Office o) { | 592 checkOffice(api.Office o) { |
| 542 buildCounterOffice++; | 593 buildCounterOffice++; |
| 543 if (buildCounterOffice < 3) { | 594 if (buildCounterOffice < 3) { |
| 544 unittest.expect(o.divisionId, unittest.equals('foo')); | 595 unittest.expect(o.divisionId, unittest.equals('foo')); |
| 545 unittest.expect(o.level, unittest.equals('foo')); | 596 checkUnnamed221(o.levels); |
| 546 unittest.expect(o.name, unittest.equals('foo')); | 597 unittest.expect(o.name, unittest.equals('foo')); |
| 547 checkUnnamed76(o.officialIds); | 598 checkUnnamed222(o.officialIndices); |
| 548 checkUnnamed77(o.sources); | 599 checkUnnamed223(o.roles); |
| 600 checkUnnamed224(o.sources); |
| 549 } | 601 } |
| 550 buildCounterOffice--; | 602 buildCounterOffice--; |
| 551 } | 603 } |
| 552 | 604 |
| 553 buildUnnamed78() { | 605 buildUnnamed225() { |
| 554 var o = new core.List<api.SimpleAddressType>(); | 606 var o = new core.List<api.SimpleAddressType>(); |
| 555 o.add(buildSimpleAddressType()); | 607 o.add(buildSimpleAddressType()); |
| 556 o.add(buildSimpleAddressType()); | 608 o.add(buildSimpleAddressType()); |
| 557 return o; | 609 return o; |
| 558 } | 610 } |
| 559 | 611 |
| 560 checkUnnamed78(core.List<api.SimpleAddressType> o) { | 612 checkUnnamed225(core.List<api.SimpleAddressType> o) { |
| 561 unittest.expect(o, unittest.hasLength(2)); | 613 unittest.expect(o, unittest.hasLength(2)); |
| 562 checkSimpleAddressType(o[0]); | 614 checkSimpleAddressType(o[0]); |
| 563 checkSimpleAddressType(o[1]); | 615 checkSimpleAddressType(o[1]); |
| 564 } | 616 } |
| 565 | 617 |
| 566 buildUnnamed79() { | 618 buildUnnamed226() { |
| 567 var o = new core.List<api.Channel>(); | 619 var o = new core.List<api.Channel>(); |
| 568 o.add(buildChannel()); | 620 o.add(buildChannel()); |
| 569 o.add(buildChannel()); | 621 o.add(buildChannel()); |
| 570 return o; | 622 return o; |
| 571 } | 623 } |
| 572 | 624 |
| 573 checkUnnamed79(core.List<api.Channel> o) { | 625 checkUnnamed226(core.List<api.Channel> o) { |
| 574 unittest.expect(o, unittest.hasLength(2)); | 626 unittest.expect(o, unittest.hasLength(2)); |
| 575 checkChannel(o[0]); | 627 checkChannel(o[0]); |
| 576 checkChannel(o[1]); | 628 checkChannel(o[1]); |
| 577 } | 629 } |
| 578 | 630 |
| 579 buildUnnamed80() { | 631 buildUnnamed227() { |
| 580 var o = new core.List<core.String>(); | 632 var o = new core.List<core.String>(); |
| 581 o.add("foo"); | 633 o.add("foo"); |
| 582 o.add("foo"); | 634 o.add("foo"); |
| 583 return o; | 635 return o; |
| 584 } | 636 } |
| 585 | 637 |
| 586 checkUnnamed80(core.List<core.String> o) { | 638 checkUnnamed227(core.List<core.String> o) { |
| 587 unittest.expect(o, unittest.hasLength(2)); | 639 unittest.expect(o, unittest.hasLength(2)); |
| 588 unittest.expect(o[0], unittest.equals('foo')); | 640 unittest.expect(o[0], unittest.equals('foo')); |
| 589 unittest.expect(o[1], unittest.equals('foo')); | 641 unittest.expect(o[1], unittest.equals('foo')); |
| 590 } | 642 } |
| 591 | 643 |
| 592 buildUnnamed81() { | 644 buildUnnamed228() { |
| 593 var o = new core.List<core.String>(); | 645 var o = new core.List<core.String>(); |
| 594 o.add("foo"); | 646 o.add("foo"); |
| 595 o.add("foo"); | 647 o.add("foo"); |
| 596 return o; | 648 return o; |
| 597 } | 649 } |
| 598 | 650 |
| 599 checkUnnamed81(core.List<core.String> o) { | 651 checkUnnamed228(core.List<core.String> o) { |
| 600 unittest.expect(o, unittest.hasLength(2)); | 652 unittest.expect(o, unittest.hasLength(2)); |
| 601 unittest.expect(o[0], unittest.equals('foo')); | 653 unittest.expect(o[0], unittest.equals('foo')); |
| 602 unittest.expect(o[1], unittest.equals('foo')); | 654 unittest.expect(o[1], unittest.equals('foo')); |
| 603 } | 655 } |
| 604 | 656 |
| 605 buildUnnamed82() { | 657 buildUnnamed229() { |
| 606 var o = new core.List<core.String>(); | 658 var o = new core.List<core.String>(); |
| 607 o.add("foo"); | 659 o.add("foo"); |
| 608 o.add("foo"); | 660 o.add("foo"); |
| 609 return o; | 661 return o; |
| 610 } | 662 } |
| 611 | 663 |
| 612 checkUnnamed82(core.List<core.String> o) { | 664 checkUnnamed229(core.List<core.String> o) { |
| 613 unittest.expect(o, unittest.hasLength(2)); | 665 unittest.expect(o, unittest.hasLength(2)); |
| 614 unittest.expect(o[0], unittest.equals('foo')); | 666 unittest.expect(o[0], unittest.equals('foo')); |
| 615 unittest.expect(o[1], unittest.equals('foo')); | 667 unittest.expect(o[1], unittest.equals('foo')); |
| 616 } | 668 } |
| 617 | 669 |
| 618 core.int buildCounterOfficial = 0; | 670 core.int buildCounterOfficial = 0; |
| 619 buildOfficial() { | 671 buildOfficial() { |
| 620 var o = new api.Official(); | 672 var o = new api.Official(); |
| 621 buildCounterOfficial++; | 673 buildCounterOfficial++; |
| 622 if (buildCounterOfficial < 3) { | 674 if (buildCounterOfficial < 3) { |
| 623 o.address = buildUnnamed78(); | 675 o.address = buildUnnamed225(); |
| 624 o.channels = buildUnnamed79(); | 676 o.channels = buildUnnamed226(); |
| 625 o.emails = buildUnnamed80(); | 677 o.emails = buildUnnamed227(); |
| 626 o.name = "foo"; | 678 o.name = "foo"; |
| 627 o.party = "foo"; | 679 o.party = "foo"; |
| 628 o.phones = buildUnnamed81(); | 680 o.phones = buildUnnamed228(); |
| 629 o.photoUrl = "foo"; | 681 o.photoUrl = "foo"; |
| 630 o.urls = buildUnnamed82(); | 682 o.urls = buildUnnamed229(); |
| 631 } | 683 } |
| 632 buildCounterOfficial--; | 684 buildCounterOfficial--; |
| 633 return o; | 685 return o; |
| 634 } | 686 } |
| 635 | 687 |
| 636 checkOfficial(api.Official o) { | 688 checkOfficial(api.Official o) { |
| 637 buildCounterOfficial++; | 689 buildCounterOfficial++; |
| 638 if (buildCounterOfficial < 3) { | 690 if (buildCounterOfficial < 3) { |
| 639 checkUnnamed78(o.address); | 691 checkUnnamed225(o.address); |
| 640 checkUnnamed79(o.channels); | 692 checkUnnamed226(o.channels); |
| 641 checkUnnamed80(o.emails); | 693 checkUnnamed227(o.emails); |
| 642 unittest.expect(o.name, unittest.equals('foo')); | 694 unittest.expect(o.name, unittest.equals('foo')); |
| 643 unittest.expect(o.party, unittest.equals('foo')); | 695 unittest.expect(o.party, unittest.equals('foo')); |
| 644 checkUnnamed81(o.phones); | 696 checkUnnamed228(o.phones); |
| 645 unittest.expect(o.photoUrl, unittest.equals('foo')); | 697 unittest.expect(o.photoUrl, unittest.equals('foo')); |
| 646 checkUnnamed82(o.urls); | 698 checkUnnamed229(o.urls); |
| 647 } | 699 } |
| 648 buildCounterOfficial--; | 700 buildCounterOfficial--; |
| 649 } | 701 } |
| 650 | 702 |
| 651 buildUnnamed83() { | 703 buildUnnamed230() { |
| 652 var o = new core.List<api.Source>(); | 704 var o = new core.List<api.Source>(); |
| 653 o.add(buildSource()); | 705 o.add(buildSource()); |
| 654 o.add(buildSource()); | 706 o.add(buildSource()); |
| 655 return o; | 707 return o; |
| 656 } | 708 } |
| 657 | 709 |
| 658 checkUnnamed83(core.List<api.Source> o) { | 710 checkUnnamed230(core.List<api.Source> o) { |
| 659 unittest.expect(o, unittest.hasLength(2)); | 711 unittest.expect(o, unittest.hasLength(2)); |
| 660 checkSource(o[0]); | 712 checkSource(o[0]); |
| 661 checkSource(o[1]); | 713 checkSource(o[1]); |
| 662 } | 714 } |
| 663 | 715 |
| 664 core.int buildCounterPollingLocation = 0; | 716 core.int buildCounterPollingLocation = 0; |
| 665 buildPollingLocation() { | 717 buildPollingLocation() { |
| 666 var o = new api.PollingLocation(); | 718 var o = new api.PollingLocation(); |
| 667 buildCounterPollingLocation++; | 719 buildCounterPollingLocation++; |
| 668 if (buildCounterPollingLocation < 3) { | 720 if (buildCounterPollingLocation < 3) { |
| 669 o.address = buildSimpleAddressType(); | 721 o.address = buildSimpleAddressType(); |
| 670 o.endDate = "foo"; | 722 o.endDate = "foo"; |
| 671 o.id = "foo"; | 723 o.id = "foo"; |
| 672 o.name = "foo"; | 724 o.name = "foo"; |
| 673 o.notes = "foo"; | 725 o.notes = "foo"; |
| 674 o.pollingHours = "foo"; | 726 o.pollingHours = "foo"; |
| 675 o.sources = buildUnnamed83(); | 727 o.sources = buildUnnamed230(); |
| 676 o.startDate = "foo"; | 728 o.startDate = "foo"; |
| 677 o.voterServices = "foo"; | 729 o.voterServices = "foo"; |
| 678 } | 730 } |
| 679 buildCounterPollingLocation--; | 731 buildCounterPollingLocation--; |
| 680 return o; | 732 return o; |
| 681 } | 733 } |
| 682 | 734 |
| 683 checkPollingLocation(api.PollingLocation o) { | 735 checkPollingLocation(api.PollingLocation o) { |
| 684 buildCounterPollingLocation++; | 736 buildCounterPollingLocation++; |
| 685 if (buildCounterPollingLocation < 3) { | 737 if (buildCounterPollingLocation < 3) { |
| 686 checkSimpleAddressType(o.address); | 738 checkSimpleAddressType(o.address); |
| 687 unittest.expect(o.endDate, unittest.equals('foo')); | 739 unittest.expect(o.endDate, unittest.equals('foo')); |
| 688 unittest.expect(o.id, unittest.equals('foo')); | 740 unittest.expect(o.id, unittest.equals('foo')); |
| 689 unittest.expect(o.name, unittest.equals('foo')); | 741 unittest.expect(o.name, unittest.equals('foo')); |
| 690 unittest.expect(o.notes, unittest.equals('foo')); | 742 unittest.expect(o.notes, unittest.equals('foo')); |
| 691 unittest.expect(o.pollingHours, unittest.equals('foo')); | 743 unittest.expect(o.pollingHours, unittest.equals('foo')); |
| 692 checkUnnamed83(o.sources); | 744 checkUnnamed230(o.sources); |
| 693 unittest.expect(o.startDate, unittest.equals('foo')); | 745 unittest.expect(o.startDate, unittest.equals('foo')); |
| 694 unittest.expect(o.voterServices, unittest.equals('foo')); | 746 unittest.expect(o.voterServices, unittest.equals('foo')); |
| 695 } | 747 } |
| 696 buildCounterPollingLocation--; | 748 buildCounterPollingLocation--; |
| 697 } | 749 } |
| 698 | 750 |
| 699 core.int buildCounterRepresentativeInfoRequest = 0; | 751 buildUnnamed231() { |
| 700 buildRepresentativeInfoRequest() { | |
| 701 var o = new api.RepresentativeInfoRequest(); | |
| 702 buildCounterRepresentativeInfoRequest++; | |
| 703 if (buildCounterRepresentativeInfoRequest < 3) { | |
| 704 o.address = "foo"; | |
| 705 } | |
| 706 buildCounterRepresentativeInfoRequest--; | |
| 707 return o; | |
| 708 } | |
| 709 | |
| 710 checkRepresentativeInfoRequest(api.RepresentativeInfoRequest o) { | |
| 711 buildCounterRepresentativeInfoRequest++; | |
| 712 if (buildCounterRepresentativeInfoRequest < 3) { | |
| 713 unittest.expect(o.address, unittest.equals('foo')); | |
| 714 } | |
| 715 buildCounterRepresentativeInfoRequest--; | |
| 716 } | |
| 717 | |
| 718 buildUnnamed84() { | |
| 719 var o = new core.Map<core.String, api.GeographicDivision>(); | 752 var o = new core.Map<core.String, api.GeographicDivision>(); |
| 720 o["x"] = buildGeographicDivision(); | 753 o["x"] = buildGeographicDivision(); |
| 721 o["y"] = buildGeographicDivision(); | 754 o["y"] = buildGeographicDivision(); |
| 722 return o; | 755 return o; |
| 723 } | 756 } |
| 724 | 757 |
| 725 checkUnnamed84(core.Map<core.String, api.GeographicDivision> o) { | 758 checkUnnamed231(core.Map<core.String, api.GeographicDivision> o) { |
| 726 unittest.expect(o, unittest.hasLength(2)); | 759 unittest.expect(o, unittest.hasLength(2)); |
| 727 checkGeographicDivision(o["x"]); | 760 checkGeographicDivision(o["x"]); |
| 728 checkGeographicDivision(o["y"]); | 761 checkGeographicDivision(o["y"]); |
| 729 } | 762 } |
| 730 | 763 |
| 731 buildUnnamed85() { | 764 buildUnnamed232() { |
| 732 var o = new core.Map<core.String, api.Office>(); | 765 var o = new core.List<api.Office>(); |
| 733 o["x"] = buildOffice(); | 766 o.add(buildOffice()); |
| 734 o["y"] = buildOffice(); | 767 o.add(buildOffice()); |
| 735 return o; | 768 return o; |
| 736 } | 769 } |
| 737 | 770 |
| 738 checkUnnamed85(core.Map<core.String, api.Office> o) { | 771 checkUnnamed232(core.List<api.Office> o) { |
| 739 unittest.expect(o, unittest.hasLength(2)); | 772 unittest.expect(o, unittest.hasLength(2)); |
| 740 checkOffice(o["x"]); | 773 checkOffice(o[0]); |
| 741 checkOffice(o["y"]); | 774 checkOffice(o[1]); |
| 742 } | 775 } |
| 743 | 776 |
| 744 buildUnnamed86() { | 777 buildUnnamed233() { |
| 745 var o = new core.Map<core.String, api.Official>(); | 778 var o = new core.List<api.Official>(); |
| 746 o["x"] = buildOfficial(); | 779 o.add(buildOfficial()); |
| 747 o["y"] = buildOfficial(); | 780 o.add(buildOfficial()); |
| 748 return o; | 781 return o; |
| 749 } | 782 } |
| 750 | 783 |
| 751 checkUnnamed86(core.Map<core.String, api.Official> o) { | 784 checkUnnamed233(core.List<api.Official> o) { |
| 752 unittest.expect(o, unittest.hasLength(2)); | 785 unittest.expect(o, unittest.hasLength(2)); |
| 753 checkOfficial(o["x"]); | 786 checkOfficial(o[0]); |
| 754 checkOfficial(o["y"]); | 787 checkOfficial(o[1]); |
| 788 } |
| 789 |
| 790 core.int buildCounterRepresentativeInfoData = 0; |
| 791 buildRepresentativeInfoData() { |
| 792 var o = new api.RepresentativeInfoData(); |
| 793 buildCounterRepresentativeInfoData++; |
| 794 if (buildCounterRepresentativeInfoData < 3) { |
| 795 o.divisions = buildUnnamed231(); |
| 796 o.offices = buildUnnamed232(); |
| 797 o.officials = buildUnnamed233(); |
| 798 } |
| 799 buildCounterRepresentativeInfoData--; |
| 800 return o; |
| 801 } |
| 802 |
| 803 checkRepresentativeInfoData(api.RepresentativeInfoData o) { |
| 804 buildCounterRepresentativeInfoData++; |
| 805 if (buildCounterRepresentativeInfoData < 3) { |
| 806 checkUnnamed231(o.divisions); |
| 807 checkUnnamed232(o.offices); |
| 808 checkUnnamed233(o.officials); |
| 809 } |
| 810 buildCounterRepresentativeInfoData--; |
| 811 } |
| 812 |
| 813 buildUnnamed234() { |
| 814 var o = new core.Map<core.String, api.GeographicDivision>(); |
| 815 o["x"] = buildGeographicDivision(); |
| 816 o["y"] = buildGeographicDivision(); |
| 817 return o; |
| 818 } |
| 819 |
| 820 checkUnnamed234(core.Map<core.String, api.GeographicDivision> o) { |
| 821 unittest.expect(o, unittest.hasLength(2)); |
| 822 checkGeographicDivision(o["x"]); |
| 823 checkGeographicDivision(o["y"]); |
| 824 } |
| 825 |
| 826 buildUnnamed235() { |
| 827 var o = new core.List<api.Office>(); |
| 828 o.add(buildOffice()); |
| 829 o.add(buildOffice()); |
| 830 return o; |
| 831 } |
| 832 |
| 833 checkUnnamed235(core.List<api.Office> o) { |
| 834 unittest.expect(o, unittest.hasLength(2)); |
| 835 checkOffice(o[0]); |
| 836 checkOffice(o[1]); |
| 837 } |
| 838 |
| 839 buildUnnamed236() { |
| 840 var o = new core.List<api.Official>(); |
| 841 o.add(buildOfficial()); |
| 842 o.add(buildOfficial()); |
| 843 return o; |
| 844 } |
| 845 |
| 846 checkUnnamed236(core.List<api.Official> o) { |
| 847 unittest.expect(o, unittest.hasLength(2)); |
| 848 checkOfficial(o[0]); |
| 849 checkOfficial(o[1]); |
| 755 } | 850 } |
| 756 | 851 |
| 757 core.int buildCounterRepresentativeInfoResponse = 0; | 852 core.int buildCounterRepresentativeInfoResponse = 0; |
| 758 buildRepresentativeInfoResponse() { | 853 buildRepresentativeInfoResponse() { |
| 759 var o = new api.RepresentativeInfoResponse(); | 854 var o = new api.RepresentativeInfoResponse(); |
| 760 buildCounterRepresentativeInfoResponse++; | 855 buildCounterRepresentativeInfoResponse++; |
| 761 if (buildCounterRepresentativeInfoResponse < 3) { | 856 if (buildCounterRepresentativeInfoResponse < 3) { |
| 762 o.divisions = buildUnnamed84(); | 857 o.divisions = buildUnnamed234(); |
| 763 o.kind = "foo"; | 858 o.kind = "foo"; |
| 764 o.normalizedInput = buildSimpleAddressType(); | 859 o.normalizedInput = buildSimpleAddressType(); |
| 765 o.offices = buildUnnamed85(); | 860 o.offices = buildUnnamed235(); |
| 766 o.officials = buildUnnamed86(); | 861 o.officials = buildUnnamed236(); |
| 767 o.status = "foo"; | |
| 768 } | 862 } |
| 769 buildCounterRepresentativeInfoResponse--; | 863 buildCounterRepresentativeInfoResponse--; |
| 770 return o; | 864 return o; |
| 771 } | 865 } |
| 772 | 866 |
| 773 checkRepresentativeInfoResponse(api.RepresentativeInfoResponse o) { | 867 checkRepresentativeInfoResponse(api.RepresentativeInfoResponse o) { |
| 774 buildCounterRepresentativeInfoResponse++; | 868 buildCounterRepresentativeInfoResponse++; |
| 775 if (buildCounterRepresentativeInfoResponse < 3) { | 869 if (buildCounterRepresentativeInfoResponse < 3) { |
| 776 checkUnnamed84(o.divisions); | 870 checkUnnamed234(o.divisions); |
| 777 unittest.expect(o.kind, unittest.equals('foo')); | 871 unittest.expect(o.kind, unittest.equals('foo')); |
| 778 checkSimpleAddressType(o.normalizedInput); | 872 checkSimpleAddressType(o.normalizedInput); |
| 779 checkUnnamed85(o.offices); | 873 checkUnnamed235(o.offices); |
| 780 checkUnnamed86(o.officials); | 874 checkUnnamed236(o.officials); |
| 781 unittest.expect(o.status, unittest.equals('foo')); | |
| 782 } | 875 } |
| 783 buildCounterRepresentativeInfoResponse--; | 876 buildCounterRepresentativeInfoResponse--; |
| 784 } | 877 } |
| 785 | 878 |
| 786 core.int buildCounterSimpleAddressType = 0; | 879 core.int buildCounterSimpleAddressType = 0; |
| 787 buildSimpleAddressType() { | 880 buildSimpleAddressType() { |
| 788 var o = new api.SimpleAddressType(); | 881 var o = new api.SimpleAddressType(); |
| 789 buildCounterSimpleAddressType++; | 882 buildCounterSimpleAddressType++; |
| 790 if (buildCounterSimpleAddressType < 3) { | 883 if (buildCounterSimpleAddressType < 3) { |
| 791 o.city = "foo"; | 884 o.city = "foo"; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 | 921 |
| 829 checkSource(api.Source o) { | 922 checkSource(api.Source o) { |
| 830 buildCounterSource++; | 923 buildCounterSource++; |
| 831 if (buildCounterSource < 3) { | 924 if (buildCounterSource < 3) { |
| 832 unittest.expect(o.name, unittest.equals('foo')); | 925 unittest.expect(o.name, unittest.equals('foo')); |
| 833 unittest.expect(o.official, unittest.isTrue); | 926 unittest.expect(o.official, unittest.isTrue); |
| 834 } | 927 } |
| 835 buildCounterSource--; | 928 buildCounterSource--; |
| 836 } | 929 } |
| 837 | 930 |
| 838 core.int buildCounterVoterInfoRequest = 0; | 931 buildUnnamed237() { |
| 839 buildVoterInfoRequest() { | |
| 840 var o = new api.VoterInfoRequest(); | |
| 841 buildCounterVoterInfoRequest++; | |
| 842 if (buildCounterVoterInfoRequest < 3) { | |
| 843 o.address = "foo"; | |
| 844 } | |
| 845 buildCounterVoterInfoRequest--; | |
| 846 return o; | |
| 847 } | |
| 848 | |
| 849 checkVoterInfoRequest(api.VoterInfoRequest o) { | |
| 850 buildCounterVoterInfoRequest++; | |
| 851 if (buildCounterVoterInfoRequest < 3) { | |
| 852 unittest.expect(o.address, unittest.equals('foo')); | |
| 853 } | |
| 854 buildCounterVoterInfoRequest--; | |
| 855 } | |
| 856 | |
| 857 buildUnnamed87() { | |
| 858 var o = new core.List<api.Contest>(); | 932 var o = new core.List<api.Contest>(); |
| 859 o.add(buildContest()); | 933 o.add(buildContest()); |
| 860 o.add(buildContest()); | 934 o.add(buildContest()); |
| 861 return o; | 935 return o; |
| 862 } | 936 } |
| 863 | 937 |
| 864 checkUnnamed87(core.List<api.Contest> o) { | 938 checkUnnamed237(core.List<api.Contest> o) { |
| 865 unittest.expect(o, unittest.hasLength(2)); | 939 unittest.expect(o, unittest.hasLength(2)); |
| 866 checkContest(o[0]); | 940 checkContest(o[0]); |
| 867 checkContest(o[1]); | 941 checkContest(o[1]); |
| 868 } | 942 } |
| 869 | 943 |
| 870 buildUnnamed88() { | 944 buildUnnamed238() { |
| 871 var o = new core.List<api.PollingLocation>(); | 945 var o = new core.List<api.PollingLocation>(); |
| 872 o.add(buildPollingLocation()); | 946 o.add(buildPollingLocation()); |
| 873 o.add(buildPollingLocation()); | 947 o.add(buildPollingLocation()); |
| 874 return o; | 948 return o; |
| 875 } | 949 } |
| 876 | 950 |
| 877 checkUnnamed88(core.List<api.PollingLocation> o) { | 951 checkUnnamed238(core.List<api.PollingLocation> o) { |
| 878 unittest.expect(o, unittest.hasLength(2)); | 952 unittest.expect(o, unittest.hasLength(2)); |
| 879 checkPollingLocation(o[0]); | 953 checkPollingLocation(o[0]); |
| 880 checkPollingLocation(o[1]); | 954 checkPollingLocation(o[1]); |
| 881 } | 955 } |
| 882 | 956 |
| 883 buildUnnamed89() { | 957 buildUnnamed239() { |
| 958 var o = new core.List<api.Election>(); |
| 959 o.add(buildElection()); |
| 960 o.add(buildElection()); |
| 961 return o; |
| 962 } |
| 963 |
| 964 checkUnnamed239(core.List<api.Election> o) { |
| 965 unittest.expect(o, unittest.hasLength(2)); |
| 966 checkElection(o[0]); |
| 967 checkElection(o[1]); |
| 968 } |
| 969 |
| 970 buildUnnamed240() { |
| 884 var o = new core.List<api.PollingLocation>(); | 971 var o = new core.List<api.PollingLocation>(); |
| 885 o.add(buildPollingLocation()); | 972 o.add(buildPollingLocation()); |
| 886 o.add(buildPollingLocation()); | 973 o.add(buildPollingLocation()); |
| 887 return o; | 974 return o; |
| 888 } | 975 } |
| 889 | 976 |
| 890 checkUnnamed89(core.List<api.PollingLocation> o) { | 977 checkUnnamed240(core.List<api.PollingLocation> o) { |
| 891 unittest.expect(o, unittest.hasLength(2)); | 978 unittest.expect(o, unittest.hasLength(2)); |
| 892 checkPollingLocation(o[0]); | 979 checkPollingLocation(o[0]); |
| 893 checkPollingLocation(o[1]); | 980 checkPollingLocation(o[1]); |
| 894 } | 981 } |
| 895 | 982 |
| 896 buildUnnamed90() { | 983 buildUnnamed241() { |
| 897 var o = new core.List<api.AdministrationRegion>(); | 984 var o = new core.List<api.AdministrationRegion>(); |
| 898 o.add(buildAdministrationRegion()); | 985 o.add(buildAdministrationRegion()); |
| 899 o.add(buildAdministrationRegion()); | 986 o.add(buildAdministrationRegion()); |
| 900 return o; | 987 return o; |
| 901 } | 988 } |
| 902 | 989 |
| 903 checkUnnamed90(core.List<api.AdministrationRegion> o) { | 990 checkUnnamed241(core.List<api.AdministrationRegion> o) { |
| 904 unittest.expect(o, unittest.hasLength(2)); | 991 unittest.expect(o, unittest.hasLength(2)); |
| 905 checkAdministrationRegion(o[0]); | 992 checkAdministrationRegion(o[0]); |
| 906 checkAdministrationRegion(o[1]); | 993 checkAdministrationRegion(o[1]); |
| 907 } | 994 } |
| 908 | 995 |
| 909 core.int buildCounterVoterInfoResponse = 0; | 996 core.int buildCounterVoterInfoResponse = 0; |
| 910 buildVoterInfoResponse() { | 997 buildVoterInfoResponse() { |
| 911 var o = new api.VoterInfoResponse(); | 998 var o = new api.VoterInfoResponse(); |
| 912 buildCounterVoterInfoResponse++; | 999 buildCounterVoterInfoResponse++; |
| 913 if (buildCounterVoterInfoResponse < 3) { | 1000 if (buildCounterVoterInfoResponse < 3) { |
| 914 o.contests = buildUnnamed87(); | 1001 o.contests = buildUnnamed237(); |
| 915 o.earlyVoteSites = buildUnnamed88(); | 1002 o.earlyVoteSites = buildUnnamed238(); |
| 916 o.election = buildElection(); | 1003 o.election = buildElection(); |
| 917 o.kind = "foo"; | 1004 o.kind = "foo"; |
| 918 o.normalizedInput = buildSimpleAddressType(); | 1005 o.normalizedInput = buildSimpleAddressType(); |
| 919 o.pollingLocations = buildUnnamed89(); | 1006 o.otherElections = buildUnnamed239(); |
| 920 o.state = buildUnnamed90(); | 1007 o.pollingLocations = buildUnnamed240(); |
| 921 o.status = "foo"; | 1008 o.precinctId = "foo"; |
| 1009 o.state = buildUnnamed241(); |
| 922 } | 1010 } |
| 923 buildCounterVoterInfoResponse--; | 1011 buildCounterVoterInfoResponse--; |
| 924 return o; | 1012 return o; |
| 925 } | 1013 } |
| 926 | 1014 |
| 927 checkVoterInfoResponse(api.VoterInfoResponse o) { | 1015 checkVoterInfoResponse(api.VoterInfoResponse o) { |
| 928 buildCounterVoterInfoResponse++; | 1016 buildCounterVoterInfoResponse++; |
| 929 if (buildCounterVoterInfoResponse < 3) { | 1017 if (buildCounterVoterInfoResponse < 3) { |
| 930 checkUnnamed87(o.contests); | 1018 checkUnnamed237(o.contests); |
| 931 checkUnnamed88(o.earlyVoteSites); | 1019 checkUnnamed238(o.earlyVoteSites); |
| 932 checkElection(o.election); | 1020 checkElection(o.election); |
| 933 unittest.expect(o.kind, unittest.equals('foo')); | 1021 unittest.expect(o.kind, unittest.equals('foo')); |
| 934 checkSimpleAddressType(o.normalizedInput); | 1022 checkSimpleAddressType(o.normalizedInput); |
| 935 checkUnnamed89(o.pollingLocations); | 1023 checkUnnamed239(o.otherElections); |
| 936 checkUnnamed90(o.state); | 1024 checkUnnamed240(o.pollingLocations); |
| 937 unittest.expect(o.status, unittest.equals('foo')); | 1025 unittest.expect(o.precinctId, unittest.equals('foo')); |
| 1026 checkUnnamed241(o.state); |
| 938 } | 1027 } |
| 939 buildCounterVoterInfoResponse--; | 1028 buildCounterVoterInfoResponse--; |
| 940 } | 1029 } |
| 941 | 1030 |
| 1031 buildUnnamed242() { |
| 1032 var o = new core.List<core.String>(); |
| 1033 o.add("foo"); |
| 1034 o.add("foo"); |
| 1035 return o; |
| 1036 } |
| 1037 |
| 1038 checkUnnamed242(core.List<core.String> o) { |
| 1039 unittest.expect(o, unittest.hasLength(2)); |
| 1040 unittest.expect(o[0], unittest.equals('foo')); |
| 1041 unittest.expect(o[1], unittest.equals('foo')); |
| 1042 } |
| 1043 |
| 1044 buildUnnamed243() { |
| 1045 var o = new core.List<core.String>(); |
| 1046 o.add("foo"); |
| 1047 o.add("foo"); |
| 1048 return o; |
| 1049 } |
| 1050 |
| 1051 checkUnnamed243(core.List<core.String> o) { |
| 1052 unittest.expect(o, unittest.hasLength(2)); |
| 1053 unittest.expect(o[0], unittest.equals('foo')); |
| 1054 unittest.expect(o[1], unittest.equals('foo')); |
| 1055 } |
| 1056 |
| 1057 buildUnnamed244() { |
| 1058 var o = new core.List<core.String>(); |
| 1059 o.add("foo"); |
| 1060 o.add("foo"); |
| 1061 return o; |
| 1062 } |
| 1063 |
| 1064 checkUnnamed244(core.List<core.String> o) { |
| 1065 unittest.expect(o, unittest.hasLength(2)); |
| 1066 unittest.expect(o[0], unittest.equals('foo')); |
| 1067 unittest.expect(o[1], unittest.equals('foo')); |
| 1068 } |
| 1069 |
| 1070 buildUnnamed245() { |
| 1071 var o = new core.List<core.String>(); |
| 1072 o.add("foo"); |
| 1073 o.add("foo"); |
| 1074 return o; |
| 1075 } |
| 1076 |
| 1077 checkUnnamed245(core.List<core.String> o) { |
| 1078 unittest.expect(o, unittest.hasLength(2)); |
| 1079 unittest.expect(o[0], unittest.equals('foo')); |
| 1080 unittest.expect(o[1], unittest.equals('foo')); |
| 1081 } |
| 1082 |
| 942 | 1083 |
| 943 main() { | 1084 main() { |
| 944 unittest.group("obj-schema-AdministrationRegion", () { | 1085 unittest.group("obj-schema-AdministrationRegion", () { |
| 945 unittest.test("to-json--from-json", () { | 1086 unittest.test("to-json--from-json", () { |
| 946 var o = buildAdministrationRegion(); | 1087 var o = buildAdministrationRegion(); |
| 947 var od = new api.AdministrationRegion.fromJson(o.toJson()); | 1088 var od = new api.AdministrationRegion.fromJson(o.toJson()); |
| 948 checkAdministrationRegion(od); | 1089 checkAdministrationRegion(od); |
| 949 }); | 1090 }); |
| 950 }); | 1091 }); |
| 951 | 1092 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 | 1210 |
| 1070 unittest.group("obj-schema-PollingLocation", () { | 1211 unittest.group("obj-schema-PollingLocation", () { |
| 1071 unittest.test("to-json--from-json", () { | 1212 unittest.test("to-json--from-json", () { |
| 1072 var o = buildPollingLocation(); | 1213 var o = buildPollingLocation(); |
| 1073 var od = new api.PollingLocation.fromJson(o.toJson()); | 1214 var od = new api.PollingLocation.fromJson(o.toJson()); |
| 1074 checkPollingLocation(od); | 1215 checkPollingLocation(od); |
| 1075 }); | 1216 }); |
| 1076 }); | 1217 }); |
| 1077 | 1218 |
| 1078 | 1219 |
| 1079 unittest.group("obj-schema-RepresentativeInfoRequest", () { | 1220 unittest.group("obj-schema-RepresentativeInfoData", () { |
| 1080 unittest.test("to-json--from-json", () { | 1221 unittest.test("to-json--from-json", () { |
| 1081 var o = buildRepresentativeInfoRequest(); | 1222 var o = buildRepresentativeInfoData(); |
| 1082 var od = new api.RepresentativeInfoRequest.fromJson(o.toJson()); | 1223 var od = new api.RepresentativeInfoData.fromJson(o.toJson()); |
| 1083 checkRepresentativeInfoRequest(od); | 1224 checkRepresentativeInfoData(od); |
| 1084 }); | 1225 }); |
| 1085 }); | 1226 }); |
| 1086 | 1227 |
| 1087 | 1228 |
| 1088 unittest.group("obj-schema-RepresentativeInfoResponse", () { | 1229 unittest.group("obj-schema-RepresentativeInfoResponse", () { |
| 1089 unittest.test("to-json--from-json", () { | 1230 unittest.test("to-json--from-json", () { |
| 1090 var o = buildRepresentativeInfoResponse(); | 1231 var o = buildRepresentativeInfoResponse(); |
| 1091 var od = new api.RepresentativeInfoResponse.fromJson(o.toJson()); | 1232 var od = new api.RepresentativeInfoResponse.fromJson(o.toJson()); |
| 1092 checkRepresentativeInfoResponse(od); | 1233 checkRepresentativeInfoResponse(od); |
| 1093 }); | 1234 }); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1105 | 1246 |
| 1106 unittest.group("obj-schema-Source", () { | 1247 unittest.group("obj-schema-Source", () { |
| 1107 unittest.test("to-json--from-json", () { | 1248 unittest.test("to-json--from-json", () { |
| 1108 var o = buildSource(); | 1249 var o = buildSource(); |
| 1109 var od = new api.Source.fromJson(o.toJson()); | 1250 var od = new api.Source.fromJson(o.toJson()); |
| 1110 checkSource(od); | 1251 checkSource(od); |
| 1111 }); | 1252 }); |
| 1112 }); | 1253 }); |
| 1113 | 1254 |
| 1114 | 1255 |
| 1115 unittest.group("obj-schema-VoterInfoRequest", () { | |
| 1116 unittest.test("to-json--from-json", () { | |
| 1117 var o = buildVoterInfoRequest(); | |
| 1118 var od = new api.VoterInfoRequest.fromJson(o.toJson()); | |
| 1119 checkVoterInfoRequest(od); | |
| 1120 }); | |
| 1121 }); | |
| 1122 | |
| 1123 | |
| 1124 unittest.group("obj-schema-VoterInfoResponse", () { | 1256 unittest.group("obj-schema-VoterInfoResponse", () { |
| 1125 unittest.test("to-json--from-json", () { | 1257 unittest.test("to-json--from-json", () { |
| 1126 var o = buildVoterInfoResponse(); | 1258 var o = buildVoterInfoResponse(); |
| 1127 var od = new api.VoterInfoResponse.fromJson(o.toJson()); | 1259 var od = new api.VoterInfoResponse.fromJson(o.toJson()); |
| 1128 checkVoterInfoResponse(od); | 1260 checkVoterInfoResponse(od); |
| 1129 }); | 1261 }); |
| 1130 }); | 1262 }); |
| 1131 | 1263 |
| 1132 | 1264 |
| 1133 unittest.group("resource-DivisionsResourceApi", () { | 1265 unittest.group("resource-DivisionsResourceApi", () { |
| 1134 unittest.test("method--search", () { | 1266 unittest.test("method--search", () { |
| 1135 | 1267 |
| 1136 var mock = new common_test.HttpServerMock(); | 1268 var mock = new common_test.HttpServerMock(); |
| 1137 api.DivisionsResourceApi res = new api.CivicinfoApi(mock).divisions; | 1269 api.DivisionsResourceApi res = new api.CivicinfoApi(mock).divisions; |
| 1138 var arg_query = "foo"; | 1270 var arg_query = "foo"; |
| 1139 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1271 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1140 var path = (req.url).path; | 1272 var path = (req.url).path; |
| 1141 var pathOffset = 0; | 1273 var pathOffset = 0; |
| 1142 var index; | 1274 var index; |
| 1143 var subPart; | 1275 var subPart; |
| 1144 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1276 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1145 pathOffset += 1; | 1277 pathOffset += 1; |
| 1146 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v1/")); | 1278 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v2/")); |
| 1147 pathOffset += 13; | 1279 pathOffset += 13; |
| 1148 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("representatives/division_search")); | 1280 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("divisions")); |
| 1149 pathOffset += 31; | 1281 pathOffset += 9; |
| 1150 | 1282 |
| 1151 var query = (req.url).query; | 1283 var query = (req.url).query; |
| 1152 var queryOffset = 0; | 1284 var queryOffset = 0; |
| 1153 var queryMap = {}; | 1285 var queryMap = {}; |
| 1154 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1286 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1155 parseBool(n) { | 1287 parseBool(n) { |
| 1156 if (n == "true") return true; | 1288 if (n == "true") return true; |
| 1157 if (n == "false") return false; | 1289 if (n == "false") return false; |
| 1158 if (n == null) return null; | 1290 if (n == null) return null; |
| 1159 throw new core.ArgumentError("Invalid boolean: $n"); | 1291 throw new core.ArgumentError("Invalid boolean: $n"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1186 | 1318 |
| 1187 var mock = new common_test.HttpServerMock(); | 1319 var mock = new common_test.HttpServerMock(); |
| 1188 api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections; | 1320 api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections; |
| 1189 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1321 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1190 var path = (req.url).path; | 1322 var path = (req.url).path; |
| 1191 var pathOffset = 0; | 1323 var pathOffset = 0; |
| 1192 var index; | 1324 var index; |
| 1193 var subPart; | 1325 var subPart; |
| 1194 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1326 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1195 pathOffset += 1; | 1327 pathOffset += 1; |
| 1196 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v1/")); | 1328 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v2/")); |
| 1197 pathOffset += 13; | 1329 pathOffset += 13; |
| 1198 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("elections")); | 1330 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("elections")); |
| 1199 pathOffset += 9; | 1331 pathOffset += 9; |
| 1200 | 1332 |
| 1201 var query = (req.url).query; | 1333 var query = (req.url).query; |
| 1202 var queryOffset = 0; | 1334 var queryOffset = 0; |
| 1203 var queryMap = {}; | 1335 var queryMap = {}; |
| 1204 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1336 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1205 parseBool(n) { | 1337 parseBool(n) { |
| 1206 if (n == "true") return true; | 1338 if (n == "true") return true; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1224 }), true); | 1356 }), true); |
| 1225 res.electionQuery().then(unittest.expectAsync(((api.ElectionsQueryResponse
response) { | 1357 res.electionQuery().then(unittest.expectAsync(((api.ElectionsQueryResponse
response) { |
| 1226 checkElectionsQueryResponse(response); | 1358 checkElectionsQueryResponse(response); |
| 1227 }))); | 1359 }))); |
| 1228 }); | 1360 }); |
| 1229 | 1361 |
| 1230 unittest.test("method--voterInfoQuery", () { | 1362 unittest.test("method--voterInfoQuery", () { |
| 1231 | 1363 |
| 1232 var mock = new common_test.HttpServerMock(); | 1364 var mock = new common_test.HttpServerMock(); |
| 1233 api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections; | 1365 api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections; |
| 1234 var arg_request = buildVoterInfoRequest(); | 1366 var arg_address = "foo"; |
| 1235 var arg_electionId = "foo"; | 1367 var arg_electionId = "foo"; |
| 1236 var arg_officialOnly = true; | 1368 var arg_officialOnly = true; |
| 1237 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1369 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1238 var obj = new api.VoterInfoRequest.fromJson(json); | |
| 1239 checkVoterInfoRequest(obj); | |
| 1240 | |
| 1241 var path = (req.url).path; | 1370 var path = (req.url).path; |
| 1242 var pathOffset = 0; | 1371 var pathOffset = 0; |
| 1243 var index; | 1372 var index; |
| 1244 var subPart; | 1373 var subPart; |
| 1245 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1374 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1246 pathOffset += 1; | 1375 pathOffset += 1; |
| 1247 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v1/")); | 1376 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v2/")); |
| 1248 pathOffset += 13; | 1377 pathOffset += 13; |
| 1249 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("voterinfo/")); | 1378 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("voterinfo")); |
| 1250 pathOffset += 10; | 1379 pathOffset += 9; |
| 1251 index = path.indexOf("/lookup", pathOffset); | |
| 1252 unittest.expect(index >= 0, unittest.isTrue); | |
| 1253 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 1254 pathOffset = index; | |
| 1255 unittest.expect(subPart, unittest.equals("$arg_electionId")); | |
| 1256 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/lookup")); | |
| 1257 pathOffset += 7; | |
| 1258 | 1380 |
| 1259 var query = (req.url).query; | 1381 var query = (req.url).query; |
| 1260 var queryOffset = 0; | 1382 var queryOffset = 0; |
| 1261 var queryMap = {}; | 1383 var queryMap = {}; |
| 1262 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1384 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1263 parseBool(n) { | 1385 parseBool(n) { |
| 1264 if (n == "true") return true; | 1386 if (n == "true") return true; |
| 1265 if (n == "false") return false; | 1387 if (n == "false") return false; |
| 1266 if (n == null) return null; | 1388 if (n == null) return null; |
| 1267 throw new core.ArgumentError("Invalid boolean: $n"); | 1389 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1268 } | 1390 } |
| 1269 if (query.length > 0) { | 1391 if (query.length > 0) { |
| 1270 for (var part in query.split("&")) { | 1392 for (var part in query.split("&")) { |
| 1271 var keyvalue = part.split("="); | 1393 var keyvalue = part.split("="); |
| 1272 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1394 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1273 } | 1395 } |
| 1274 } | 1396 } |
| 1397 unittest.expect(queryMap["address"].first, unittest.equals(arg_address))
; |
| 1398 unittest.expect(queryMap["electionId"].first, unittest.equals(arg_electi
onId)); |
| 1275 unittest.expect(queryMap["officialOnly"].first, unittest.equals("$arg_of
ficialOnly")); | 1399 unittest.expect(queryMap["officialOnly"].first, unittest.equals("$arg_of
ficialOnly")); |
| 1276 | 1400 |
| 1277 | 1401 |
| 1278 var h = { | 1402 var h = { |
| 1279 "content-type" : "application/json; charset=utf-8", | 1403 "content-type" : "application/json; charset=utf-8", |
| 1280 }; | 1404 }; |
| 1281 var resp = convert.JSON.encode(buildVoterInfoResponse()); | 1405 var resp = convert.JSON.encode(buildVoterInfoResponse()); |
| 1282 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1406 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1283 }), true); | 1407 }), true); |
| 1284 res.voterInfoQuery(arg_request, arg_electionId, officialOnly: arg_official
Only).then(unittest.expectAsync(((api.VoterInfoResponse response) { | 1408 res.voterInfoQuery(arg_address, electionId: arg_electionId, officialOnly:
arg_officialOnly).then(unittest.expectAsync(((api.VoterInfoResponse response) { |
| 1285 checkVoterInfoResponse(response); | 1409 checkVoterInfoResponse(response); |
| 1286 }))); | 1410 }))); |
| 1287 }); | 1411 }); |
| 1288 | 1412 |
| 1289 }); | 1413 }); |
| 1290 | 1414 |
| 1291 | 1415 |
| 1292 unittest.group("resource-RepresentativesResourceApi", () { | 1416 unittest.group("resource-RepresentativesResourceApi", () { |
| 1293 unittest.test("method--representativeInfoQuery", () { | 1417 unittest.test("method--representativeInfoByAddress", () { |
| 1294 | 1418 |
| 1295 var mock = new common_test.HttpServerMock(); | 1419 var mock = new common_test.HttpServerMock(); |
| 1296 api.RepresentativesResourceApi res = new api.CivicinfoApi(mock).representa
tives; | 1420 api.RepresentativesResourceApi res = new api.CivicinfoApi(mock).representa
tives; |
| 1297 var arg_request = buildRepresentativeInfoRequest(); | 1421 var arg_address = "foo"; |
| 1298 var arg_includeOffices = true; | 1422 var arg_includeOffices = true; |
| 1299 var arg_ocdId = "foo"; | 1423 var arg_levels = buildUnnamed242(); |
| 1300 var arg_recursive = true; | 1424 var arg_roles = buildUnnamed243(); |
| 1301 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1425 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1302 var obj = new api.RepresentativeInfoRequest.fromJson(json); | |
| 1303 checkRepresentativeInfoRequest(obj); | |
| 1304 | |
| 1305 var path = (req.url).path; | 1426 var path = (req.url).path; |
| 1306 var pathOffset = 0; | 1427 var pathOffset = 0; |
| 1307 var index; | 1428 var index; |
| 1308 var subPart; | 1429 var subPart; |
| 1309 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1430 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1310 pathOffset += 1; | 1431 pathOffset += 1; |
| 1311 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v1/")); | 1432 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v2/")); |
| 1312 pathOffset += 13; | 1433 pathOffset += 13; |
| 1313 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("representatives/lookup")); | 1434 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("representatives")); |
| 1314 pathOffset += 22; | 1435 pathOffset += 15; |
| 1315 | 1436 |
| 1316 var query = (req.url).query; | 1437 var query = (req.url).query; |
| 1317 var queryOffset = 0; | 1438 var queryOffset = 0; |
| 1318 var queryMap = {}; | 1439 var queryMap = {}; |
| 1319 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1440 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1320 parseBool(n) { | 1441 parseBool(n) { |
| 1321 if (n == "true") return true; | 1442 if (n == "true") return true; |
| 1322 if (n == "false") return false; | 1443 if (n == "false") return false; |
| 1323 if (n == null) return null; | 1444 if (n == null) return null; |
| 1324 throw new core.ArgumentError("Invalid boolean: $n"); | 1445 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1325 } | 1446 } |
| 1326 if (query.length > 0) { | 1447 if (query.length > 0) { |
| 1327 for (var part in query.split("&")) { | 1448 for (var part in query.split("&")) { |
| 1328 var keyvalue = part.split("="); | 1449 var keyvalue = part.split("="); |
| 1329 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1450 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1330 } | 1451 } |
| 1331 } | 1452 } |
| 1453 unittest.expect(queryMap["address"].first, unittest.equals(arg_address))
; |
| 1332 unittest.expect(queryMap["includeOffices"].first, unittest.equals("$arg_
includeOffices")); | 1454 unittest.expect(queryMap["includeOffices"].first, unittest.equals("$arg_
includeOffices")); |
| 1333 unittest.expect(queryMap["ocdId"].first, unittest.equals(arg_ocdId)); | 1455 unittest.expect(queryMap["levels"], unittest.equals(arg_levels)); |
| 1334 unittest.expect(queryMap["recursive"].first, unittest.equals("$arg_recur
sive")); | 1456 unittest.expect(queryMap["roles"], unittest.equals(arg_roles)); |
| 1335 | 1457 |
| 1336 | 1458 |
| 1337 var h = { | 1459 var h = { |
| 1338 "content-type" : "application/json; charset=utf-8", | 1460 "content-type" : "application/json; charset=utf-8", |
| 1339 }; | 1461 }; |
| 1340 var resp = convert.JSON.encode(buildRepresentativeInfoResponse()); | 1462 var resp = convert.JSON.encode(buildRepresentativeInfoResponse()); |
| 1341 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1463 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1342 }), true); | 1464 }), true); |
| 1343 res.representativeInfoQuery(arg_request, includeOffices: arg_includeOffice
s, ocdId: arg_ocdId, recursive: arg_recursive).then(unittest.expectAsync(((api.R
epresentativeInfoResponse response) { | 1465 res.representativeInfoByAddress(address: arg_address, includeOffices: arg_
includeOffices, levels: arg_levels, roles: arg_roles).then(unittest.expectAsync(
((api.RepresentativeInfoResponse response) { |
| 1344 checkRepresentativeInfoResponse(response); | 1466 checkRepresentativeInfoResponse(response); |
| 1345 }))); | 1467 }))); |
| 1346 }); | 1468 }); |
| 1347 | 1469 |
| 1470 unittest.test("method--representativeInfoByDivision", () { |
| 1471 |
| 1472 var mock = new common_test.HttpServerMock(); |
| 1473 api.RepresentativesResourceApi res = new api.CivicinfoApi(mock).representa
tives; |
| 1474 var arg_ocdId = "foo"; |
| 1475 var arg_levels = buildUnnamed244(); |
| 1476 var arg_recursive = true; |
| 1477 var arg_roles = buildUnnamed245(); |
| 1478 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1479 var path = (req.url).path; |
| 1480 var pathOffset = 0; |
| 1481 var index; |
| 1482 var subPart; |
| 1483 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1484 pathOffset += 1; |
| 1485 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("civicinfo/v2/")); |
| 1486 pathOffset += 13; |
| 1487 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("representatives/")); |
| 1488 pathOffset += 16; |
| 1489 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1490 pathOffset = path.length; |
| 1491 unittest.expect(subPart, unittest.equals("$arg_ocdId")); |
| 1492 |
| 1493 var query = (req.url).query; |
| 1494 var queryOffset = 0; |
| 1495 var queryMap = {}; |
| 1496 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1497 parseBool(n) { |
| 1498 if (n == "true") return true; |
| 1499 if (n == "false") return false; |
| 1500 if (n == null) return null; |
| 1501 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1502 } |
| 1503 if (query.length > 0) { |
| 1504 for (var part in query.split("&")) { |
| 1505 var keyvalue = part.split("="); |
| 1506 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1507 } |
| 1508 } |
| 1509 unittest.expect(queryMap["levels"], unittest.equals(arg_levels)); |
| 1510 unittest.expect(queryMap["recursive"].first, unittest.equals("$arg_recur
sive")); |
| 1511 unittest.expect(queryMap["roles"], unittest.equals(arg_roles)); |
| 1512 |
| 1513 |
| 1514 var h = { |
| 1515 "content-type" : "application/json; charset=utf-8", |
| 1516 }; |
| 1517 var resp = convert.JSON.encode(buildRepresentativeInfoData()); |
| 1518 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1519 }), true); |
| 1520 res.representativeInfoByDivision(arg_ocdId, levels: arg_levels, recursive:
arg_recursive, roles: arg_roles).then(unittest.expectAsync(((api.Representative
InfoData response) { |
| 1521 checkRepresentativeInfoData(response); |
| 1522 }))); |
| 1523 }); |
| 1524 |
| 1348 }); | 1525 }); |
| 1349 | 1526 |
| 1350 | 1527 |
| 1351 } | 1528 } |
| 1352 | 1529 |
| OLD | NEW |