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

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

Issue 2695743002: Api-roll 45: 2017-02-13 (Closed)
Patch Set: reverted local changes to pubspec file Created 3 years, 10 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.firebaserules.v1.test; 1 library googleapis.firebaserules.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 checkIssue(api.Issue o) { 107 checkIssue(api.Issue o) {
108 buildCounterIssue++; 108 buildCounterIssue++;
109 if (buildCounterIssue < 3) { 109 if (buildCounterIssue < 3) {
110 unittest.expect(o.description, unittest.equals('foo')); 110 unittest.expect(o.description, unittest.equals('foo'));
111 unittest.expect(o.severity, unittest.equals('foo')); 111 unittest.expect(o.severity, unittest.equals('foo'));
112 checkSourcePosition(o.sourcePosition); 112 checkSourcePosition(o.sourcePosition);
113 } 113 }
114 buildCounterIssue--; 114 buildCounterIssue--;
115 } 115 }
116 116
117 buildUnnamed3043() { 117 buildUnnamed3134() {
118 var o = new core.List<api.Release>(); 118 var o = new core.List<api.Release>();
119 o.add(buildRelease()); 119 o.add(buildRelease());
120 o.add(buildRelease()); 120 o.add(buildRelease());
121 return o; 121 return o;
122 } 122 }
123 123
124 checkUnnamed3043(core.List<api.Release> o) { 124 checkUnnamed3134(core.List<api.Release> o) {
125 unittest.expect(o, unittest.hasLength(2)); 125 unittest.expect(o, unittest.hasLength(2));
126 checkRelease(o[0]); 126 checkRelease(o[0]);
127 checkRelease(o[1]); 127 checkRelease(o[1]);
128 } 128 }
129 129
130 core.int buildCounterListReleasesResponse = 0; 130 core.int buildCounterListReleasesResponse = 0;
131 buildListReleasesResponse() { 131 buildListReleasesResponse() {
132 var o = new api.ListReleasesResponse(); 132 var o = new api.ListReleasesResponse();
133 buildCounterListReleasesResponse++; 133 buildCounterListReleasesResponse++;
134 if (buildCounterListReleasesResponse < 3) { 134 if (buildCounterListReleasesResponse < 3) {
135 o.nextPageToken = "foo"; 135 o.nextPageToken = "foo";
136 o.releases = buildUnnamed3043(); 136 o.releases = buildUnnamed3134();
137 } 137 }
138 buildCounterListReleasesResponse--; 138 buildCounterListReleasesResponse--;
139 return o; 139 return o;
140 } 140 }
141 141
142 checkListReleasesResponse(api.ListReleasesResponse o) { 142 checkListReleasesResponse(api.ListReleasesResponse o) {
143 buildCounterListReleasesResponse++; 143 buildCounterListReleasesResponse++;
144 if (buildCounterListReleasesResponse < 3) { 144 if (buildCounterListReleasesResponse < 3) {
145 unittest.expect(o.nextPageToken, unittest.equals('foo')); 145 unittest.expect(o.nextPageToken, unittest.equals('foo'));
146 checkUnnamed3043(o.releases); 146 checkUnnamed3134(o.releases);
147 } 147 }
148 buildCounterListReleasesResponse--; 148 buildCounterListReleasesResponse--;
149 } 149 }
150 150
151 buildUnnamed3044() { 151 buildUnnamed3135() {
152 var o = new core.List<api.Ruleset>(); 152 var o = new core.List<api.Ruleset>();
153 o.add(buildRuleset()); 153 o.add(buildRuleset());
154 o.add(buildRuleset()); 154 o.add(buildRuleset());
155 return o; 155 return o;
156 } 156 }
157 157
158 checkUnnamed3044(core.List<api.Ruleset> o) { 158 checkUnnamed3135(core.List<api.Ruleset> o) {
159 unittest.expect(o, unittest.hasLength(2)); 159 unittest.expect(o, unittest.hasLength(2));
160 checkRuleset(o[0]); 160 checkRuleset(o[0]);
161 checkRuleset(o[1]); 161 checkRuleset(o[1]);
162 } 162 }
163 163
164 core.int buildCounterListRulesetsResponse = 0; 164 core.int buildCounterListRulesetsResponse = 0;
165 buildListRulesetsResponse() { 165 buildListRulesetsResponse() {
166 var o = new api.ListRulesetsResponse(); 166 var o = new api.ListRulesetsResponse();
167 buildCounterListRulesetsResponse++; 167 buildCounterListRulesetsResponse++;
168 if (buildCounterListRulesetsResponse < 3) { 168 if (buildCounterListRulesetsResponse < 3) {
169 o.nextPageToken = "foo"; 169 o.nextPageToken = "foo";
170 o.rulesets = buildUnnamed3044(); 170 o.rulesets = buildUnnamed3135();
171 } 171 }
172 buildCounterListRulesetsResponse--; 172 buildCounterListRulesetsResponse--;
173 return o; 173 return o;
174 } 174 }
175 175
176 checkListRulesetsResponse(api.ListRulesetsResponse o) { 176 checkListRulesetsResponse(api.ListRulesetsResponse o) {
177 buildCounterListRulesetsResponse++; 177 buildCounterListRulesetsResponse++;
178 if (buildCounterListRulesetsResponse < 3) { 178 if (buildCounterListRulesetsResponse < 3) {
179 unittest.expect(o.nextPageToken, unittest.equals('foo')); 179 unittest.expect(o.nextPageToken, unittest.equals('foo'));
180 checkUnnamed3044(o.rulesets); 180 checkUnnamed3135(o.rulesets);
181 } 181 }
182 buildCounterListRulesetsResponse--; 182 buildCounterListRulesetsResponse--;
183 } 183 }
184 184
185 core.int buildCounterRelease = 0; 185 core.int buildCounterRelease = 0;
186 buildRelease() { 186 buildRelease() {
187 var o = new api.Release(); 187 var o = new api.Release();
188 buildCounterRelease++; 188 buildCounterRelease++;
189 if (buildCounterRelease < 3) { 189 if (buildCounterRelease < 3) {
190 o.createTime = "foo"; 190 o.createTime = "foo";
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 checkRuleset(api.Ruleset o) { 223 checkRuleset(api.Ruleset o) {
224 buildCounterRuleset++; 224 buildCounterRuleset++;
225 if (buildCounterRuleset < 3) { 225 if (buildCounterRuleset < 3) {
226 unittest.expect(o.createTime, unittest.equals('foo')); 226 unittest.expect(o.createTime, unittest.equals('foo'));
227 unittest.expect(o.name, unittest.equals('foo')); 227 unittest.expect(o.name, unittest.equals('foo'));
228 checkSource(o.source); 228 checkSource(o.source);
229 } 229 }
230 buildCounterRuleset--; 230 buildCounterRuleset--;
231 } 231 }
232 232
233 buildUnnamed3045() { 233 buildUnnamed3136() {
234 var o = new core.List<api.File>(); 234 var o = new core.List<api.File>();
235 o.add(buildFile()); 235 o.add(buildFile());
236 o.add(buildFile()); 236 o.add(buildFile());
237 return o; 237 return o;
238 } 238 }
239 239
240 checkUnnamed3045(core.List<api.File> o) { 240 checkUnnamed3136(core.List<api.File> o) {
241 unittest.expect(o, unittest.hasLength(2)); 241 unittest.expect(o, unittest.hasLength(2));
242 checkFile(o[0]); 242 checkFile(o[0]);
243 checkFile(o[1]); 243 checkFile(o[1]);
244 } 244 }
245 245
246 core.int buildCounterSource = 0; 246 core.int buildCounterSource = 0;
247 buildSource() { 247 buildSource() {
248 var o = new api.Source(); 248 var o = new api.Source();
249 buildCounterSource++; 249 buildCounterSource++;
250 if (buildCounterSource < 3) { 250 if (buildCounterSource < 3) {
251 o.files = buildUnnamed3045(); 251 o.files = buildUnnamed3136();
252 } 252 }
253 buildCounterSource--; 253 buildCounterSource--;
254 return o; 254 return o;
255 } 255 }
256 256
257 checkSource(api.Source o) { 257 checkSource(api.Source o) {
258 buildCounterSource++; 258 buildCounterSource++;
259 if (buildCounterSource < 3) { 259 if (buildCounterSource < 3) {
260 checkUnnamed3045(o.files); 260 checkUnnamed3136(o.files);
261 } 261 }
262 buildCounterSource--; 262 buildCounterSource--;
263 } 263 }
264 264
265 core.int buildCounterSourcePosition = 0; 265 core.int buildCounterSourcePosition = 0;
266 buildSourcePosition() { 266 buildSourcePosition() {
267 var o = new api.SourcePosition(); 267 var o = new api.SourcePosition();
268 buildCounterSourcePosition++; 268 buildCounterSourcePosition++;
269 if (buildCounterSourcePosition < 3) { 269 if (buildCounterSourcePosition < 3) {
270 o.column = 42; 270 o.column = 42;
(...skipping 26 matching lines...) Expand all
297 } 297 }
298 298
299 checkTestRulesetRequest(api.TestRulesetRequest o) { 299 checkTestRulesetRequest(api.TestRulesetRequest o) {
300 buildCounterTestRulesetRequest++; 300 buildCounterTestRulesetRequest++;
301 if (buildCounterTestRulesetRequest < 3) { 301 if (buildCounterTestRulesetRequest < 3) {
302 checkSource(o.source); 302 checkSource(o.source);
303 } 303 }
304 buildCounterTestRulesetRequest--; 304 buildCounterTestRulesetRequest--;
305 } 305 }
306 306
307 buildUnnamed3046() { 307 buildUnnamed3137() {
308 var o = new core.List<api.Issue>(); 308 var o = new core.List<api.Issue>();
309 o.add(buildIssue()); 309 o.add(buildIssue());
310 o.add(buildIssue()); 310 o.add(buildIssue());
311 return o; 311 return o;
312 } 312 }
313 313
314 checkUnnamed3046(core.List<api.Issue> o) { 314 checkUnnamed3137(core.List<api.Issue> o) {
315 unittest.expect(o, unittest.hasLength(2)); 315 unittest.expect(o, unittest.hasLength(2));
316 checkIssue(o[0]); 316 checkIssue(o[0]);
317 checkIssue(o[1]); 317 checkIssue(o[1]);
318 } 318 }
319 319
320 core.int buildCounterTestRulesetResponse = 0; 320 core.int buildCounterTestRulesetResponse = 0;
321 buildTestRulesetResponse() { 321 buildTestRulesetResponse() {
322 var o = new api.TestRulesetResponse(); 322 var o = new api.TestRulesetResponse();
323 buildCounterTestRulesetResponse++; 323 buildCounterTestRulesetResponse++;
324 if (buildCounterTestRulesetResponse < 3) { 324 if (buildCounterTestRulesetResponse < 3) {
325 o.issues = buildUnnamed3046(); 325 o.issues = buildUnnamed3137();
326 } 326 }
327 buildCounterTestRulesetResponse--; 327 buildCounterTestRulesetResponse--;
328 return o; 328 return o;
329 } 329 }
330 330
331 checkTestRulesetResponse(api.TestRulesetResponse o) { 331 checkTestRulesetResponse(api.TestRulesetResponse o) {
332 buildCounterTestRulesetResponse++; 332 buildCounterTestRulesetResponse++;
333 if (buildCounterTestRulesetResponse < 3) { 333 if (buildCounterTestRulesetResponse < 3) {
334 checkUnnamed3046(o.issues); 334 checkUnnamed3137(o.issues);
335 } 335 }
336 buildCounterTestRulesetResponse--; 336 buildCounterTestRulesetResponse--;
337 } 337 }
338 338
339 339
340 main() { 340 main() {
341 unittest.group("obj-schema-Empty", () { 341 unittest.group("obj-schema-Empty", () {
342 unittest.test("to-json--from-json", () { 342 unittest.test("to-json--from-json", () {
343 var o = buildEmpty(); 343 var o = buildEmpty();
344 var od = new api.Empty.fromJson(o.toJson()); 344 var od = new api.Empty.fromJson(o.toJson());
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 res.get(arg_name).then(unittest.expectAsync(((api.Release response) { 628 res.get(arg_name).then(unittest.expectAsync(((api.Release response) {
629 checkRelease(response); 629 checkRelease(response);
630 }))); 630 })));
631 }); 631 });
632 632
633 unittest.test("method--list", () { 633 unittest.test("method--list", () {
634 634
635 var mock = new HttpServerMock(); 635 var mock = new HttpServerMock();
636 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje cts.releases; 636 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje cts.releases;
637 var arg_name = "foo"; 637 var arg_name = "foo";
638 var arg_pageToken = "foo";
638 var arg_pageSize = 42; 639 var arg_pageSize = 42;
639 var arg_filter = "foo"; 640 var arg_filter = "foo";
640 var arg_pageToken = "foo";
641 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 641 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
642 var path = (req.url).path; 642 var path = (req.url).path;
643 var pathOffset = 0; 643 var pathOffset = 0;
644 var index; 644 var index;
645 var subPart; 645 var subPart;
646 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 646 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
647 pathOffset += 1; 647 pathOffset += 1;
648 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 648 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
649 pathOffset += 3; 649 pathOffset += 3;
650 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 650 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
651 651
652 var query = (req.url).query; 652 var query = (req.url).query;
653 var queryOffset = 0; 653 var queryOffset = 0;
654 var queryMap = {}; 654 var queryMap = {};
655 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 655 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
656 parseBool(n) { 656 parseBool(n) {
657 if (n == "true") return true; 657 if (n == "true") return true;
658 if (n == "false") return false; 658 if (n == "false") return false;
659 if (n == null) return null; 659 if (n == null) return null;
660 throw new core.ArgumentError("Invalid boolean: $n"); 660 throw new core.ArgumentError("Invalid boolean: $n");
661 } 661 }
662 if (query.length > 0) { 662 if (query.length > 0) {
663 for (var part in query.split("&")) { 663 for (var part in query.split("&")) {
664 var keyvalue = part.split("="); 664 var keyvalue = part.split("=");
665 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 665 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
666 } 666 }
667 } 667 }
668 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
668 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 669 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
669 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 670 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
670 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
671 671
672 672
673 var h = { 673 var h = {
674 "content-type" : "application/json; charset=utf-8", 674 "content-type" : "application/json; charset=utf-8",
675 }; 675 };
676 var resp = convert.JSON.encode(buildListReleasesResponse()); 676 var resp = convert.JSON.encode(buildListReleasesResponse());
677 return new async.Future.value(stringResponse(200, h, resp)); 677 return new async.Future.value(stringResponse(200, h, resp));
678 }), true); 678 }), true);
679 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListReleasesResponse response) { 679 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte r: arg_filter).then(unittest.expectAsync(((api.ListReleasesResponse response) {
680 checkListReleasesResponse(response); 680 checkListReleasesResponse(response);
681 }))); 681 })));
682 }); 682 });
683 683
684 unittest.test("method--update", () { 684 unittest.test("method--update", () {
685 685
686 var mock = new HttpServerMock(); 686 var mock = new HttpServerMock();
687 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje cts.releases; 687 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje cts.releases;
688 var arg_request = buildRelease(); 688 var arg_request = buildRelease();
689 var arg_name = "foo"; 689 var arg_name = "foo";
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 res.get(arg_name).then(unittest.expectAsync(((api.Ruleset response) { 871 res.get(arg_name).then(unittest.expectAsync(((api.Ruleset response) {
872 checkRuleset(response); 872 checkRuleset(response);
873 }))); 873 })));
874 }); 874 });
875 875
876 unittest.test("method--list", () { 876 unittest.test("method--list", () {
877 877
878 var mock = new HttpServerMock(); 878 var mock = new HttpServerMock();
879 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje cts.rulesets; 879 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje cts.rulesets;
880 var arg_name = "foo"; 880 var arg_name = "foo";
881 var arg_pageToken = "foo";
881 var arg_pageSize = 42; 882 var arg_pageSize = 42;
882 var arg_pageToken = "foo";
883 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 883 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
884 var path = (req.url).path; 884 var path = (req.url).path;
885 var pathOffset = 0; 885 var pathOffset = 0;
886 var index; 886 var index;
887 var subPart; 887 var subPart;
888 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 888 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
889 pathOffset += 1; 889 pathOffset += 1;
890 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 890 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
891 pathOffset += 3; 891 pathOffset += 3;
892 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 892 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
893 893
894 var query = (req.url).query; 894 var query = (req.url).query;
895 var queryOffset = 0; 895 var queryOffset = 0;
896 var queryMap = {}; 896 var queryMap = {};
897 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 897 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
898 parseBool(n) { 898 parseBool(n) {
899 if (n == "true") return true; 899 if (n == "true") return true;
900 if (n == "false") return false; 900 if (n == "false") return false;
901 if (n == null) return null; 901 if (n == null) return null;
902 throw new core.ArgumentError("Invalid boolean: $n"); 902 throw new core.ArgumentError("Invalid boolean: $n");
903 } 903 }
904 if (query.length > 0) { 904 if (query.length > 0) {
905 for (var part in query.split("&")) { 905 for (var part in query.split("&")) {
906 var keyvalue = part.split("="); 906 var keyvalue = part.split("=");
907 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 907 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
908 } 908 }
909 } 909 }
910 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
910 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 911 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
911 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
912 912
913 913
914 var h = { 914 var h = {
915 "content-type" : "application/json; charset=utf-8", 915 "content-type" : "application/json; charset=utf-8",
916 }; 916 };
917 var resp = convert.JSON.encode(buildListRulesetsResponse()); 917 var resp = convert.JSON.encode(buildListRulesetsResponse());
918 return new async.Future.value(stringResponse(200, h, resp)); 918 return new async.Future.value(stringResponse(200, h, resp));
919 }), true); 919 }), true);
920 res.list(arg_name, pageSize: arg_pageSize, pageToken: arg_pageToken).then( unittest.expectAsync(((api.ListRulesetsResponse response) { 920 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize).then( unittest.expectAsync(((api.ListRulesetsResponse response) {
921 checkListRulesetsResponse(response); 921 checkListRulesetsResponse(response);
922 }))); 922 })));
923 }); 923 });
924 924
925 }); 925 });
926 926
927 927
928 } 928 }
929 929
OLDNEW
« no previous file with comments | « generated/googleapis/test/firebasedynamiclinks/v1_test.dart ('k') | generated/googleapis/test/fitness/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698