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

Unified Diff: generated/googleapis/test/civicinfo/v1.dart

Issue 560323003: Add discovery service to stable APIs (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: New generator hash in pubspec.yaml, test files renamed ot have _test.dart postfix Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: generated/googleapis/test/civicinfo/v1.dart
diff --git a/generated/googleapis/test/civicinfo/v1.dart b/generated/googleapis/test/civicinfo/v1.dart
deleted file mode 100644
index 433190b7182c4445e9fd73a2fab36eada3f41a9a..0000000000000000000000000000000000000000
--- a/generated/googleapis/test/civicinfo/v1.dart
+++ /dev/null
@@ -1,1344 +0,0 @@
-library googleapis.civicinfo.v1.test;
-
-import "dart:core" as core;
-import "dart:collection" as collection;
-import "dart:async" as async;
-import "dart:convert" as convert;
-
-import 'package:http/http.dart' as http;
-import 'package:http/testing.dart' as http_testing;
-import 'package:unittest/unittest.dart' as unittest;
-import 'package:googleapis/common/common.dart' as common;
-import 'package:googleapis/src/common_internal.dart' as common_internal;
-import '../common/common_internal_test.dart' as common_test;
-
-import 'package:googleapis/civicinfo/v1.dart' as api;
-
-
-
-buildUnnamed65() {
- var o = new core.List<api.Source>();
- o.add(buildSource());
- o.add(buildSource());
- return o;
-}
-
-checkUnnamed65(core.List<api.Source> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkSource(o[0]);
- checkSource(o[1]);
-}
-
-core.int buildCounterAdministrationRegion = 0;
-buildAdministrationRegion() {
- var o = new api.AdministrationRegion();
- buildCounterAdministrationRegion++;
- if (buildCounterAdministrationRegion < 3) {
- o.electionAdministrationBody = buildAdministrativeBody();
- o.id = "foo";
- o.localJurisdiction = buildAdministrationRegion();
- o.name = "foo";
- o.sources = buildUnnamed65();
- }
- buildCounterAdministrationRegion--;
- return o;
-}
-
-checkAdministrationRegion(api.AdministrationRegion o) {
- buildCounterAdministrationRegion++;
- if (buildCounterAdministrationRegion < 3) {
- checkAdministrativeBody(o.electionAdministrationBody);
- unittest.expect(o.id, unittest.equals('foo'));
- checkAdministrationRegion(o.localJurisdiction);
- unittest.expect(o.name, unittest.equals('foo'));
- checkUnnamed65(o.sources);
- }
- buildCounterAdministrationRegion--;
-}
-
-buildUnnamed66() {
- var o = new core.List<api.ElectionOfficial>();
- o.add(buildElectionOfficial());
- o.add(buildElectionOfficial());
- return o;
-}
-
-checkUnnamed66(core.List<api.ElectionOfficial> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkElectionOfficial(o[0]);
- checkElectionOfficial(o[1]);
-}
-
-buildUnnamed67() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed67(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-core.int buildCounterAdministrativeBody = 0;
-buildAdministrativeBody() {
- var o = new api.AdministrativeBody();
- buildCounterAdministrativeBody++;
- if (buildCounterAdministrativeBody < 3) {
- o.absenteeVotingInfoUrl = "foo";
- o.ballotInfoUrl = "foo";
- o.correspondenceAddress = buildSimpleAddressType();
- o.electionInfoUrl = "foo";
- o.electionOfficials = buildUnnamed66();
- o.electionRegistrationConfirmationUrl = "foo";
- o.electionRegistrationUrl = "foo";
- o.electionRulesUrl = "foo";
- o.hoursOfOperation = "foo";
- o.name = "foo";
- o.physicalAddress = buildSimpleAddressType();
- o.voterServices = buildUnnamed67();
- o.votingLocationFinderUrl = "foo";
- }
- buildCounterAdministrativeBody--;
- return o;
-}
-
-checkAdministrativeBody(api.AdministrativeBody o) {
- buildCounterAdministrativeBody++;
- if (buildCounterAdministrativeBody < 3) {
- unittest.expect(o.absenteeVotingInfoUrl, unittest.equals('foo'));
- unittest.expect(o.ballotInfoUrl, unittest.equals('foo'));
- checkSimpleAddressType(o.correspondenceAddress);
- unittest.expect(o.electionInfoUrl, unittest.equals('foo'));
- checkUnnamed66(o.electionOfficials);
- unittest.expect(o.electionRegistrationConfirmationUrl, unittest.equals('foo'));
- unittest.expect(o.electionRegistrationUrl, unittest.equals('foo'));
- unittest.expect(o.electionRulesUrl, unittest.equals('foo'));
- unittest.expect(o.hoursOfOperation, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- checkSimpleAddressType(o.physicalAddress);
- checkUnnamed67(o.voterServices);
- unittest.expect(o.votingLocationFinderUrl, unittest.equals('foo'));
- }
- buildCounterAdministrativeBody--;
-}
-
-buildUnnamed68() {
- var o = new core.List<api.Channel>();
- o.add(buildChannel());
- o.add(buildChannel());
- return o;
-}
-
-checkUnnamed68(core.List<api.Channel> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkChannel(o[0]);
- checkChannel(o[1]);
-}
-
-core.int buildCounterCandidate = 0;
-buildCandidate() {
- var o = new api.Candidate();
- buildCounterCandidate++;
- if (buildCounterCandidate < 3) {
- o.candidateUrl = "foo";
- o.channels = buildUnnamed68();
- o.email = "foo";
- o.name = "foo";
- o.orderOnBallot = "foo";
- o.party = "foo";
- o.phone = "foo";
- o.photoUrl = "foo";
- }
- buildCounterCandidate--;
- return o;
-}
-
-checkCandidate(api.Candidate o) {
- buildCounterCandidate++;
- if (buildCounterCandidate < 3) {
- unittest.expect(o.candidateUrl, unittest.equals('foo'));
- checkUnnamed68(o.channels);
- unittest.expect(o.email, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.orderOnBallot, unittest.equals('foo'));
- unittest.expect(o.party, unittest.equals('foo'));
- unittest.expect(o.phone, unittest.equals('foo'));
- unittest.expect(o.photoUrl, unittest.equals('foo'));
- }
- buildCounterCandidate--;
-}
-
-core.int buildCounterChannel = 0;
-buildChannel() {
- var o = new api.Channel();
- buildCounterChannel++;
- if (buildCounterChannel < 3) {
- o.id = "foo";
- o.type = "foo";
- }
- buildCounterChannel--;
- return o;
-}
-
-checkChannel(api.Channel o) {
- buildCounterChannel++;
- if (buildCounterChannel < 3) {
- unittest.expect(o.id, unittest.equals('foo'));
- unittest.expect(o.type, unittest.equals('foo'));
- }
- buildCounterChannel--;
-}
-
-buildUnnamed69() {
- var o = new core.List<api.Candidate>();
- o.add(buildCandidate());
- o.add(buildCandidate());
- return o;
-}
-
-checkUnnamed69(core.List<api.Candidate> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkCandidate(o[0]);
- checkCandidate(o[1]);
-}
-
-buildUnnamed70() {
- var o = new core.List<api.Source>();
- o.add(buildSource());
- o.add(buildSource());
- return o;
-}
-
-checkUnnamed70(core.List<api.Source> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkSource(o[0]);
- checkSource(o[1]);
-}
-
-core.int buildCounterContest = 0;
-buildContest() {
- var o = new api.Contest();
- buildCounterContest++;
- if (buildCounterContest < 3) {
- o.ballotPlacement = "foo";
- o.candidates = buildUnnamed69();
- o.district = buildElectoralDistrict();
- o.electorateSpecifications = "foo";
- o.id = "foo";
- o.level = "foo";
- o.numberElected = "foo";
- o.numberVotingFor = "foo";
- o.office = "foo";
- o.primaryParty = "foo";
- o.referendumSubtitle = "foo";
- o.referendumTitle = "foo";
- o.referendumUrl = "foo";
- o.sources = buildUnnamed70();
- o.special = "foo";
- o.type = "foo";
- }
- buildCounterContest--;
- return o;
-}
-
-checkContest(api.Contest o) {
- buildCounterContest++;
- if (buildCounterContest < 3) {
- unittest.expect(o.ballotPlacement, unittest.equals('foo'));
- checkUnnamed69(o.candidates);
- checkElectoralDistrict(o.district);
- unittest.expect(o.electorateSpecifications, unittest.equals('foo'));
- unittest.expect(o.id, unittest.equals('foo'));
- unittest.expect(o.level, unittest.equals('foo'));
- unittest.expect(o.numberElected, unittest.equals('foo'));
- unittest.expect(o.numberVotingFor, unittest.equals('foo'));
- unittest.expect(o.office, unittest.equals('foo'));
- unittest.expect(o.primaryParty, unittest.equals('foo'));
- unittest.expect(o.referendumSubtitle, unittest.equals('foo'));
- unittest.expect(o.referendumTitle, unittest.equals('foo'));
- unittest.expect(o.referendumUrl, unittest.equals('foo'));
- checkUnnamed70(o.sources);
- unittest.expect(o.special, unittest.equals('foo'));
- unittest.expect(o.type, unittest.equals('foo'));
- }
- buildCounterContest--;
-}
-
-buildUnnamed71() {
- var o = new core.List<api.DivisionSearchResult>();
- o.add(buildDivisionSearchResult());
- o.add(buildDivisionSearchResult());
- return o;
-}
-
-checkUnnamed71(core.List<api.DivisionSearchResult> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkDivisionSearchResult(o[0]);
- checkDivisionSearchResult(o[1]);
-}
-
-core.int buildCounterDivisionSearchResponse = 0;
-buildDivisionSearchResponse() {
- var o = new api.DivisionSearchResponse();
- buildCounterDivisionSearchResponse++;
- if (buildCounterDivisionSearchResponse < 3) {
- o.kind = "foo";
- o.results = buildUnnamed71();
- o.status = "foo";
- }
- buildCounterDivisionSearchResponse--;
- return o;
-}
-
-checkDivisionSearchResponse(api.DivisionSearchResponse o) {
- buildCounterDivisionSearchResponse++;
- if (buildCounterDivisionSearchResponse < 3) {
- unittest.expect(o.kind, unittest.equals('foo'));
- checkUnnamed71(o.results);
- unittest.expect(o.status, unittest.equals('foo'));
- }
- buildCounterDivisionSearchResponse--;
-}
-
-buildUnnamed72() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed72(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-core.int buildCounterDivisionSearchResult = 0;
-buildDivisionSearchResult() {
- var o = new api.DivisionSearchResult();
- buildCounterDivisionSearchResult++;
- if (buildCounterDivisionSearchResult < 3) {
- o.aliases = buildUnnamed72();
- o.name = "foo";
- o.ocdId = "foo";
- }
- buildCounterDivisionSearchResult--;
- return o;
-}
-
-checkDivisionSearchResult(api.DivisionSearchResult o) {
- buildCounterDivisionSearchResult++;
- if (buildCounterDivisionSearchResult < 3) {
- checkUnnamed72(o.aliases);
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.ocdId, unittest.equals('foo'));
- }
- buildCounterDivisionSearchResult--;
-}
-
-core.int buildCounterElection = 0;
-buildElection() {
- var o = new api.Election();
- buildCounterElection++;
- if (buildCounterElection < 3) {
- o.electionDay = "foo";
- o.id = "foo";
- o.name = "foo";
- }
- buildCounterElection--;
- return o;
-}
-
-checkElection(api.Election o) {
- buildCounterElection++;
- if (buildCounterElection < 3) {
- unittest.expect(o.electionDay, unittest.equals('foo'));
- unittest.expect(o.id, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- }
- buildCounterElection--;
-}
-
-core.int buildCounterElectionOfficial = 0;
-buildElectionOfficial() {
- var o = new api.ElectionOfficial();
- buildCounterElectionOfficial++;
- if (buildCounterElectionOfficial < 3) {
- o.emailAddress = "foo";
- o.faxNumber = "foo";
- o.name = "foo";
- o.officePhoneNumber = "foo";
- o.title = "foo";
- }
- buildCounterElectionOfficial--;
- return o;
-}
-
-checkElectionOfficial(api.ElectionOfficial o) {
- buildCounterElectionOfficial++;
- if (buildCounterElectionOfficial < 3) {
- unittest.expect(o.emailAddress, unittest.equals('foo'));
- unittest.expect(o.faxNumber, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.officePhoneNumber, unittest.equals('foo'));
- unittest.expect(o.title, unittest.equals('foo'));
- }
- buildCounterElectionOfficial--;
-}
-
-buildUnnamed73() {
- var o = new core.List<api.Election>();
- o.add(buildElection());
- o.add(buildElection());
- return o;
-}
-
-checkUnnamed73(core.List<api.Election> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkElection(o[0]);
- checkElection(o[1]);
-}
-
-core.int buildCounterElectionsQueryResponse = 0;
-buildElectionsQueryResponse() {
- var o = new api.ElectionsQueryResponse();
- buildCounterElectionsQueryResponse++;
- if (buildCounterElectionsQueryResponse < 3) {
- o.elections = buildUnnamed73();
- o.kind = "foo";
- }
- buildCounterElectionsQueryResponse--;
- return o;
-}
-
-checkElectionsQueryResponse(api.ElectionsQueryResponse o) {
- buildCounterElectionsQueryResponse++;
- if (buildCounterElectionsQueryResponse < 3) {
- checkUnnamed73(o.elections);
- unittest.expect(o.kind, unittest.equals('foo'));
- }
- buildCounterElectionsQueryResponse--;
-}
-
-core.int buildCounterElectoralDistrict = 0;
-buildElectoralDistrict() {
- var o = new api.ElectoralDistrict();
- buildCounterElectoralDistrict++;
- if (buildCounterElectoralDistrict < 3) {
- o.id = "foo";
- o.name = "foo";
- o.scope = "foo";
- }
- buildCounterElectoralDistrict--;
- return o;
-}
-
-checkElectoralDistrict(api.ElectoralDistrict o) {
- buildCounterElectoralDistrict++;
- if (buildCounterElectoralDistrict < 3) {
- unittest.expect(o.id, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.scope, unittest.equals('foo'));
- }
- buildCounterElectoralDistrict--;
-}
-
-buildUnnamed74() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed74(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-buildUnnamed75() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed75(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-core.int buildCounterGeographicDivision = 0;
-buildGeographicDivision() {
- var o = new api.GeographicDivision();
- buildCounterGeographicDivision++;
- if (buildCounterGeographicDivision < 3) {
- o.alsoKnownAs = buildUnnamed74();
- o.name = "foo";
- o.officeIds = buildUnnamed75();
- o.scope = "foo";
- }
- buildCounterGeographicDivision--;
- return o;
-}
-
-checkGeographicDivision(api.GeographicDivision o) {
- buildCounterGeographicDivision++;
- if (buildCounterGeographicDivision < 3) {
- checkUnnamed74(o.alsoKnownAs);
- unittest.expect(o.name, unittest.equals('foo'));
- checkUnnamed75(o.officeIds);
- unittest.expect(o.scope, unittest.equals('foo'));
- }
- buildCounterGeographicDivision--;
-}
-
-buildUnnamed76() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed76(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-buildUnnamed77() {
- var o = new core.List<api.Source>();
- o.add(buildSource());
- o.add(buildSource());
- return o;
-}
-
-checkUnnamed77(core.List<api.Source> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkSource(o[0]);
- checkSource(o[1]);
-}
-
-core.int buildCounterOffice = 0;
-buildOffice() {
- var o = new api.Office();
- buildCounterOffice++;
- if (buildCounterOffice < 3) {
- o.divisionId = "foo";
- o.level = "foo";
- o.name = "foo";
- o.officialIds = buildUnnamed76();
- o.sources = buildUnnamed77();
- }
- buildCounterOffice--;
- return o;
-}
-
-checkOffice(api.Office o) {
- buildCounterOffice++;
- if (buildCounterOffice < 3) {
- unittest.expect(o.divisionId, unittest.equals('foo'));
- unittest.expect(o.level, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- checkUnnamed76(o.officialIds);
- checkUnnamed77(o.sources);
- }
- buildCounterOffice--;
-}
-
-buildUnnamed78() {
- var o = new core.List<api.SimpleAddressType>();
- o.add(buildSimpleAddressType());
- o.add(buildSimpleAddressType());
- return o;
-}
-
-checkUnnamed78(core.List<api.SimpleAddressType> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkSimpleAddressType(o[0]);
- checkSimpleAddressType(o[1]);
-}
-
-buildUnnamed79() {
- var o = new core.List<api.Channel>();
- o.add(buildChannel());
- o.add(buildChannel());
- return o;
-}
-
-checkUnnamed79(core.List<api.Channel> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkChannel(o[0]);
- checkChannel(o[1]);
-}
-
-buildUnnamed80() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed80(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-buildUnnamed81() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed81(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-buildUnnamed82() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed82(core.List<core.String> o) {
- unittest.expect(o, unittest.hasLength(2));
- unittest.expect(o[0], unittest.equals('foo'));
- unittest.expect(o[1], unittest.equals('foo'));
-}
-
-core.int buildCounterOfficial = 0;
-buildOfficial() {
- var o = new api.Official();
- buildCounterOfficial++;
- if (buildCounterOfficial < 3) {
- o.address = buildUnnamed78();
- o.channels = buildUnnamed79();
- o.emails = buildUnnamed80();
- o.name = "foo";
- o.party = "foo";
- o.phones = buildUnnamed81();
- o.photoUrl = "foo";
- o.urls = buildUnnamed82();
- }
- buildCounterOfficial--;
- return o;
-}
-
-checkOfficial(api.Official o) {
- buildCounterOfficial++;
- if (buildCounterOfficial < 3) {
- checkUnnamed78(o.address);
- checkUnnamed79(o.channels);
- checkUnnamed80(o.emails);
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.party, unittest.equals('foo'));
- checkUnnamed81(o.phones);
- unittest.expect(o.photoUrl, unittest.equals('foo'));
- checkUnnamed82(o.urls);
- }
- buildCounterOfficial--;
-}
-
-buildUnnamed83() {
- var o = new core.List<api.Source>();
- o.add(buildSource());
- o.add(buildSource());
- return o;
-}
-
-checkUnnamed83(core.List<api.Source> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkSource(o[0]);
- checkSource(o[1]);
-}
-
-core.int buildCounterPollingLocation = 0;
-buildPollingLocation() {
- var o = new api.PollingLocation();
- buildCounterPollingLocation++;
- if (buildCounterPollingLocation < 3) {
- o.address = buildSimpleAddressType();
- o.endDate = "foo";
- o.id = "foo";
- o.name = "foo";
- o.notes = "foo";
- o.pollingHours = "foo";
- o.sources = buildUnnamed83();
- o.startDate = "foo";
- o.voterServices = "foo";
- }
- buildCounterPollingLocation--;
- return o;
-}
-
-checkPollingLocation(api.PollingLocation o) {
- buildCounterPollingLocation++;
- if (buildCounterPollingLocation < 3) {
- checkSimpleAddressType(o.address);
- unittest.expect(o.endDate, unittest.equals('foo'));
- unittest.expect(o.id, unittest.equals('foo'));
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.notes, unittest.equals('foo'));
- unittest.expect(o.pollingHours, unittest.equals('foo'));
- checkUnnamed83(o.sources);
- unittest.expect(o.startDate, unittest.equals('foo'));
- unittest.expect(o.voterServices, unittest.equals('foo'));
- }
- buildCounterPollingLocation--;
-}
-
-core.int buildCounterRepresentativeInfoRequest = 0;
-buildRepresentativeInfoRequest() {
- var o = new api.RepresentativeInfoRequest();
- buildCounterRepresentativeInfoRequest++;
- if (buildCounterRepresentativeInfoRequest < 3) {
- o.address = "foo";
- }
- buildCounterRepresentativeInfoRequest--;
- return o;
-}
-
-checkRepresentativeInfoRequest(api.RepresentativeInfoRequest o) {
- buildCounterRepresentativeInfoRequest++;
- if (buildCounterRepresentativeInfoRequest < 3) {
- unittest.expect(o.address, unittest.equals('foo'));
- }
- buildCounterRepresentativeInfoRequest--;
-}
-
-buildUnnamed84() {
- var o = new core.Map<core.String, api.GeographicDivision>();
- o["x"] = buildGeographicDivision();
- o["y"] = buildGeographicDivision();
- return o;
-}
-
-checkUnnamed84(core.Map<core.String, api.GeographicDivision> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkGeographicDivision(o["x"]);
- checkGeographicDivision(o["y"]);
-}
-
-buildUnnamed85() {
- var o = new core.Map<core.String, api.Office>();
- o["x"] = buildOffice();
- o["y"] = buildOffice();
- return o;
-}
-
-checkUnnamed85(core.Map<core.String, api.Office> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkOffice(o["x"]);
- checkOffice(o["y"]);
-}
-
-buildUnnamed86() {
- var o = new core.Map<core.String, api.Official>();
- o["x"] = buildOfficial();
- o["y"] = buildOfficial();
- return o;
-}
-
-checkUnnamed86(core.Map<core.String, api.Official> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkOfficial(o["x"]);
- checkOfficial(o["y"]);
-}
-
-core.int buildCounterRepresentativeInfoResponse = 0;
-buildRepresentativeInfoResponse() {
- var o = new api.RepresentativeInfoResponse();
- buildCounterRepresentativeInfoResponse++;
- if (buildCounterRepresentativeInfoResponse < 3) {
- o.divisions = buildUnnamed84();
- o.kind = "foo";
- o.normalizedInput = buildSimpleAddressType();
- o.offices = buildUnnamed85();
- o.officials = buildUnnamed86();
- o.status = "foo";
- }
- buildCounterRepresentativeInfoResponse--;
- return o;
-}
-
-checkRepresentativeInfoResponse(api.RepresentativeInfoResponse o) {
- buildCounterRepresentativeInfoResponse++;
- if (buildCounterRepresentativeInfoResponse < 3) {
- checkUnnamed84(o.divisions);
- unittest.expect(o.kind, unittest.equals('foo'));
- checkSimpleAddressType(o.normalizedInput);
- checkUnnamed85(o.offices);
- checkUnnamed86(o.officials);
- unittest.expect(o.status, unittest.equals('foo'));
- }
- buildCounterRepresentativeInfoResponse--;
-}
-
-core.int buildCounterSimpleAddressType = 0;
-buildSimpleAddressType() {
- var o = new api.SimpleAddressType();
- buildCounterSimpleAddressType++;
- if (buildCounterSimpleAddressType < 3) {
- o.city = "foo";
- o.line1 = "foo";
- o.line2 = "foo";
- o.line3 = "foo";
- o.locationName = "foo";
- o.state = "foo";
- o.zip = "foo";
- }
- buildCounterSimpleAddressType--;
- return o;
-}
-
-checkSimpleAddressType(api.SimpleAddressType o) {
- buildCounterSimpleAddressType++;
- if (buildCounterSimpleAddressType < 3) {
- unittest.expect(o.city, unittest.equals('foo'));
- unittest.expect(o.line1, unittest.equals('foo'));
- unittest.expect(o.line2, unittest.equals('foo'));
- unittest.expect(o.line3, unittest.equals('foo'));
- unittest.expect(o.locationName, unittest.equals('foo'));
- unittest.expect(o.state, unittest.equals('foo'));
- unittest.expect(o.zip, unittest.equals('foo'));
- }
- buildCounterSimpleAddressType--;
-}
-
-core.int buildCounterSource = 0;
-buildSource() {
- var o = new api.Source();
- buildCounterSource++;
- if (buildCounterSource < 3) {
- o.name = "foo";
- o.official = true;
- }
- buildCounterSource--;
- return o;
-}
-
-checkSource(api.Source o) {
- buildCounterSource++;
- if (buildCounterSource < 3) {
- unittest.expect(o.name, unittest.equals('foo'));
- unittest.expect(o.official, unittest.isTrue);
- }
- buildCounterSource--;
-}
-
-core.int buildCounterVoterInfoRequest = 0;
-buildVoterInfoRequest() {
- var o = new api.VoterInfoRequest();
- buildCounterVoterInfoRequest++;
- if (buildCounterVoterInfoRequest < 3) {
- o.address = "foo";
- }
- buildCounterVoterInfoRequest--;
- return o;
-}
-
-checkVoterInfoRequest(api.VoterInfoRequest o) {
- buildCounterVoterInfoRequest++;
- if (buildCounterVoterInfoRequest < 3) {
- unittest.expect(o.address, unittest.equals('foo'));
- }
- buildCounterVoterInfoRequest--;
-}
-
-buildUnnamed87() {
- var o = new core.List<api.Contest>();
- o.add(buildContest());
- o.add(buildContest());
- return o;
-}
-
-checkUnnamed87(core.List<api.Contest> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkContest(o[0]);
- checkContest(o[1]);
-}
-
-buildUnnamed88() {
- var o = new core.List<api.PollingLocation>();
- o.add(buildPollingLocation());
- o.add(buildPollingLocation());
- return o;
-}
-
-checkUnnamed88(core.List<api.PollingLocation> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkPollingLocation(o[0]);
- checkPollingLocation(o[1]);
-}
-
-buildUnnamed89() {
- var o = new core.List<api.PollingLocation>();
- o.add(buildPollingLocation());
- o.add(buildPollingLocation());
- return o;
-}
-
-checkUnnamed89(core.List<api.PollingLocation> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkPollingLocation(o[0]);
- checkPollingLocation(o[1]);
-}
-
-buildUnnamed90() {
- var o = new core.List<api.AdministrationRegion>();
- o.add(buildAdministrationRegion());
- o.add(buildAdministrationRegion());
- return o;
-}
-
-checkUnnamed90(core.List<api.AdministrationRegion> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkAdministrationRegion(o[0]);
- checkAdministrationRegion(o[1]);
-}
-
-core.int buildCounterVoterInfoResponse = 0;
-buildVoterInfoResponse() {
- var o = new api.VoterInfoResponse();
- buildCounterVoterInfoResponse++;
- if (buildCounterVoterInfoResponse < 3) {
- o.contests = buildUnnamed87();
- o.earlyVoteSites = buildUnnamed88();
- o.election = buildElection();
- o.kind = "foo";
- o.normalizedInput = buildSimpleAddressType();
- o.pollingLocations = buildUnnamed89();
- o.state = buildUnnamed90();
- o.status = "foo";
- }
- buildCounterVoterInfoResponse--;
- return o;
-}
-
-checkVoterInfoResponse(api.VoterInfoResponse o) {
- buildCounterVoterInfoResponse++;
- if (buildCounterVoterInfoResponse < 3) {
- checkUnnamed87(o.contests);
- checkUnnamed88(o.earlyVoteSites);
- checkElection(o.election);
- unittest.expect(o.kind, unittest.equals('foo'));
- checkSimpleAddressType(o.normalizedInput);
- checkUnnamed89(o.pollingLocations);
- checkUnnamed90(o.state);
- unittest.expect(o.status, unittest.equals('foo'));
- }
- buildCounterVoterInfoResponse--;
-}
-
-
-main() {
- unittest.group("obj-schema-AdministrationRegion", () {
- unittest.test("to-json--from-json", () {
- var o = buildAdministrationRegion();
- var od = new api.AdministrationRegion.fromJson(o.toJson());
- checkAdministrationRegion(od);
- });
- });
-
-
- unittest.group("obj-schema-AdministrativeBody", () {
- unittest.test("to-json--from-json", () {
- var o = buildAdministrativeBody();
- var od = new api.AdministrativeBody.fromJson(o.toJson());
- checkAdministrativeBody(od);
- });
- });
-
-
- unittest.group("obj-schema-Candidate", () {
- unittest.test("to-json--from-json", () {
- var o = buildCandidate();
- var od = new api.Candidate.fromJson(o.toJson());
- checkCandidate(od);
- });
- });
-
-
- unittest.group("obj-schema-Channel", () {
- unittest.test("to-json--from-json", () {
- var o = buildChannel();
- var od = new api.Channel.fromJson(o.toJson());
- checkChannel(od);
- });
- });
-
-
- unittest.group("obj-schema-Contest", () {
- unittest.test("to-json--from-json", () {
- var o = buildContest();
- var od = new api.Contest.fromJson(o.toJson());
- checkContest(od);
- });
- });
-
-
- unittest.group("obj-schema-DivisionSearchResponse", () {
- unittest.test("to-json--from-json", () {
- var o = buildDivisionSearchResponse();
- var od = new api.DivisionSearchResponse.fromJson(o.toJson());
- checkDivisionSearchResponse(od);
- });
- });
-
-
- unittest.group("obj-schema-DivisionSearchResult", () {
- unittest.test("to-json--from-json", () {
- var o = buildDivisionSearchResult();
- var od = new api.DivisionSearchResult.fromJson(o.toJson());
- checkDivisionSearchResult(od);
- });
- });
-
-
- unittest.group("obj-schema-Election", () {
- unittest.test("to-json--from-json", () {
- var o = buildElection();
- var od = new api.Election.fromJson(o.toJson());
- checkElection(od);
- });
- });
-
-
- unittest.group("obj-schema-ElectionOfficial", () {
- unittest.test("to-json--from-json", () {
- var o = buildElectionOfficial();
- var od = new api.ElectionOfficial.fromJson(o.toJson());
- checkElectionOfficial(od);
- });
- });
-
-
- unittest.group("obj-schema-ElectionsQueryResponse", () {
- unittest.test("to-json--from-json", () {
- var o = buildElectionsQueryResponse();
- var od = new api.ElectionsQueryResponse.fromJson(o.toJson());
- checkElectionsQueryResponse(od);
- });
- });
-
-
- unittest.group("obj-schema-ElectoralDistrict", () {
- unittest.test("to-json--from-json", () {
- var o = buildElectoralDistrict();
- var od = new api.ElectoralDistrict.fromJson(o.toJson());
- checkElectoralDistrict(od);
- });
- });
-
-
- unittest.group("obj-schema-GeographicDivision", () {
- unittest.test("to-json--from-json", () {
- var o = buildGeographicDivision();
- var od = new api.GeographicDivision.fromJson(o.toJson());
- checkGeographicDivision(od);
- });
- });
-
-
- unittest.group("obj-schema-Office", () {
- unittest.test("to-json--from-json", () {
- var o = buildOffice();
- var od = new api.Office.fromJson(o.toJson());
- checkOffice(od);
- });
- });
-
-
- unittest.group("obj-schema-Official", () {
- unittest.test("to-json--from-json", () {
- var o = buildOfficial();
- var od = new api.Official.fromJson(o.toJson());
- checkOfficial(od);
- });
- });
-
-
- unittest.group("obj-schema-PollingLocation", () {
- unittest.test("to-json--from-json", () {
- var o = buildPollingLocation();
- var od = new api.PollingLocation.fromJson(o.toJson());
- checkPollingLocation(od);
- });
- });
-
-
- unittest.group("obj-schema-RepresentativeInfoRequest", () {
- unittest.test("to-json--from-json", () {
- var o = buildRepresentativeInfoRequest();
- var od = new api.RepresentativeInfoRequest.fromJson(o.toJson());
- checkRepresentativeInfoRequest(od);
- });
- });
-
-
- unittest.group("obj-schema-RepresentativeInfoResponse", () {
- unittest.test("to-json--from-json", () {
- var o = buildRepresentativeInfoResponse();
- var od = new api.RepresentativeInfoResponse.fromJson(o.toJson());
- checkRepresentativeInfoResponse(od);
- });
- });
-
-
- unittest.group("obj-schema-SimpleAddressType", () {
- unittest.test("to-json--from-json", () {
- var o = buildSimpleAddressType();
- var od = new api.SimpleAddressType.fromJson(o.toJson());
- checkSimpleAddressType(od);
- });
- });
-
-
- unittest.group("obj-schema-Source", () {
- unittest.test("to-json--from-json", () {
- var o = buildSource();
- var od = new api.Source.fromJson(o.toJson());
- checkSource(od);
- });
- });
-
-
- unittest.group("obj-schema-VoterInfoRequest", () {
- unittest.test("to-json--from-json", () {
- var o = buildVoterInfoRequest();
- var od = new api.VoterInfoRequest.fromJson(o.toJson());
- checkVoterInfoRequest(od);
- });
- });
-
-
- unittest.group("obj-schema-VoterInfoResponse", () {
- unittest.test("to-json--from-json", () {
- var o = buildVoterInfoResponse();
- var od = new api.VoterInfoResponse.fromJson(o.toJson());
- checkVoterInfoResponse(od);
- });
- });
-
-
- unittest.group("resource-DivisionsResourceApi", () {
- unittest.test("method--search", () {
-
- var mock = new common_test.HttpServerMock();
- api.DivisionsResourceApi res = new api.CivicinfoApi(mock).divisions;
- var arg_query = "foo";
- mock.register(unittest.expectAsync((http.BaseRequest req, json) {
- var path = (req.url).path;
- var pathOffset = 0;
- var index;
- var subPart;
- unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("/civicinfo/v1/"));
- pathOffset += 14;
- unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.equals("representatives/division_search"));
- pathOffset += 31;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
- parseBool(n) {
- if (n == "true") return true;
- if (n == "false") return false;
- if (n == null) return null;
- throw new core.ArgumentError("Invalid boolean: $n");
- }
- if (query.length > 0) {
- for (var part in query.split("&")) {
- var keyvalue = part.split("=");
- addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
- }
- }
- unittest.expect(queryMap["query"].first, unittest.equals(arg_query));
-
-
- var h = {
- "content-type" : "application/json; charset=utf-8",
- };
- var resp = convert.JSON.encode(buildDivisionSearchResponse());
- return new async.Future.value(common_test.stringResponse(200, h, resp));
- }), true);
- res.search(query: arg_query).then(unittest.expectAsync(((api.DivisionSearchResponse response) {
- checkDivisionSearchResponse(response);
- })));
- });
-
- });
-
-
- unittest.group("resource-ElectionsResourceApi", () {
- unittest.test("method--electionQuery", () {
-
- var mock = new common_test.HttpServerMock();
- api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections;
- mock.register(unittest.expectAsync((http.BaseRequest req, json) {
- var path = (req.url).path;
- var pathOffset = 0;
- var index;
- var subPart;
- unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("/civicinfo/v1/"));
- pathOffset += 14;
- unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("elections"));
- pathOffset += 9;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
- parseBool(n) {
- if (n == "true") return true;
- if (n == "false") return false;
- if (n == null) return null;
- throw new core.ArgumentError("Invalid boolean: $n");
- }
- if (query.length > 0) {
- for (var part in query.split("&")) {
- var keyvalue = part.split("=");
- addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
- }
- }
-
-
- var h = {
- "content-type" : "application/json; charset=utf-8",
- };
- var resp = convert.JSON.encode(buildElectionsQueryResponse());
- return new async.Future.value(common_test.stringResponse(200, h, resp));
- }), true);
- res.electionQuery().then(unittest.expectAsync(((api.ElectionsQueryResponse response) {
- checkElectionsQueryResponse(response);
- })));
- });
-
- unittest.test("method--voterInfoQuery", () {
-
- var mock = new common_test.HttpServerMock();
- api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections;
- var arg_request = buildVoterInfoRequest();
- var arg_electionId = "foo";
- var arg_officialOnly = true;
- mock.register(unittest.expectAsync((http.BaseRequest req, json) {
- var obj = new api.VoterInfoRequest.fromJson(json);
- checkVoterInfoRequest(obj);
-
- var path = (req.url).path;
- var pathOffset = 0;
- var index;
- var subPart;
- unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("/civicinfo/v1/"));
- pathOffset += 14;
- unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("voterinfo/"));
- pathOffset += 10;
- index = path.indexOf("/lookup", pathOffset);
- unittest.expect(index >= 0, unittest.isTrue);
- subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
- pathOffset = index;
- unittest.expect(subPart, unittest.equals("$arg_electionId"));
- unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("/lookup"));
- pathOffset += 7;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
- parseBool(n) {
- if (n == "true") return true;
- if (n == "false") return false;
- if (n == null) return null;
- throw new core.ArgumentError("Invalid boolean: $n");
- }
- if (query.length > 0) {
- for (var part in query.split("&")) {
- var keyvalue = part.split("=");
- addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
- }
- }
- unittest.expect(queryMap["officialOnly"].first, unittest.equals("$arg_officialOnly"));
-
-
- var h = {
- "content-type" : "application/json; charset=utf-8",
- };
- var resp = convert.JSON.encode(buildVoterInfoResponse());
- return new async.Future.value(common_test.stringResponse(200, h, resp));
- }), true);
- res.voterInfoQuery(arg_request, arg_electionId, officialOnly: arg_officialOnly).then(unittest.expectAsync(((api.VoterInfoResponse response) {
- checkVoterInfoResponse(response);
- })));
- });
-
- });
-
-
- unittest.group("resource-RepresentativesResourceApi", () {
- unittest.test("method--representativeInfoQuery", () {
-
- var mock = new common_test.HttpServerMock();
- api.RepresentativesResourceApi res = new api.CivicinfoApi(mock).representatives;
- var arg_request = buildRepresentativeInfoRequest();
- var arg_includeOffices = true;
- var arg_ocdId = "foo";
- var arg_recursive = true;
- mock.register(unittest.expectAsync((http.BaseRequest req, json) {
- var obj = new api.RepresentativeInfoRequest.fromJson(json);
- checkRepresentativeInfoRequest(obj);
-
- var path = (req.url).path;
- var pathOffset = 0;
- var index;
- var subPart;
- unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.equals("/civicinfo/v1/"));
- pathOffset += 14;
- unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("representatives/lookup"));
- pathOffset += 22;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
- parseBool(n) {
- if (n == "true") return true;
- if (n == "false") return false;
- if (n == null) return null;
- throw new core.ArgumentError("Invalid boolean: $n");
- }
- if (query.length > 0) {
- for (var part in query.split("&")) {
- var keyvalue = part.split("=");
- addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
- }
- }
- unittest.expect(queryMap["includeOffices"].first, unittest.equals("$arg_includeOffices"));
- unittest.expect(queryMap["ocdId"].first, unittest.equals(arg_ocdId));
- unittest.expect(queryMap["recursive"].first, unittest.equals("$arg_recursive"));
-
-
- var h = {
- "content-type" : "application/json; charset=utf-8",
- };
- var resp = convert.JSON.encode(buildRepresentativeInfoResponse());
- return new async.Future.value(common_test.stringResponse(200, h, resp));
- }), true);
- res.representativeInfoQuery(arg_request, includeOffices: arg_includeOffices, ocdId: arg_ocdId, recursive: arg_recursive).then(unittest.expectAsync(((api.RepresentativeInfoResponse response) {
- checkRepresentativeInfoResponse(response);
- })));
- });
-
- });
-
-
-}
-
« no previous file with comments | « generated/googleapis/test/civicinfo/us_v1_test.dart ('k') | generated/googleapis/test/civicinfo/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698