OLD | NEW |
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 checkFile(api.File o) { | 84 checkFile(api.File o) { |
85 buildCounterFile++; | 85 buildCounterFile++; |
86 if (buildCounterFile < 3) { | 86 if (buildCounterFile < 3) { |
87 unittest.expect(o.content, unittest.equals('foo')); | 87 unittest.expect(o.content, unittest.equals('foo')); |
88 unittest.expect(o.fingerprint, unittest.equals('foo')); | 88 unittest.expect(o.fingerprint, unittest.equals('foo')); |
89 unittest.expect(o.name, unittest.equals('foo')); | 89 unittest.expect(o.name, unittest.equals('foo')); |
90 } | 90 } |
91 buildCounterFile--; | 91 buildCounterFile--; |
92 } | 92 } |
93 | 93 |
94 buildUnnamed3075() { | 94 buildUnnamed3078() { |
95 var o = new core.List<core.Object>(); | 95 var o = new core.List<core.Object>(); |
96 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 96 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
97 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 97 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
98 return o; | 98 return o; |
99 } | 99 } |
100 | 100 |
101 checkUnnamed3075(core.List<core.Object> o) { | 101 checkUnnamed3078(core.List<core.Object> o) { |
102 unittest.expect(o, unittest.hasLength(2)); | 102 unittest.expect(o, unittest.hasLength(2)); |
103 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); | 103 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); |
104 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); | 104 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); |
105 } | 105 } |
106 | 106 |
107 core.int buildCounterFunctionCall = 0; | 107 core.int buildCounterFunctionCall = 0; |
108 buildFunctionCall() { | 108 buildFunctionCall() { |
109 var o = new api.FunctionCall(); | 109 var o = new api.FunctionCall(); |
110 buildCounterFunctionCall++; | 110 buildCounterFunctionCall++; |
111 if (buildCounterFunctionCall < 3) { | 111 if (buildCounterFunctionCall < 3) { |
112 o.args = buildUnnamed3075(); | 112 o.args = buildUnnamed3078(); |
113 o.function = "foo"; | 113 o.function = "foo"; |
114 } | 114 } |
115 buildCounterFunctionCall--; | 115 buildCounterFunctionCall--; |
116 return o; | 116 return o; |
117 } | 117 } |
118 | 118 |
119 checkFunctionCall(api.FunctionCall o) { | 119 checkFunctionCall(api.FunctionCall o) { |
120 buildCounterFunctionCall++; | 120 buildCounterFunctionCall++; |
121 if (buildCounterFunctionCall < 3) { | 121 if (buildCounterFunctionCall < 3) { |
122 checkUnnamed3075(o.args); | 122 checkUnnamed3078(o.args); |
123 unittest.expect(o.function, unittest.equals('foo')); | 123 unittest.expect(o.function, unittest.equals('foo')); |
124 } | 124 } |
125 buildCounterFunctionCall--; | 125 buildCounterFunctionCall--; |
126 } | 126 } |
127 | 127 |
128 core.int buildCounterIssue = 0; | 128 core.int buildCounterIssue = 0; |
129 buildIssue() { | 129 buildIssue() { |
130 var o = new api.Issue(); | 130 var o = new api.Issue(); |
131 buildCounterIssue++; | 131 buildCounterIssue++; |
132 if (buildCounterIssue < 3) { | 132 if (buildCounterIssue < 3) { |
133 o.description = "foo"; | 133 o.description = "foo"; |
134 o.severity = "foo"; | 134 o.severity = "foo"; |
135 o.sourcePosition = buildSourcePosition(); | 135 o.sourcePosition = buildSourcePosition(); |
136 } | 136 } |
137 buildCounterIssue--; | 137 buildCounterIssue--; |
138 return o; | 138 return o; |
139 } | 139 } |
140 | 140 |
141 checkIssue(api.Issue o) { | 141 checkIssue(api.Issue o) { |
142 buildCounterIssue++; | 142 buildCounterIssue++; |
143 if (buildCounterIssue < 3) { | 143 if (buildCounterIssue < 3) { |
144 unittest.expect(o.description, unittest.equals('foo')); | 144 unittest.expect(o.description, unittest.equals('foo')); |
145 unittest.expect(o.severity, unittest.equals('foo')); | 145 unittest.expect(o.severity, unittest.equals('foo')); |
146 checkSourcePosition(o.sourcePosition); | 146 checkSourcePosition(o.sourcePosition); |
147 } | 147 } |
148 buildCounterIssue--; | 148 buildCounterIssue--; |
149 } | 149 } |
150 | 150 |
151 buildUnnamed3076() { | 151 buildUnnamed3079() { |
152 var o = new core.List<api.Release>(); | 152 var o = new core.List<api.Release>(); |
153 o.add(buildRelease()); | 153 o.add(buildRelease()); |
154 o.add(buildRelease()); | 154 o.add(buildRelease()); |
155 return o; | 155 return o; |
156 } | 156 } |
157 | 157 |
158 checkUnnamed3076(core.List<api.Release> o) { | 158 checkUnnamed3079(core.List<api.Release> o) { |
159 unittest.expect(o, unittest.hasLength(2)); | 159 unittest.expect(o, unittest.hasLength(2)); |
160 checkRelease(o[0]); | 160 checkRelease(o[0]); |
161 checkRelease(o[1]); | 161 checkRelease(o[1]); |
162 } | 162 } |
163 | 163 |
164 core.int buildCounterListReleasesResponse = 0; | 164 core.int buildCounterListReleasesResponse = 0; |
165 buildListReleasesResponse() { | 165 buildListReleasesResponse() { |
166 var o = new api.ListReleasesResponse(); | 166 var o = new api.ListReleasesResponse(); |
167 buildCounterListReleasesResponse++; | 167 buildCounterListReleasesResponse++; |
168 if (buildCounterListReleasesResponse < 3) { | 168 if (buildCounterListReleasesResponse < 3) { |
169 o.nextPageToken = "foo"; | 169 o.nextPageToken = "foo"; |
170 o.releases = buildUnnamed3076(); | 170 o.releases = buildUnnamed3079(); |
171 } | 171 } |
172 buildCounterListReleasesResponse--; | 172 buildCounterListReleasesResponse--; |
173 return o; | 173 return o; |
174 } | 174 } |
175 | 175 |
176 checkListReleasesResponse(api.ListReleasesResponse o) { | 176 checkListReleasesResponse(api.ListReleasesResponse o) { |
177 buildCounterListReleasesResponse++; | 177 buildCounterListReleasesResponse++; |
178 if (buildCounterListReleasesResponse < 3) { | 178 if (buildCounterListReleasesResponse < 3) { |
179 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 179 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
180 checkUnnamed3076(o.releases); | 180 checkUnnamed3079(o.releases); |
181 } | 181 } |
182 buildCounterListReleasesResponse--; | 182 buildCounterListReleasesResponse--; |
183 } | 183 } |
184 | 184 |
185 buildUnnamed3077() { | 185 buildUnnamed3080() { |
186 var o = new core.List<api.Ruleset>(); | 186 var o = new core.List<api.Ruleset>(); |
187 o.add(buildRuleset()); | 187 o.add(buildRuleset()); |
188 o.add(buildRuleset()); | 188 o.add(buildRuleset()); |
189 return o; | 189 return o; |
190 } | 190 } |
191 | 191 |
192 checkUnnamed3077(core.List<api.Ruleset> o) { | 192 checkUnnamed3080(core.List<api.Ruleset> o) { |
193 unittest.expect(o, unittest.hasLength(2)); | 193 unittest.expect(o, unittest.hasLength(2)); |
194 checkRuleset(o[0]); | 194 checkRuleset(o[0]); |
195 checkRuleset(o[1]); | 195 checkRuleset(o[1]); |
196 } | 196 } |
197 | 197 |
198 core.int buildCounterListRulesetsResponse = 0; | 198 core.int buildCounterListRulesetsResponse = 0; |
199 buildListRulesetsResponse() { | 199 buildListRulesetsResponse() { |
200 var o = new api.ListRulesetsResponse(); | 200 var o = new api.ListRulesetsResponse(); |
201 buildCounterListRulesetsResponse++; | 201 buildCounterListRulesetsResponse++; |
202 if (buildCounterListRulesetsResponse < 3) { | 202 if (buildCounterListRulesetsResponse < 3) { |
203 o.nextPageToken = "foo"; | 203 o.nextPageToken = "foo"; |
204 o.rulesets = buildUnnamed3077(); | 204 o.rulesets = buildUnnamed3080(); |
205 } | 205 } |
206 buildCounterListRulesetsResponse--; | 206 buildCounterListRulesetsResponse--; |
207 return o; | 207 return o; |
208 } | 208 } |
209 | 209 |
210 checkListRulesetsResponse(api.ListRulesetsResponse o) { | 210 checkListRulesetsResponse(api.ListRulesetsResponse o) { |
211 buildCounterListRulesetsResponse++; | 211 buildCounterListRulesetsResponse++; |
212 if (buildCounterListRulesetsResponse < 3) { | 212 if (buildCounterListRulesetsResponse < 3) { |
213 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 213 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
214 checkUnnamed3077(o.rulesets); | 214 checkUnnamed3080(o.rulesets); |
215 } | 215 } |
216 buildCounterListRulesetsResponse--; | 216 buildCounterListRulesetsResponse--; |
217 } | 217 } |
218 | 218 |
219 core.int buildCounterRelease = 0; | 219 core.int buildCounterRelease = 0; |
220 buildRelease() { | 220 buildRelease() { |
221 var o = new api.Release(); | 221 var o = new api.Release(); |
222 buildCounterRelease++; | 222 buildCounterRelease++; |
223 if (buildCounterRelease < 3) { | 223 if (buildCounterRelease < 3) { |
224 o.createTime = "foo"; | 224 o.createTime = "foo"; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 checkRuleset(api.Ruleset o) { | 257 checkRuleset(api.Ruleset o) { |
258 buildCounterRuleset++; | 258 buildCounterRuleset++; |
259 if (buildCounterRuleset < 3) { | 259 if (buildCounterRuleset < 3) { |
260 unittest.expect(o.createTime, unittest.equals('foo')); | 260 unittest.expect(o.createTime, unittest.equals('foo')); |
261 unittest.expect(o.name, unittest.equals('foo')); | 261 unittest.expect(o.name, unittest.equals('foo')); |
262 checkSource(o.source); | 262 checkSource(o.source); |
263 } | 263 } |
264 buildCounterRuleset--; | 264 buildCounterRuleset--; |
265 } | 265 } |
266 | 266 |
267 buildUnnamed3078() { | 267 buildUnnamed3081() { |
268 var o = new core.List<api.File>(); | 268 var o = new core.List<api.File>(); |
269 o.add(buildFile()); | 269 o.add(buildFile()); |
270 o.add(buildFile()); | 270 o.add(buildFile()); |
271 return o; | 271 return o; |
272 } | 272 } |
273 | 273 |
274 checkUnnamed3078(core.List<api.File> o) { | 274 checkUnnamed3081(core.List<api.File> o) { |
275 unittest.expect(o, unittest.hasLength(2)); | 275 unittest.expect(o, unittest.hasLength(2)); |
276 checkFile(o[0]); | 276 checkFile(o[0]); |
277 checkFile(o[1]); | 277 checkFile(o[1]); |
278 } | 278 } |
279 | 279 |
280 core.int buildCounterSource = 0; | 280 core.int buildCounterSource = 0; |
281 buildSource() { | 281 buildSource() { |
282 var o = new api.Source(); | 282 var o = new api.Source(); |
283 buildCounterSource++; | 283 buildCounterSource++; |
284 if (buildCounterSource < 3) { | 284 if (buildCounterSource < 3) { |
285 o.files = buildUnnamed3078(); | 285 o.files = buildUnnamed3081(); |
286 } | 286 } |
287 buildCounterSource--; | 287 buildCounterSource--; |
288 return o; | 288 return o; |
289 } | 289 } |
290 | 290 |
291 checkSource(api.Source o) { | 291 checkSource(api.Source o) { |
292 buildCounterSource++; | 292 buildCounterSource++; |
293 if (buildCounterSource < 3) { | 293 if (buildCounterSource < 3) { |
294 checkUnnamed3078(o.files); | 294 checkUnnamed3081(o.files); |
295 } | 295 } |
296 buildCounterSource--; | 296 buildCounterSource--; |
297 } | 297 } |
298 | 298 |
299 core.int buildCounterSourcePosition = 0; | 299 core.int buildCounterSourcePosition = 0; |
300 buildSourcePosition() { | 300 buildSourcePosition() { |
301 var o = new api.SourcePosition(); | 301 var o = new api.SourcePosition(); |
302 buildCounterSourcePosition++; | 302 buildCounterSourcePosition++; |
303 if (buildCounterSourcePosition < 3) { | 303 if (buildCounterSourcePosition < 3) { |
304 o.column = 42; | 304 o.column = 42; |
305 o.fileName = "foo"; | 305 o.fileName = "foo"; |
306 o.line = 42; | 306 o.line = 42; |
307 } | 307 } |
308 buildCounterSourcePosition--; | 308 buildCounterSourcePosition--; |
309 return o; | 309 return o; |
310 } | 310 } |
311 | 311 |
312 checkSourcePosition(api.SourcePosition o) { | 312 checkSourcePosition(api.SourcePosition o) { |
313 buildCounterSourcePosition++; | 313 buildCounterSourcePosition++; |
314 if (buildCounterSourcePosition < 3) { | 314 if (buildCounterSourcePosition < 3) { |
315 unittest.expect(o.column, unittest.equals(42)); | 315 unittest.expect(o.column, unittest.equals(42)); |
316 unittest.expect(o.fileName, unittest.equals('foo')); | 316 unittest.expect(o.fileName, unittest.equals('foo')); |
317 unittest.expect(o.line, unittest.equals(42)); | 317 unittest.expect(o.line, unittest.equals(42)); |
318 } | 318 } |
319 buildCounterSourcePosition--; | 319 buildCounterSourcePosition--; |
320 } | 320 } |
321 | 321 |
322 buildUnnamed3079() { | 322 buildUnnamed3082() { |
323 var o = new core.List<core.String>(); | 323 var o = new core.List<core.String>(); |
324 o.add("foo"); | 324 o.add("foo"); |
325 o.add("foo"); | 325 o.add("foo"); |
326 return o; | 326 return o; |
327 } | 327 } |
328 | 328 |
329 checkUnnamed3079(core.List<core.String> o) { | 329 checkUnnamed3082(core.List<core.String> o) { |
330 unittest.expect(o, unittest.hasLength(2)); | 330 unittest.expect(o, unittest.hasLength(2)); |
331 unittest.expect(o[0], unittest.equals('foo')); | 331 unittest.expect(o[0], unittest.equals('foo')); |
332 unittest.expect(o[1], unittest.equals('foo')); | 332 unittest.expect(o[1], unittest.equals('foo')); |
333 } | 333 } |
334 | 334 |
335 buildUnnamed3080() { | 335 buildUnnamed3083() { |
336 var o = new core.List<api.FunctionCall>(); | 336 var o = new core.List<api.FunctionCall>(); |
337 o.add(buildFunctionCall()); | 337 o.add(buildFunctionCall()); |
338 o.add(buildFunctionCall()); | 338 o.add(buildFunctionCall()); |
339 return o; | 339 return o; |
340 } | 340 } |
341 | 341 |
342 checkUnnamed3080(core.List<api.FunctionCall> o) { | 342 checkUnnamed3083(core.List<api.FunctionCall> o) { |
343 unittest.expect(o, unittest.hasLength(2)); | 343 unittest.expect(o, unittest.hasLength(2)); |
344 checkFunctionCall(o[0]); | 344 checkFunctionCall(o[0]); |
345 checkFunctionCall(o[1]); | 345 checkFunctionCall(o[1]); |
346 } | 346 } |
347 | 347 |
348 core.int buildCounterTestResult = 0; | 348 core.int buildCounterTestResult = 0; |
349 buildTestResult() { | 349 buildTestResult() { |
350 var o = new api.TestResult(); | 350 var o = new api.TestResult(); |
351 buildCounterTestResult++; | 351 buildCounterTestResult++; |
352 if (buildCounterTestResult < 3) { | 352 if (buildCounterTestResult < 3) { |
353 o.debugMessages = buildUnnamed3079(); | 353 o.debugMessages = buildUnnamed3082(); |
354 o.errorPosition = buildSourcePosition(); | 354 o.errorPosition = buildSourcePosition(); |
355 o.functionCalls = buildUnnamed3080(); | 355 o.functionCalls = buildUnnamed3083(); |
356 o.state = "foo"; | 356 o.state = "foo"; |
357 } | 357 } |
358 buildCounterTestResult--; | 358 buildCounterTestResult--; |
359 return o; | 359 return o; |
360 } | 360 } |
361 | 361 |
362 checkTestResult(api.TestResult o) { | 362 checkTestResult(api.TestResult o) { |
363 buildCounterTestResult++; | 363 buildCounterTestResult++; |
364 if (buildCounterTestResult < 3) { | 364 if (buildCounterTestResult < 3) { |
365 checkUnnamed3079(o.debugMessages); | 365 checkUnnamed3082(o.debugMessages); |
366 checkSourcePosition(o.errorPosition); | 366 checkSourcePosition(o.errorPosition); |
367 checkUnnamed3080(o.functionCalls); | 367 checkUnnamed3083(o.functionCalls); |
368 unittest.expect(o.state, unittest.equals('foo')); | 368 unittest.expect(o.state, unittest.equals('foo')); |
369 } | 369 } |
370 buildCounterTestResult--; | 370 buildCounterTestResult--; |
371 } | 371 } |
372 | 372 |
373 core.int buildCounterTestRulesetRequest = 0; | 373 core.int buildCounterTestRulesetRequest = 0; |
374 buildTestRulesetRequest() { | 374 buildTestRulesetRequest() { |
375 var o = new api.TestRulesetRequest(); | 375 var o = new api.TestRulesetRequest(); |
376 buildCounterTestRulesetRequest++; | 376 buildCounterTestRulesetRequest++; |
377 if (buildCounterTestRulesetRequest < 3) { | 377 if (buildCounterTestRulesetRequest < 3) { |
378 o.source = buildSource(); | 378 o.source = buildSource(); |
379 } | 379 } |
380 buildCounterTestRulesetRequest--; | 380 buildCounterTestRulesetRequest--; |
381 return o; | 381 return o; |
382 } | 382 } |
383 | 383 |
384 checkTestRulesetRequest(api.TestRulesetRequest o) { | 384 checkTestRulesetRequest(api.TestRulesetRequest o) { |
385 buildCounterTestRulesetRequest++; | 385 buildCounterTestRulesetRequest++; |
386 if (buildCounterTestRulesetRequest < 3) { | 386 if (buildCounterTestRulesetRequest < 3) { |
387 checkSource(o.source); | 387 checkSource(o.source); |
388 } | 388 } |
389 buildCounterTestRulesetRequest--; | 389 buildCounterTestRulesetRequest--; |
390 } | 390 } |
391 | 391 |
392 buildUnnamed3081() { | 392 buildUnnamed3084() { |
393 var o = new core.List<api.Issue>(); | 393 var o = new core.List<api.Issue>(); |
394 o.add(buildIssue()); | 394 o.add(buildIssue()); |
395 o.add(buildIssue()); | 395 o.add(buildIssue()); |
396 return o; | 396 return o; |
397 } | 397 } |
398 | 398 |
399 checkUnnamed3081(core.List<api.Issue> o) { | 399 checkUnnamed3084(core.List<api.Issue> o) { |
400 unittest.expect(o, unittest.hasLength(2)); | 400 unittest.expect(o, unittest.hasLength(2)); |
401 checkIssue(o[0]); | 401 checkIssue(o[0]); |
402 checkIssue(o[1]); | 402 checkIssue(o[1]); |
403 } | 403 } |
404 | 404 |
405 buildUnnamed3082() { | 405 buildUnnamed3085() { |
406 var o = new core.List<api.TestResult>(); | 406 var o = new core.List<api.TestResult>(); |
407 o.add(buildTestResult()); | 407 o.add(buildTestResult()); |
408 o.add(buildTestResult()); | 408 o.add(buildTestResult()); |
409 return o; | 409 return o; |
410 } | 410 } |
411 | 411 |
412 checkUnnamed3082(core.List<api.TestResult> o) { | 412 checkUnnamed3085(core.List<api.TestResult> o) { |
413 unittest.expect(o, unittest.hasLength(2)); | 413 unittest.expect(o, unittest.hasLength(2)); |
414 checkTestResult(o[0]); | 414 checkTestResult(o[0]); |
415 checkTestResult(o[1]); | 415 checkTestResult(o[1]); |
416 } | 416 } |
417 | 417 |
418 core.int buildCounterTestRulesetResponse = 0; | 418 core.int buildCounterTestRulesetResponse = 0; |
419 buildTestRulesetResponse() { | 419 buildTestRulesetResponse() { |
420 var o = new api.TestRulesetResponse(); | 420 var o = new api.TestRulesetResponse(); |
421 buildCounterTestRulesetResponse++; | 421 buildCounterTestRulesetResponse++; |
422 if (buildCounterTestRulesetResponse < 3) { | 422 if (buildCounterTestRulesetResponse < 3) { |
423 o.issues = buildUnnamed3081(); | 423 o.issues = buildUnnamed3084(); |
424 o.testResults = buildUnnamed3082(); | 424 o.testResults = buildUnnamed3085(); |
425 } | 425 } |
426 buildCounterTestRulesetResponse--; | 426 buildCounterTestRulesetResponse--; |
427 return o; | 427 return o; |
428 } | 428 } |
429 | 429 |
430 checkTestRulesetResponse(api.TestRulesetResponse o) { | 430 checkTestRulesetResponse(api.TestRulesetResponse o) { |
431 buildCounterTestRulesetResponse++; | 431 buildCounterTestRulesetResponse++; |
432 if (buildCounterTestRulesetResponse < 3) { | 432 if (buildCounterTestRulesetResponse < 3) { |
433 checkUnnamed3081(o.issues); | 433 checkUnnamed3084(o.issues); |
434 checkUnnamed3082(o.testResults); | 434 checkUnnamed3085(o.testResults); |
435 } | 435 } |
436 buildCounterTestRulesetResponse--; | 436 buildCounterTestRulesetResponse--; |
437 } | 437 } |
438 | 438 |
439 | 439 |
440 main() { | 440 main() { |
441 unittest.group("obj-schema-Empty", () { | 441 unittest.group("obj-schema-Empty", () { |
442 unittest.test("to-json--from-json", () { | 442 unittest.test("to-json--from-json", () { |
443 var o = buildEmpty(); | 443 var o = buildEmpty(); |
444 var od = new api.Empty.fromJson(o.toJson()); | 444 var od = new api.Empty.fromJson(o.toJson()); |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 res.get(arg_name).then(unittest.expectAsync(((api.Ruleset response) { | 989 res.get(arg_name).then(unittest.expectAsync(((api.Ruleset response) { |
990 checkRuleset(response); | 990 checkRuleset(response); |
991 }))); | 991 }))); |
992 }); | 992 }); |
993 | 993 |
994 unittest.test("method--list", () { | 994 unittest.test("method--list", () { |
995 | 995 |
996 var mock = new HttpServerMock(); | 996 var mock = new HttpServerMock(); |
997 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; | 997 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; |
998 var arg_name = "foo"; | 998 var arg_name = "foo"; |
999 var arg_filter = "foo"; | |
1000 var arg_pageToken = "foo"; | 999 var arg_pageToken = "foo"; |
1001 var arg_pageSize = 42; | 1000 var arg_pageSize = 42; |
| 1001 var arg_filter = "foo"; |
1002 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1002 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1003 var path = (req.url).path; | 1003 var path = (req.url).path; |
1004 var pathOffset = 0; | 1004 var pathOffset = 0; |
1005 var index; | 1005 var index; |
1006 var subPart; | 1006 var subPart; |
1007 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1007 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1008 pathOffset += 1; | 1008 pathOffset += 1; |
1009 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1009 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1010 pathOffset += 3; | 1010 pathOffset += 3; |
1011 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1011 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1012 | 1012 |
1013 var query = (req.url).query; | 1013 var query = (req.url).query; |
1014 var queryOffset = 0; | 1014 var queryOffset = 0; |
1015 var queryMap = {}; | 1015 var queryMap = {}; |
1016 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1016 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1017 parseBool(n) { | 1017 parseBool(n) { |
1018 if (n == "true") return true; | 1018 if (n == "true") return true; |
1019 if (n == "false") return false; | 1019 if (n == "false") return false; |
1020 if (n == null) return null; | 1020 if (n == null) return null; |
1021 throw new core.ArgumentError("Invalid boolean: $n"); | 1021 throw new core.ArgumentError("Invalid boolean: $n"); |
1022 } | 1022 } |
1023 if (query.length > 0) { | 1023 if (query.length > 0) { |
1024 for (var part in query.split("&")) { | 1024 for (var part in query.split("&")) { |
1025 var keyvalue = part.split("="); | 1025 var keyvalue = part.split("="); |
1026 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1026 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1027 } | 1027 } |
1028 } | 1028 } |
1029 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
1030 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1029 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1031 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1030 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1031 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1032 | 1032 |
1033 | 1033 |
1034 var h = { | 1034 var h = { |
1035 "content-type" : "application/json; charset=utf-8", | 1035 "content-type" : "application/json; charset=utf-8", |
1036 }; | 1036 }; |
1037 var resp = convert.JSON.encode(buildListRulesetsResponse()); | 1037 var resp = convert.JSON.encode(buildListRulesetsResponse()); |
1038 return new async.Future.value(stringResponse(200, h, resp)); | 1038 return new async.Future.value(stringResponse(200, h, resp)); |
1039 }), true); | 1039 }), true); |
1040 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize:
arg_pageSize).then(unittest.expectAsync(((api.ListRulesetsResponse response) { | 1040 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync(((api.ListRulesetsResponse response) { |
1041 checkListRulesetsResponse(response); | 1041 checkListRulesetsResponse(response); |
1042 }))); | 1042 }))); |
1043 }); | 1043 }); |
1044 | 1044 |
1045 }); | 1045 }); |
1046 | 1046 |
1047 | 1047 |
1048 } | 1048 } |
1049 | 1049 |
OLD | NEW |