| 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:test/test.dart' as unittest; |
| 11 | 11 |
| 12 import 'package:googleapis/firebaserules/v1.dart' as api; | 12 import 'package:googleapis/firebaserules/v1.dart' as api; |
| 13 | 13 |
| 14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 15 core.Function _callback; |
| 16 core.bool _expectJson; | 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 19 _callback = callback; |
| 20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 } else { | 39 } else { |
| 40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 41 return _callback(request, data); |
| 42 }); | 42 }); |
| 43 } | 43 } |
| 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<core.String, core.String> headers, core.String bod
y) { |
| 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 core.int buildCounterArg = 0; |
| 55 buildArg() { |
| 56 var o = new api.Arg(); |
| 57 buildCounterArg++; |
| 58 if (buildCounterArg < 3) { |
| 59 o.anyValue = buildEmpty(); |
| 60 o.exactValue = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 61 } |
| 62 buildCounterArg--; |
| 63 return o; |
| 64 } |
| 65 |
| 66 checkArg(api.Arg o) { |
| 67 buildCounterArg++; |
| 68 if (buildCounterArg < 3) { |
| 69 checkEmpty(o.anyValue); |
| 70 var casted1 = (o.exactValue) as core.Map; unittest.expect(casted1, unittest.
hasLength(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); uni
ttest.expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["s
tring"], unittest.equals('foo')); |
| 71 } |
| 72 buildCounterArg--; |
| 73 } |
| 74 |
| 54 core.int buildCounterEmpty = 0; | 75 core.int buildCounterEmpty = 0; |
| 55 buildEmpty() { | 76 buildEmpty() { |
| 56 var o = new api.Empty(); | 77 var o = new api.Empty(); |
| 57 buildCounterEmpty++; | 78 buildCounterEmpty++; |
| 58 if (buildCounterEmpty < 3) { | 79 if (buildCounterEmpty < 3) { |
| 59 } | 80 } |
| 60 buildCounterEmpty--; | 81 buildCounterEmpty--; |
| 61 return o; | 82 return o; |
| 62 } | 83 } |
| 63 | 84 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 84 checkFile(api.File o) { | 105 checkFile(api.File o) { |
| 85 buildCounterFile++; | 106 buildCounterFile++; |
| 86 if (buildCounterFile < 3) { | 107 if (buildCounterFile < 3) { |
| 87 unittest.expect(o.content, unittest.equals('foo')); | 108 unittest.expect(o.content, unittest.equals('foo')); |
| 88 unittest.expect(o.fingerprint, unittest.equals('foo')); | 109 unittest.expect(o.fingerprint, unittest.equals('foo')); |
| 89 unittest.expect(o.name, unittest.equals('foo')); | 110 unittest.expect(o.name, unittest.equals('foo')); |
| 90 } | 111 } |
| 91 buildCounterFile--; | 112 buildCounterFile--; |
| 92 } | 113 } |
| 93 | 114 |
| 94 buildUnnamed3439() { | 115 buildUnnamed2910() { |
| 95 var o = new core.List<core.Object>(); | 116 var o = new core.List<core.Object>(); |
| 96 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 117 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| 97 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 118 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| 98 return o; | 119 return o; |
| 99 } | 120 } |
| 100 | 121 |
| 101 checkUnnamed3439(core.List<core.Object> o) { | 122 checkUnnamed2910(core.List<core.Object> o) { |
| 102 unittest.expect(o, unittest.hasLength(2)); | 123 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')); | 124 var casted2 = (o[0]) 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')); | 125 var casted3 = (o[1]) as core.Map; unittest.expect(casted3, unittest.hasLength(
3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], u
nittest.equals('foo')); |
| 105 } | 126 } |
| 106 | 127 |
| 107 core.int buildCounterFunctionCall = 0; | 128 core.int buildCounterFunctionCall = 0; |
| 108 buildFunctionCall() { | 129 buildFunctionCall() { |
| 109 var o = new api.FunctionCall(); | 130 var o = new api.FunctionCall(); |
| 110 buildCounterFunctionCall++; | 131 buildCounterFunctionCall++; |
| 111 if (buildCounterFunctionCall < 3) { | 132 if (buildCounterFunctionCall < 3) { |
| 112 o.args = buildUnnamed3439(); | 133 o.args = buildUnnamed2910(); |
| 113 o.function = "foo"; | 134 o.function = "foo"; |
| 114 } | 135 } |
| 115 buildCounterFunctionCall--; | 136 buildCounterFunctionCall--; |
| 116 return o; | 137 return o; |
| 117 } | 138 } |
| 118 | 139 |
| 119 checkFunctionCall(api.FunctionCall o) { | 140 checkFunctionCall(api.FunctionCall o) { |
| 120 buildCounterFunctionCall++; | 141 buildCounterFunctionCall++; |
| 121 if (buildCounterFunctionCall < 3) { | 142 if (buildCounterFunctionCall < 3) { |
| 122 checkUnnamed3439(o.args); | 143 checkUnnamed2910(o.args); |
| 123 unittest.expect(o.function, unittest.equals('foo')); | 144 unittest.expect(o.function, unittest.equals('foo')); |
| 124 } | 145 } |
| 125 buildCounterFunctionCall--; | 146 buildCounterFunctionCall--; |
| 126 } | 147 } |
| 127 | 148 |
| 149 buildUnnamed2911() { |
| 150 var o = new core.List<api.Arg>(); |
| 151 o.add(buildArg()); |
| 152 o.add(buildArg()); |
| 153 return o; |
| 154 } |
| 155 |
| 156 checkUnnamed2911(core.List<api.Arg> o) { |
| 157 unittest.expect(o, unittest.hasLength(2)); |
| 158 checkArg(o[0]); |
| 159 checkArg(o[1]); |
| 160 } |
| 161 |
| 162 core.int buildCounterFunctionMock = 0; |
| 163 buildFunctionMock() { |
| 164 var o = new api.FunctionMock(); |
| 165 buildCounterFunctionMock++; |
| 166 if (buildCounterFunctionMock < 3) { |
| 167 o.args = buildUnnamed2911(); |
| 168 o.function = "foo"; |
| 169 o.result = buildResult(); |
| 170 } |
| 171 buildCounterFunctionMock--; |
| 172 return o; |
| 173 } |
| 174 |
| 175 checkFunctionMock(api.FunctionMock o) { |
| 176 buildCounterFunctionMock++; |
| 177 if (buildCounterFunctionMock < 3) { |
| 178 checkUnnamed2911(o.args); |
| 179 unittest.expect(o.function, unittest.equals('foo')); |
| 180 checkResult(o.result); |
| 181 } |
| 182 buildCounterFunctionMock--; |
| 183 } |
| 184 |
| 128 core.int buildCounterIssue = 0; | 185 core.int buildCounterIssue = 0; |
| 129 buildIssue() { | 186 buildIssue() { |
| 130 var o = new api.Issue(); | 187 var o = new api.Issue(); |
| 131 buildCounterIssue++; | 188 buildCounterIssue++; |
| 132 if (buildCounterIssue < 3) { | 189 if (buildCounterIssue < 3) { |
| 133 o.description = "foo"; | 190 o.description = "foo"; |
| 134 o.severity = "foo"; | 191 o.severity = "foo"; |
| 135 o.sourcePosition = buildSourcePosition(); | 192 o.sourcePosition = buildSourcePosition(); |
| 136 } | 193 } |
| 137 buildCounterIssue--; | 194 buildCounterIssue--; |
| 138 return o; | 195 return o; |
| 139 } | 196 } |
| 140 | 197 |
| 141 checkIssue(api.Issue o) { | 198 checkIssue(api.Issue o) { |
| 142 buildCounterIssue++; | 199 buildCounterIssue++; |
| 143 if (buildCounterIssue < 3) { | 200 if (buildCounterIssue < 3) { |
| 144 unittest.expect(o.description, unittest.equals('foo')); | 201 unittest.expect(o.description, unittest.equals('foo')); |
| 145 unittest.expect(o.severity, unittest.equals('foo')); | 202 unittest.expect(o.severity, unittest.equals('foo')); |
| 146 checkSourcePosition(o.sourcePosition); | 203 checkSourcePosition(o.sourcePosition); |
| 147 } | 204 } |
| 148 buildCounterIssue--; | 205 buildCounterIssue--; |
| 149 } | 206 } |
| 150 | 207 |
| 151 buildUnnamed3440() { | 208 buildUnnamed2912() { |
| 152 var o = new core.List<api.Release>(); | 209 var o = new core.List<api.Release>(); |
| 153 o.add(buildRelease()); | 210 o.add(buildRelease()); |
| 154 o.add(buildRelease()); | 211 o.add(buildRelease()); |
| 155 return o; | 212 return o; |
| 156 } | 213 } |
| 157 | 214 |
| 158 checkUnnamed3440(core.List<api.Release> o) { | 215 checkUnnamed2912(core.List<api.Release> o) { |
| 159 unittest.expect(o, unittest.hasLength(2)); | 216 unittest.expect(o, unittest.hasLength(2)); |
| 160 checkRelease(o[0]); | 217 checkRelease(o[0]); |
| 161 checkRelease(o[1]); | 218 checkRelease(o[1]); |
| 162 } | 219 } |
| 163 | 220 |
| 164 core.int buildCounterListReleasesResponse = 0; | 221 core.int buildCounterListReleasesResponse = 0; |
| 165 buildListReleasesResponse() { | 222 buildListReleasesResponse() { |
| 166 var o = new api.ListReleasesResponse(); | 223 var o = new api.ListReleasesResponse(); |
| 167 buildCounterListReleasesResponse++; | 224 buildCounterListReleasesResponse++; |
| 168 if (buildCounterListReleasesResponse < 3) { | 225 if (buildCounterListReleasesResponse < 3) { |
| 169 o.nextPageToken = "foo"; | 226 o.nextPageToken = "foo"; |
| 170 o.releases = buildUnnamed3440(); | 227 o.releases = buildUnnamed2912(); |
| 171 } | 228 } |
| 172 buildCounterListReleasesResponse--; | 229 buildCounterListReleasesResponse--; |
| 173 return o; | 230 return o; |
| 174 } | 231 } |
| 175 | 232 |
| 176 checkListReleasesResponse(api.ListReleasesResponse o) { | 233 checkListReleasesResponse(api.ListReleasesResponse o) { |
| 177 buildCounterListReleasesResponse++; | 234 buildCounterListReleasesResponse++; |
| 178 if (buildCounterListReleasesResponse < 3) { | 235 if (buildCounterListReleasesResponse < 3) { |
| 179 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 236 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 180 checkUnnamed3440(o.releases); | 237 checkUnnamed2912(o.releases); |
| 181 } | 238 } |
| 182 buildCounterListReleasesResponse--; | 239 buildCounterListReleasesResponse--; |
| 183 } | 240 } |
| 184 | 241 |
| 185 buildUnnamed3441() { | 242 buildUnnamed2913() { |
| 186 var o = new core.List<api.Ruleset>(); | 243 var o = new core.List<api.Ruleset>(); |
| 187 o.add(buildRuleset()); | 244 o.add(buildRuleset()); |
| 188 o.add(buildRuleset()); | 245 o.add(buildRuleset()); |
| 189 return o; | 246 return o; |
| 190 } | 247 } |
| 191 | 248 |
| 192 checkUnnamed3441(core.List<api.Ruleset> o) { | 249 checkUnnamed2913(core.List<api.Ruleset> o) { |
| 193 unittest.expect(o, unittest.hasLength(2)); | 250 unittest.expect(o, unittest.hasLength(2)); |
| 194 checkRuleset(o[0]); | 251 checkRuleset(o[0]); |
| 195 checkRuleset(o[1]); | 252 checkRuleset(o[1]); |
| 196 } | 253 } |
| 197 | 254 |
| 198 core.int buildCounterListRulesetsResponse = 0; | 255 core.int buildCounterListRulesetsResponse = 0; |
| 199 buildListRulesetsResponse() { | 256 buildListRulesetsResponse() { |
| 200 var o = new api.ListRulesetsResponse(); | 257 var o = new api.ListRulesetsResponse(); |
| 201 buildCounterListRulesetsResponse++; | 258 buildCounterListRulesetsResponse++; |
| 202 if (buildCounterListRulesetsResponse < 3) { | 259 if (buildCounterListRulesetsResponse < 3) { |
| 203 o.nextPageToken = "foo"; | 260 o.nextPageToken = "foo"; |
| 204 o.rulesets = buildUnnamed3441(); | 261 o.rulesets = buildUnnamed2913(); |
| 205 } | 262 } |
| 206 buildCounterListRulesetsResponse--; | 263 buildCounterListRulesetsResponse--; |
| 207 return o; | 264 return o; |
| 208 } | 265 } |
| 209 | 266 |
| 210 checkListRulesetsResponse(api.ListRulesetsResponse o) { | 267 checkListRulesetsResponse(api.ListRulesetsResponse o) { |
| 211 buildCounterListRulesetsResponse++; | 268 buildCounterListRulesetsResponse++; |
| 212 if (buildCounterListRulesetsResponse < 3) { | 269 if (buildCounterListRulesetsResponse < 3) { |
| 213 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 270 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 214 checkUnnamed3441(o.rulesets); | 271 checkUnnamed2913(o.rulesets); |
| 215 } | 272 } |
| 216 buildCounterListRulesetsResponse--; | 273 buildCounterListRulesetsResponse--; |
| 217 } | 274 } |
| 218 | 275 |
| 219 core.int buildCounterRelease = 0; | 276 core.int buildCounterRelease = 0; |
| 220 buildRelease() { | 277 buildRelease() { |
| 221 var o = new api.Release(); | 278 var o = new api.Release(); |
| 222 buildCounterRelease++; | 279 buildCounterRelease++; |
| 223 if (buildCounterRelease < 3) { | 280 if (buildCounterRelease < 3) { |
| 224 o.createTime = "foo"; | 281 o.createTime = "foo"; |
| 225 o.name = "foo"; | 282 o.name = "foo"; |
| 226 o.rulesetName = "foo"; | 283 o.rulesetName = "foo"; |
| 227 o.updateTime = "foo"; | 284 o.updateTime = "foo"; |
| 228 } | 285 } |
| 229 buildCounterRelease--; | 286 buildCounterRelease--; |
| 230 return o; | 287 return o; |
| 231 } | 288 } |
| 232 | 289 |
| 233 checkRelease(api.Release o) { | 290 checkRelease(api.Release o) { |
| 234 buildCounterRelease++; | 291 buildCounterRelease++; |
| 235 if (buildCounterRelease < 3) { | 292 if (buildCounterRelease < 3) { |
| 236 unittest.expect(o.createTime, unittest.equals('foo')); | 293 unittest.expect(o.createTime, unittest.equals('foo')); |
| 237 unittest.expect(o.name, unittest.equals('foo')); | 294 unittest.expect(o.name, unittest.equals('foo')); |
| 238 unittest.expect(o.rulesetName, unittest.equals('foo')); | 295 unittest.expect(o.rulesetName, unittest.equals('foo')); |
| 239 unittest.expect(o.updateTime, unittest.equals('foo')); | 296 unittest.expect(o.updateTime, unittest.equals('foo')); |
| 240 } | 297 } |
| 241 buildCounterRelease--; | 298 buildCounterRelease--; |
| 242 } | 299 } |
| 243 | 300 |
| 301 core.int buildCounterResult = 0; |
| 302 buildResult() { |
| 303 var o = new api.Result(); |
| 304 buildCounterResult++; |
| 305 if (buildCounterResult < 3) { |
| 306 o.undefined = buildEmpty(); |
| 307 o.value = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 308 } |
| 309 buildCounterResult--; |
| 310 return o; |
| 311 } |
| 312 |
| 313 checkResult(api.Result o) { |
| 314 buildCounterResult++; |
| 315 if (buildCounterResult < 3) { |
| 316 checkEmpty(o.undefined); |
| 317 var casted4 = (o.value) as core.Map; unittest.expect(casted4, unittest.hasLe
ngth(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string
"], unittest.equals('foo')); |
| 318 } |
| 319 buildCounterResult--; |
| 320 } |
| 321 |
| 244 core.int buildCounterRuleset = 0; | 322 core.int buildCounterRuleset = 0; |
| 245 buildRuleset() { | 323 buildRuleset() { |
| 246 var o = new api.Ruleset(); | 324 var o = new api.Ruleset(); |
| 247 buildCounterRuleset++; | 325 buildCounterRuleset++; |
| 248 if (buildCounterRuleset < 3) { | 326 if (buildCounterRuleset < 3) { |
| 249 o.createTime = "foo"; | 327 o.createTime = "foo"; |
| 250 o.name = "foo"; | 328 o.name = "foo"; |
| 251 o.source = buildSource(); | 329 o.source = buildSource(); |
| 252 } | 330 } |
| 253 buildCounterRuleset--; | 331 buildCounterRuleset--; |
| 254 return o; | 332 return o; |
| 255 } | 333 } |
| 256 | 334 |
| 257 checkRuleset(api.Ruleset o) { | 335 checkRuleset(api.Ruleset o) { |
| 258 buildCounterRuleset++; | 336 buildCounterRuleset++; |
| 259 if (buildCounterRuleset < 3) { | 337 if (buildCounterRuleset < 3) { |
| 260 unittest.expect(o.createTime, unittest.equals('foo')); | 338 unittest.expect(o.createTime, unittest.equals('foo')); |
| 261 unittest.expect(o.name, unittest.equals('foo')); | 339 unittest.expect(o.name, unittest.equals('foo')); |
| 262 checkSource(o.source); | 340 checkSource(o.source); |
| 263 } | 341 } |
| 264 buildCounterRuleset--; | 342 buildCounterRuleset--; |
| 265 } | 343 } |
| 266 | 344 |
| 267 buildUnnamed3442() { | 345 buildUnnamed2914() { |
| 268 var o = new core.List<api.File>(); | 346 var o = new core.List<api.File>(); |
| 269 o.add(buildFile()); | 347 o.add(buildFile()); |
| 270 o.add(buildFile()); | 348 o.add(buildFile()); |
| 271 return o; | 349 return o; |
| 272 } | 350 } |
| 273 | 351 |
| 274 checkUnnamed3442(core.List<api.File> o) { | 352 checkUnnamed2914(core.List<api.File> o) { |
| 275 unittest.expect(o, unittest.hasLength(2)); | 353 unittest.expect(o, unittest.hasLength(2)); |
| 276 checkFile(o[0]); | 354 checkFile(o[0]); |
| 277 checkFile(o[1]); | 355 checkFile(o[1]); |
| 278 } | 356 } |
| 279 | 357 |
| 280 core.int buildCounterSource = 0; | 358 core.int buildCounterSource = 0; |
| 281 buildSource() { | 359 buildSource() { |
| 282 var o = new api.Source(); | 360 var o = new api.Source(); |
| 283 buildCounterSource++; | 361 buildCounterSource++; |
| 284 if (buildCounterSource < 3) { | 362 if (buildCounterSource < 3) { |
| 285 o.files = buildUnnamed3442(); | 363 o.files = buildUnnamed2914(); |
| 286 } | 364 } |
| 287 buildCounterSource--; | 365 buildCounterSource--; |
| 288 return o; | 366 return o; |
| 289 } | 367 } |
| 290 | 368 |
| 291 checkSource(api.Source o) { | 369 checkSource(api.Source o) { |
| 292 buildCounterSource++; | 370 buildCounterSource++; |
| 293 if (buildCounterSource < 3) { | 371 if (buildCounterSource < 3) { |
| 294 checkUnnamed3442(o.files); | 372 checkUnnamed2914(o.files); |
| 295 } | 373 } |
| 296 buildCounterSource--; | 374 buildCounterSource--; |
| 297 } | 375 } |
| 298 | 376 |
| 299 core.int buildCounterSourcePosition = 0; | 377 core.int buildCounterSourcePosition = 0; |
| 300 buildSourcePosition() { | 378 buildSourcePosition() { |
| 301 var o = new api.SourcePosition(); | 379 var o = new api.SourcePosition(); |
| 302 buildCounterSourcePosition++; | 380 buildCounterSourcePosition++; |
| 303 if (buildCounterSourcePosition < 3) { | 381 if (buildCounterSourcePosition < 3) { |
| 304 o.column = 42; | 382 o.column = 42; |
| 305 o.fileName = "foo"; | 383 o.fileName = "foo"; |
| 306 o.line = 42; | 384 o.line = 42; |
| 307 } | 385 } |
| 308 buildCounterSourcePosition--; | 386 buildCounterSourcePosition--; |
| 309 return o; | 387 return o; |
| 310 } | 388 } |
| 311 | 389 |
| 312 checkSourcePosition(api.SourcePosition o) { | 390 checkSourcePosition(api.SourcePosition o) { |
| 313 buildCounterSourcePosition++; | 391 buildCounterSourcePosition++; |
| 314 if (buildCounterSourcePosition < 3) { | 392 if (buildCounterSourcePosition < 3) { |
| 315 unittest.expect(o.column, unittest.equals(42)); | 393 unittest.expect(o.column, unittest.equals(42)); |
| 316 unittest.expect(o.fileName, unittest.equals('foo')); | 394 unittest.expect(o.fileName, unittest.equals('foo')); |
| 317 unittest.expect(o.line, unittest.equals(42)); | 395 unittest.expect(o.line, unittest.equals(42)); |
| 318 } | 396 } |
| 319 buildCounterSourcePosition--; | 397 buildCounterSourcePosition--; |
| 320 } | 398 } |
| 321 | 399 |
| 322 buildUnnamed3443() { | 400 buildUnnamed2915() { |
| 401 var o = new core.List<api.FunctionMock>(); |
| 402 o.add(buildFunctionMock()); |
| 403 o.add(buildFunctionMock()); |
| 404 return o; |
| 405 } |
| 406 |
| 407 checkUnnamed2915(core.List<api.FunctionMock> o) { |
| 408 unittest.expect(o, unittest.hasLength(2)); |
| 409 checkFunctionMock(o[0]); |
| 410 checkFunctionMock(o[1]); |
| 411 } |
| 412 |
| 413 core.int buildCounterTestCase = 0; |
| 414 buildTestCase() { |
| 415 var o = new api.TestCase(); |
| 416 buildCounterTestCase++; |
| 417 if (buildCounterTestCase < 3) { |
| 418 o.expectation = "foo"; |
| 419 o.functionMocks = buildUnnamed2915(); |
| 420 o.request = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 421 o.resource = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 422 } |
| 423 buildCounterTestCase--; |
| 424 return o; |
| 425 } |
| 426 |
| 427 checkTestCase(api.TestCase o) { |
| 428 buildCounterTestCase++; |
| 429 if (buildCounterTestCase < 3) { |
| 430 unittest.expect(o.expectation, unittest.equals('foo')); |
| 431 checkUnnamed2915(o.functionMocks); |
| 432 var casted5 = (o.request) as core.Map; unittest.expect(casted5, unittest.has
Length(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unitte
st.expect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["stri
ng"], unittest.equals('foo')); |
| 433 var casted6 = (o.resource) as core.Map; unittest.expect(casted6, unittest.ha
sLength(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unitt
est.expect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["str
ing"], unittest.equals('foo')); |
| 434 } |
| 435 buildCounterTestCase--; |
| 436 } |
| 437 |
| 438 buildUnnamed2916() { |
| 323 var o = new core.List<core.String>(); | 439 var o = new core.List<core.String>(); |
| 324 o.add("foo"); | 440 o.add("foo"); |
| 325 o.add("foo"); | 441 o.add("foo"); |
| 326 return o; | 442 return o; |
| 327 } | 443 } |
| 328 | 444 |
| 329 checkUnnamed3443(core.List<core.String> o) { | 445 checkUnnamed2916(core.List<core.String> o) { |
| 330 unittest.expect(o, unittest.hasLength(2)); | 446 unittest.expect(o, unittest.hasLength(2)); |
| 331 unittest.expect(o[0], unittest.equals('foo')); | 447 unittest.expect(o[0], unittest.equals('foo')); |
| 332 unittest.expect(o[1], unittest.equals('foo')); | 448 unittest.expect(o[1], unittest.equals('foo')); |
| 333 } | 449 } |
| 334 | 450 |
| 335 buildUnnamed3444() { | 451 buildUnnamed2917() { |
| 336 var o = new core.List<api.FunctionCall>(); | 452 var o = new core.List<api.FunctionCall>(); |
| 337 o.add(buildFunctionCall()); | 453 o.add(buildFunctionCall()); |
| 338 o.add(buildFunctionCall()); | 454 o.add(buildFunctionCall()); |
| 339 return o; | 455 return o; |
| 340 } | 456 } |
| 341 | 457 |
| 342 checkUnnamed3444(core.List<api.FunctionCall> o) { | 458 checkUnnamed2917(core.List<api.FunctionCall> o) { |
| 343 unittest.expect(o, unittest.hasLength(2)); | 459 unittest.expect(o, unittest.hasLength(2)); |
| 344 checkFunctionCall(o[0]); | 460 checkFunctionCall(o[0]); |
| 345 checkFunctionCall(o[1]); | 461 checkFunctionCall(o[1]); |
| 346 } | 462 } |
| 347 | 463 |
| 348 core.int buildCounterTestResult = 0; | 464 core.int buildCounterTestResult = 0; |
| 349 buildTestResult() { | 465 buildTestResult() { |
| 350 var o = new api.TestResult(); | 466 var o = new api.TestResult(); |
| 351 buildCounterTestResult++; | 467 buildCounterTestResult++; |
| 352 if (buildCounterTestResult < 3) { | 468 if (buildCounterTestResult < 3) { |
| 353 o.debugMessages = buildUnnamed3443(); | 469 o.debugMessages = buildUnnamed2916(); |
| 354 o.errorPosition = buildSourcePosition(); | 470 o.errorPosition = buildSourcePosition(); |
| 355 o.functionCalls = buildUnnamed3444(); | 471 o.functionCalls = buildUnnamed2917(); |
| 356 o.state = "foo"; | 472 o.state = "foo"; |
| 357 } | 473 } |
| 358 buildCounterTestResult--; | 474 buildCounterTestResult--; |
| 359 return o; | 475 return o; |
| 360 } | 476 } |
| 361 | 477 |
| 362 checkTestResult(api.TestResult o) { | 478 checkTestResult(api.TestResult o) { |
| 363 buildCounterTestResult++; | 479 buildCounterTestResult++; |
| 364 if (buildCounterTestResult < 3) { | 480 if (buildCounterTestResult < 3) { |
| 365 checkUnnamed3443(o.debugMessages); | 481 checkUnnamed2916(o.debugMessages); |
| 366 checkSourcePosition(o.errorPosition); | 482 checkSourcePosition(o.errorPosition); |
| 367 checkUnnamed3444(o.functionCalls); | 483 checkUnnamed2917(o.functionCalls); |
| 368 unittest.expect(o.state, unittest.equals('foo')); | 484 unittest.expect(o.state, unittest.equals('foo')); |
| 369 } | 485 } |
| 370 buildCounterTestResult--; | 486 buildCounterTestResult--; |
| 371 } | 487 } |
| 372 | 488 |
| 373 core.int buildCounterTestRulesetRequest = 0; | 489 core.int buildCounterTestRulesetRequest = 0; |
| 374 buildTestRulesetRequest() { | 490 buildTestRulesetRequest() { |
| 375 var o = new api.TestRulesetRequest(); | 491 var o = new api.TestRulesetRequest(); |
| 376 buildCounterTestRulesetRequest++; | 492 buildCounterTestRulesetRequest++; |
| 377 if (buildCounterTestRulesetRequest < 3) { | 493 if (buildCounterTestRulesetRequest < 3) { |
| 378 o.source = buildSource(); | 494 o.source = buildSource(); |
| 495 o.testSuite = buildTestSuite(); |
| 379 } | 496 } |
| 380 buildCounterTestRulesetRequest--; | 497 buildCounterTestRulesetRequest--; |
| 381 return o; | 498 return o; |
| 382 } | 499 } |
| 383 | 500 |
| 384 checkTestRulesetRequest(api.TestRulesetRequest o) { | 501 checkTestRulesetRequest(api.TestRulesetRequest o) { |
| 385 buildCounterTestRulesetRequest++; | 502 buildCounterTestRulesetRequest++; |
| 386 if (buildCounterTestRulesetRequest < 3) { | 503 if (buildCounterTestRulesetRequest < 3) { |
| 387 checkSource(o.source); | 504 checkSource(o.source); |
| 505 checkTestSuite(o.testSuite); |
| 388 } | 506 } |
| 389 buildCounterTestRulesetRequest--; | 507 buildCounterTestRulesetRequest--; |
| 390 } | 508 } |
| 391 | 509 |
| 392 buildUnnamed3445() { | 510 buildUnnamed2918() { |
| 393 var o = new core.List<api.Issue>(); | 511 var o = new core.List<api.Issue>(); |
| 394 o.add(buildIssue()); | 512 o.add(buildIssue()); |
| 395 o.add(buildIssue()); | 513 o.add(buildIssue()); |
| 396 return o; | 514 return o; |
| 397 } | 515 } |
| 398 | 516 |
| 399 checkUnnamed3445(core.List<api.Issue> o) { | 517 checkUnnamed2918(core.List<api.Issue> o) { |
| 400 unittest.expect(o, unittest.hasLength(2)); | 518 unittest.expect(o, unittest.hasLength(2)); |
| 401 checkIssue(o[0]); | 519 checkIssue(o[0]); |
| 402 checkIssue(o[1]); | 520 checkIssue(o[1]); |
| 403 } | 521 } |
| 404 | 522 |
| 405 buildUnnamed3446() { | 523 buildUnnamed2919() { |
| 406 var o = new core.List<api.TestResult>(); | 524 var o = new core.List<api.TestResult>(); |
| 407 o.add(buildTestResult()); | 525 o.add(buildTestResult()); |
| 408 o.add(buildTestResult()); | 526 o.add(buildTestResult()); |
| 409 return o; | 527 return o; |
| 410 } | 528 } |
| 411 | 529 |
| 412 checkUnnamed3446(core.List<api.TestResult> o) { | 530 checkUnnamed2919(core.List<api.TestResult> o) { |
| 413 unittest.expect(o, unittest.hasLength(2)); | 531 unittest.expect(o, unittest.hasLength(2)); |
| 414 checkTestResult(o[0]); | 532 checkTestResult(o[0]); |
| 415 checkTestResult(o[1]); | 533 checkTestResult(o[1]); |
| 416 } | 534 } |
| 417 | 535 |
| 418 core.int buildCounterTestRulesetResponse = 0; | 536 core.int buildCounterTestRulesetResponse = 0; |
| 419 buildTestRulesetResponse() { | 537 buildTestRulesetResponse() { |
| 420 var o = new api.TestRulesetResponse(); | 538 var o = new api.TestRulesetResponse(); |
| 421 buildCounterTestRulesetResponse++; | 539 buildCounterTestRulesetResponse++; |
| 422 if (buildCounterTestRulesetResponse < 3) { | 540 if (buildCounterTestRulesetResponse < 3) { |
| 423 o.issues = buildUnnamed3445(); | 541 o.issues = buildUnnamed2918(); |
| 424 o.testResults = buildUnnamed3446(); | 542 o.testResults = buildUnnamed2919(); |
| 425 } | 543 } |
| 426 buildCounterTestRulesetResponse--; | 544 buildCounterTestRulesetResponse--; |
| 427 return o; | 545 return o; |
| 428 } | 546 } |
| 429 | 547 |
| 430 checkTestRulesetResponse(api.TestRulesetResponse o) { | 548 checkTestRulesetResponse(api.TestRulesetResponse o) { |
| 431 buildCounterTestRulesetResponse++; | 549 buildCounterTestRulesetResponse++; |
| 432 if (buildCounterTestRulesetResponse < 3) { | 550 if (buildCounterTestRulesetResponse < 3) { |
| 433 checkUnnamed3445(o.issues); | 551 checkUnnamed2918(o.issues); |
| 434 checkUnnamed3446(o.testResults); | 552 checkUnnamed2919(o.testResults); |
| 435 } | 553 } |
| 436 buildCounterTestRulesetResponse--; | 554 buildCounterTestRulesetResponse--; |
| 437 } | 555 } |
| 438 | 556 |
| 557 buildUnnamed2920() { |
| 558 var o = new core.List<api.TestCase>(); |
| 559 o.add(buildTestCase()); |
| 560 o.add(buildTestCase()); |
| 561 return o; |
| 562 } |
| 563 |
| 564 checkUnnamed2920(core.List<api.TestCase> o) { |
| 565 unittest.expect(o, unittest.hasLength(2)); |
| 566 checkTestCase(o[0]); |
| 567 checkTestCase(o[1]); |
| 568 } |
| 569 |
| 570 core.int buildCounterTestSuite = 0; |
| 571 buildTestSuite() { |
| 572 var o = new api.TestSuite(); |
| 573 buildCounterTestSuite++; |
| 574 if (buildCounterTestSuite < 3) { |
| 575 o.testCases = buildUnnamed2920(); |
| 576 } |
| 577 buildCounterTestSuite--; |
| 578 return o; |
| 579 } |
| 580 |
| 581 checkTestSuite(api.TestSuite o) { |
| 582 buildCounterTestSuite++; |
| 583 if (buildCounterTestSuite < 3) { |
| 584 checkUnnamed2920(o.testCases); |
| 585 } |
| 586 buildCounterTestSuite--; |
| 587 } |
| 588 |
| 439 | 589 |
| 440 main() { | 590 main() { |
| 591 unittest.group("obj-schema-Arg", () { |
| 592 unittest.test("to-json--from-json", () { |
| 593 var o = buildArg(); |
| 594 var od = new api.Arg.fromJson(o.toJson()); |
| 595 checkArg(od); |
| 596 }); |
| 597 }); |
| 598 |
| 599 |
| 441 unittest.group("obj-schema-Empty", () { | 600 unittest.group("obj-schema-Empty", () { |
| 442 unittest.test("to-json--from-json", () { | 601 unittest.test("to-json--from-json", () { |
| 443 var o = buildEmpty(); | 602 var o = buildEmpty(); |
| 444 var od = new api.Empty.fromJson(o.toJson()); | 603 var od = new api.Empty.fromJson(o.toJson()); |
| 445 checkEmpty(od); | 604 checkEmpty(od); |
| 446 }); | 605 }); |
| 447 }); | 606 }); |
| 448 | 607 |
| 449 | 608 |
| 450 unittest.group("obj-schema-File", () { | 609 unittest.group("obj-schema-File", () { |
| 451 unittest.test("to-json--from-json", () { | 610 unittest.test("to-json--from-json", () { |
| 452 var o = buildFile(); | 611 var o = buildFile(); |
| 453 var od = new api.File.fromJson(o.toJson()); | 612 var od = new api.File.fromJson(o.toJson()); |
| 454 checkFile(od); | 613 checkFile(od); |
| 455 }); | 614 }); |
| 456 }); | 615 }); |
| 457 | 616 |
| 458 | 617 |
| 459 unittest.group("obj-schema-FunctionCall", () { | 618 unittest.group("obj-schema-FunctionCall", () { |
| 460 unittest.test("to-json--from-json", () { | 619 unittest.test("to-json--from-json", () { |
| 461 var o = buildFunctionCall(); | 620 var o = buildFunctionCall(); |
| 462 var od = new api.FunctionCall.fromJson(o.toJson()); | 621 var od = new api.FunctionCall.fromJson(o.toJson()); |
| 463 checkFunctionCall(od); | 622 checkFunctionCall(od); |
| 464 }); | 623 }); |
| 465 }); | 624 }); |
| 466 | 625 |
| 467 | 626 |
| 627 unittest.group("obj-schema-FunctionMock", () { |
| 628 unittest.test("to-json--from-json", () { |
| 629 var o = buildFunctionMock(); |
| 630 var od = new api.FunctionMock.fromJson(o.toJson()); |
| 631 checkFunctionMock(od); |
| 632 }); |
| 633 }); |
| 634 |
| 635 |
| 468 unittest.group("obj-schema-Issue", () { | 636 unittest.group("obj-schema-Issue", () { |
| 469 unittest.test("to-json--from-json", () { | 637 unittest.test("to-json--from-json", () { |
| 470 var o = buildIssue(); | 638 var o = buildIssue(); |
| 471 var od = new api.Issue.fromJson(o.toJson()); | 639 var od = new api.Issue.fromJson(o.toJson()); |
| 472 checkIssue(od); | 640 checkIssue(od); |
| 473 }); | 641 }); |
| 474 }); | 642 }); |
| 475 | 643 |
| 476 | 644 |
| 477 unittest.group("obj-schema-ListReleasesResponse", () { | 645 unittest.group("obj-schema-ListReleasesResponse", () { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 494 | 662 |
| 495 unittest.group("obj-schema-Release", () { | 663 unittest.group("obj-schema-Release", () { |
| 496 unittest.test("to-json--from-json", () { | 664 unittest.test("to-json--from-json", () { |
| 497 var o = buildRelease(); | 665 var o = buildRelease(); |
| 498 var od = new api.Release.fromJson(o.toJson()); | 666 var od = new api.Release.fromJson(o.toJson()); |
| 499 checkRelease(od); | 667 checkRelease(od); |
| 500 }); | 668 }); |
| 501 }); | 669 }); |
| 502 | 670 |
| 503 | 671 |
| 672 unittest.group("obj-schema-Result", () { |
| 673 unittest.test("to-json--from-json", () { |
| 674 var o = buildResult(); |
| 675 var od = new api.Result.fromJson(o.toJson()); |
| 676 checkResult(od); |
| 677 }); |
| 678 }); |
| 679 |
| 680 |
| 504 unittest.group("obj-schema-Ruleset", () { | 681 unittest.group("obj-schema-Ruleset", () { |
| 505 unittest.test("to-json--from-json", () { | 682 unittest.test("to-json--from-json", () { |
| 506 var o = buildRuleset(); | 683 var o = buildRuleset(); |
| 507 var od = new api.Ruleset.fromJson(o.toJson()); | 684 var od = new api.Ruleset.fromJson(o.toJson()); |
| 508 checkRuleset(od); | 685 checkRuleset(od); |
| 509 }); | 686 }); |
| 510 }); | 687 }); |
| 511 | 688 |
| 512 | 689 |
| 513 unittest.group("obj-schema-Source", () { | 690 unittest.group("obj-schema-Source", () { |
| 514 unittest.test("to-json--from-json", () { | 691 unittest.test("to-json--from-json", () { |
| 515 var o = buildSource(); | 692 var o = buildSource(); |
| 516 var od = new api.Source.fromJson(o.toJson()); | 693 var od = new api.Source.fromJson(o.toJson()); |
| 517 checkSource(od); | 694 checkSource(od); |
| 518 }); | 695 }); |
| 519 }); | 696 }); |
| 520 | 697 |
| 521 | 698 |
| 522 unittest.group("obj-schema-SourcePosition", () { | 699 unittest.group("obj-schema-SourcePosition", () { |
| 523 unittest.test("to-json--from-json", () { | 700 unittest.test("to-json--from-json", () { |
| 524 var o = buildSourcePosition(); | 701 var o = buildSourcePosition(); |
| 525 var od = new api.SourcePosition.fromJson(o.toJson()); | 702 var od = new api.SourcePosition.fromJson(o.toJson()); |
| 526 checkSourcePosition(od); | 703 checkSourcePosition(od); |
| 527 }); | 704 }); |
| 528 }); | 705 }); |
| 529 | 706 |
| 530 | 707 |
| 708 unittest.group("obj-schema-TestCase", () { |
| 709 unittest.test("to-json--from-json", () { |
| 710 var o = buildTestCase(); |
| 711 var od = new api.TestCase.fromJson(o.toJson()); |
| 712 checkTestCase(od); |
| 713 }); |
| 714 }); |
| 715 |
| 716 |
| 531 unittest.group("obj-schema-TestResult", () { | 717 unittest.group("obj-schema-TestResult", () { |
| 532 unittest.test("to-json--from-json", () { | 718 unittest.test("to-json--from-json", () { |
| 533 var o = buildTestResult(); | 719 var o = buildTestResult(); |
| 534 var od = new api.TestResult.fromJson(o.toJson()); | 720 var od = new api.TestResult.fromJson(o.toJson()); |
| 535 checkTestResult(od); | 721 checkTestResult(od); |
| 536 }); | 722 }); |
| 537 }); | 723 }); |
| 538 | 724 |
| 539 | 725 |
| 540 unittest.group("obj-schema-TestRulesetRequest", () { | 726 unittest.group("obj-schema-TestRulesetRequest", () { |
| 541 unittest.test("to-json--from-json", () { | 727 unittest.test("to-json--from-json", () { |
| 542 var o = buildTestRulesetRequest(); | 728 var o = buildTestRulesetRequest(); |
| 543 var od = new api.TestRulesetRequest.fromJson(o.toJson()); | 729 var od = new api.TestRulesetRequest.fromJson(o.toJson()); |
| 544 checkTestRulesetRequest(od); | 730 checkTestRulesetRequest(od); |
| 545 }); | 731 }); |
| 546 }); | 732 }); |
| 547 | 733 |
| 548 | 734 |
| 549 unittest.group("obj-schema-TestRulesetResponse", () { | 735 unittest.group("obj-schema-TestRulesetResponse", () { |
| 550 unittest.test("to-json--from-json", () { | 736 unittest.test("to-json--from-json", () { |
| 551 var o = buildTestRulesetResponse(); | 737 var o = buildTestRulesetResponse(); |
| 552 var od = new api.TestRulesetResponse.fromJson(o.toJson()); | 738 var od = new api.TestRulesetResponse.fromJson(o.toJson()); |
| 553 checkTestRulesetResponse(od); | 739 checkTestRulesetResponse(od); |
| 554 }); | 740 }); |
| 555 }); | 741 }); |
| 556 | 742 |
| 557 | 743 |
| 744 unittest.group("obj-schema-TestSuite", () { |
| 745 unittest.test("to-json--from-json", () { |
| 746 var o = buildTestSuite(); |
| 747 var od = new api.TestSuite.fromJson(o.toJson()); |
| 748 checkTestSuite(od); |
| 749 }); |
| 750 }); |
| 751 |
| 752 |
| 558 unittest.group("resource-ProjectsResourceApi", () { | 753 unittest.group("resource-ProjectsResourceApi", () { |
| 559 unittest.test("method--test", () { | 754 unittest.test("method--test", () { |
| 560 | 755 |
| 561 var mock = new HttpServerMock(); | 756 var mock = new HttpServerMock(); |
| 562 api.ProjectsResourceApi res = new api.FirebaserulesApi(mock).projects; | 757 api.ProjectsResourceApi res = new api.FirebaserulesApi(mock).projects; |
| 563 var arg_request = buildTestRulesetRequest(); | 758 var arg_request = buildTestRulesetRequest(); |
| 564 var arg_name = "foo"; | 759 var arg_name = "foo"; |
| 565 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 760 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 566 var obj = new api.TestRulesetRequest.fromJson(json); | 761 var obj = new api.TestRulesetRequest.fromJson(json); |
| 567 checkTestRulesetRequest(obj); | 762 checkTestRulesetRequest(obj); |
| 568 | 763 |
| 569 var path = (req.url).path; | 764 var path = (req.url).path; |
| 570 var pathOffset = 0; | 765 var pathOffset = 0; |
| 571 var index; | 766 var index; |
| 572 var subPart; | 767 var subPart; |
| 573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 768 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 574 pathOffset += 1; | 769 pathOffset += 1; |
| 575 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 770 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 593 } | 788 } |
| 594 } | 789 } |
| 595 | 790 |
| 596 | 791 |
| 597 var h = { | 792 var h = { |
| 598 "content-type" : "application/json; charset=utf-8", | 793 "content-type" : "application/json; charset=utf-8", |
| 599 }; | 794 }; |
| 600 var resp = convert.JSON.encode(buildTestRulesetResponse()); | 795 var resp = convert.JSON.encode(buildTestRulesetResponse()); |
| 601 return new async.Future.value(stringResponse(200, h, resp)); | 796 return new async.Future.value(stringResponse(200, h, resp)); |
| 602 }), true); | 797 }), true); |
| 603 res.test(arg_request, arg_name).then(unittest.expectAsync(((api.TestRulese
tResponse response) { | 798 res.test(arg_request, arg_name).then(unittest.expectAsync1(((api.TestRules
etResponse response) { |
| 604 checkTestRulesetResponse(response); | 799 checkTestRulesetResponse(response); |
| 605 }))); | 800 }))); |
| 606 }); | 801 }); |
| 607 | 802 |
| 608 }); | 803 }); |
| 609 | 804 |
| 610 | 805 |
| 611 unittest.group("resource-ProjectsReleasesResourceApi", () { | 806 unittest.group("resource-ProjectsReleasesResourceApi", () { |
| 612 unittest.test("method--create", () { | 807 unittest.test("method--create", () { |
| 613 | 808 |
| 614 var mock = new HttpServerMock(); | 809 var mock = new HttpServerMock(); |
| 615 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; | 810 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; |
| 616 var arg_request = buildRelease(); | 811 var arg_request = buildRelease(); |
| 617 var arg_name = "foo"; | 812 var arg_name = "foo"; |
| 618 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 813 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 619 var obj = new api.Release.fromJson(json); | 814 var obj = new api.Release.fromJson(json); |
| 620 checkRelease(obj); | 815 checkRelease(obj); |
| 621 | 816 |
| 622 var path = (req.url).path; | 817 var path = (req.url).path; |
| 623 var pathOffset = 0; | 818 var pathOffset = 0; |
| 624 var index; | 819 var index; |
| 625 var subPart; | 820 var subPart; |
| 626 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 821 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 627 pathOffset += 1; | 822 pathOffset += 1; |
| 628 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 823 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 646 } | 841 } |
| 647 } | 842 } |
| 648 | 843 |
| 649 | 844 |
| 650 var h = { | 845 var h = { |
| 651 "content-type" : "application/json; charset=utf-8", | 846 "content-type" : "application/json; charset=utf-8", |
| 652 }; | 847 }; |
| 653 var resp = convert.JSON.encode(buildRelease()); | 848 var resp = convert.JSON.encode(buildRelease()); |
| 654 return new async.Future.value(stringResponse(200, h, resp)); | 849 return new async.Future.value(stringResponse(200, h, resp)); |
| 655 }), true); | 850 }), true); |
| 656 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Release
response) { | 851 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Release
response) { |
| 657 checkRelease(response); | 852 checkRelease(response); |
| 658 }))); | 853 }))); |
| 659 }); | 854 }); |
| 660 | 855 |
| 661 unittest.test("method--delete", () { | 856 unittest.test("method--delete", () { |
| 662 | 857 |
| 663 var mock = new HttpServerMock(); | 858 var mock = new HttpServerMock(); |
| 664 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; | 859 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; |
| 665 var arg_name = "foo"; | 860 var arg_name = "foo"; |
| 666 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 861 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 667 var path = (req.url).path; | 862 var path = (req.url).path; |
| 668 var pathOffset = 0; | 863 var pathOffset = 0; |
| 669 var index; | 864 var index; |
| 670 var subPart; | 865 var subPart; |
| 671 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 866 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 672 pathOffset += 1; | 867 pathOffset += 1; |
| 673 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 868 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 674 pathOffset += 3; | 869 pathOffset += 3; |
| 675 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 870 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 676 | 871 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 691 } | 886 } |
| 692 } | 887 } |
| 693 | 888 |
| 694 | 889 |
| 695 var h = { | 890 var h = { |
| 696 "content-type" : "application/json; charset=utf-8", | 891 "content-type" : "application/json; charset=utf-8", |
| 697 }; | 892 }; |
| 698 var resp = convert.JSON.encode(buildEmpty()); | 893 var resp = convert.JSON.encode(buildEmpty()); |
| 699 return new async.Future.value(stringResponse(200, h, resp)); | 894 return new async.Future.value(stringResponse(200, h, resp)); |
| 700 }), true); | 895 }), true); |
| 701 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { | 896 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 702 checkEmpty(response); | 897 checkEmpty(response); |
| 703 }))); | 898 }))); |
| 704 }); | 899 }); |
| 705 | 900 |
| 706 unittest.test("method--get", () { | 901 unittest.test("method--get", () { |
| 707 | 902 |
| 708 var mock = new HttpServerMock(); | 903 var mock = new HttpServerMock(); |
| 709 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; | 904 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; |
| 710 var arg_name = "foo"; | 905 var arg_name = "foo"; |
| 711 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 906 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 712 var path = (req.url).path; | 907 var path = (req.url).path; |
| 713 var pathOffset = 0; | 908 var pathOffset = 0; |
| 714 var index; | 909 var index; |
| 715 var subPart; | 910 var subPart; |
| 716 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 911 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 717 pathOffset += 1; | 912 pathOffset += 1; |
| 718 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 913 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 719 pathOffset += 3; | 914 pathOffset += 3; |
| 720 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 915 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 721 | 916 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 736 } | 931 } |
| 737 } | 932 } |
| 738 | 933 |
| 739 | 934 |
| 740 var h = { | 935 var h = { |
| 741 "content-type" : "application/json; charset=utf-8", | 936 "content-type" : "application/json; charset=utf-8", |
| 742 }; | 937 }; |
| 743 var resp = convert.JSON.encode(buildRelease()); | 938 var resp = convert.JSON.encode(buildRelease()); |
| 744 return new async.Future.value(stringResponse(200, h, resp)); | 939 return new async.Future.value(stringResponse(200, h, resp)); |
| 745 }), true); | 940 }), true); |
| 746 res.get(arg_name).then(unittest.expectAsync(((api.Release response) { | 941 res.get(arg_name).then(unittest.expectAsync1(((api.Release response) { |
| 747 checkRelease(response); | 942 checkRelease(response); |
| 748 }))); | 943 }))); |
| 749 }); | 944 }); |
| 750 | 945 |
| 751 unittest.test("method--list", () { | 946 unittest.test("method--list", () { |
| 752 | 947 |
| 753 var mock = new HttpServerMock(); | 948 var mock = new HttpServerMock(); |
| 754 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; | 949 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; |
| 755 var arg_name = "foo"; | 950 var arg_name = "foo"; |
| 756 var arg_filter = "foo"; | |
| 757 var arg_pageToken = "foo"; | 951 var arg_pageToken = "foo"; |
| 758 var arg_pageSize = 42; | 952 var arg_pageSize = 42; |
| 759 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 953 var arg_filter = "foo"; |
| 954 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 760 var path = (req.url).path; | 955 var path = (req.url).path; |
| 761 var pathOffset = 0; | 956 var pathOffset = 0; |
| 762 var index; | 957 var index; |
| 763 var subPart; | 958 var subPart; |
| 764 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 959 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 765 pathOffset += 1; | 960 pathOffset += 1; |
| 766 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 961 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 767 pathOffset += 3; | 962 pathOffset += 3; |
| 768 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 963 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 769 | 964 |
| 770 var query = (req.url).query; | 965 var query = (req.url).query; |
| 771 var queryOffset = 0; | 966 var queryOffset = 0; |
| 772 var queryMap = {}; | 967 var queryMap = {}; |
| 773 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 968 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 774 parseBool(n) { | 969 parseBool(n) { |
| 775 if (n == "true") return true; | 970 if (n == "true") return true; |
| 776 if (n == "false") return false; | 971 if (n == "false") return false; |
| 777 if (n == null) return null; | 972 if (n == null) return null; |
| 778 throw new core.ArgumentError("Invalid boolean: $n"); | 973 throw new core.ArgumentError("Invalid boolean: $n"); |
| 779 } | 974 } |
| 780 if (query.length > 0) { | 975 if (query.length > 0) { |
| 781 for (var part in query.split("&")) { | 976 for (var part in query.split("&")) { |
| 782 var keyvalue = part.split("="); | 977 var keyvalue = part.split("="); |
| 783 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 978 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 784 } | 979 } |
| 785 } | 980 } |
| 786 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
| 787 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 981 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 788 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 982 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 983 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 789 | 984 |
| 790 | 985 |
| 791 var h = { | 986 var h = { |
| 792 "content-type" : "application/json; charset=utf-8", | 987 "content-type" : "application/json; charset=utf-8", |
| 793 }; | 988 }; |
| 794 var resp = convert.JSON.encode(buildListReleasesResponse()); | 989 var resp = convert.JSON.encode(buildListReleasesResponse()); |
| 795 return new async.Future.value(stringResponse(200, h, resp)); | 990 return new async.Future.value(stringResponse(200, h, resp)); |
| 796 }), true); | 991 }), true); |
| 797 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize:
arg_pageSize).then(unittest.expectAsync(((api.ListReleasesResponse response) { | 992 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync1(((api.ListReleasesResponse response) { |
| 798 checkListReleasesResponse(response); | 993 checkListReleasesResponse(response); |
| 799 }))); | 994 }))); |
| 800 }); | 995 }); |
| 801 | 996 |
| 802 unittest.test("method--update", () { | 997 unittest.test("method--update", () { |
| 803 | 998 |
| 804 var mock = new HttpServerMock(); | 999 var mock = new HttpServerMock(); |
| 805 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; | 1000 api.ProjectsReleasesResourceApi res = new api.FirebaserulesApi(mock).proje
cts.releases; |
| 806 var arg_request = buildRelease(); | 1001 var arg_request = buildRelease(); |
| 807 var arg_name = "foo"; | 1002 var arg_name = "foo"; |
| 808 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1003 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 809 var obj = new api.Release.fromJson(json); | 1004 var obj = new api.Release.fromJson(json); |
| 810 checkRelease(obj); | 1005 checkRelease(obj); |
| 811 | 1006 |
| 812 var path = (req.url).path; | 1007 var path = (req.url).path; |
| 813 var pathOffset = 0; | 1008 var pathOffset = 0; |
| 814 var index; | 1009 var index; |
| 815 var subPart; | 1010 var subPart; |
| 816 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1011 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 817 pathOffset += 1; | 1012 pathOffset += 1; |
| 818 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1013 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 836 } | 1031 } |
| 837 } | 1032 } |
| 838 | 1033 |
| 839 | 1034 |
| 840 var h = { | 1035 var h = { |
| 841 "content-type" : "application/json; charset=utf-8", | 1036 "content-type" : "application/json; charset=utf-8", |
| 842 }; | 1037 }; |
| 843 var resp = convert.JSON.encode(buildRelease()); | 1038 var resp = convert.JSON.encode(buildRelease()); |
| 844 return new async.Future.value(stringResponse(200, h, resp)); | 1039 return new async.Future.value(stringResponse(200, h, resp)); |
| 845 }), true); | 1040 }), true); |
| 846 res.update(arg_request, arg_name).then(unittest.expectAsync(((api.Release
response) { | 1041 res.update(arg_request, arg_name).then(unittest.expectAsync1(((api.Release
response) { |
| 847 checkRelease(response); | 1042 checkRelease(response); |
| 848 }))); | 1043 }))); |
| 849 }); | 1044 }); |
| 850 | 1045 |
| 851 }); | 1046 }); |
| 852 | 1047 |
| 853 | 1048 |
| 854 unittest.group("resource-ProjectsRulesetsResourceApi", () { | 1049 unittest.group("resource-ProjectsRulesetsResourceApi", () { |
| 855 unittest.test("method--create", () { | 1050 unittest.test("method--create", () { |
| 856 | 1051 |
| 857 var mock = new HttpServerMock(); | 1052 var mock = new HttpServerMock(); |
| 858 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; | 1053 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; |
| 859 var arg_request = buildRuleset(); | 1054 var arg_request = buildRuleset(); |
| 860 var arg_name = "foo"; | 1055 var arg_name = "foo"; |
| 861 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1056 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 862 var obj = new api.Ruleset.fromJson(json); | 1057 var obj = new api.Ruleset.fromJson(json); |
| 863 checkRuleset(obj); | 1058 checkRuleset(obj); |
| 864 | 1059 |
| 865 var path = (req.url).path; | 1060 var path = (req.url).path; |
| 866 var pathOffset = 0; | 1061 var pathOffset = 0; |
| 867 var index; | 1062 var index; |
| 868 var subPart; | 1063 var subPart; |
| 869 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1064 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 870 pathOffset += 1; | 1065 pathOffset += 1; |
| 871 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1066 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 889 } | 1084 } |
| 890 } | 1085 } |
| 891 | 1086 |
| 892 | 1087 |
| 893 var h = { | 1088 var h = { |
| 894 "content-type" : "application/json; charset=utf-8", | 1089 "content-type" : "application/json; charset=utf-8", |
| 895 }; | 1090 }; |
| 896 var resp = convert.JSON.encode(buildRuleset()); | 1091 var resp = convert.JSON.encode(buildRuleset()); |
| 897 return new async.Future.value(stringResponse(200, h, resp)); | 1092 return new async.Future.value(stringResponse(200, h, resp)); |
| 898 }), true); | 1093 }), true); |
| 899 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Ruleset
response) { | 1094 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Ruleset
response) { |
| 900 checkRuleset(response); | 1095 checkRuleset(response); |
| 901 }))); | 1096 }))); |
| 902 }); | 1097 }); |
| 903 | 1098 |
| 904 unittest.test("method--delete", () { | 1099 unittest.test("method--delete", () { |
| 905 | 1100 |
| 906 var mock = new HttpServerMock(); | 1101 var mock = new HttpServerMock(); |
| 907 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; | 1102 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; |
| 908 var arg_name = "foo"; | 1103 var arg_name = "foo"; |
| 909 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1104 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 910 var path = (req.url).path; | 1105 var path = (req.url).path; |
| 911 var pathOffset = 0; | 1106 var pathOffset = 0; |
| 912 var index; | 1107 var index; |
| 913 var subPart; | 1108 var subPart; |
| 914 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1109 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 915 pathOffset += 1; | 1110 pathOffset += 1; |
| 916 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1111 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 917 pathOffset += 3; | 1112 pathOffset += 3; |
| 918 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1113 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 919 | 1114 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 934 } | 1129 } |
| 935 } | 1130 } |
| 936 | 1131 |
| 937 | 1132 |
| 938 var h = { | 1133 var h = { |
| 939 "content-type" : "application/json; charset=utf-8", | 1134 "content-type" : "application/json; charset=utf-8", |
| 940 }; | 1135 }; |
| 941 var resp = convert.JSON.encode(buildEmpty()); | 1136 var resp = convert.JSON.encode(buildEmpty()); |
| 942 return new async.Future.value(stringResponse(200, h, resp)); | 1137 return new async.Future.value(stringResponse(200, h, resp)); |
| 943 }), true); | 1138 }), true); |
| 944 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { | 1139 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 945 checkEmpty(response); | 1140 checkEmpty(response); |
| 946 }))); | 1141 }))); |
| 947 }); | 1142 }); |
| 948 | 1143 |
| 949 unittest.test("method--get", () { | 1144 unittest.test("method--get", () { |
| 950 | 1145 |
| 951 var mock = new HttpServerMock(); | 1146 var mock = new HttpServerMock(); |
| 952 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; | 1147 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; |
| 953 var arg_name = "foo"; | 1148 var arg_name = "foo"; |
| 954 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1149 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 955 var path = (req.url).path; | 1150 var path = (req.url).path; |
| 956 var pathOffset = 0; | 1151 var pathOffset = 0; |
| 957 var index; | 1152 var index; |
| 958 var subPart; | 1153 var subPart; |
| 959 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1154 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 960 pathOffset += 1; | 1155 pathOffset += 1; |
| 961 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1156 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 962 pathOffset += 3; | 1157 pathOffset += 3; |
| 963 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1158 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 964 | 1159 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 979 } | 1174 } |
| 980 } | 1175 } |
| 981 | 1176 |
| 982 | 1177 |
| 983 var h = { | 1178 var h = { |
| 984 "content-type" : "application/json; charset=utf-8", | 1179 "content-type" : "application/json; charset=utf-8", |
| 985 }; | 1180 }; |
| 986 var resp = convert.JSON.encode(buildRuleset()); | 1181 var resp = convert.JSON.encode(buildRuleset()); |
| 987 return new async.Future.value(stringResponse(200, h, resp)); | 1182 return new async.Future.value(stringResponse(200, h, resp)); |
| 988 }), true); | 1183 }), true); |
| 989 res.get(arg_name).then(unittest.expectAsync(((api.Ruleset response) { | 1184 res.get(arg_name).then(unittest.expectAsync1(((api.Ruleset response) { |
| 990 checkRuleset(response); | 1185 checkRuleset(response); |
| 991 }))); | 1186 }))); |
| 992 }); | 1187 }); |
| 993 | 1188 |
| 994 unittest.test("method--list", () { | 1189 unittest.test("method--list", () { |
| 995 | 1190 |
| 996 var mock = new HttpServerMock(); | 1191 var mock = new HttpServerMock(); |
| 997 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; | 1192 api.ProjectsRulesetsResourceApi res = new api.FirebaserulesApi(mock).proje
cts.rulesets; |
| 998 var arg_name = "foo"; | 1193 var arg_name = "foo"; |
| 999 var arg_pageToken = "foo"; | 1194 var arg_pageToken = "foo"; |
| 1000 var arg_pageSize = 42; | 1195 var arg_pageSize = 42; |
| 1001 var arg_filter = "foo"; | 1196 var arg_filter = "foo"; |
| 1002 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1197 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1003 var path = (req.url).path; | 1198 var path = (req.url).path; |
| 1004 var pathOffset = 0; | 1199 var pathOffset = 0; |
| 1005 var index; | 1200 var index; |
| 1006 var subPart; | 1201 var subPart; |
| 1007 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1202 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1008 pathOffset += 1; | 1203 pathOffset += 1; |
| 1009 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1204 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1010 pathOffset += 3; | 1205 pathOffset += 3; |
| 1011 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1206 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1012 | 1207 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1030 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1225 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1031 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1226 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1032 | 1227 |
| 1033 | 1228 |
| 1034 var h = { | 1229 var h = { |
| 1035 "content-type" : "application/json; charset=utf-8", | 1230 "content-type" : "application/json; charset=utf-8", |
| 1036 }; | 1231 }; |
| 1037 var resp = convert.JSON.encode(buildListRulesetsResponse()); | 1232 var resp = convert.JSON.encode(buildListRulesetsResponse()); |
| 1038 return new async.Future.value(stringResponse(200, h, resp)); | 1233 return new async.Future.value(stringResponse(200, h, resp)); |
| 1039 }), true); | 1234 }), true); |
| 1040 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync(((api.ListRulesetsResponse response) { | 1235 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync1(((api.ListRulesetsResponse response) { |
| 1041 checkListRulesetsResponse(response); | 1236 checkListRulesetsResponse(response); |
| 1042 }))); | 1237 }))); |
| 1043 }); | 1238 }); |
| 1044 | 1239 |
| 1045 }); | 1240 }); |
| 1046 | 1241 |
| 1047 | 1242 |
| 1048 } | 1243 } |
| 1049 | 1244 |
| OLD | NEW |