blob: 325ef8b5677008e881cd8c3fdaf3c6f5b074271b [file]
library googleapis.civicinfo.v2.test;
import "dart:core" as core;
import "dart:async" as async;
import "dart:convert" as convert;
import 'package:http/http.dart' as http;
import 'package:test/test.dart' as unittest;
import 'package:googleapis/civicinfo/v2.dart' as api;
class HttpServerMock extends http.BaseClient {
core.Function _callback;
core.bool _expectJson;
void register(core.Function callback, core.bool expectJson) {
_callback = callback;
_expectJson = expectJson;
}
async.Future<http.StreamedResponse> send(http.BaseRequest request) {
if (_expectJson) {
return request
.finalize()
.transform(convert.utf8.decoder)
.join('')
.then((core.String jsonString) {
if (jsonString.isEmpty) {
return _callback(request, null);
} else {
return _callback(request, convert.json.decode(jsonString));
}
});
} else {
var stream = request.finalize();
if (stream == null) {
return _callback(request, []);
} else {
return stream.toBytes().then((data) {
return _callback(request, data);
});
}
}
}
}
http.StreamedResponse stringResponse(core.int status,
core.Map<core.String, core.String> headers, core.String body) {
var stream = new async.Stream.fromIterable([convert.utf8.encode(body)]);
return new http.StreamedResponse(stream, status, headers: headers);
}
buildUnnamed4970() {
var o = new core.List<api.Source>();
o.add(buildSource());
o.add(buildSource());
return o;
}
checkUnnamed4970(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 = buildUnnamed4970();
}
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'));
checkUnnamed4970(o.sources);
}
buildCounterAdministrationRegion--;
}
buildUnnamed4971() {
var o = new core.List<api.ElectionOfficial>();
o.add(buildElectionOfficial());
o.add(buildElectionOfficial());
return o;
}
checkUnnamed4971(core.List<api.ElectionOfficial> o) {
unittest.expect(o, unittest.hasLength(2));
checkElectionOfficial(o[0]);
checkElectionOfficial(o[1]);
}
buildUnnamed4972() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4972(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.electionNoticeText = "foo";
o.electionNoticeUrl = "foo";
o.electionOfficials = buildUnnamed4971();
o.electionRegistrationConfirmationUrl = "foo";
o.electionRegistrationUrl = "foo";
o.electionRulesUrl = "foo";
o.hoursOfOperation = "foo";
o.name = "foo";
o.physicalAddress = buildSimpleAddressType();
o.voterServices = buildUnnamed4972();
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'));
unittest.expect(o.electionNoticeText, unittest.equals('foo'));
unittest.expect(o.electionNoticeUrl, unittest.equals('foo'));
checkUnnamed4971(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);
checkUnnamed4972(o.voterServices);
unittest.expect(o.votingLocationFinderUrl, unittest.equals('foo'));
}
buildCounterAdministrativeBody--;
}
buildUnnamed4973() {
var o = new core.List<api.Channel>();
o.add(buildChannel());
o.add(buildChannel());
return o;
}
checkUnnamed4973(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 = buildUnnamed4973();
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'));
checkUnnamed4973(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--;
}
buildUnnamed4974() {
var o = new core.List<api.Candidate>();
o.add(buildCandidate());
o.add(buildCandidate());
return o;
}
checkUnnamed4974(core.List<api.Candidate> o) {
unittest.expect(o, unittest.hasLength(2));
checkCandidate(o[0]);
checkCandidate(o[1]);
}
buildUnnamed4975() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4975(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'));
}
buildUnnamed4976() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4976(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'));
}
buildUnnamed4977() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4977(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'));
}
buildUnnamed4978() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4978(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'));
}
buildUnnamed4979() {
var o = new core.List<api.Source>();
o.add(buildSource());
o.add(buildSource());
return o;
}
checkUnnamed4979(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.ballotTitle = "foo";
o.candidates = buildUnnamed4974();
o.district = buildElectoralDistrict();
o.electorateSpecifications = "foo";
o.id = "foo";
o.level = buildUnnamed4975();
o.numberElected = "foo";
o.numberVotingFor = "foo";
o.office = "foo";
o.primaryParties = buildUnnamed4976();
o.primaryParty = "foo";
o.referendumBallotResponses = buildUnnamed4977();
o.referendumBrief = "foo";
o.referendumConStatement = "foo";
o.referendumEffectOfAbstain = "foo";
o.referendumPassageThreshold = "foo";
o.referendumProStatement = "foo";
o.referendumSubtitle = "foo";
o.referendumText = "foo";
o.referendumTitle = "foo";
o.referendumUrl = "foo";
o.roles = buildUnnamed4978();
o.sources = buildUnnamed4979();
o.special = "foo";
o.type = "foo";
}
buildCounterContest--;
return o;
}
checkContest(api.Contest o) {
buildCounterContest++;
if (buildCounterContest < 3) {
unittest.expect(o.ballotPlacement, unittest.equals('foo'));
unittest.expect(o.ballotTitle, unittest.equals('foo'));
checkUnnamed4974(o.candidates);
checkElectoralDistrict(o.district);
unittest.expect(o.electorateSpecifications, unittest.equals('foo'));
unittest.expect(o.id, unittest.equals('foo'));
checkUnnamed4975(o.level);
unittest.expect(o.numberElected, unittest.equals('foo'));
unittest.expect(o.numberVotingFor, unittest.equals('foo'));
unittest.expect(o.office, unittest.equals('foo'));
checkUnnamed4976(o.primaryParties);
unittest.expect(o.primaryParty, unittest.equals('foo'));
checkUnnamed4977(o.referendumBallotResponses);
unittest.expect(o.referendumBrief, unittest.equals('foo'));
unittest.expect(o.referendumConStatement, unittest.equals('foo'));
unittest.expect(o.referendumEffectOfAbstain, unittest.equals('foo'));
unittest.expect(o.referendumPassageThreshold, unittest.equals('foo'));
unittest.expect(o.referendumProStatement, unittest.equals('foo'));
unittest.expect(o.referendumSubtitle, unittest.equals('foo'));
unittest.expect(o.referendumText, unittest.equals('foo'));
unittest.expect(o.referendumTitle, unittest.equals('foo'));
unittest.expect(o.referendumUrl, unittest.equals('foo'));
checkUnnamed4978(o.roles);
checkUnnamed4979(o.sources);
unittest.expect(o.special, unittest.equals('foo'));
unittest.expect(o.type, unittest.equals('foo'));
}
buildCounterContest--;
}
buildUnnamed4980() {
var o = new core.List<api.DivisionSearchResult>();
o.add(buildDivisionSearchResult());
o.add(buildDivisionSearchResult());
return o;
}
checkUnnamed4980(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 = buildUnnamed4980();
}
buildCounterDivisionSearchResponse--;
return o;
}
checkDivisionSearchResponse(api.DivisionSearchResponse o) {
buildCounterDivisionSearchResponse++;
if (buildCounterDivisionSearchResponse < 3) {
unittest.expect(o.kind, unittest.equals('foo'));
checkUnnamed4980(o.results);
}
buildCounterDivisionSearchResponse--;
}
buildUnnamed4981() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4981(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 = buildUnnamed4981();
o.name = "foo";
o.ocdId = "foo";
}
buildCounterDivisionSearchResult--;
return o;
}
checkDivisionSearchResult(api.DivisionSearchResult o) {
buildCounterDivisionSearchResult++;
if (buildCounterDivisionSearchResult < 3) {
checkUnnamed4981(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";
o.ocdDivisionId = "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'));
unittest.expect(o.ocdDivisionId, 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--;
}
buildUnnamed4982() {
var o = new core.List<api.Election>();
o.add(buildElection());
o.add(buildElection());
return o;
}
checkUnnamed4982(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 = buildUnnamed4982();
o.kind = "foo";
}
buildCounterElectionsQueryResponse--;
return o;
}
checkElectionsQueryResponse(api.ElectionsQueryResponse o) {
buildCounterElectionsQueryResponse++;
if (buildCounterElectionsQueryResponse < 3) {
checkUnnamed4982(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--;
}
buildUnnamed4983() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4983(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'));
}
buildUnnamed4984() {
var o = new core.List<core.int>();
o.add(42);
o.add(42);
return o;
}
checkUnnamed4984(core.List<core.int> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals(42));
unittest.expect(o[1], unittest.equals(42));
}
core.int buildCounterGeographicDivision = 0;
buildGeographicDivision() {
var o = new api.GeographicDivision();
buildCounterGeographicDivision++;
if (buildCounterGeographicDivision < 3) {
o.alsoKnownAs = buildUnnamed4983();
o.name = "foo";
o.officeIndices = buildUnnamed4984();
}
buildCounterGeographicDivision--;
return o;
}
checkGeographicDivision(api.GeographicDivision o) {
buildCounterGeographicDivision++;
if (buildCounterGeographicDivision < 3) {
checkUnnamed4983(o.alsoKnownAs);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed4984(o.officeIndices);
}
buildCounterGeographicDivision--;
}
buildUnnamed4985() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4985(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'));
}
buildUnnamed4986() {
var o = new core.List<core.int>();
o.add(42);
o.add(42);
return o;
}
checkUnnamed4986(core.List<core.int> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals(42));
unittest.expect(o[1], unittest.equals(42));
}
buildUnnamed4987() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4987(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'));
}
buildUnnamed4988() {
var o = new core.List<api.Source>();
o.add(buildSource());
o.add(buildSource());
return o;
}
checkUnnamed4988(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.levels = buildUnnamed4985();
o.name = "foo";
o.officialIndices = buildUnnamed4986();
o.roles = buildUnnamed4987();
o.sources = buildUnnamed4988();
}
buildCounterOffice--;
return o;
}
checkOffice(api.Office o) {
buildCounterOffice++;
if (buildCounterOffice < 3) {
unittest.expect(o.divisionId, unittest.equals('foo'));
checkUnnamed4985(o.levels);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed4986(o.officialIndices);
checkUnnamed4987(o.roles);
checkUnnamed4988(o.sources);
}
buildCounterOffice--;
}
buildUnnamed4989() {
var o = new core.List<api.SimpleAddressType>();
o.add(buildSimpleAddressType());
o.add(buildSimpleAddressType());
return o;
}
checkUnnamed4989(core.List<api.SimpleAddressType> o) {
unittest.expect(o, unittest.hasLength(2));
checkSimpleAddressType(o[0]);
checkSimpleAddressType(o[1]);
}
buildUnnamed4990() {
var o = new core.List<api.Channel>();
o.add(buildChannel());
o.add(buildChannel());
return o;
}
checkUnnamed4990(core.List<api.Channel> o) {
unittest.expect(o, unittest.hasLength(2));
checkChannel(o[0]);
checkChannel(o[1]);
}
buildUnnamed4991() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4991(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'));
}
buildUnnamed4992() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4992(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'));
}
buildUnnamed4993() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed4993(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 = buildUnnamed4989();
o.channels = buildUnnamed4990();
o.emails = buildUnnamed4991();
o.name = "foo";
o.party = "foo";
o.phones = buildUnnamed4992();
o.photoUrl = "foo";
o.urls = buildUnnamed4993();
}
buildCounterOfficial--;
return o;
}
checkOfficial(api.Official o) {
buildCounterOfficial++;
if (buildCounterOfficial < 3) {
checkUnnamed4989(o.address);
checkUnnamed4990(o.channels);
checkUnnamed4991(o.emails);
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.party, unittest.equals('foo'));
checkUnnamed4992(o.phones);
unittest.expect(o.photoUrl, unittest.equals('foo'));
checkUnnamed4993(o.urls);
}
buildCounterOfficial--;
}
buildUnnamed4994() {
var o = new core.List<api.Source>();
o.add(buildSource());
o.add(buildSource());
return o;
}
checkUnnamed4994(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.latitude = 42.0;
o.longitude = 42.0;
o.name = "foo";
o.notes = "foo";
o.pollingHours = "foo";
o.sources = buildUnnamed4994();
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.latitude, unittest.equals(42.0));
unittest.expect(o.longitude, unittest.equals(42.0));
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.notes, unittest.equals('foo'));
unittest.expect(o.pollingHours, unittest.equals('foo'));
checkUnnamed4994(o.sources);
unittest.expect(o.startDate, unittest.equals('foo'));
unittest.expect(o.voterServices, unittest.equals('foo'));
}
buildCounterPollingLocation--;
}
buildUnnamed4995() {
var o = new core.Map<core.String, api.GeographicDivision>();
o["x"] = buildGeographicDivision();
o["y"] = buildGeographicDivision();
return o;
}
checkUnnamed4995(core.Map<core.String, api.GeographicDivision> o) {
unittest.expect(o, unittest.hasLength(2));
checkGeographicDivision(o["x"]);
checkGeographicDivision(o["y"]);
}
buildUnnamed4996() {
var o = new core.List<api.Office>();
o.add(buildOffice());
o.add(buildOffice());
return o;
}
checkUnnamed4996(core.List<api.Office> o) {
unittest.expect(o, unittest.hasLength(2));
checkOffice(o[0]);
checkOffice(o[1]);
}
buildUnnamed4997() {
var o = new core.List<api.Official>();
o.add(buildOfficial());
o.add(buildOfficial());
return o;
}
checkUnnamed4997(core.List<api.Official> o) {
unittest.expect(o, unittest.hasLength(2));
checkOfficial(o[0]);
checkOfficial(o[1]);
}
core.int buildCounterRepresentativeInfoData = 0;
buildRepresentativeInfoData() {
var o = new api.RepresentativeInfoData();
buildCounterRepresentativeInfoData++;
if (buildCounterRepresentativeInfoData < 3) {
o.divisions = buildUnnamed4995();
o.offices = buildUnnamed4996();
o.officials = buildUnnamed4997();
}
buildCounterRepresentativeInfoData--;
return o;
}
checkRepresentativeInfoData(api.RepresentativeInfoData o) {
buildCounterRepresentativeInfoData++;
if (buildCounterRepresentativeInfoData < 3) {
checkUnnamed4995(o.divisions);
checkUnnamed4996(o.offices);
checkUnnamed4997(o.officials);
}
buildCounterRepresentativeInfoData--;
}
buildUnnamed4998() {
var o = new core.Map<core.String, api.GeographicDivision>();
o["x"] = buildGeographicDivision();
o["y"] = buildGeographicDivision();
return o;
}
checkUnnamed4998(core.Map<core.String, api.GeographicDivision> o) {
unittest.expect(o, unittest.hasLength(2));
checkGeographicDivision(o["x"]);
checkGeographicDivision(o["y"]);
}
buildUnnamed4999() {
var o = new core.List<api.Office>();
o.add(buildOffice());
o.add(buildOffice());
return o;
}
checkUnnamed4999(core.List<api.Office> o) {
unittest.expect(o, unittest.hasLength(2));
checkOffice(o[0]);
checkOffice(o[1]);
}
buildUnnamed5000() {
var o = new core.List<api.Official>();
o.add(buildOfficial());
o.add(buildOfficial());
return o;
}
checkUnnamed5000(core.List<api.Official> o) {
unittest.expect(o, unittest.hasLength(2));
checkOfficial(o[0]);
checkOfficial(o[1]);
}
core.int buildCounterRepresentativeInfoResponse = 0;
buildRepresentativeInfoResponse() {
var o = new api.RepresentativeInfoResponse();
buildCounterRepresentativeInfoResponse++;
if (buildCounterRepresentativeInfoResponse < 3) {
o.divisions = buildUnnamed4998();
o.kind = "foo";
o.normalizedInput = buildSimpleAddressType();
o.offices = buildUnnamed4999();
o.officials = buildUnnamed5000();
}
buildCounterRepresentativeInfoResponse--;
return o;
}
checkRepresentativeInfoResponse(api.RepresentativeInfoResponse o) {
buildCounterRepresentativeInfoResponse++;
if (buildCounterRepresentativeInfoResponse < 3) {
checkUnnamed4998(o.divisions);
unittest.expect(o.kind, unittest.equals('foo'));
checkSimpleAddressType(o.normalizedInput);
checkUnnamed4999(o.offices);
checkUnnamed5000(o.officials);
}
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--;
}
buildUnnamed5001() {
var o = new core.List<api.Contest>();
o.add(buildContest());
o.add(buildContest());
return o;
}
checkUnnamed5001(core.List<api.Contest> o) {
unittest.expect(o, unittest.hasLength(2));
checkContest(o[0]);
checkContest(o[1]);
}
buildUnnamed5002() {
var o = new core.List<api.PollingLocation>();
o.add(buildPollingLocation());
o.add(buildPollingLocation());
return o;
}
checkUnnamed5002(core.List<api.PollingLocation> o) {
unittest.expect(o, unittest.hasLength(2));
checkPollingLocation(o[0]);
checkPollingLocation(o[1]);
}
buildUnnamed5003() {
var o = new core.List<api.PollingLocation>();
o.add(buildPollingLocation());
o.add(buildPollingLocation());
return o;
}
checkUnnamed5003(core.List<api.PollingLocation> o) {
unittest.expect(o, unittest.hasLength(2));
checkPollingLocation(o[0]);
checkPollingLocation(o[1]);
}
buildUnnamed5004() {
var o = new core.List<api.Election>();
o.add(buildElection());
o.add(buildElection());
return o;
}
checkUnnamed5004(core.List<api.Election> o) {
unittest.expect(o, unittest.hasLength(2));
checkElection(o[0]);
checkElection(o[1]);
}
buildUnnamed5005() {
var o = new core.List<api.PollingLocation>();
o.add(buildPollingLocation());
o.add(buildPollingLocation());
return o;
}
checkUnnamed5005(core.List<api.PollingLocation> o) {
unittest.expect(o, unittest.hasLength(2));
checkPollingLocation(o[0]);
checkPollingLocation(o[1]);
}
buildUnnamed5006() {
var o = new core.List<api.AdministrationRegion>();
o.add(buildAdministrationRegion());
o.add(buildAdministrationRegion());
return o;
}
checkUnnamed5006(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 = buildUnnamed5001();
o.dropOffLocations = buildUnnamed5002();
o.earlyVoteSites = buildUnnamed5003();
o.election = buildElection();
o.kind = "foo";
o.mailOnly = true;
o.normalizedInput = buildSimpleAddressType();
o.otherElections = buildUnnamed5004();
o.pollingLocations = buildUnnamed5005();
o.precinctId = "foo";
o.state = buildUnnamed5006();
}
buildCounterVoterInfoResponse--;
return o;
}
checkVoterInfoResponse(api.VoterInfoResponse o) {
buildCounterVoterInfoResponse++;
if (buildCounterVoterInfoResponse < 3) {
checkUnnamed5001(o.contests);
checkUnnamed5002(o.dropOffLocations);
checkUnnamed5003(o.earlyVoteSites);
checkElection(o.election);
unittest.expect(o.kind, unittest.equals('foo'));
unittest.expect(o.mailOnly, unittest.isTrue);
checkSimpleAddressType(o.normalizedInput);
checkUnnamed5004(o.otherElections);
checkUnnamed5005(o.pollingLocations);
unittest.expect(o.precinctId, unittest.equals('foo'));
checkUnnamed5006(o.state);
}
buildCounterVoterInfoResponse--;
}
buildUnnamed5007() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed5007(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'));
}
buildUnnamed5008() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed5008(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'));
}
buildUnnamed5009() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed5009(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'));
}
buildUnnamed5010() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed5010(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'));
}
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-RepresentativeInfoData", () {
unittest.test("to-json--from-json", () {
var o = buildRepresentativeInfoData();
var od = new api.RepresentativeInfoData.fromJson(o.toJson());
checkRepresentativeInfoData(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-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 HttpServerMock();
api.DivisionsResourceApi res = new api.CivicinfoApi(mock).divisions;
var arg_query = "foo";
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(path.substring(pathOffset, pathOffset + 22),
unittest.equals("civicinfo/v2/divisions"));
pathOffset += 22;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
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));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
"content-type": "application/json; charset=utf-8",
};
var resp = convert.json.encode(buildDivisionSearchResponse());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.search(query: arg_query, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkDivisionSearchResponse(response);
})));
});
});
unittest.group("resource-ElectionsResourceApi", () {
unittest.test("method--electionQuery", () {
var mock = new HttpServerMock();
api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections;
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(path.substring(pathOffset, pathOffset + 22),
unittest.equals("civicinfo/v2/elections"));
pathOffset += 22;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
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["fields"].first, unittest.equals(arg_$fields));
var h = {
"content-type": "application/json; charset=utf-8",
};
var resp = convert.json.encode(buildElectionsQueryResponse());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.electionQuery($fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkElectionsQueryResponse(response);
})));
});
unittest.test("method--voterInfoQuery", () {
var mock = new HttpServerMock();
api.ElectionsResourceApi res = new api.CivicinfoApi(mock).elections;
var arg_address = "foo";
var arg_electionId = "foo";
var arg_returnAllAvailableData = true;
var arg_officialOnly = true;
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(path.substring(pathOffset, pathOffset + 22),
unittest.equals("civicinfo/v2/voterinfo"));
pathOffset += 22;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
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["address"].first, unittest.equals(arg_address));
unittest.expect(
queryMap["electionId"].first, unittest.equals(arg_electionId));
unittest.expect(queryMap["returnAllAvailableData"].first,
unittest.equals("$arg_returnAllAvailableData"));
unittest.expect(queryMap["officialOnly"].first,
unittest.equals("$arg_officialOnly"));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
"content-type": "application/json; charset=utf-8",
};
var resp = convert.json.encode(buildVoterInfoResponse());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.voterInfoQuery(arg_address,
electionId: arg_electionId,
returnAllAvailableData: arg_returnAllAvailableData,
officialOnly: arg_officialOnly,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkVoterInfoResponse(response);
})));
});
});
unittest.group("resource-RepresentativesResourceApi", () {
unittest.test("method--representativeInfoByAddress", () {
var mock = new HttpServerMock();
api.RepresentativesResourceApi res =
new api.CivicinfoApi(mock).representatives;
var arg_address = "foo";
var arg_roles = buildUnnamed5007();
var arg_includeOffices = true;
var arg_levels = buildUnnamed5008();
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(path.substring(pathOffset, pathOffset + 28),
unittest.equals("civicinfo/v2/representatives"));
pathOffset += 28;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
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["address"].first, unittest.equals(arg_address));
unittest.expect(queryMap["roles"], unittest.equals(arg_roles));
unittest.expect(queryMap["includeOffices"].first,
unittest.equals("$arg_includeOffices"));
unittest.expect(queryMap["levels"], unittest.equals(arg_levels));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
"content-type": "application/json; charset=utf-8",
};
var resp = convert.json.encode(buildRepresentativeInfoResponse());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.representativeInfoByAddress(
address: arg_address,
roles: arg_roles,
includeOffices: arg_includeOffices,
levels: arg_levels,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkRepresentativeInfoResponse(response);
})));
});
unittest.test("method--representativeInfoByDivision", () {
var mock = new HttpServerMock();
api.RepresentativesResourceApi res =
new api.CivicinfoApi(mock).representatives;
var arg_ocdId = "foo";
var arg_recursive = true;
var arg_levels = buildUnnamed5009();
var arg_roles = buildUnnamed5010();
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(path.substring(pathOffset, pathOffset + 29),
unittest.equals("civicinfo/v2/representatives/"));
pathOffset += 29;
subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
pathOffset = path.length;
unittest.expect(subPart, unittest.equals("$arg_ocdId"));
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
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["recursive"].first, unittest.equals("$arg_recursive"));
unittest.expect(queryMap["levels"], unittest.equals(arg_levels));
unittest.expect(queryMap["roles"], unittest.equals(arg_roles));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
"content-type": "application/json; charset=utf-8",
};
var resp = convert.json.encode(buildRepresentativeInfoData());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.representativeInfoByDivision(arg_ocdId,
recursive: arg_recursive,
levels: arg_levels,
roles: arg_roles,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkRepresentativeInfoData(response);
})));
});
});
}