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

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

Issue 2485703002: Api-roll 42: 2016-11-08 (Closed)
Patch Set: Created 4 years, 1 month 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.cloudresourcemanager.v1.test; 1 library googleapis.cloudresourcemanager.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 http.StreamedResponse stringResponse( 48 http.StreamedResponse stringResponse(
49 core.int status, core.Map headers, core.String body) { 49 core.int status, core.Map headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 51 return new http.StreamedResponse(stream, status, headers: headers);
52 } 52 }
53 53
54 buildUnnamed2174() { 54 buildUnnamed1927() {
55 var o = new core.List<core.String>(); 55 var o = new core.List<core.String>();
56 o.add("foo"); 56 o.add("foo");
57 o.add("foo"); 57 o.add("foo");
58 return o; 58 return o;
59 } 59 }
60 60
61 checkUnnamed2174(core.List<core.String> o) { 61 checkUnnamed1927(core.List<core.String> o) {
62 unittest.expect(o, unittest.hasLength(2)); 62 unittest.expect(o, unittest.hasLength(2));
63 unittest.expect(o[0], unittest.equals('foo')); 63 unittest.expect(o[0], unittest.equals('foo'));
64 unittest.expect(o[1], unittest.equals('foo')); 64 unittest.expect(o[1], unittest.equals('foo'));
65 } 65 }
66 66
67 core.int buildCounterBinding = 0; 67 core.int buildCounterBinding = 0;
68 buildBinding() { 68 buildBinding() {
69 var o = new api.Binding(); 69 var o = new api.Binding();
70 buildCounterBinding++; 70 buildCounterBinding++;
71 if (buildCounterBinding < 3) { 71 if (buildCounterBinding < 3) {
72 o.members = buildUnnamed2174(); 72 o.members = buildUnnamed1927();
73 o.role = "foo"; 73 o.role = "foo";
74 } 74 }
75 buildCounterBinding--; 75 buildCounterBinding--;
76 return o; 76 return o;
77 } 77 }
78 78
79 checkBinding(api.Binding o) { 79 checkBinding(api.Binding o) {
80 buildCounterBinding++; 80 buildCounterBinding++;
81 if (buildCounterBinding < 3) { 81 if (buildCounterBinding < 3) {
82 checkUnnamed2174(o.members); 82 checkUnnamed1927(o.members);
83 unittest.expect(o.role, unittest.equals('foo')); 83 unittest.expect(o.role, unittest.equals('foo'));
84 } 84 }
85 buildCounterBinding--; 85 buildCounterBinding--;
86 } 86 }
87 87
88 core.int buildCounterEmpty = 0; 88 core.int buildCounterEmpty = 0;
89 buildEmpty() { 89 buildEmpty() {
90 var o = new api.Empty(); 90 var o = new api.Empty();
91 buildCounterEmpty++; 91 buildCounterEmpty++;
92 if (buildCounterEmpty < 3) { 92 if (buildCounterEmpty < 3) {
93 } 93 }
94 buildCounterEmpty--; 94 buildCounterEmpty--;
95 return o; 95 return o;
96 } 96 }
97 97
98 checkEmpty(api.Empty o) { 98 checkEmpty(api.Empty o) {
99 buildCounterEmpty++; 99 buildCounterEmpty++;
100 if (buildCounterEmpty < 3) { 100 if (buildCounterEmpty < 3) {
101 } 101 }
102 buildCounterEmpty--; 102 buildCounterEmpty--;
103 } 103 }
104 104
105 core.int buildCounterFolderOperation = 0;
106 buildFolderOperation() {
107 var o = new api.FolderOperation();
108 buildCounterFolderOperation++;
109 if (buildCounterFolderOperation < 3) {
110 o.destinationParent = "foo";
111 o.displayName = "foo";
112 o.operationType = "foo";
113 o.sourceParent = "foo";
114 }
115 buildCounterFolderOperation--;
116 return o;
117 }
118
119 checkFolderOperation(api.FolderOperation o) {
120 buildCounterFolderOperation++;
121 if (buildCounterFolderOperation < 3) {
122 unittest.expect(o.destinationParent, unittest.equals('foo'));
123 unittest.expect(o.displayName, unittest.equals('foo'));
124 unittest.expect(o.operationType, unittest.equals('foo'));
125 unittest.expect(o.sourceParent, unittest.equals('foo'));
126 }
127 buildCounterFolderOperation--;
128 }
129
130 core.int buildCounterFolderOperationError = 0;
131 buildFolderOperationError() {
132 var o = new api.FolderOperationError();
133 buildCounterFolderOperationError++;
134 if (buildCounterFolderOperationError < 3) {
135 o.errorMessageId = "foo";
136 }
137 buildCounterFolderOperationError--;
138 return o;
139 }
140
141 checkFolderOperationError(api.FolderOperationError o) {
142 buildCounterFolderOperationError++;
143 if (buildCounterFolderOperationError < 3) {
144 unittest.expect(o.errorMessageId, unittest.equals('foo'));
145 }
146 buildCounterFolderOperationError--;
147 }
148
105 core.int buildCounterGetIamPolicyRequest = 0; 149 core.int buildCounterGetIamPolicyRequest = 0;
106 buildGetIamPolicyRequest() { 150 buildGetIamPolicyRequest() {
107 var o = new api.GetIamPolicyRequest(); 151 var o = new api.GetIamPolicyRequest();
108 buildCounterGetIamPolicyRequest++; 152 buildCounterGetIamPolicyRequest++;
109 if (buildCounterGetIamPolicyRequest < 3) { 153 if (buildCounterGetIamPolicyRequest < 3) {
110 } 154 }
111 buildCounterGetIamPolicyRequest--; 155 buildCounterGetIamPolicyRequest--;
112 return o; 156 return o;
113 } 157 }
114 158
115 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { 159 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) {
116 buildCounterGetIamPolicyRequest++; 160 buildCounterGetIamPolicyRequest++;
117 if (buildCounterGetIamPolicyRequest < 3) { 161 if (buildCounterGetIamPolicyRequest < 3) {
118 } 162 }
119 buildCounterGetIamPolicyRequest--; 163 buildCounterGetIamPolicyRequest--;
120 } 164 }
121 165
122 buildUnnamed2175() { 166 buildUnnamed1928() {
123 var o = new core.List<api.Project>(); 167 var o = new core.List<api.Project>();
124 o.add(buildProject()); 168 o.add(buildProject());
125 o.add(buildProject()); 169 o.add(buildProject());
126 return o; 170 return o;
127 } 171 }
128 172
129 checkUnnamed2175(core.List<api.Project> o) { 173 checkUnnamed1928(core.List<api.Project> o) {
130 unittest.expect(o, unittest.hasLength(2)); 174 unittest.expect(o, unittest.hasLength(2));
131 checkProject(o[0]); 175 checkProject(o[0]);
132 checkProject(o[1]); 176 checkProject(o[1]);
133 } 177 }
134 178
135 core.int buildCounterListProjectsResponse = 0; 179 core.int buildCounterListProjectsResponse = 0;
136 buildListProjectsResponse() { 180 buildListProjectsResponse() {
137 var o = new api.ListProjectsResponse(); 181 var o = new api.ListProjectsResponse();
138 buildCounterListProjectsResponse++; 182 buildCounterListProjectsResponse++;
139 if (buildCounterListProjectsResponse < 3) { 183 if (buildCounterListProjectsResponse < 3) {
140 o.nextPageToken = "foo"; 184 o.nextPageToken = "foo";
141 o.projects = buildUnnamed2175(); 185 o.projects = buildUnnamed1928();
142 } 186 }
143 buildCounterListProjectsResponse--; 187 buildCounterListProjectsResponse--;
144 return o; 188 return o;
145 } 189 }
146 190
147 checkListProjectsResponse(api.ListProjectsResponse o) { 191 checkListProjectsResponse(api.ListProjectsResponse o) {
148 buildCounterListProjectsResponse++; 192 buildCounterListProjectsResponse++;
149 if (buildCounterListProjectsResponse < 3) { 193 if (buildCounterListProjectsResponse < 3) {
150 unittest.expect(o.nextPageToken, unittest.equals('foo')); 194 unittest.expect(o.nextPageToken, unittest.equals('foo'));
151 checkUnnamed2175(o.projects); 195 checkUnnamed1928(o.projects);
152 } 196 }
153 buildCounterListProjectsResponse--; 197 buildCounterListProjectsResponse--;
154 } 198 }
155 199
156 buildUnnamed2176() { 200 buildUnnamed1929() {
157 var o = new core.Map<core.String, core.Object>(); 201 var o = new core.Map<core.String, core.Object>();
158 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 202 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
159 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 203 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
160 return o; 204 return o;
161 } 205 }
162 206
163 checkUnnamed2176(core.Map<core.String, core.Object> o) { 207 checkUnnamed1929(core.Map<core.String, core.Object> o) {
164 unittest.expect(o, unittest.hasLength(2)); 208 unittest.expect(o, unittest.hasLength(2));
165 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); 209 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo'));
166 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); 210 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo'));
167 } 211 }
168 212
169 buildUnnamed2177() { 213 buildUnnamed1930() {
170 var o = new core.Map<core.String, core.Object>(); 214 var o = new core.Map<core.String, core.Object>();
171 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 215 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
172 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 216 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
173 return o; 217 return o;
174 } 218 }
175 219
176 checkUnnamed2177(core.Map<core.String, core.Object> o) { 220 checkUnnamed1930(core.Map<core.String, core.Object> o) {
177 unittest.expect(o, unittest.hasLength(2)); 221 unittest.expect(o, unittest.hasLength(2));
178 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); 222 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo'));
179 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); 223 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo'));
180 } 224 }
181 225
182 core.int buildCounterOperation = 0; 226 core.int buildCounterOperation = 0;
183 buildOperation() { 227 buildOperation() {
184 var o = new api.Operation(); 228 var o = new api.Operation();
185 buildCounterOperation++; 229 buildCounterOperation++;
186 if (buildCounterOperation < 3) { 230 if (buildCounterOperation < 3) {
187 o.done = true; 231 o.done = true;
188 o.error = buildStatus(); 232 o.error = buildStatus();
189 o.metadata = buildUnnamed2176(); 233 o.metadata = buildUnnamed1929();
190 o.name = "foo"; 234 o.name = "foo";
191 o.response = buildUnnamed2177(); 235 o.response = buildUnnamed1930();
192 } 236 }
193 buildCounterOperation--; 237 buildCounterOperation--;
194 return o; 238 return o;
195 } 239 }
196 240
197 checkOperation(api.Operation o) { 241 checkOperation(api.Operation o) {
198 buildCounterOperation++; 242 buildCounterOperation++;
199 if (buildCounterOperation < 3) { 243 if (buildCounterOperation < 3) {
200 unittest.expect(o.done, unittest.isTrue); 244 unittest.expect(o.done, unittest.isTrue);
201 checkStatus(o.error); 245 checkStatus(o.error);
202 checkUnnamed2176(o.metadata); 246 checkUnnamed1929(o.metadata);
203 unittest.expect(o.name, unittest.equals('foo')); 247 unittest.expect(o.name, unittest.equals('foo'));
204 checkUnnamed2177(o.response); 248 checkUnnamed1930(o.response);
205 } 249 }
206 buildCounterOperation--; 250 buildCounterOperation--;
207 } 251 }
208 252
209 buildUnnamed2178() { 253 core.int buildCounterOrganization = 0;
254 buildOrganization() {
255 var o = new api.Organization();
256 buildCounterOrganization++;
257 if (buildCounterOrganization < 3) {
258 o.creationTime = "foo";
259 o.displayName = "foo";
260 o.lifecycleState = "foo";
261 o.name = "foo";
262 o.owner = buildOrganizationOwner();
263 }
264 buildCounterOrganization--;
265 return o;
266 }
267
268 checkOrganization(api.Organization o) {
269 buildCounterOrganization++;
270 if (buildCounterOrganization < 3) {
271 unittest.expect(o.creationTime, unittest.equals('foo'));
272 unittest.expect(o.displayName, unittest.equals('foo'));
273 unittest.expect(o.lifecycleState, unittest.equals('foo'));
274 unittest.expect(o.name, unittest.equals('foo'));
275 checkOrganizationOwner(o.owner);
276 }
277 buildCounterOrganization--;
278 }
279
280 core.int buildCounterOrganizationOwner = 0;
281 buildOrganizationOwner() {
282 var o = new api.OrganizationOwner();
283 buildCounterOrganizationOwner++;
284 if (buildCounterOrganizationOwner < 3) {
285 o.directoryCustomerId = "foo";
286 }
287 buildCounterOrganizationOwner--;
288 return o;
289 }
290
291 checkOrganizationOwner(api.OrganizationOwner o) {
292 buildCounterOrganizationOwner++;
293 if (buildCounterOrganizationOwner < 3) {
294 unittest.expect(o.directoryCustomerId, unittest.equals('foo'));
295 }
296 buildCounterOrganizationOwner--;
297 }
298
299 buildUnnamed1931() {
210 var o = new core.List<api.Binding>(); 300 var o = new core.List<api.Binding>();
211 o.add(buildBinding()); 301 o.add(buildBinding());
212 o.add(buildBinding()); 302 o.add(buildBinding());
213 return o; 303 return o;
214 } 304 }
215 305
216 checkUnnamed2178(core.List<api.Binding> o) { 306 checkUnnamed1931(core.List<api.Binding> o) {
217 unittest.expect(o, unittest.hasLength(2)); 307 unittest.expect(o, unittest.hasLength(2));
218 checkBinding(o[0]); 308 checkBinding(o[0]);
219 checkBinding(o[1]); 309 checkBinding(o[1]);
220 } 310 }
221 311
222 core.int buildCounterPolicy = 0; 312 core.int buildCounterPolicy = 0;
223 buildPolicy() { 313 buildPolicy() {
224 var o = new api.Policy(); 314 var o = new api.Policy();
225 buildCounterPolicy++; 315 buildCounterPolicy++;
226 if (buildCounterPolicy < 3) { 316 if (buildCounterPolicy < 3) {
227 o.bindings = buildUnnamed2178(); 317 o.bindings = buildUnnamed1931();
228 o.etag = "foo"; 318 o.etag = "foo";
229 o.version = 42; 319 o.version = 42;
230 } 320 }
231 buildCounterPolicy--; 321 buildCounterPolicy--;
232 return o; 322 return o;
233 } 323 }
234 324
235 checkPolicy(api.Policy o) { 325 checkPolicy(api.Policy o) {
236 buildCounterPolicy++; 326 buildCounterPolicy++;
237 if (buildCounterPolicy < 3) { 327 if (buildCounterPolicy < 3) {
238 checkUnnamed2178(o.bindings); 328 checkUnnamed1931(o.bindings);
239 unittest.expect(o.etag, unittest.equals('foo')); 329 unittest.expect(o.etag, unittest.equals('foo'));
240 unittest.expect(o.version, unittest.equals(42)); 330 unittest.expect(o.version, unittest.equals(42));
241 } 331 }
242 buildCounterPolicy--; 332 buildCounterPolicy--;
243 } 333 }
244 334
245 buildUnnamed2179() { 335 buildUnnamed1932() {
246 var o = new core.Map<core.String, core.String>(); 336 var o = new core.Map<core.String, core.String>();
247 o["x"] = "foo"; 337 o["x"] = "foo";
248 o["y"] = "foo"; 338 o["y"] = "foo";
249 return o; 339 return o;
250 } 340 }
251 341
252 checkUnnamed2179(core.Map<core.String, core.String> o) { 342 checkUnnamed1932(core.Map<core.String, core.String> o) {
253 unittest.expect(o, unittest.hasLength(2)); 343 unittest.expect(o, unittest.hasLength(2));
254 unittest.expect(o["x"], unittest.equals('foo')); 344 unittest.expect(o["x"], unittest.equals('foo'));
255 unittest.expect(o["y"], unittest.equals('foo')); 345 unittest.expect(o["y"], unittest.equals('foo'));
256 } 346 }
257 347
258 core.int buildCounterProject = 0; 348 core.int buildCounterProject = 0;
259 buildProject() { 349 buildProject() {
260 var o = new api.Project(); 350 var o = new api.Project();
261 buildCounterProject++; 351 buildCounterProject++;
262 if (buildCounterProject < 3) { 352 if (buildCounterProject < 3) {
263 o.createTime = "foo"; 353 o.createTime = "foo";
264 o.labels = buildUnnamed2179(); 354 o.labels = buildUnnamed1932();
265 o.lifecycleState = "foo"; 355 o.lifecycleState = "foo";
266 o.name = "foo"; 356 o.name = "foo";
267 o.parent = buildResourceId(); 357 o.parent = buildResourceId();
268 o.projectId = "foo"; 358 o.projectId = "foo";
269 o.projectNumber = "foo"; 359 o.projectNumber = "foo";
270 } 360 }
271 buildCounterProject--; 361 buildCounterProject--;
272 return o; 362 return o;
273 } 363 }
274 364
275 checkProject(api.Project o) { 365 checkProject(api.Project o) {
276 buildCounterProject++; 366 buildCounterProject++;
277 if (buildCounterProject < 3) { 367 if (buildCounterProject < 3) {
278 unittest.expect(o.createTime, unittest.equals('foo')); 368 unittest.expect(o.createTime, unittest.equals('foo'));
279 checkUnnamed2179(o.labels); 369 checkUnnamed1932(o.labels);
280 unittest.expect(o.lifecycleState, unittest.equals('foo')); 370 unittest.expect(o.lifecycleState, unittest.equals('foo'));
281 unittest.expect(o.name, unittest.equals('foo')); 371 unittest.expect(o.name, unittest.equals('foo'));
282 checkResourceId(o.parent); 372 checkResourceId(o.parent);
283 unittest.expect(o.projectId, unittest.equals('foo')); 373 unittest.expect(o.projectId, unittest.equals('foo'));
284 unittest.expect(o.projectNumber, unittest.equals('foo')); 374 unittest.expect(o.projectNumber, unittest.equals('foo'));
285 } 375 }
286 buildCounterProject--; 376 buildCounterProject--;
287 } 377 }
288 378
379 core.int buildCounterProjectCreationStatus = 0;
380 buildProjectCreationStatus() {
381 var o = new api.ProjectCreationStatus();
382 buildCounterProjectCreationStatus++;
383 if (buildCounterProjectCreationStatus < 3) {
384 o.createTime = "foo";
385 o.gettable = true;
386 o.ready = true;
387 }
388 buildCounterProjectCreationStatus--;
389 return o;
390 }
391
392 checkProjectCreationStatus(api.ProjectCreationStatus o) {
393 buildCounterProjectCreationStatus++;
394 if (buildCounterProjectCreationStatus < 3) {
395 unittest.expect(o.createTime, unittest.equals('foo'));
396 unittest.expect(o.gettable, unittest.isTrue);
397 unittest.expect(o.ready, unittest.isTrue);
398 }
399 buildCounterProjectCreationStatus--;
400 }
401
289 core.int buildCounterResourceId = 0; 402 core.int buildCounterResourceId = 0;
290 buildResourceId() { 403 buildResourceId() {
291 var o = new api.ResourceId(); 404 var o = new api.ResourceId();
292 buildCounterResourceId++; 405 buildCounterResourceId++;
293 if (buildCounterResourceId < 3) { 406 if (buildCounterResourceId < 3) {
294 o.id = "foo"; 407 o.id = "foo";
295 o.type = "foo"; 408 o.type = "foo";
296 } 409 }
297 buildCounterResourceId--; 410 buildCounterResourceId--;
298 return o; 411 return o;
299 } 412 }
300 413
301 checkResourceId(api.ResourceId o) { 414 checkResourceId(api.ResourceId o) {
302 buildCounterResourceId++; 415 buildCounterResourceId++;
303 if (buildCounterResourceId < 3) { 416 if (buildCounterResourceId < 3) {
304 unittest.expect(o.id, unittest.equals('foo')); 417 unittest.expect(o.id, unittest.equals('foo'));
305 unittest.expect(o.type, unittest.equals('foo')); 418 unittest.expect(o.type, unittest.equals('foo'));
306 } 419 }
307 buildCounterResourceId--; 420 buildCounterResourceId--;
308 } 421 }
309 422
423 core.int buildCounterSearchOrganizationsRequest = 0;
424 buildSearchOrganizationsRequest() {
425 var o = new api.SearchOrganizationsRequest();
426 buildCounterSearchOrganizationsRequest++;
427 if (buildCounterSearchOrganizationsRequest < 3) {
428 o.filter = "foo";
429 o.pageSize = 42;
430 o.pageToken = "foo";
431 }
432 buildCounterSearchOrganizationsRequest--;
433 return o;
434 }
435
436 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) {
437 buildCounterSearchOrganizationsRequest++;
438 if (buildCounterSearchOrganizationsRequest < 3) {
439 unittest.expect(o.filter, unittest.equals('foo'));
440 unittest.expect(o.pageSize, unittest.equals(42));
441 unittest.expect(o.pageToken, unittest.equals('foo'));
442 }
443 buildCounterSearchOrganizationsRequest--;
444 }
445
446 buildUnnamed1933() {
447 var o = new core.List<api.Organization>();
448 o.add(buildOrganization());
449 o.add(buildOrganization());
450 return o;
451 }
452
453 checkUnnamed1933(core.List<api.Organization> o) {
454 unittest.expect(o, unittest.hasLength(2));
455 checkOrganization(o[0]);
456 checkOrganization(o[1]);
457 }
458
459 core.int buildCounterSearchOrganizationsResponse = 0;
460 buildSearchOrganizationsResponse() {
461 var o = new api.SearchOrganizationsResponse();
462 buildCounterSearchOrganizationsResponse++;
463 if (buildCounterSearchOrganizationsResponse < 3) {
464 o.nextPageToken = "foo";
465 o.organizations = buildUnnamed1933();
466 }
467 buildCounterSearchOrganizationsResponse--;
468 return o;
469 }
470
471 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) {
472 buildCounterSearchOrganizationsResponse++;
473 if (buildCounterSearchOrganizationsResponse < 3) {
474 unittest.expect(o.nextPageToken, unittest.equals('foo'));
475 checkUnnamed1933(o.organizations);
476 }
477 buildCounterSearchOrganizationsResponse--;
478 }
479
310 core.int buildCounterSetIamPolicyRequest = 0; 480 core.int buildCounterSetIamPolicyRequest = 0;
311 buildSetIamPolicyRequest() { 481 buildSetIamPolicyRequest() {
312 var o = new api.SetIamPolicyRequest(); 482 var o = new api.SetIamPolicyRequest();
313 buildCounterSetIamPolicyRequest++; 483 buildCounterSetIamPolicyRequest++;
314 if (buildCounterSetIamPolicyRequest < 3) { 484 if (buildCounterSetIamPolicyRequest < 3) {
315 o.policy = buildPolicy(); 485 o.policy = buildPolicy();
316 } 486 }
317 buildCounterSetIamPolicyRequest--; 487 buildCounterSetIamPolicyRequest--;
318 return o; 488 return o;
319 } 489 }
320 490
321 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { 491 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) {
322 buildCounterSetIamPolicyRequest++; 492 buildCounterSetIamPolicyRequest++;
323 if (buildCounterSetIamPolicyRequest < 3) { 493 if (buildCounterSetIamPolicyRequest < 3) {
324 checkPolicy(o.policy); 494 checkPolicy(o.policy);
325 } 495 }
326 buildCounterSetIamPolicyRequest--; 496 buildCounterSetIamPolicyRequest--;
327 } 497 }
328 498
329 buildUnnamed2180() { 499 buildUnnamed1934() {
330 var o = new core.Map<core.String, core.Object>(); 500 var o = new core.Map<core.String, core.Object>();
331 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 501 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
332 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 502 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
333 return o; 503 return o;
334 } 504 }
335 505
336 checkUnnamed2180(core.Map<core.String, core.Object> o) { 506 checkUnnamed1934(core.Map<core.String, core.Object> o) {
337 unittest.expect(o, unittest.hasLength(2)); 507 unittest.expect(o, unittest.hasLength(2));
338 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo')); 508 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo'));
339 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo')); 509 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo'));
340 } 510 }
341 511
342 buildUnnamed2181() { 512 buildUnnamed1935() {
343 var o = new core.List<core.Map<core.String, core.Object>>(); 513 var o = new core.List<core.Map<core.String, core.Object>>();
344 o.add(buildUnnamed2180()); 514 o.add(buildUnnamed1934());
345 o.add(buildUnnamed2180()); 515 o.add(buildUnnamed1934());
346 return o; 516 return o;
347 } 517 }
348 518
349 checkUnnamed2181(core.List<core.Map<core.String, core.Object>> o) { 519 checkUnnamed1935(core.List<core.Map<core.String, core.Object>> o) {
350 unittest.expect(o, unittest.hasLength(2)); 520 unittest.expect(o, unittest.hasLength(2));
351 checkUnnamed2180(o[0]); 521 checkUnnamed1934(o[0]);
352 checkUnnamed2180(o[1]); 522 checkUnnamed1934(o[1]);
353 } 523 }
354 524
355 core.int buildCounterStatus = 0; 525 core.int buildCounterStatus = 0;
356 buildStatus() { 526 buildStatus() {
357 var o = new api.Status(); 527 var o = new api.Status();
358 buildCounterStatus++; 528 buildCounterStatus++;
359 if (buildCounterStatus < 3) { 529 if (buildCounterStatus < 3) {
360 o.code = 42; 530 o.code = 42;
361 o.details = buildUnnamed2181(); 531 o.details = buildUnnamed1935();
362 o.message = "foo"; 532 o.message = "foo";
363 } 533 }
364 buildCounterStatus--; 534 buildCounterStatus--;
365 return o; 535 return o;
366 } 536 }
367 537
368 checkStatus(api.Status o) { 538 checkStatus(api.Status o) {
369 buildCounterStatus++; 539 buildCounterStatus++;
370 if (buildCounterStatus < 3) { 540 if (buildCounterStatus < 3) {
371 unittest.expect(o.code, unittest.equals(42)); 541 unittest.expect(o.code, unittest.equals(42));
372 checkUnnamed2181(o.details); 542 checkUnnamed1935(o.details);
373 unittest.expect(o.message, unittest.equals('foo')); 543 unittest.expect(o.message, unittest.equals('foo'));
374 } 544 }
375 buildCounterStatus--; 545 buildCounterStatus--;
376 } 546 }
377 547
378 buildUnnamed2182() { 548 buildUnnamed1936() {
379 var o = new core.List<core.String>(); 549 var o = new core.List<core.String>();
380 o.add("foo"); 550 o.add("foo");
381 o.add("foo"); 551 o.add("foo");
382 return o; 552 return o;
383 } 553 }
384 554
385 checkUnnamed2182(core.List<core.String> o) { 555 checkUnnamed1936(core.List<core.String> o) {
386 unittest.expect(o, unittest.hasLength(2)); 556 unittest.expect(o, unittest.hasLength(2));
387 unittest.expect(o[0], unittest.equals('foo')); 557 unittest.expect(o[0], unittest.equals('foo'));
388 unittest.expect(o[1], unittest.equals('foo')); 558 unittest.expect(o[1], unittest.equals('foo'));
389 } 559 }
390 560
391 core.int buildCounterTestIamPermissionsRequest = 0; 561 core.int buildCounterTestIamPermissionsRequest = 0;
392 buildTestIamPermissionsRequest() { 562 buildTestIamPermissionsRequest() {
393 var o = new api.TestIamPermissionsRequest(); 563 var o = new api.TestIamPermissionsRequest();
394 buildCounterTestIamPermissionsRequest++; 564 buildCounterTestIamPermissionsRequest++;
395 if (buildCounterTestIamPermissionsRequest < 3) { 565 if (buildCounterTestIamPermissionsRequest < 3) {
396 o.permissions = buildUnnamed2182(); 566 o.permissions = buildUnnamed1936();
397 } 567 }
398 buildCounterTestIamPermissionsRequest--; 568 buildCounterTestIamPermissionsRequest--;
399 return o; 569 return o;
400 } 570 }
401 571
402 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { 572 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
403 buildCounterTestIamPermissionsRequest++; 573 buildCounterTestIamPermissionsRequest++;
404 if (buildCounterTestIamPermissionsRequest < 3) { 574 if (buildCounterTestIamPermissionsRequest < 3) {
405 checkUnnamed2182(o.permissions); 575 checkUnnamed1936(o.permissions);
406 } 576 }
407 buildCounterTestIamPermissionsRequest--; 577 buildCounterTestIamPermissionsRequest--;
408 } 578 }
409 579
410 buildUnnamed2183() { 580 buildUnnamed1937() {
411 var o = new core.List<core.String>(); 581 var o = new core.List<core.String>();
412 o.add("foo"); 582 o.add("foo");
413 o.add("foo"); 583 o.add("foo");
414 return o; 584 return o;
415 } 585 }
416 586
417 checkUnnamed2183(core.List<core.String> o) { 587 checkUnnamed1937(core.List<core.String> o) {
418 unittest.expect(o, unittest.hasLength(2)); 588 unittest.expect(o, unittest.hasLength(2));
419 unittest.expect(o[0], unittest.equals('foo')); 589 unittest.expect(o[0], unittest.equals('foo'));
420 unittest.expect(o[1], unittest.equals('foo')); 590 unittest.expect(o[1], unittest.equals('foo'));
421 } 591 }
422 592
423 core.int buildCounterTestIamPermissionsResponse = 0; 593 core.int buildCounterTestIamPermissionsResponse = 0;
424 buildTestIamPermissionsResponse() { 594 buildTestIamPermissionsResponse() {
425 var o = new api.TestIamPermissionsResponse(); 595 var o = new api.TestIamPermissionsResponse();
426 buildCounterTestIamPermissionsResponse++; 596 buildCounterTestIamPermissionsResponse++;
427 if (buildCounterTestIamPermissionsResponse < 3) { 597 if (buildCounterTestIamPermissionsResponse < 3) {
428 o.permissions = buildUnnamed2183(); 598 o.permissions = buildUnnamed1937();
429 } 599 }
430 buildCounterTestIamPermissionsResponse--; 600 buildCounterTestIamPermissionsResponse--;
431 return o; 601 return o;
432 } 602 }
433 603
434 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { 604 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
435 buildCounterTestIamPermissionsResponse++; 605 buildCounterTestIamPermissionsResponse++;
436 if (buildCounterTestIamPermissionsResponse < 3) { 606 if (buildCounterTestIamPermissionsResponse < 3) {
437 checkUnnamed2183(o.permissions); 607 checkUnnamed1937(o.permissions);
438 } 608 }
439 buildCounterTestIamPermissionsResponse--; 609 buildCounterTestIamPermissionsResponse--;
440 } 610 }
441 611
442 core.int buildCounterUndeleteProjectRequest = 0; 612 core.int buildCounterUndeleteProjectRequest = 0;
443 buildUndeleteProjectRequest() { 613 buildUndeleteProjectRequest() {
444 var o = new api.UndeleteProjectRequest(); 614 var o = new api.UndeleteProjectRequest();
445 buildCounterUndeleteProjectRequest++; 615 buildCounterUndeleteProjectRequest++;
446 if (buildCounterUndeleteProjectRequest < 3) { 616 if (buildCounterUndeleteProjectRequest < 3) {
447 } 617 }
(...skipping 21 matching lines...) Expand all
469 639
470 unittest.group("obj-schema-Empty", () { 640 unittest.group("obj-schema-Empty", () {
471 unittest.test("to-json--from-json", () { 641 unittest.test("to-json--from-json", () {
472 var o = buildEmpty(); 642 var o = buildEmpty();
473 var od = new api.Empty.fromJson(o.toJson()); 643 var od = new api.Empty.fromJson(o.toJson());
474 checkEmpty(od); 644 checkEmpty(od);
475 }); 645 });
476 }); 646 });
477 647
478 648
649 unittest.group("obj-schema-FolderOperation", () {
650 unittest.test("to-json--from-json", () {
651 var o = buildFolderOperation();
652 var od = new api.FolderOperation.fromJson(o.toJson());
653 checkFolderOperation(od);
654 });
655 });
656
657
658 unittest.group("obj-schema-FolderOperationError", () {
659 unittest.test("to-json--from-json", () {
660 var o = buildFolderOperationError();
661 var od = new api.FolderOperationError.fromJson(o.toJson());
662 checkFolderOperationError(od);
663 });
664 });
665
666
479 unittest.group("obj-schema-GetIamPolicyRequest", () { 667 unittest.group("obj-schema-GetIamPolicyRequest", () {
480 unittest.test("to-json--from-json", () { 668 unittest.test("to-json--from-json", () {
481 var o = buildGetIamPolicyRequest(); 669 var o = buildGetIamPolicyRequest();
482 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); 670 var od = new api.GetIamPolicyRequest.fromJson(o.toJson());
483 checkGetIamPolicyRequest(od); 671 checkGetIamPolicyRequest(od);
484 }); 672 });
485 }); 673 });
486 674
487 675
488 unittest.group("obj-schema-ListProjectsResponse", () { 676 unittest.group("obj-schema-ListProjectsResponse", () {
489 unittest.test("to-json--from-json", () { 677 unittest.test("to-json--from-json", () {
490 var o = buildListProjectsResponse(); 678 var o = buildListProjectsResponse();
491 var od = new api.ListProjectsResponse.fromJson(o.toJson()); 679 var od = new api.ListProjectsResponse.fromJson(o.toJson());
492 checkListProjectsResponse(od); 680 checkListProjectsResponse(od);
493 }); 681 });
494 }); 682 });
495 683
496 684
497 unittest.group("obj-schema-Operation", () { 685 unittest.group("obj-schema-Operation", () {
498 unittest.test("to-json--from-json", () { 686 unittest.test("to-json--from-json", () {
499 var o = buildOperation(); 687 var o = buildOperation();
500 var od = new api.Operation.fromJson(o.toJson()); 688 var od = new api.Operation.fromJson(o.toJson());
501 checkOperation(od); 689 checkOperation(od);
502 }); 690 });
503 }); 691 });
504 692
505 693
694 unittest.group("obj-schema-Organization", () {
695 unittest.test("to-json--from-json", () {
696 var o = buildOrganization();
697 var od = new api.Organization.fromJson(o.toJson());
698 checkOrganization(od);
699 });
700 });
701
702
703 unittest.group("obj-schema-OrganizationOwner", () {
704 unittest.test("to-json--from-json", () {
705 var o = buildOrganizationOwner();
706 var od = new api.OrganizationOwner.fromJson(o.toJson());
707 checkOrganizationOwner(od);
708 });
709 });
710
711
506 unittest.group("obj-schema-Policy", () { 712 unittest.group("obj-schema-Policy", () {
507 unittest.test("to-json--from-json", () { 713 unittest.test("to-json--from-json", () {
508 var o = buildPolicy(); 714 var o = buildPolicy();
509 var od = new api.Policy.fromJson(o.toJson()); 715 var od = new api.Policy.fromJson(o.toJson());
510 checkPolicy(od); 716 checkPolicy(od);
511 }); 717 });
512 }); 718 });
513 719
514 720
515 unittest.group("obj-schema-Project", () { 721 unittest.group("obj-schema-Project", () {
516 unittest.test("to-json--from-json", () { 722 unittest.test("to-json--from-json", () {
517 var o = buildProject(); 723 var o = buildProject();
518 var od = new api.Project.fromJson(o.toJson()); 724 var od = new api.Project.fromJson(o.toJson());
519 checkProject(od); 725 checkProject(od);
520 }); 726 });
521 }); 727 });
522 728
523 729
730 unittest.group("obj-schema-ProjectCreationStatus", () {
731 unittest.test("to-json--from-json", () {
732 var o = buildProjectCreationStatus();
733 var od = new api.ProjectCreationStatus.fromJson(o.toJson());
734 checkProjectCreationStatus(od);
735 });
736 });
737
738
524 unittest.group("obj-schema-ResourceId", () { 739 unittest.group("obj-schema-ResourceId", () {
525 unittest.test("to-json--from-json", () { 740 unittest.test("to-json--from-json", () {
526 var o = buildResourceId(); 741 var o = buildResourceId();
527 var od = new api.ResourceId.fromJson(o.toJson()); 742 var od = new api.ResourceId.fromJson(o.toJson());
528 checkResourceId(od); 743 checkResourceId(od);
529 }); 744 });
530 }); 745 });
531 746
532 747
748 unittest.group("obj-schema-SearchOrganizationsRequest", () {
749 unittest.test("to-json--from-json", () {
750 var o = buildSearchOrganizationsRequest();
751 var od = new api.SearchOrganizationsRequest.fromJson(o.toJson());
752 checkSearchOrganizationsRequest(od);
753 });
754 });
755
756
757 unittest.group("obj-schema-SearchOrganizationsResponse", () {
758 unittest.test("to-json--from-json", () {
759 var o = buildSearchOrganizationsResponse();
760 var od = new api.SearchOrganizationsResponse.fromJson(o.toJson());
761 checkSearchOrganizationsResponse(od);
762 });
763 });
764
765
533 unittest.group("obj-schema-SetIamPolicyRequest", () { 766 unittest.group("obj-schema-SetIamPolicyRequest", () {
534 unittest.test("to-json--from-json", () { 767 unittest.test("to-json--from-json", () {
535 var o = buildSetIamPolicyRequest(); 768 var o = buildSetIamPolicyRequest();
536 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); 769 var od = new api.SetIamPolicyRequest.fromJson(o.toJson());
537 checkSetIamPolicyRequest(od); 770 checkSetIamPolicyRequest(od);
538 }); 771 });
539 }); 772 });
540 773
541 774
542 unittest.group("obj-schema-Status", () { 775 unittest.group("obj-schema-Status", () {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 return new async.Future.value(stringResponse(200, h, resp)); 850 return new async.Future.value(stringResponse(200, h, resp));
618 }), true); 851 }), true);
619 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { 852 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) {
620 checkOperation(response); 853 checkOperation(response);
621 }))); 854 })));
622 }); 855 });
623 856
624 }); 857 });
625 858
626 859
860 unittest.group("resource-OrganizationsResourceApi", () {
861 unittest.test("method--get", () {
862
863 var mock = new HttpServerMock();
864 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o rganizations;
865 var arg_name = "foo";
866 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
867 var path = (req.url).path;
868 var pathOffset = 0;
869 var index;
870 var subPart;
871 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
872 pathOffset += 1;
873 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
874 pathOffset += 3;
875 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
876
877 var query = (req.url).query;
878 var queryOffset = 0;
879 var queryMap = {};
880 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
881 parseBool(n) {
882 if (n == "true") return true;
883 if (n == "false") return false;
884 if (n == null) return null;
885 throw new core.ArgumentError("Invalid boolean: $n");
886 }
887 if (query.length > 0) {
888 for (var part in query.split("&")) {
889 var keyvalue = part.split("=");
890 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
891 }
892 }
893
894
895 var h = {
896 "content-type" : "application/json; charset=utf-8",
897 };
898 var resp = convert.JSON.encode(buildOrganization());
899 return new async.Future.value(stringResponse(200, h, resp));
900 }), true);
901 res.get(arg_name).then(unittest.expectAsync(((api.Organization response) {
902 checkOrganization(response);
903 })));
904 });
905
906 unittest.test("method--getIamPolicy", () {
907
908 var mock = new HttpServerMock();
909 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o rganizations;
910 var arg_request = buildGetIamPolicyRequest();
911 var arg_resource = "foo";
912 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
913 var obj = new api.GetIamPolicyRequest.fromJson(json);
914 checkGetIamPolicyRequest(obj);
915
916 var path = (req.url).path;
917 var pathOffset = 0;
918 var index;
919 var subPart;
920 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
921 pathOffset += 1;
922 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
923 pathOffset += 3;
924 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
925
926 var query = (req.url).query;
927 var queryOffset = 0;
928 var queryMap = {};
929 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
930 parseBool(n) {
931 if (n == "true") return true;
932 if (n == "false") return false;
933 if (n == null) return null;
934 throw new core.ArgumentError("Invalid boolean: $n");
935 }
936 if (query.length > 0) {
937 for (var part in query.split("&")) {
938 var keyvalue = part.split("=");
939 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
940 }
941 }
942
943
944 var h = {
945 "content-type" : "application/json; charset=utf-8",
946 };
947 var resp = convert.JSON.encode(buildPolicy());
948 return new async.Future.value(stringResponse(200, h, resp));
949 }), true);
950 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap i.Policy response) {
951 checkPolicy(response);
952 })));
953 });
954
955 unittest.test("method--search", () {
956
957 var mock = new HttpServerMock();
958 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o rganizations;
959 var arg_request = buildSearchOrganizationsRequest();
960 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
961 var obj = new api.SearchOrganizationsRequest.fromJson(json);
962 checkSearchOrganizationsRequest(obj);
963
964 var path = (req.url).path;
965 var pathOffset = 0;
966 var index;
967 var subPart;
968 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
969 pathOffset += 1;
970 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq uals("v1/organizations:search"));
971 pathOffset += 23;
972
973 var query = (req.url).query;
974 var queryOffset = 0;
975 var queryMap = {};
976 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
977 parseBool(n) {
978 if (n == "true") return true;
979 if (n == "false") return false;
980 if (n == null) return null;
981 throw new core.ArgumentError("Invalid boolean: $n");
982 }
983 if (query.length > 0) {
984 for (var part in query.split("&")) {
985 var keyvalue = part.split("=");
986 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
987 }
988 }
989
990
991 var h = {
992 "content-type" : "application/json; charset=utf-8",
993 };
994 var resp = convert.JSON.encode(buildSearchOrganizationsResponse());
995 return new async.Future.value(stringResponse(200, h, resp));
996 }), true);
997 res.search(arg_request).then(unittest.expectAsync(((api.SearchOrganization sResponse response) {
998 checkSearchOrganizationsResponse(response);
999 })));
1000 });
1001
1002 unittest.test("method--setIamPolicy", () {
1003
1004 var mock = new HttpServerMock();
1005 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o rganizations;
1006 var arg_request = buildSetIamPolicyRequest();
1007 var arg_resource = "foo";
1008 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1009 var obj = new api.SetIamPolicyRequest.fromJson(json);
1010 checkSetIamPolicyRequest(obj);
1011
1012 var path = (req.url).path;
1013 var pathOffset = 0;
1014 var index;
1015 var subPart;
1016 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1017 pathOffset += 1;
1018 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
1019 pathOffset += 3;
1020 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1021
1022 var query = (req.url).query;
1023 var queryOffset = 0;
1024 var queryMap = {};
1025 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1026 parseBool(n) {
1027 if (n == "true") return true;
1028 if (n == "false") return false;
1029 if (n == null) return null;
1030 throw new core.ArgumentError("Invalid boolean: $n");
1031 }
1032 if (query.length > 0) {
1033 for (var part in query.split("&")) {
1034 var keyvalue = part.split("=");
1035 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1036 }
1037 }
1038
1039
1040 var h = {
1041 "content-type" : "application/json; charset=utf-8",
1042 };
1043 var resp = convert.JSON.encode(buildPolicy());
1044 return new async.Future.value(stringResponse(200, h, resp));
1045 }), true);
1046 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap i.Policy response) {
1047 checkPolicy(response);
1048 })));
1049 });
1050
1051 unittest.test("method--testIamPermissions", () {
1052
1053 var mock = new HttpServerMock();
1054 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o rganizations;
1055 var arg_request = buildTestIamPermissionsRequest();
1056 var arg_resource = "foo";
1057 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1058 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1059 checkTestIamPermissionsRequest(obj);
1060
1061 var path = (req.url).path;
1062 var pathOffset = 0;
1063 var index;
1064 var subPart;
1065 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1066 pathOffset += 1;
1067 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
1068 pathOffset += 3;
1069 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1070
1071 var query = (req.url).query;
1072 var queryOffset = 0;
1073 var queryMap = {};
1074 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1075 parseBool(n) {
1076 if (n == "true") return true;
1077 if (n == "false") return false;
1078 if (n == null) return null;
1079 throw new core.ArgumentError("Invalid boolean: $n");
1080 }
1081 if (query.length > 0) {
1082 for (var part in query.split("&")) {
1083 var keyvalue = part.split("=");
1084 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1085 }
1086 }
1087
1088
1089 var h = {
1090 "content-type" : "application/json; charset=utf-8",
1091 };
1092 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1093 return new async.Future.value(stringResponse(200, h, resp));
1094 }), true);
1095 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c(((api.TestIamPermissionsResponse response) {
1096 checkTestIamPermissionsResponse(response);
1097 })));
1098 });
1099
1100 });
1101
1102
627 unittest.group("resource-ProjectsResourceApi", () { 1103 unittest.group("resource-ProjectsResourceApi", () {
1104 unittest.test("method--create", () {
1105
1106 var mock = new HttpServerMock();
1107 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec ts;
1108 var arg_request = buildProject();
1109 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1110 var obj = new api.Project.fromJson(json);
1111 checkProject(obj);
1112
1113 var path = (req.url).path;
1114 var pathOffset = 0;
1115 var index;
1116 var subPart;
1117 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1118 pathOffset += 1;
1119 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("v1/projects"));
1120 pathOffset += 11;
1121
1122 var query = (req.url).query;
1123 var queryOffset = 0;
1124 var queryMap = {};
1125 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1126 parseBool(n) {
1127 if (n == "true") return true;
1128 if (n == "false") return false;
1129 if (n == null) return null;
1130 throw new core.ArgumentError("Invalid boolean: $n");
1131 }
1132 if (query.length > 0) {
1133 for (var part in query.split("&")) {
1134 var keyvalue = part.split("=");
1135 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1136 }
1137 }
1138
1139
1140 var h = {
1141 "content-type" : "application/json; charset=utf-8",
1142 };
1143 var resp = convert.JSON.encode(buildOperation());
1144 return new async.Future.value(stringResponse(200, h, resp));
1145 }), true);
1146 res.create(arg_request).then(unittest.expectAsync(((api.Operation response ) {
1147 checkOperation(response);
1148 })));
1149 });
1150
628 unittest.test("method--delete", () { 1151 unittest.test("method--delete", () {
629 1152
630 var mock = new HttpServerMock(); 1153 var mock = new HttpServerMock();
631 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec ts; 1154 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec ts;
632 var arg_projectId = "foo"; 1155 var arg_projectId = "foo";
633 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1156 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
634 var path = (req.url).path; 1157 var path = (req.url).path;
635 var pathOffset = 0; 1158 var pathOffset = 0;
636 var index; 1159 var index;
637 var subPart; 1160 var subPart;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro ject response) { 1560 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro ject response) {
1038 checkProject(response); 1561 checkProject(response);
1039 }))); 1562 })));
1040 }); 1563 });
1041 1564
1042 }); 1565 });
1043 1566
1044 1567
1045 } 1568 }
1046 1569
OLDNEW
« no previous file with comments | « generated/googleapis/test/clouddebugger/v2_test.dart ('k') | generated/googleapis/test/compute/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698