| Index: generated/googleapis/test/consumersurveys/v2_test.dart
|
| diff --git a/generated/googleapis/test/consumersurveys/v2_test.dart b/generated/googleapis/test/consumersurveys/v2_test.dart
|
| index e4d838f80059862cfcd29128182e3e998160c703..c7e41c67c245d531bb3be4af5cf221bcd8cf9f6e 100644
|
| --- a/generated/googleapis/test/consumersurveys/v2_test.dart
|
| +++ b/generated/googleapis/test/consumersurveys/v2_test.dart
|
| @@ -1,12 +1,10 @@
|
| library googleapis.consumersurveys.v2.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:test/test.dart' as unittest;
|
|
|
| import 'package:googleapis/consumersurveys/v2.dart' as api;
|
| @@ -22,7 +20,8 @@ class HttpServerMock extends http.BaseClient {
|
|
|
| async.Future<http.StreamedResponse> send(http.BaseRequest request) {
|
| if (_expectJson) {
|
| - return request.finalize()
|
| + return request
|
| + .finalize()
|
| .transform(convert.UTF8.decoder)
|
| .join('')
|
| .then((core.String jsonString) {
|
| @@ -45,20 +44,20 @@ class HttpServerMock extends http.BaseClient {
|
| }
|
| }
|
|
|
| -http.StreamedResponse stringResponse(
|
| - core.int status, core.Map<core.String, core.String> headers, core.String body) {
|
| +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);
|
| }
|
|
|
| -buildUnnamed75() {
|
| +buildUnnamed70() {
|
| var o = new core.List<api.FieldMask>();
|
| o.add(buildFieldMask());
|
| o.add(buildFieldMask());
|
| return o;
|
| }
|
|
|
| -checkUnnamed75(core.List<api.FieldMask> o) {
|
| +checkUnnamed70(core.List<api.FieldMask> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkFieldMask(o[0]);
|
| checkFieldMask(o[1]);
|
| @@ -69,7 +68,7 @@ buildFieldMask() {
|
| var o = new api.FieldMask();
|
| buildCounterFieldMask++;
|
| if (buildCounterFieldMask < 3) {
|
| - o.fields = buildUnnamed75();
|
| + o.fields = buildUnnamed70();
|
| o.id = 42;
|
| }
|
| buildCounterFieldMask--;
|
| @@ -79,20 +78,20 @@ buildFieldMask() {
|
| checkFieldMask(api.FieldMask o) {
|
| buildCounterFieldMask++;
|
| if (buildCounterFieldMask < 3) {
|
| - checkUnnamed75(o.fields);
|
| + checkUnnamed70(o.fields);
|
| unittest.expect(o.id, unittest.equals(42));
|
| }
|
| buildCounterFieldMask--;
|
| }
|
|
|
| -buildUnnamed76() {
|
| +buildUnnamed71() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed76(core.List<core.String> o) {
|
| +checkUnnamed71(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'));
|
| @@ -108,7 +107,7 @@ buildMobileAppPanel() {
|
| o.language = "foo";
|
| o.mobileAppPanelId = "foo";
|
| o.name = "foo";
|
| - o.owners = buildUnnamed76();
|
| + o.owners = buildUnnamed71();
|
| }
|
| buildCounterMobileAppPanel--;
|
| return o;
|
| @@ -122,19 +121,19 @@ checkMobileAppPanel(api.MobileAppPanel o) {
|
| unittest.expect(o.language, unittest.equals('foo'));
|
| unittest.expect(o.mobileAppPanelId, unittest.equals('foo'));
|
| unittest.expect(o.name, unittest.equals('foo'));
|
| - checkUnnamed76(o.owners);
|
| + checkUnnamed71(o.owners);
|
| }
|
| buildCounterMobileAppPanel--;
|
| }
|
|
|
| -buildUnnamed77() {
|
| +buildUnnamed72() {
|
| var o = new core.List<api.MobileAppPanel>();
|
| o.add(buildMobileAppPanel());
|
| o.add(buildMobileAppPanel());
|
| return o;
|
| }
|
|
|
| -checkUnnamed77(core.List<api.MobileAppPanel> o) {
|
| +checkUnnamed72(core.List<api.MobileAppPanel> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkMobileAppPanel(o[0]);
|
| checkMobileAppPanel(o[1]);
|
| @@ -147,7 +146,7 @@ buildMobileAppPanelsListResponse() {
|
| if (buildCounterMobileAppPanelsListResponse < 3) {
|
| o.pageInfo = buildPageInfo();
|
| o.requestId = "foo";
|
| - o.resources = buildUnnamed77();
|
| + o.resources = buildUnnamed72();
|
| o.tokenPagination = buildTokenPagination();
|
| }
|
| buildCounterMobileAppPanelsListResponse--;
|
| @@ -159,7 +158,7 @@ checkMobileAppPanelsListResponse(api.MobileAppPanelsListResponse o) {
|
| if (buildCounterMobileAppPanelsListResponse < 3) {
|
| checkPageInfo(o.pageInfo);
|
| unittest.expect(o.requestId, unittest.equals('foo'));
|
| - checkUnnamed77(o.resources);
|
| + checkUnnamed72(o.resources);
|
| checkTokenPagination(o.tokenPagination);
|
| }
|
| buildCounterMobileAppPanelsListResponse--;
|
| @@ -207,14 +206,14 @@ checkResultsGetRequest(api.ResultsGetRequest o) {
|
| buildCounterResultsGetRequest--;
|
| }
|
|
|
| -buildUnnamed78() {
|
| +buildUnnamed73() {
|
| var o = new core.List<api.FieldMask>();
|
| o.add(buildFieldMask());
|
| o.add(buildFieldMask());
|
| return o;
|
| }
|
|
|
| -checkUnnamed78(core.List<api.FieldMask> o) {
|
| +checkUnnamed73(core.List<api.FieldMask> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkFieldMask(o[0]);
|
| checkFieldMask(o[1]);
|
| @@ -225,7 +224,7 @@ buildResultsMask() {
|
| var o = new api.ResultsMask();
|
| buildCounterResultsMask++;
|
| if (buildCounterResultsMask < 3) {
|
| - o.fields = buildUnnamed78();
|
| + o.fields = buildUnnamed73();
|
| o.projection = "foo";
|
| }
|
| buildCounterResultsMask--;
|
| @@ -235,33 +234,33 @@ buildResultsMask() {
|
| checkResultsMask(api.ResultsMask o) {
|
| buildCounterResultsMask++;
|
| if (buildCounterResultsMask < 3) {
|
| - checkUnnamed78(o.fields);
|
| + checkUnnamed73(o.fields);
|
| unittest.expect(o.projection, unittest.equals('foo'));
|
| }
|
| buildCounterResultsMask--;
|
| }
|
|
|
| -buildUnnamed79() {
|
| +buildUnnamed74() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed79(core.List<core.String> 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'));
|
| }
|
|
|
| -buildUnnamed80() {
|
| +buildUnnamed75() {
|
| var o = new core.List<api.SurveyQuestion>();
|
| o.add(buildSurveyQuestion());
|
| o.add(buildSurveyQuestion());
|
| return o;
|
| }
|
|
|
| -checkUnnamed80(core.List<api.SurveyQuestion> o) {
|
| +checkUnnamed75(core.List<api.SurveyQuestion> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSurveyQuestion(o[0]);
|
| checkSurveyQuestion(o[1]);
|
| @@ -276,8 +275,8 @@ buildSurvey() {
|
| o.cost = buildSurveyCost();
|
| o.customerData = "foo";
|
| o.description = "foo";
|
| - o.owners = buildUnnamed79();
|
| - o.questions = buildUnnamed80();
|
| + o.owners = buildUnnamed74();
|
| + o.questions = buildUnnamed75();
|
| o.rejectionReason = buildSurveyRejection();
|
| o.state = "foo";
|
| o.surveyUrlId = "foo";
|
| @@ -295,8 +294,8 @@ checkSurvey(api.Survey o) {
|
| checkSurveyCost(o.cost);
|
| unittest.expect(o.customerData, unittest.equals('foo'));
|
| unittest.expect(o.description, unittest.equals('foo'));
|
| - checkUnnamed79(o.owners);
|
| - checkUnnamed80(o.questions);
|
| + checkUnnamed74(o.owners);
|
| + checkUnnamed75(o.questions);
|
| checkSurveyRejection(o.rejectionReason);
|
| unittest.expect(o.state, unittest.equals('foo'));
|
| unittest.expect(o.surveyUrlId, unittest.equals('foo'));
|
| @@ -306,27 +305,27 @@ checkSurvey(api.Survey o) {
|
| buildCounterSurvey--;
|
| }
|
|
|
| -buildUnnamed81() {
|
| +buildUnnamed76() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed81(core.List<core.String> 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'));
|
| }
|
|
|
| -buildUnnamed82() {
|
| +buildUnnamed77() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed82(core.List<core.String> o) {
|
| +checkUnnamed77(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'));
|
| @@ -337,11 +336,11 @@ buildSurveyAudience() {
|
| var o = new api.SurveyAudience();
|
| buildCounterSurveyAudience++;
|
| if (buildCounterSurveyAudience < 3) {
|
| - o.ages = buildUnnamed81();
|
| + o.ages = buildUnnamed76();
|
| o.country = "foo";
|
| o.countrySubdivision = "foo";
|
| o.gender = "foo";
|
| - o.languages = buildUnnamed82();
|
| + o.languages = buildUnnamed77();
|
| o.mobileAppPanelId = "foo";
|
| o.populationSource = "foo";
|
| }
|
| @@ -352,11 +351,11 @@ buildSurveyAudience() {
|
| checkSurveyAudience(api.SurveyAudience o) {
|
| buildCounterSurveyAudience++;
|
| if (buildCounterSurveyAudience < 3) {
|
| - checkUnnamed81(o.ages);
|
| + checkUnnamed76(o.ages);
|
| unittest.expect(o.country, unittest.equals('foo'));
|
| unittest.expect(o.countrySubdivision, unittest.equals('foo'));
|
| unittest.expect(o.gender, unittest.equals('foo'));
|
| - checkUnnamed82(o.languages);
|
| + checkUnnamed77(o.languages);
|
| unittest.expect(o.mobileAppPanelId, unittest.equals('foo'));
|
| unittest.expect(o.populationSource, unittest.equals('foo'));
|
| }
|
| @@ -388,53 +387,53 @@ checkSurveyCost(api.SurveyCost o) {
|
| buildCounterSurveyCost--;
|
| }
|
|
|
| -buildUnnamed83() {
|
| +buildUnnamed78() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed83(core.List<core.String> o) {
|
| +checkUnnamed78(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'));
|
| }
|
|
|
| -buildUnnamed84() {
|
| +buildUnnamed79() {
|
| var o = new core.List<api.SurveyQuestionImage>();
|
| o.add(buildSurveyQuestionImage());
|
| o.add(buildSurveyQuestionImage());
|
| return o;
|
| }
|
|
|
| -checkUnnamed84(core.List<api.SurveyQuestionImage> o) {
|
| +checkUnnamed79(core.List<api.SurveyQuestionImage> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSurveyQuestionImage(o[0]);
|
| checkSurveyQuestionImage(o[1]);
|
| }
|
|
|
| -buildUnnamed85() {
|
| +buildUnnamed80() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed85(core.List<core.String> 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'));
|
| }
|
|
|
| -buildUnnamed86() {
|
| +buildUnnamed81() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed86(core.List<core.String> 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'));
|
| @@ -446,20 +445,20 @@ buildSurveyQuestion() {
|
| buildCounterSurveyQuestion++;
|
| if (buildCounterSurveyQuestion < 3) {
|
| o.answerOrder = "foo";
|
| - o.answers = buildUnnamed83();
|
| + o.answers = buildUnnamed78();
|
| o.hasOther = true;
|
| o.highValueLabel = "foo";
|
| - o.images = buildUnnamed84();
|
| + o.images = buildUnnamed79();
|
| o.lastAnswerPositionPinned = true;
|
| o.lowValueLabel = "foo";
|
| o.mustPickSuggestion = true;
|
| o.numStars = "foo";
|
| o.openTextPlaceholder = "foo";
|
| - o.openTextSuggestions = buildUnnamed85();
|
| + o.openTextSuggestions = buildUnnamed80();
|
| o.question = "foo";
|
| o.sentimentText = "foo";
|
| o.singleLineResponse = true;
|
| - o.thresholdAnswers = buildUnnamed86();
|
| + o.thresholdAnswers = buildUnnamed81();
|
| o.type = "foo";
|
| o.unitOfMeasurementLabel = "foo";
|
| o.videoId = "foo";
|
| @@ -472,20 +471,20 @@ checkSurveyQuestion(api.SurveyQuestion o) {
|
| buildCounterSurveyQuestion++;
|
| if (buildCounterSurveyQuestion < 3) {
|
| unittest.expect(o.answerOrder, unittest.equals('foo'));
|
| - checkUnnamed83(o.answers);
|
| + checkUnnamed78(o.answers);
|
| unittest.expect(o.hasOther, unittest.isTrue);
|
| unittest.expect(o.highValueLabel, unittest.equals('foo'));
|
| - checkUnnamed84(o.images);
|
| + checkUnnamed79(o.images);
|
| unittest.expect(o.lastAnswerPositionPinned, unittest.isTrue);
|
| unittest.expect(o.lowValueLabel, unittest.equals('foo'));
|
| unittest.expect(o.mustPickSuggestion, unittest.isTrue);
|
| unittest.expect(o.numStars, unittest.equals('foo'));
|
| unittest.expect(o.openTextPlaceholder, unittest.equals('foo'));
|
| - checkUnnamed85(o.openTextSuggestions);
|
| + checkUnnamed80(o.openTextSuggestions);
|
| unittest.expect(o.question, unittest.equals('foo'));
|
| unittest.expect(o.sentimentText, unittest.equals('foo'));
|
| unittest.expect(o.singleLineResponse, unittest.isTrue);
|
| - checkUnnamed86(o.thresholdAnswers);
|
| + checkUnnamed81(o.thresholdAnswers);
|
| unittest.expect(o.type, unittest.equals('foo'));
|
| unittest.expect(o.unitOfMeasurementLabel, unittest.equals('foo'));
|
| unittest.expect(o.videoId, unittest.equals('foo'));
|
| @@ -577,14 +576,14 @@ checkSurveysDeleteResponse(api.SurveysDeleteResponse o) {
|
| buildCounterSurveysDeleteResponse--;
|
| }
|
|
|
| -buildUnnamed87() {
|
| +buildUnnamed82() {
|
| var o = new core.List<api.Survey>();
|
| o.add(buildSurvey());
|
| o.add(buildSurvey());
|
| return o;
|
| }
|
|
|
| -checkUnnamed87(core.List<api.Survey> o) {
|
| +checkUnnamed82(core.List<api.Survey> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSurvey(o[0]);
|
| checkSurvey(o[1]);
|
| @@ -597,7 +596,7 @@ buildSurveysListResponse() {
|
| if (buildCounterSurveysListResponse < 3) {
|
| o.pageInfo = buildPageInfo();
|
| o.requestId = "foo";
|
| - o.resources = buildUnnamed87();
|
| + o.resources = buildUnnamed82();
|
| o.tokenPagination = buildTokenPagination();
|
| }
|
| buildCounterSurveysListResponse--;
|
| @@ -609,7 +608,7 @@ checkSurveysListResponse(api.SurveysListResponse o) {
|
| if (buildCounterSurveysListResponse < 3) {
|
| checkPageInfo(o.pageInfo);
|
| unittest.expect(o.requestId, unittest.equals('foo'));
|
| - checkUnnamed87(o.resources);
|
| + checkUnnamed82(o.resources);
|
| checkTokenPagination(o.tokenPagination);
|
| }
|
| buildCounterSurveysListResponse--;
|
| @@ -693,7 +692,6 @@ checkTokenPagination(api.TokenPagination o) {
|
| buildCounterTokenPagination--;
|
| }
|
|
|
| -
|
| main() {
|
| unittest.group("obj-schema-FieldMask", () {
|
| unittest.test("to-json--from-json", () {
|
| @@ -703,7 +701,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-MobileAppPanel", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildMobileAppPanel();
|
| @@ -712,7 +709,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-MobileAppPanelsListResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildMobileAppPanelsListResponse();
|
| @@ -721,7 +717,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-PageInfo", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildPageInfo();
|
| @@ -730,7 +725,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-ResultsGetRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildResultsGetRequest();
|
| @@ -739,7 +733,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-ResultsMask", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildResultsMask();
|
| @@ -748,7 +741,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Survey", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurvey();
|
| @@ -757,7 +749,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveyAudience", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveyAudience();
|
| @@ -766,7 +757,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveyCost", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveyCost();
|
| @@ -775,7 +765,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveyQuestion", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveyQuestion();
|
| @@ -784,7 +773,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveyQuestionImage", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveyQuestionImage();
|
| @@ -793,7 +781,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveyRejection", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveyRejection();
|
| @@ -802,7 +789,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveyResults", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveyResults();
|
| @@ -811,7 +797,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveysDeleteResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveysDeleteResponse();
|
| @@ -820,7 +805,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveysListResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveysListResponse();
|
| @@ -829,7 +813,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveysStartRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveysStartRequest();
|
| @@ -838,7 +821,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveysStartResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveysStartResponse();
|
| @@ -847,7 +829,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SurveysStopResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSurveysStopResponse();
|
| @@ -856,7 +837,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-TokenPagination", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildTokenPagination();
|
| @@ -865,23 +845,25 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("resource-MobileapppanelsResourceApi", () {
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| - api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobileapppanels;
|
| + api.MobileapppanelsResourceApi res =
|
| + new api.ConsumersurveysApi(mock).mobileapppanels;
|
| var arg_panelId = "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("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.equals("mobileAppPanels/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 16),
|
| + unittest.equals("mobileAppPanels/"));
|
| pathOffset += 16;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -897,29 +879,32 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildMobileAppPanel());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.get(arg_panelId).then(unittest.expectAsync1(((api.MobileAppPanel response) {
|
| + res
|
| + .get(arg_panelId)
|
| + .then(unittest.expectAsync1(((api.MobileAppPanel response) {
|
| checkMobileAppPanel(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--list", () {
|
| -
|
| var mock = new HttpServerMock();
|
| - api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobileapppanels;
|
| + api.MobileapppanelsResourceApi res =
|
| + new api.ConsumersurveysApi(mock).mobileapppanels;
|
| var arg_maxResults = 42;
|
| var arg_startIndex = 42;
|
| var arg_token = "foo";
|
| @@ -928,11 +913,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.equals("mobileAppPanels"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 15),
|
| + unittest.equals("mobileAppPanels"));
|
| pathOffset += 15;
|
|
|
| var query = (req.url).query;
|
| @@ -945,32 +933,41 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
| - unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults));
|
| - unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.equals(arg_startIndex));
|
| + unittest.expect(core.int.parse(queryMap["maxResults"].first),
|
| + unittest.equals(arg_maxResults));
|
| + unittest.expect(core.int.parse(queryMap["startIndex"].first),
|
| + unittest.equals(arg_startIndex));
|
| unittest.expect(queryMap["token"].first, unittest.equals(arg_token));
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildMobileAppPanelsListResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: arg_token).then(unittest.expectAsync1(((api.MobileAppPanelsListResponse response) {
|
| + res
|
| + .list(
|
| + maxResults: arg_maxResults,
|
| + startIndex: arg_startIndex,
|
| + token: arg_token)
|
| + .then(unittest
|
| + .expectAsync1(((api.MobileAppPanelsListResponse response) {
|
| checkMobileAppPanelsListResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--update", () {
|
| -
|
| var mock = new HttpServerMock();
|
| - api.MobileapppanelsResourceApi res = new api.ConsumersurveysApi(mock).mobileapppanels;
|
| + api.MobileapppanelsResourceApi res =
|
| + new api.ConsumersurveysApi(mock).mobileapppanels;
|
| var arg_request = buildMobileAppPanel();
|
| var arg_panelId = "foo";
|
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
|
| @@ -981,11 +978,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.equals("mobileAppPanels/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 16),
|
| + unittest.equals("mobileAppPanels/"));
|
| pathOffset += 16;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -1001,28 +1001,29 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildMobileAppPanel());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.update(arg_request, arg_panelId).then(unittest.expectAsync1(((api.MobileAppPanel response) {
|
| + res
|
| + .update(arg_request, arg_panelId)
|
| + .then(unittest.expectAsync1(((api.MobileAppPanel response) {
|
| checkMobileAppPanel(response);
|
| })));
|
| });
|
| -
|
| });
|
|
|
| -
|
| unittest.group("resource-ResultsResourceApi", () {
|
| unittest.test("method--get", () {
|
| // TODO: Implement tests for media upload;
|
| @@ -1040,18 +1041,23 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("surveys/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("surveys/"));
|
| pathOffset += 8;
|
| index = path.indexOf("/results", pathOffset);
|
| unittest.expect(index >= 0, unittest.isTrue);
|
| - subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| + subPart =
|
| + core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| pathOffset = index;
|
| unittest.expect(subPart, unittest.equals("$arg_surveyUrlId"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("/results"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("/results"));
|
| pathOffset += 8;
|
|
|
| var query = (req.url).query;
|
| @@ -1064,31 +1070,31 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurveyResults());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.get(arg_request, arg_surveyUrlId).then(unittest.expectAsync1(((api.SurveyResults response) {
|
| + res
|
| + .get(arg_request, arg_surveyUrlId)
|
| + .then(unittest.expectAsync1(((api.SurveyResults response) {
|
| checkSurveyResults(response);
|
| })));
|
| });
|
| -
|
| });
|
|
|
| -
|
| unittest.group("resource-SurveysResourceApi", () {
|
| unittest.test("method--delete", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_surveyUrlId = "foo";
|
| @@ -1097,11 +1103,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("surveys/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("surveys/"));
|
| pathOffset += 8;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -1117,27 +1126,29 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurveysDeleteResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.delete(arg_surveyUrlId).then(unittest.expectAsync1(((api.SurveysDeleteResponse response) {
|
| + res
|
| + .delete(arg_surveyUrlId)
|
| + .then(unittest.expectAsync1(((api.SurveysDeleteResponse response) {
|
| checkSurveysDeleteResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_surveyUrlId = "foo";
|
| @@ -1146,11 +1157,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("surveys/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("surveys/"));
|
| pathOffset += 8;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -1166,27 +1180,29 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurvey());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.get(arg_surveyUrlId).then(unittest.expectAsync1(((api.Survey response) {
|
| + res
|
| + .get(arg_surveyUrlId)
|
| + .then(unittest.expectAsync1(((api.Survey response) {
|
| checkSurvey(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--insert", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_request = buildSurvey();
|
| @@ -1198,11 +1214,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("surveys"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("surveys"));
|
| pathOffset += 7;
|
|
|
| var query = (req.url).query;
|
| @@ -1215,27 +1234,29 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurvey());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.insert(arg_request).then(unittest.expectAsync1(((api.Survey response) {
|
| + res
|
| + .insert(arg_request)
|
| + .then(unittest.expectAsync1(((api.Survey response) {
|
| checkSurvey(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--list", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_maxResults = 42;
|
| @@ -1246,11 +1267,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("surveys"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("surveys"));
|
| pathOffset += 7;
|
|
|
| var query = (req.url).query;
|
| @@ -1263,30 +1287,37 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
| - unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults));
|
| - unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.equals(arg_startIndex));
|
| + unittest.expect(core.int.parse(queryMap["maxResults"].first),
|
| + unittest.equals(arg_maxResults));
|
| + unittest.expect(core.int.parse(queryMap["startIndex"].first),
|
| + unittest.equals(arg_startIndex));
|
| unittest.expect(queryMap["token"].first, unittest.equals(arg_token));
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurveysListResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.list(maxResults: arg_maxResults, startIndex: arg_startIndex, token: arg_token).then(unittest.expectAsync1(((api.SurveysListResponse response) {
|
| + res
|
| + .list(
|
| + maxResults: arg_maxResults,
|
| + startIndex: arg_startIndex,
|
| + token: arg_token)
|
| + .then(unittest.expectAsync1(((api.SurveysListResponse response) {
|
| checkSurveysListResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--start", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_request = buildSurveysStartRequest();
|
| @@ -1299,18 +1330,23 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("surveys/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("surveys/"));
|
| pathOffset += 8;
|
| index = path.indexOf("/start", pathOffset);
|
| unittest.expect(index >= 0, unittest.isTrue);
|
| - subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| + subPart =
|
| + core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| pathOffset = index;
|
| unittest.expect(subPart, unittest.equals("$arg_resourceId"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("/start"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 6),
|
| + unittest.equals("/start"));
|
| pathOffset += 6;
|
|
|
| var query = (req.url).query;
|
| @@ -1323,27 +1359,29 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurveysStartResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.start(arg_request, arg_resourceId).then(unittest.expectAsync1(((api.SurveysStartResponse response) {
|
| + res
|
| + .start(arg_request, arg_resourceId)
|
| + .then(unittest.expectAsync1(((api.SurveysStartResponse response) {
|
| checkSurveysStartResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--stop", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_resourceId = "foo";
|
| @@ -1352,18 +1390,23 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("surveys/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("surveys/"));
|
| pathOffset += 8;
|
| index = path.indexOf("/stop", pathOffset);
|
| unittest.expect(index >= 0, unittest.isTrue);
|
| - subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| + subPart =
|
| + core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| pathOffset = index;
|
| unittest.expect(subPart, unittest.equals("$arg_resourceId"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equals("/stop"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 5),
|
| + unittest.equals("/stop"));
|
| pathOffset += 5;
|
|
|
| var query = (req.url).query;
|
| @@ -1376,27 +1419,29 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurveysStopResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.stop(arg_resourceId).then(unittest.expectAsync1(((api.SurveysStopResponse response) {
|
| + res
|
| + .stop(arg_resourceId)
|
| + .then(unittest.expectAsync1(((api.SurveysStopResponse response) {
|
| checkSurveysStopResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--update", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SurveysResourceApi res = new api.ConsumersurveysApi(mock).surveys;
|
| var arg_request = buildSurvey();
|
| @@ -1409,11 +1454,14 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.equals("consumersurveys/v2/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("consumersurveys/v2/"));
|
| pathOffset += 19;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("surveys/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("surveys/"));
|
| pathOffset += 8;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -1429,27 +1477,26 @@ main() {
|
| 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]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildSurvey());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.update(arg_request, arg_surveyUrlId).then(unittest.expectAsync1(((api.Survey response) {
|
| + res
|
| + .update(arg_request, arg_surveyUrlId)
|
| + .then(unittest.expectAsync1(((api.Survey response) {
|
| checkSurvey(response);
|
| })));
|
| });
|
| -
|
| });
|
| -
|
| -
|
| }
|
| -
|
|
|