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

Side by Side Diff: generated/googleapis/test/reseller/v1_test.dart

Issue 2734843002: Api-roll 46: 2017-03-06 (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 library googleapis.reseller.v1.test; 1 library googleapis.reseller.v1.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection; 4 import "dart:collection" as collection;
5 import "dart:async" as async; 5 import "dart:async" as async;
6 import "dart:convert" as convert; 6 import "dart:convert" as convert;
7 7
8 import 'package:http/http.dart' as http; 8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing; 9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest; 10 import 'package:unittest/unittest.dart' as unittest;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 checkRenewalSettings(api.RenewalSettings o) { 163 checkRenewalSettings(api.RenewalSettings o) {
164 buildCounterRenewalSettings++; 164 buildCounterRenewalSettings++;
165 if (buildCounterRenewalSettings < 3) { 165 if (buildCounterRenewalSettings < 3) {
166 unittest.expect(o.kind, unittest.equals('foo')); 166 unittest.expect(o.kind, unittest.equals('foo'));
167 unittest.expect(o.renewalType, unittest.equals('foo')); 167 unittest.expect(o.renewalType, unittest.equals('foo'));
168 } 168 }
169 buildCounterRenewalSettings--; 169 buildCounterRenewalSettings--;
170 } 170 }
171 171
172 buildUnnamed2079() {
173 var o = new core.List<core.String>();
174 o.add("foo");
175 o.add("foo");
176 return o;
177 }
178
179 checkUnnamed2079(core.List<core.String> o) {
180 unittest.expect(o, unittest.hasLength(2));
181 unittest.expect(o[0], unittest.equals('foo'));
182 unittest.expect(o[1], unittest.equals('foo'));
183 }
184
185 core.int buildCounterResellernotifyGetwatchdetailsResponse = 0;
186 buildResellernotifyGetwatchdetailsResponse() {
187 var o = new api.ResellernotifyGetwatchdetailsResponse();
188 buildCounterResellernotifyGetwatchdetailsResponse++;
189 if (buildCounterResellernotifyGetwatchdetailsResponse < 3) {
190 o.serviceAccountEmailAddresses = buildUnnamed2079();
191 o.topicName = "foo";
192 }
193 buildCounterResellernotifyGetwatchdetailsResponse--;
194 return o;
195 }
196
197 checkResellernotifyGetwatchdetailsResponse(api.ResellernotifyGetwatchdetailsResp onse o) {
198 buildCounterResellernotifyGetwatchdetailsResponse++;
199 if (buildCounterResellernotifyGetwatchdetailsResponse < 3) {
200 checkUnnamed2079(o.serviceAccountEmailAddresses);
201 unittest.expect(o.topicName, unittest.equals('foo'));
202 }
203 buildCounterResellernotifyGetwatchdetailsResponse--;
204 }
205
206 core.int buildCounterResellernotifyResource = 0;
207 buildResellernotifyResource() {
208 var o = new api.ResellernotifyResource();
209 buildCounterResellernotifyResource++;
210 if (buildCounterResellernotifyResource < 3) {
211 o.topicName = "foo";
212 }
213 buildCounterResellernotifyResource--;
214 return o;
215 }
216
217 checkResellernotifyResource(api.ResellernotifyResource o) {
218 buildCounterResellernotifyResource++;
219 if (buildCounterResellernotifyResource < 3) {
220 unittest.expect(o.topicName, unittest.equals('foo'));
221 }
222 buildCounterResellernotifyResource--;
223 }
224
172 core.int buildCounterSeats = 0; 225 core.int buildCounterSeats = 0;
173 buildSeats() { 226 buildSeats() {
174 var o = new api.Seats(); 227 var o = new api.Seats();
175 buildCounterSeats++; 228 buildCounterSeats++;
176 if (buildCounterSeats < 3) { 229 if (buildCounterSeats < 3) {
177 o.kind = "foo"; 230 o.kind = "foo";
178 o.licensedNumberOfSeats = 42; 231 o.licensedNumberOfSeats = 42;
179 o.maximumNumberOfSeats = 42; 232 o.maximumNumberOfSeats = 42;
180 o.numberOfSeats = 42; 233 o.numberOfSeats = 42;
181 } 234 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 checkSubscriptionPlan(api.SubscriptionPlan o) { 284 checkSubscriptionPlan(api.SubscriptionPlan o) {
232 buildCounterSubscriptionPlan++; 285 buildCounterSubscriptionPlan++;
233 if (buildCounterSubscriptionPlan < 3) { 286 if (buildCounterSubscriptionPlan < 3) {
234 checkSubscriptionPlanCommitmentInterval(o.commitmentInterval); 287 checkSubscriptionPlanCommitmentInterval(o.commitmentInterval);
235 unittest.expect(o.isCommitmentPlan, unittest.isTrue); 288 unittest.expect(o.isCommitmentPlan, unittest.isTrue);
236 unittest.expect(o.planName, unittest.equals('foo')); 289 unittest.expect(o.planName, unittest.equals('foo'));
237 } 290 }
238 buildCounterSubscriptionPlan--; 291 buildCounterSubscriptionPlan--;
239 } 292 }
240 293
241 buildUnnamed2256() { 294 buildUnnamed2080() {
242 var o = new core.List<core.String>(); 295 var o = new core.List<core.String>();
243 o.add("foo"); 296 o.add("foo");
244 o.add("foo"); 297 o.add("foo");
245 return o; 298 return o;
246 } 299 }
247 300
248 checkUnnamed2256(core.List<core.String> o) { 301 checkUnnamed2080(core.List<core.String> o) {
249 unittest.expect(o, unittest.hasLength(2)); 302 unittest.expect(o, unittest.hasLength(2));
250 unittest.expect(o[0], unittest.equals('foo')); 303 unittest.expect(o[0], unittest.equals('foo'));
251 unittest.expect(o[1], unittest.equals('foo')); 304 unittest.expect(o[1], unittest.equals('foo'));
252 } 305 }
253 306
254 core.int buildCounterSubscriptionTransferInfo = 0; 307 core.int buildCounterSubscriptionTransferInfo = 0;
255 buildSubscriptionTransferInfo() { 308 buildSubscriptionTransferInfo() {
256 var o = new api.SubscriptionTransferInfo(); 309 var o = new api.SubscriptionTransferInfo();
257 buildCounterSubscriptionTransferInfo++; 310 buildCounterSubscriptionTransferInfo++;
258 if (buildCounterSubscriptionTransferInfo < 3) { 311 if (buildCounterSubscriptionTransferInfo < 3) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 o.dealCode = "foo"; 358 o.dealCode = "foo";
306 o.kind = "foo"; 359 o.kind = "foo";
307 o.plan = buildSubscriptionPlan(); 360 o.plan = buildSubscriptionPlan();
308 o.purchaseOrderId = "foo"; 361 o.purchaseOrderId = "foo";
309 o.renewalSettings = buildRenewalSettings(); 362 o.renewalSettings = buildRenewalSettings();
310 o.resourceUiUrl = "foo"; 363 o.resourceUiUrl = "foo";
311 o.seats = buildSeats(); 364 o.seats = buildSeats();
312 o.skuId = "foo"; 365 o.skuId = "foo";
313 o.status = "foo"; 366 o.status = "foo";
314 o.subscriptionId = "foo"; 367 o.subscriptionId = "foo";
315 o.suspensionReasons = buildUnnamed2256(); 368 o.suspensionReasons = buildUnnamed2080();
316 o.transferInfo = buildSubscriptionTransferInfo(); 369 o.transferInfo = buildSubscriptionTransferInfo();
317 o.trialSettings = buildSubscriptionTrialSettings(); 370 o.trialSettings = buildSubscriptionTrialSettings();
318 } 371 }
319 buildCounterSubscription--; 372 buildCounterSubscription--;
320 return o; 373 return o;
321 } 374 }
322 375
323 checkSubscription(api.Subscription o) { 376 checkSubscription(api.Subscription o) {
324 buildCounterSubscription++; 377 buildCounterSubscription++;
325 if (buildCounterSubscription < 3) { 378 if (buildCounterSubscription < 3) {
326 unittest.expect(o.billingMethod, unittest.equals('foo')); 379 unittest.expect(o.billingMethod, unittest.equals('foo'));
327 unittest.expect(o.creationTime, unittest.equals('foo')); 380 unittest.expect(o.creationTime, unittest.equals('foo'));
328 unittest.expect(o.customerDomain, unittest.equals('foo')); 381 unittest.expect(o.customerDomain, unittest.equals('foo'));
329 unittest.expect(o.customerId, unittest.equals('foo')); 382 unittest.expect(o.customerId, unittest.equals('foo'));
330 unittest.expect(o.dealCode, unittest.equals('foo')); 383 unittest.expect(o.dealCode, unittest.equals('foo'));
331 unittest.expect(o.kind, unittest.equals('foo')); 384 unittest.expect(o.kind, unittest.equals('foo'));
332 checkSubscriptionPlan(o.plan); 385 checkSubscriptionPlan(o.plan);
333 unittest.expect(o.purchaseOrderId, unittest.equals('foo')); 386 unittest.expect(o.purchaseOrderId, unittest.equals('foo'));
334 checkRenewalSettings(o.renewalSettings); 387 checkRenewalSettings(o.renewalSettings);
335 unittest.expect(o.resourceUiUrl, unittest.equals('foo')); 388 unittest.expect(o.resourceUiUrl, unittest.equals('foo'));
336 checkSeats(o.seats); 389 checkSeats(o.seats);
337 unittest.expect(o.skuId, unittest.equals('foo')); 390 unittest.expect(o.skuId, unittest.equals('foo'));
338 unittest.expect(o.status, unittest.equals('foo')); 391 unittest.expect(o.status, unittest.equals('foo'));
339 unittest.expect(o.subscriptionId, unittest.equals('foo')); 392 unittest.expect(o.subscriptionId, unittest.equals('foo'));
340 checkUnnamed2256(o.suspensionReasons); 393 checkUnnamed2080(o.suspensionReasons);
341 checkSubscriptionTransferInfo(o.transferInfo); 394 checkSubscriptionTransferInfo(o.transferInfo);
342 checkSubscriptionTrialSettings(o.trialSettings); 395 checkSubscriptionTrialSettings(o.trialSettings);
343 } 396 }
344 buildCounterSubscription--; 397 buildCounterSubscription--;
345 } 398 }
346 399
347 buildUnnamed2257() { 400 buildUnnamed2081() {
348 var o = new core.List<api.Subscription>(); 401 var o = new core.List<api.Subscription>();
349 o.add(buildSubscription()); 402 o.add(buildSubscription());
350 o.add(buildSubscription()); 403 o.add(buildSubscription());
351 return o; 404 return o;
352 } 405 }
353 406
354 checkUnnamed2257(core.List<api.Subscription> o) { 407 checkUnnamed2081(core.List<api.Subscription> o) {
355 unittest.expect(o, unittest.hasLength(2)); 408 unittest.expect(o, unittest.hasLength(2));
356 checkSubscription(o[0]); 409 checkSubscription(o[0]);
357 checkSubscription(o[1]); 410 checkSubscription(o[1]);
358 } 411 }
359 412
360 core.int buildCounterSubscriptions = 0; 413 core.int buildCounterSubscriptions = 0;
361 buildSubscriptions() { 414 buildSubscriptions() {
362 var o = new api.Subscriptions(); 415 var o = new api.Subscriptions();
363 buildCounterSubscriptions++; 416 buildCounterSubscriptions++;
364 if (buildCounterSubscriptions < 3) { 417 if (buildCounterSubscriptions < 3) {
365 o.kind = "foo"; 418 o.kind = "foo";
366 o.nextPageToken = "foo"; 419 o.nextPageToken = "foo";
367 o.subscriptions = buildUnnamed2257(); 420 o.subscriptions = buildUnnamed2081();
368 } 421 }
369 buildCounterSubscriptions--; 422 buildCounterSubscriptions--;
370 return o; 423 return o;
371 } 424 }
372 425
373 checkSubscriptions(api.Subscriptions o) { 426 checkSubscriptions(api.Subscriptions o) {
374 buildCounterSubscriptions++; 427 buildCounterSubscriptions++;
375 if (buildCounterSubscriptions < 3) { 428 if (buildCounterSubscriptions < 3) {
376 unittest.expect(o.kind, unittest.equals('foo')); 429 unittest.expect(o.kind, unittest.equals('foo'));
377 unittest.expect(o.nextPageToken, unittest.equals('foo')); 430 unittest.expect(o.nextPageToken, unittest.equals('foo'));
378 checkUnnamed2257(o.subscriptions); 431 checkUnnamed2081(o.subscriptions);
379 } 432 }
380 buildCounterSubscriptions--; 433 buildCounterSubscriptions--;
381 } 434 }
382 435
383 436
384 main() { 437 main() {
385 unittest.group("obj-schema-Address", () { 438 unittest.group("obj-schema-Address", () {
386 unittest.test("to-json--from-json", () { 439 unittest.test("to-json--from-json", () {
387 var o = buildAddress(); 440 var o = buildAddress();
388 var od = new api.Address.fromJson(o.toJson()); 441 var od = new api.Address.fromJson(o.toJson());
(...skipping 22 matching lines...) Expand all
411 464
412 unittest.group("obj-schema-RenewalSettings", () { 465 unittest.group("obj-schema-RenewalSettings", () {
413 unittest.test("to-json--from-json", () { 466 unittest.test("to-json--from-json", () {
414 var o = buildRenewalSettings(); 467 var o = buildRenewalSettings();
415 var od = new api.RenewalSettings.fromJson(o.toJson()); 468 var od = new api.RenewalSettings.fromJson(o.toJson());
416 checkRenewalSettings(od); 469 checkRenewalSettings(od);
417 }); 470 });
418 }); 471 });
419 472
420 473
474 unittest.group("obj-schema-ResellernotifyGetwatchdetailsResponse", () {
475 unittest.test("to-json--from-json", () {
476 var o = buildResellernotifyGetwatchdetailsResponse();
477 var od = new api.ResellernotifyGetwatchdetailsResponse.fromJson(o.toJson() );
478 checkResellernotifyGetwatchdetailsResponse(od);
479 });
480 });
481
482
483 unittest.group("obj-schema-ResellernotifyResource", () {
484 unittest.test("to-json--from-json", () {
485 var o = buildResellernotifyResource();
486 var od = new api.ResellernotifyResource.fromJson(o.toJson());
487 checkResellernotifyResource(od);
488 });
489 });
490
491
421 unittest.group("obj-schema-Seats", () { 492 unittest.group("obj-schema-Seats", () {
422 unittest.test("to-json--from-json", () { 493 unittest.test("to-json--from-json", () {
423 var o = buildSeats(); 494 var o = buildSeats();
424 var od = new api.Seats.fromJson(o.toJson()); 495 var od = new api.Seats.fromJson(o.toJson());
425 checkSeats(od); 496 checkSeats(od);
426 }); 497 });
427 }); 498 });
428 499
429 500
430 unittest.group("obj-schema-SubscriptionPlanCommitmentInterval", () { 501 unittest.group("obj-schema-SubscriptionPlanCommitmentInterval", () {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 return new async.Future.value(stringResponse(200, h, resp)); 755 return new async.Future.value(stringResponse(200, h, resp));
685 }), true); 756 }), true);
686 res.update(arg_request, arg_customerId).then(unittest.expectAsync(((api.Cu stomer response) { 757 res.update(arg_request, arg_customerId).then(unittest.expectAsync(((api.Cu stomer response) {
687 checkCustomer(response); 758 checkCustomer(response);
688 }))); 759 })));
689 }); 760 });
690 761
691 }); 762 });
692 763
693 764
765 unittest.group("resource-ResellernotifyResourceApi", () {
766 unittest.test("method--getwatchdetails", () {
767
768 var mock = new HttpServerMock();
769 api.ResellernotifyResourceApi res = new api.ResellerApi(mock).resellernoti fy;
770 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
771 var path = (req.url).path;
772 var pathOffset = 0;
773 var index;
774 var subPart;
775 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
776 pathOffset += 1;
777 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("apps/reseller/v1/"));
778 pathOffset += 17;
779 unittest.expect(path.substring(pathOffset, pathOffset + 30), unittest.eq uals("resellernotify/getwatchdetails"));
780 pathOffset += 30;
781
782 var query = (req.url).query;
783 var queryOffset = 0;
784 var queryMap = {};
785 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
786 parseBool(n) {
787 if (n == "true") return true;
788 if (n == "false") return false;
789 if (n == null) return null;
790 throw new core.ArgumentError("Invalid boolean: $n");
791 }
792 if (query.length > 0) {
793 for (var part in query.split("&")) {
794 var keyvalue = part.split("=");
795 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
796 }
797 }
798
799
800 var h = {
801 "content-type" : "application/json; charset=utf-8",
802 };
803 var resp = convert.JSON.encode(buildResellernotifyGetwatchdetailsRespons e());
804 return new async.Future.value(stringResponse(200, h, resp));
805 }), true);
806 res.getwatchdetails().then(unittest.expectAsync(((api.ResellernotifyGetwat chdetailsResponse response) {
807 checkResellernotifyGetwatchdetailsResponse(response);
808 })));
809 });
810
811 unittest.test("method--register", () {
812
813 var mock = new HttpServerMock();
814 api.ResellernotifyResourceApi res = new api.ResellerApi(mock).resellernoti fy;
815 var arg_serviceAccountEmailAddress = "foo";
816 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
817 var path = (req.url).path;
818 var pathOffset = 0;
819 var index;
820 var subPart;
821 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
822 pathOffset += 1;
823 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("apps/reseller/v1/"));
824 pathOffset += 17;
825 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq uals("resellernotify/register"));
826 pathOffset += 23;
827
828 var query = (req.url).query;
829 var queryOffset = 0;
830 var queryMap = {};
831 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
832 parseBool(n) {
833 if (n == "true") return true;
834 if (n == "false") return false;
835 if (n == null) return null;
836 throw new core.ArgumentError("Invalid boolean: $n");
837 }
838 if (query.length > 0) {
839 for (var part in query.split("&")) {
840 var keyvalue = part.split("=");
841 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
842 }
843 }
844 unittest.expect(queryMap["serviceAccountEmailAddress"].first, unittest.e quals(arg_serviceAccountEmailAddress));
845
846
847 var h = {
848 "content-type" : "application/json; charset=utf-8",
849 };
850 var resp = convert.JSON.encode(buildResellernotifyResource());
851 return new async.Future.value(stringResponse(200, h, resp));
852 }), true);
853 res.register(serviceAccountEmailAddress: arg_serviceAccountEmailAddress).t hen(unittest.expectAsync(((api.ResellernotifyResource response) {
854 checkResellernotifyResource(response);
855 })));
856 });
857
858 unittest.test("method--unregister", () {
859
860 var mock = new HttpServerMock();
861 api.ResellernotifyResourceApi res = new api.ResellerApi(mock).resellernoti fy;
862 var arg_serviceAccountEmailAddress = "foo";
863 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
864 var path = (req.url).path;
865 var pathOffset = 0;
866 var index;
867 var subPart;
868 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
869 pathOffset += 1;
870 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("apps/reseller/v1/"));
871 pathOffset += 17;
872 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq uals("resellernotify/unregister"));
873 pathOffset += 25;
874
875 var query = (req.url).query;
876 var queryOffset = 0;
877 var queryMap = {};
878 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
879 parseBool(n) {
880 if (n == "true") return true;
881 if (n == "false") return false;
882 if (n == null) return null;
883 throw new core.ArgumentError("Invalid boolean: $n");
884 }
885 if (query.length > 0) {
886 for (var part in query.split("&")) {
887 var keyvalue = part.split("=");
888 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
889 }
890 }
891 unittest.expect(queryMap["serviceAccountEmailAddress"].first, unittest.e quals(arg_serviceAccountEmailAddress));
892
893
894 var h = {
895 "content-type" : "application/json; charset=utf-8",
896 };
897 var resp = convert.JSON.encode(buildResellernotifyResource());
898 return new async.Future.value(stringResponse(200, h, resp));
899 }), true);
900 res.unregister(serviceAccountEmailAddress: arg_serviceAccountEmailAddress) .then(unittest.expectAsync(((api.ResellernotifyResource response) {
901 checkResellernotifyResource(response);
902 })));
903 });
904
905 });
906
907
694 unittest.group("resource-SubscriptionsResourceApi", () { 908 unittest.group("resource-SubscriptionsResourceApi", () {
695 unittest.test("method--activate", () { 909 unittest.test("method--activate", () {
696 910
697 var mock = new HttpServerMock(); 911 var mock = new HttpServerMock();
698 api.SubscriptionsResourceApi res = new api.ResellerApi(mock).subscriptions ; 912 api.SubscriptionsResourceApi res = new api.ResellerApi(mock).subscriptions ;
699 var arg_customerId = "foo"; 913 var arg_customerId = "foo";
700 var arg_subscriptionId = "foo"; 914 var arg_subscriptionId = "foo";
701 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 915 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
702 var path = (req.url).path; 916 var path = (req.url).path;
703 var pathOffset = 0; 917 var pathOffset = 0;
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 res.suspend(arg_customerId, arg_subscriptionId).then(unittest.expectAsync( ((api.Subscription response) { 1510 res.suspend(arg_customerId, arg_subscriptionId).then(unittest.expectAsync( ((api.Subscription response) {
1297 checkSubscription(response); 1511 checkSubscription(response);
1298 }))); 1512 })));
1299 }); 1513 });
1300 1514
1301 }); 1515 });
1302 1516
1303 1517
1304 } 1518 }
1305 1519
OLDNEW
« no previous file with comments | « generated/googleapis/test/pubsub/v1_test.dart ('k') | generated/googleapis/test/runtimeconfig/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698