| OLD | NEW |
| 1 library googleapis_beta.proximitybeacon.v1beta1.test; | 1 library googleapis_beta.proximitybeacon.v1beta1.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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 checkAttachmentInfo(api.AttachmentInfo o) { | 87 checkAttachmentInfo(api.AttachmentInfo o) { |
| 88 buildCounterAttachmentInfo++; | 88 buildCounterAttachmentInfo++; |
| 89 if (buildCounterAttachmentInfo < 3) { | 89 if (buildCounterAttachmentInfo < 3) { |
| 90 unittest.expect(o.data, unittest.equals('foo')); | 90 unittest.expect(o.data, unittest.equals('foo')); |
| 91 unittest.expect(o.namespacedType, unittest.equals('foo')); | 91 unittest.expect(o.namespacedType, unittest.equals('foo')); |
| 92 } | 92 } |
| 93 buildCounterAttachmentInfo--; | 93 buildCounterAttachmentInfo--; |
| 94 } | 94 } |
| 95 | 95 |
| 96 buildUnnamed3363() { | 96 buildUnnamed3459() { |
| 97 var o = new core.Map<core.String, core.String>(); | 97 var o = new core.Map<core.String, core.String>(); |
| 98 o["x"] = "foo"; | 98 o["x"] = "foo"; |
| 99 o["y"] = "foo"; | 99 o["y"] = "foo"; |
| 100 return o; | 100 return o; |
| 101 } | 101 } |
| 102 | 102 |
| 103 checkUnnamed3363(core.Map<core.String, core.String> o) { | 103 checkUnnamed3459(core.Map<core.String, core.String> o) { |
| 104 unittest.expect(o, unittest.hasLength(2)); | 104 unittest.expect(o, unittest.hasLength(2)); |
| 105 unittest.expect(o["x"], unittest.equals('foo')); | 105 unittest.expect(o["x"], unittest.equals('foo')); |
| 106 unittest.expect(o["y"], unittest.equals('foo')); | 106 unittest.expect(o["y"], unittest.equals('foo')); |
| 107 } | 107 } |
| 108 | 108 |
| 109 core.int buildCounterBeacon = 0; | 109 core.int buildCounterBeacon = 0; |
| 110 buildBeacon() { | 110 buildBeacon() { |
| 111 var o = new api.Beacon(); | 111 var o = new api.Beacon(); |
| 112 buildCounterBeacon++; | 112 buildCounterBeacon++; |
| 113 if (buildCounterBeacon < 3) { | 113 if (buildCounterBeacon < 3) { |
| 114 o.advertisedId = buildAdvertisedId(); | 114 o.advertisedId = buildAdvertisedId(); |
| 115 o.beaconName = "foo"; | 115 o.beaconName = "foo"; |
| 116 o.description = "foo"; | 116 o.description = "foo"; |
| 117 o.ephemeralIdRegistration = buildEphemeralIdRegistration(); | 117 o.ephemeralIdRegistration = buildEphemeralIdRegistration(); |
| 118 o.expectedStability = "foo"; | 118 o.expectedStability = "foo"; |
| 119 o.indoorLevel = buildIndoorLevel(); | 119 o.indoorLevel = buildIndoorLevel(); |
| 120 o.latLng = buildLatLng(); | 120 o.latLng = buildLatLng(); |
| 121 o.placeId = "foo"; | 121 o.placeId = "foo"; |
| 122 o.properties = buildUnnamed3363(); | 122 o.properties = buildUnnamed3459(); |
| 123 o.provisioningKey = "foo"; | 123 o.provisioningKey = "foo"; |
| 124 o.status = "foo"; | 124 o.status = "foo"; |
| 125 } | 125 } |
| 126 buildCounterBeacon--; | 126 buildCounterBeacon--; |
| 127 return o; | 127 return o; |
| 128 } | 128 } |
| 129 | 129 |
| 130 checkBeacon(api.Beacon o) { | 130 checkBeacon(api.Beacon o) { |
| 131 buildCounterBeacon++; | 131 buildCounterBeacon++; |
| 132 if (buildCounterBeacon < 3) { | 132 if (buildCounterBeacon < 3) { |
| 133 checkAdvertisedId(o.advertisedId); | 133 checkAdvertisedId(o.advertisedId); |
| 134 unittest.expect(o.beaconName, unittest.equals('foo')); | 134 unittest.expect(o.beaconName, unittest.equals('foo')); |
| 135 unittest.expect(o.description, unittest.equals('foo')); | 135 unittest.expect(o.description, unittest.equals('foo')); |
| 136 checkEphemeralIdRegistration(o.ephemeralIdRegistration); | 136 checkEphemeralIdRegistration(o.ephemeralIdRegistration); |
| 137 unittest.expect(o.expectedStability, unittest.equals('foo')); | 137 unittest.expect(o.expectedStability, unittest.equals('foo')); |
| 138 checkIndoorLevel(o.indoorLevel); | 138 checkIndoorLevel(o.indoorLevel); |
| 139 checkLatLng(o.latLng); | 139 checkLatLng(o.latLng); |
| 140 unittest.expect(o.placeId, unittest.equals('foo')); | 140 unittest.expect(o.placeId, unittest.equals('foo')); |
| 141 checkUnnamed3363(o.properties); | 141 checkUnnamed3459(o.properties); |
| 142 unittest.expect(o.provisioningKey, unittest.equals('foo')); | 142 unittest.expect(o.provisioningKey, unittest.equals('foo')); |
| 143 unittest.expect(o.status, unittest.equals('foo')); | 143 unittest.expect(o.status, unittest.equals('foo')); |
| 144 } | 144 } |
| 145 buildCounterBeacon--; | 145 buildCounterBeacon--; |
| 146 } | 146 } |
| 147 | 147 |
| 148 core.int buildCounterBeaconAttachment = 0; | 148 core.int buildCounterBeaconAttachment = 0; |
| 149 buildBeaconAttachment() { | 149 buildBeaconAttachment() { |
| 150 var o = new api.BeaconAttachment(); | 150 var o = new api.BeaconAttachment(); |
| 151 buildCounterBeaconAttachment++; | 151 buildCounterBeaconAttachment++; |
| 152 if (buildCounterBeaconAttachment < 3) { | 152 if (buildCounterBeaconAttachment < 3) { |
| 153 o.attachmentName = "foo"; | 153 o.attachmentName = "foo"; |
| 154 o.creationTimeMs = "foo"; |
| 154 o.data = "foo"; | 155 o.data = "foo"; |
| 155 o.namespacedType = "foo"; | 156 o.namespacedType = "foo"; |
| 156 } | 157 } |
| 157 buildCounterBeaconAttachment--; | 158 buildCounterBeaconAttachment--; |
| 158 return o; | 159 return o; |
| 159 } | 160 } |
| 160 | 161 |
| 161 checkBeaconAttachment(api.BeaconAttachment o) { | 162 checkBeaconAttachment(api.BeaconAttachment o) { |
| 162 buildCounterBeaconAttachment++; | 163 buildCounterBeaconAttachment++; |
| 163 if (buildCounterBeaconAttachment < 3) { | 164 if (buildCounterBeaconAttachment < 3) { |
| 164 unittest.expect(o.attachmentName, unittest.equals('foo')); | 165 unittest.expect(o.attachmentName, unittest.equals('foo')); |
| 166 unittest.expect(o.creationTimeMs, unittest.equals('foo')); |
| 165 unittest.expect(o.data, unittest.equals('foo')); | 167 unittest.expect(o.data, unittest.equals('foo')); |
| 166 unittest.expect(o.namespacedType, unittest.equals('foo')); | 168 unittest.expect(o.namespacedType, unittest.equals('foo')); |
| 167 } | 169 } |
| 168 buildCounterBeaconAttachment--; | 170 buildCounterBeaconAttachment--; |
| 169 } | 171 } |
| 170 | 172 |
| 171 buildUnnamed3364() { | 173 buildUnnamed3460() { |
| 172 var o = new core.List<api.AttachmentInfo>(); | 174 var o = new core.List<api.AttachmentInfo>(); |
| 173 o.add(buildAttachmentInfo()); | 175 o.add(buildAttachmentInfo()); |
| 174 o.add(buildAttachmentInfo()); | 176 o.add(buildAttachmentInfo()); |
| 175 return o; | 177 return o; |
| 176 } | 178 } |
| 177 | 179 |
| 178 checkUnnamed3364(core.List<api.AttachmentInfo> o) { | 180 checkUnnamed3460(core.List<api.AttachmentInfo> o) { |
| 179 unittest.expect(o, unittest.hasLength(2)); | 181 unittest.expect(o, unittest.hasLength(2)); |
| 180 checkAttachmentInfo(o[0]); | 182 checkAttachmentInfo(o[0]); |
| 181 checkAttachmentInfo(o[1]); | 183 checkAttachmentInfo(o[1]); |
| 182 } | 184 } |
| 183 | 185 |
| 184 core.int buildCounterBeaconInfo = 0; | 186 core.int buildCounterBeaconInfo = 0; |
| 185 buildBeaconInfo() { | 187 buildBeaconInfo() { |
| 186 var o = new api.BeaconInfo(); | 188 var o = new api.BeaconInfo(); |
| 187 buildCounterBeaconInfo++; | 189 buildCounterBeaconInfo++; |
| 188 if (buildCounterBeaconInfo < 3) { | 190 if (buildCounterBeaconInfo < 3) { |
| 189 o.advertisedId = buildAdvertisedId(); | 191 o.advertisedId = buildAdvertisedId(); |
| 190 o.attachments = buildUnnamed3364(); | 192 o.attachments = buildUnnamed3460(); |
| 191 o.beaconName = "foo"; | 193 o.beaconName = "foo"; |
| 192 } | 194 } |
| 193 buildCounterBeaconInfo--; | 195 buildCounterBeaconInfo--; |
| 194 return o; | 196 return o; |
| 195 } | 197 } |
| 196 | 198 |
| 197 checkBeaconInfo(api.BeaconInfo o) { | 199 checkBeaconInfo(api.BeaconInfo o) { |
| 198 buildCounterBeaconInfo++; | 200 buildCounterBeaconInfo++; |
| 199 if (buildCounterBeaconInfo < 3) { | 201 if (buildCounterBeaconInfo < 3) { |
| 200 checkAdvertisedId(o.advertisedId); | 202 checkAdvertisedId(o.advertisedId); |
| 201 checkUnnamed3364(o.attachments); | 203 checkUnnamed3460(o.attachments); |
| 202 unittest.expect(o.beaconName, unittest.equals('foo')); | 204 unittest.expect(o.beaconName, unittest.equals('foo')); |
| 203 } | 205 } |
| 204 buildCounterBeaconInfo--; | 206 buildCounterBeaconInfo--; |
| 205 } | 207 } |
| 206 | 208 |
| 207 core.int buildCounterDate = 0; | 209 core.int buildCounterDate = 0; |
| 208 buildDate() { | 210 buildDate() { |
| 209 var o = new api.Date(); | 211 var o = new api.Date(); |
| 210 buildCounterDate++; | 212 buildCounterDate++; |
| 211 if (buildCounterDate < 3) { | 213 if (buildCounterDate < 3) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 239 } | 241 } |
| 240 | 242 |
| 241 checkDeleteAttachmentsResponse(api.DeleteAttachmentsResponse o) { | 243 checkDeleteAttachmentsResponse(api.DeleteAttachmentsResponse o) { |
| 242 buildCounterDeleteAttachmentsResponse++; | 244 buildCounterDeleteAttachmentsResponse++; |
| 243 if (buildCounterDeleteAttachmentsResponse < 3) { | 245 if (buildCounterDeleteAttachmentsResponse < 3) { |
| 244 unittest.expect(o.numDeleted, unittest.equals(42)); | 246 unittest.expect(o.numDeleted, unittest.equals(42)); |
| 245 } | 247 } |
| 246 buildCounterDeleteAttachmentsResponse--; | 248 buildCounterDeleteAttachmentsResponse--; |
| 247 } | 249 } |
| 248 | 250 |
| 249 buildUnnamed3365() { | 251 buildUnnamed3461() { |
| 250 var o = new core.List<core.String>(); | 252 var o = new core.List<core.String>(); |
| 251 o.add("foo"); | 253 o.add("foo"); |
| 252 o.add("foo"); | 254 o.add("foo"); |
| 253 return o; | 255 return o; |
| 254 } | 256 } |
| 255 | 257 |
| 256 checkUnnamed3365(core.List<core.String> o) { | 258 checkUnnamed3461(core.List<core.String> o) { |
| 257 unittest.expect(o, unittest.hasLength(2)); | 259 unittest.expect(o, unittest.hasLength(2)); |
| 258 unittest.expect(o[0], unittest.equals('foo')); | 260 unittest.expect(o[0], unittest.equals('foo')); |
| 259 unittest.expect(o[1], unittest.equals('foo')); | 261 unittest.expect(o[1], unittest.equals('foo')); |
| 260 } | 262 } |
| 261 | 263 |
| 262 core.int buildCounterDiagnostics = 0; | 264 core.int buildCounterDiagnostics = 0; |
| 263 buildDiagnostics() { | 265 buildDiagnostics() { |
| 264 var o = new api.Diagnostics(); | 266 var o = new api.Diagnostics(); |
| 265 buildCounterDiagnostics++; | 267 buildCounterDiagnostics++; |
| 266 if (buildCounterDiagnostics < 3) { | 268 if (buildCounterDiagnostics < 3) { |
| 267 o.alerts = buildUnnamed3365(); | 269 o.alerts = buildUnnamed3461(); |
| 268 o.beaconName = "foo"; | 270 o.beaconName = "foo"; |
| 269 o.estimatedLowBatteryDate = buildDate(); | 271 o.estimatedLowBatteryDate = buildDate(); |
| 270 } | 272 } |
| 271 buildCounterDiagnostics--; | 273 buildCounterDiagnostics--; |
| 272 return o; | 274 return o; |
| 273 } | 275 } |
| 274 | 276 |
| 275 checkDiagnostics(api.Diagnostics o) { | 277 checkDiagnostics(api.Diagnostics o) { |
| 276 buildCounterDiagnostics++; | 278 buildCounterDiagnostics++; |
| 277 if (buildCounterDiagnostics < 3) { | 279 if (buildCounterDiagnostics < 3) { |
| 278 checkUnnamed3365(o.alerts); | 280 checkUnnamed3461(o.alerts); |
| 279 unittest.expect(o.beaconName, unittest.equals('foo')); | 281 unittest.expect(o.beaconName, unittest.equals('foo')); |
| 280 checkDate(o.estimatedLowBatteryDate); | 282 checkDate(o.estimatedLowBatteryDate); |
| 281 } | 283 } |
| 282 buildCounterDiagnostics--; | 284 buildCounterDiagnostics--; |
| 283 } | 285 } |
| 284 | 286 |
| 285 core.int buildCounterEmpty = 0; | 287 core.int buildCounterEmpty = 0; |
| 286 buildEmpty() { | 288 buildEmpty() { |
| 287 var o = new api.Empty(); | 289 var o = new api.Empty(); |
| 288 buildCounterEmpty++; | 290 buildCounterEmpty++; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 checkEphemeralIdRegistrationParams(api.EphemeralIdRegistrationParams o) { | 346 checkEphemeralIdRegistrationParams(api.EphemeralIdRegistrationParams o) { |
| 345 buildCounterEphemeralIdRegistrationParams++; | 347 buildCounterEphemeralIdRegistrationParams++; |
| 346 if (buildCounterEphemeralIdRegistrationParams < 3) { | 348 if (buildCounterEphemeralIdRegistrationParams < 3) { |
| 347 unittest.expect(o.maxRotationPeriodExponent, unittest.equals(42)); | 349 unittest.expect(o.maxRotationPeriodExponent, unittest.equals(42)); |
| 348 unittest.expect(o.minRotationPeriodExponent, unittest.equals(42)); | 350 unittest.expect(o.minRotationPeriodExponent, unittest.equals(42)); |
| 349 unittest.expect(o.serviceEcdhPublicKey, unittest.equals('foo')); | 351 unittest.expect(o.serviceEcdhPublicKey, unittest.equals('foo')); |
| 350 } | 352 } |
| 351 buildCounterEphemeralIdRegistrationParams--; | 353 buildCounterEphemeralIdRegistrationParams--; |
| 352 } | 354 } |
| 353 | 355 |
| 354 buildUnnamed3366() { | 356 buildUnnamed3462() { |
| 355 var o = new core.List<core.String>(); | 357 var o = new core.List<core.String>(); |
| 356 o.add("foo"); | 358 o.add("foo"); |
| 357 o.add("foo"); | 359 o.add("foo"); |
| 358 return o; | 360 return o; |
| 359 } | 361 } |
| 360 | 362 |
| 361 checkUnnamed3366(core.List<core.String> o) { | 363 checkUnnamed3462(core.List<core.String> o) { |
| 362 unittest.expect(o, unittest.hasLength(2)); | 364 unittest.expect(o, unittest.hasLength(2)); |
| 363 unittest.expect(o[0], unittest.equals('foo')); | 365 unittest.expect(o[0], unittest.equals('foo')); |
| 364 unittest.expect(o[1], unittest.equals('foo')); | 366 unittest.expect(o[1], unittest.equals('foo')); |
| 365 } | 367 } |
| 366 | 368 |
| 367 buildUnnamed3367() { | 369 buildUnnamed3463() { |
| 368 var o = new core.List<api.Observation>(); | 370 var o = new core.List<api.Observation>(); |
| 369 o.add(buildObservation()); | 371 o.add(buildObservation()); |
| 370 o.add(buildObservation()); | 372 o.add(buildObservation()); |
| 371 return o; | 373 return o; |
| 372 } | 374 } |
| 373 | 375 |
| 374 checkUnnamed3367(core.List<api.Observation> o) { | 376 checkUnnamed3463(core.List<api.Observation> o) { |
| 375 unittest.expect(o, unittest.hasLength(2)); | 377 unittest.expect(o, unittest.hasLength(2)); |
| 376 checkObservation(o[0]); | 378 checkObservation(o[0]); |
| 377 checkObservation(o[1]); | 379 checkObservation(o[1]); |
| 378 } | 380 } |
| 379 | 381 |
| 380 core.int buildCounterGetInfoForObservedBeaconsRequest = 0; | 382 core.int buildCounterGetInfoForObservedBeaconsRequest = 0; |
| 381 buildGetInfoForObservedBeaconsRequest() { | 383 buildGetInfoForObservedBeaconsRequest() { |
| 382 var o = new api.GetInfoForObservedBeaconsRequest(); | 384 var o = new api.GetInfoForObservedBeaconsRequest(); |
| 383 buildCounterGetInfoForObservedBeaconsRequest++; | 385 buildCounterGetInfoForObservedBeaconsRequest++; |
| 384 if (buildCounterGetInfoForObservedBeaconsRequest < 3) { | 386 if (buildCounterGetInfoForObservedBeaconsRequest < 3) { |
| 385 o.namespacedTypes = buildUnnamed3366(); | 387 o.namespacedTypes = buildUnnamed3462(); |
| 386 o.observations = buildUnnamed3367(); | 388 o.observations = buildUnnamed3463(); |
| 387 } | 389 } |
| 388 buildCounterGetInfoForObservedBeaconsRequest--; | 390 buildCounterGetInfoForObservedBeaconsRequest--; |
| 389 return o; | 391 return o; |
| 390 } | 392 } |
| 391 | 393 |
| 392 checkGetInfoForObservedBeaconsRequest(api.GetInfoForObservedBeaconsRequest o) { | 394 checkGetInfoForObservedBeaconsRequest(api.GetInfoForObservedBeaconsRequest o) { |
| 393 buildCounterGetInfoForObservedBeaconsRequest++; | 395 buildCounterGetInfoForObservedBeaconsRequest++; |
| 394 if (buildCounterGetInfoForObservedBeaconsRequest < 3) { | 396 if (buildCounterGetInfoForObservedBeaconsRequest < 3) { |
| 395 checkUnnamed3366(o.namespacedTypes); | 397 checkUnnamed3462(o.namespacedTypes); |
| 396 checkUnnamed3367(o.observations); | 398 checkUnnamed3463(o.observations); |
| 397 } | 399 } |
| 398 buildCounterGetInfoForObservedBeaconsRequest--; | 400 buildCounterGetInfoForObservedBeaconsRequest--; |
| 399 } | 401 } |
| 400 | 402 |
| 401 buildUnnamed3368() { | 403 buildUnnamed3464() { |
| 402 var o = new core.List<api.BeaconInfo>(); | 404 var o = new core.List<api.BeaconInfo>(); |
| 403 o.add(buildBeaconInfo()); | 405 o.add(buildBeaconInfo()); |
| 404 o.add(buildBeaconInfo()); | 406 o.add(buildBeaconInfo()); |
| 405 return o; | 407 return o; |
| 406 } | 408 } |
| 407 | 409 |
| 408 checkUnnamed3368(core.List<api.BeaconInfo> o) { | 410 checkUnnamed3464(core.List<api.BeaconInfo> o) { |
| 409 unittest.expect(o, unittest.hasLength(2)); | 411 unittest.expect(o, unittest.hasLength(2)); |
| 410 checkBeaconInfo(o[0]); | 412 checkBeaconInfo(o[0]); |
| 411 checkBeaconInfo(o[1]); | 413 checkBeaconInfo(o[1]); |
| 412 } | 414 } |
| 413 | 415 |
| 414 core.int buildCounterGetInfoForObservedBeaconsResponse = 0; | 416 core.int buildCounterGetInfoForObservedBeaconsResponse = 0; |
| 415 buildGetInfoForObservedBeaconsResponse() { | 417 buildGetInfoForObservedBeaconsResponse() { |
| 416 var o = new api.GetInfoForObservedBeaconsResponse(); | 418 var o = new api.GetInfoForObservedBeaconsResponse(); |
| 417 buildCounterGetInfoForObservedBeaconsResponse++; | 419 buildCounterGetInfoForObservedBeaconsResponse++; |
| 418 if (buildCounterGetInfoForObservedBeaconsResponse < 3) { | 420 if (buildCounterGetInfoForObservedBeaconsResponse < 3) { |
| 419 o.beacons = buildUnnamed3368(); | 421 o.beacons = buildUnnamed3464(); |
| 420 } | 422 } |
| 421 buildCounterGetInfoForObservedBeaconsResponse--; | 423 buildCounterGetInfoForObservedBeaconsResponse--; |
| 422 return o; | 424 return o; |
| 423 } | 425 } |
| 424 | 426 |
| 425 checkGetInfoForObservedBeaconsResponse(api.GetInfoForObservedBeaconsResponse o)
{ | 427 checkGetInfoForObservedBeaconsResponse(api.GetInfoForObservedBeaconsResponse o)
{ |
| 426 buildCounterGetInfoForObservedBeaconsResponse++; | 428 buildCounterGetInfoForObservedBeaconsResponse++; |
| 427 if (buildCounterGetInfoForObservedBeaconsResponse < 3) { | 429 if (buildCounterGetInfoForObservedBeaconsResponse < 3) { |
| 428 checkUnnamed3368(o.beacons); | 430 checkUnnamed3464(o.beacons); |
| 429 } | 431 } |
| 430 buildCounterGetInfoForObservedBeaconsResponse--; | 432 buildCounterGetInfoForObservedBeaconsResponse--; |
| 431 } | 433 } |
| 432 | 434 |
| 433 core.int buildCounterIndoorLevel = 0; | 435 core.int buildCounterIndoorLevel = 0; |
| 434 buildIndoorLevel() { | 436 buildIndoorLevel() { |
| 435 var o = new api.IndoorLevel(); | 437 var o = new api.IndoorLevel(); |
| 436 buildCounterIndoorLevel++; | 438 buildCounterIndoorLevel++; |
| 437 if (buildCounterIndoorLevel < 3) { | 439 if (buildCounterIndoorLevel < 3) { |
| 438 o.name = "foo"; | 440 o.name = "foo"; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 463 | 465 |
| 464 checkLatLng(api.LatLng o) { | 466 checkLatLng(api.LatLng o) { |
| 465 buildCounterLatLng++; | 467 buildCounterLatLng++; |
| 466 if (buildCounterLatLng < 3) { | 468 if (buildCounterLatLng < 3) { |
| 467 unittest.expect(o.latitude, unittest.equals(42.0)); | 469 unittest.expect(o.latitude, unittest.equals(42.0)); |
| 468 unittest.expect(o.longitude, unittest.equals(42.0)); | 470 unittest.expect(o.longitude, unittest.equals(42.0)); |
| 469 } | 471 } |
| 470 buildCounterLatLng--; | 472 buildCounterLatLng--; |
| 471 } | 473 } |
| 472 | 474 |
| 473 buildUnnamed3369() { | 475 buildUnnamed3465() { |
| 474 var o = new core.List<api.BeaconAttachment>(); | 476 var o = new core.List<api.BeaconAttachment>(); |
| 475 o.add(buildBeaconAttachment()); | 477 o.add(buildBeaconAttachment()); |
| 476 o.add(buildBeaconAttachment()); | 478 o.add(buildBeaconAttachment()); |
| 477 return o; | 479 return o; |
| 478 } | 480 } |
| 479 | 481 |
| 480 checkUnnamed3369(core.List<api.BeaconAttachment> o) { | 482 checkUnnamed3465(core.List<api.BeaconAttachment> o) { |
| 481 unittest.expect(o, unittest.hasLength(2)); | 483 unittest.expect(o, unittest.hasLength(2)); |
| 482 checkBeaconAttachment(o[0]); | 484 checkBeaconAttachment(o[0]); |
| 483 checkBeaconAttachment(o[1]); | 485 checkBeaconAttachment(o[1]); |
| 484 } | 486 } |
| 485 | 487 |
| 486 core.int buildCounterListBeaconAttachmentsResponse = 0; | 488 core.int buildCounterListBeaconAttachmentsResponse = 0; |
| 487 buildListBeaconAttachmentsResponse() { | 489 buildListBeaconAttachmentsResponse() { |
| 488 var o = new api.ListBeaconAttachmentsResponse(); | 490 var o = new api.ListBeaconAttachmentsResponse(); |
| 489 buildCounterListBeaconAttachmentsResponse++; | 491 buildCounterListBeaconAttachmentsResponse++; |
| 490 if (buildCounterListBeaconAttachmentsResponse < 3) { | 492 if (buildCounterListBeaconAttachmentsResponse < 3) { |
| 491 o.attachments = buildUnnamed3369(); | 493 o.attachments = buildUnnamed3465(); |
| 492 } | 494 } |
| 493 buildCounterListBeaconAttachmentsResponse--; | 495 buildCounterListBeaconAttachmentsResponse--; |
| 494 return o; | 496 return o; |
| 495 } | 497 } |
| 496 | 498 |
| 497 checkListBeaconAttachmentsResponse(api.ListBeaconAttachmentsResponse o) { | 499 checkListBeaconAttachmentsResponse(api.ListBeaconAttachmentsResponse o) { |
| 498 buildCounterListBeaconAttachmentsResponse++; | 500 buildCounterListBeaconAttachmentsResponse++; |
| 499 if (buildCounterListBeaconAttachmentsResponse < 3) { | 501 if (buildCounterListBeaconAttachmentsResponse < 3) { |
| 500 checkUnnamed3369(o.attachments); | 502 checkUnnamed3465(o.attachments); |
| 501 } | 503 } |
| 502 buildCounterListBeaconAttachmentsResponse--; | 504 buildCounterListBeaconAttachmentsResponse--; |
| 503 } | 505 } |
| 504 | 506 |
| 505 buildUnnamed3370() { | 507 buildUnnamed3466() { |
| 506 var o = new core.List<api.Beacon>(); | 508 var o = new core.List<api.Beacon>(); |
| 507 o.add(buildBeacon()); | 509 o.add(buildBeacon()); |
| 508 o.add(buildBeacon()); | 510 o.add(buildBeacon()); |
| 509 return o; | 511 return o; |
| 510 } | 512 } |
| 511 | 513 |
| 512 checkUnnamed3370(core.List<api.Beacon> o) { | 514 checkUnnamed3466(core.List<api.Beacon> o) { |
| 513 unittest.expect(o, unittest.hasLength(2)); | 515 unittest.expect(o, unittest.hasLength(2)); |
| 514 checkBeacon(o[0]); | 516 checkBeacon(o[0]); |
| 515 checkBeacon(o[1]); | 517 checkBeacon(o[1]); |
| 516 } | 518 } |
| 517 | 519 |
| 518 core.int buildCounterListBeaconsResponse = 0; | 520 core.int buildCounterListBeaconsResponse = 0; |
| 519 buildListBeaconsResponse() { | 521 buildListBeaconsResponse() { |
| 520 var o = new api.ListBeaconsResponse(); | 522 var o = new api.ListBeaconsResponse(); |
| 521 buildCounterListBeaconsResponse++; | 523 buildCounterListBeaconsResponse++; |
| 522 if (buildCounterListBeaconsResponse < 3) { | 524 if (buildCounterListBeaconsResponse < 3) { |
| 523 o.beacons = buildUnnamed3370(); | 525 o.beacons = buildUnnamed3466(); |
| 524 o.nextPageToken = "foo"; | 526 o.nextPageToken = "foo"; |
| 525 o.totalCount = "foo"; | 527 o.totalCount = "foo"; |
| 526 } | 528 } |
| 527 buildCounterListBeaconsResponse--; | 529 buildCounterListBeaconsResponse--; |
| 528 return o; | 530 return o; |
| 529 } | 531 } |
| 530 | 532 |
| 531 checkListBeaconsResponse(api.ListBeaconsResponse o) { | 533 checkListBeaconsResponse(api.ListBeaconsResponse o) { |
| 532 buildCounterListBeaconsResponse++; | 534 buildCounterListBeaconsResponse++; |
| 533 if (buildCounterListBeaconsResponse < 3) { | 535 if (buildCounterListBeaconsResponse < 3) { |
| 534 checkUnnamed3370(o.beacons); | 536 checkUnnamed3466(o.beacons); |
| 535 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 537 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 536 unittest.expect(o.totalCount, unittest.equals('foo')); | 538 unittest.expect(o.totalCount, unittest.equals('foo')); |
| 537 } | 539 } |
| 538 buildCounterListBeaconsResponse--; | 540 buildCounterListBeaconsResponse--; |
| 539 } | 541 } |
| 540 | 542 |
| 541 buildUnnamed3371() { | 543 buildUnnamed3467() { |
| 542 var o = new core.List<api.Diagnostics>(); | 544 var o = new core.List<api.Diagnostics>(); |
| 543 o.add(buildDiagnostics()); | 545 o.add(buildDiagnostics()); |
| 544 o.add(buildDiagnostics()); | 546 o.add(buildDiagnostics()); |
| 545 return o; | 547 return o; |
| 546 } | 548 } |
| 547 | 549 |
| 548 checkUnnamed3371(core.List<api.Diagnostics> o) { | 550 checkUnnamed3467(core.List<api.Diagnostics> o) { |
| 549 unittest.expect(o, unittest.hasLength(2)); | 551 unittest.expect(o, unittest.hasLength(2)); |
| 550 checkDiagnostics(o[0]); | 552 checkDiagnostics(o[0]); |
| 551 checkDiagnostics(o[1]); | 553 checkDiagnostics(o[1]); |
| 552 } | 554 } |
| 553 | 555 |
| 554 core.int buildCounterListDiagnosticsResponse = 0; | 556 core.int buildCounterListDiagnosticsResponse = 0; |
| 555 buildListDiagnosticsResponse() { | 557 buildListDiagnosticsResponse() { |
| 556 var o = new api.ListDiagnosticsResponse(); | 558 var o = new api.ListDiagnosticsResponse(); |
| 557 buildCounterListDiagnosticsResponse++; | 559 buildCounterListDiagnosticsResponse++; |
| 558 if (buildCounterListDiagnosticsResponse < 3) { | 560 if (buildCounterListDiagnosticsResponse < 3) { |
| 559 o.diagnostics = buildUnnamed3371(); | 561 o.diagnostics = buildUnnamed3467(); |
| 560 o.nextPageToken = "foo"; | 562 o.nextPageToken = "foo"; |
| 561 } | 563 } |
| 562 buildCounterListDiagnosticsResponse--; | 564 buildCounterListDiagnosticsResponse--; |
| 563 return o; | 565 return o; |
| 564 } | 566 } |
| 565 | 567 |
| 566 checkListDiagnosticsResponse(api.ListDiagnosticsResponse o) { | 568 checkListDiagnosticsResponse(api.ListDiagnosticsResponse o) { |
| 567 buildCounterListDiagnosticsResponse++; | 569 buildCounterListDiagnosticsResponse++; |
| 568 if (buildCounterListDiagnosticsResponse < 3) { | 570 if (buildCounterListDiagnosticsResponse < 3) { |
| 569 checkUnnamed3371(o.diagnostics); | 571 checkUnnamed3467(o.diagnostics); |
| 570 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 572 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 571 } | 573 } |
| 572 buildCounterListDiagnosticsResponse--; | 574 buildCounterListDiagnosticsResponse--; |
| 573 } | 575 } |
| 574 | 576 |
| 575 buildUnnamed3372() { | 577 buildUnnamed3468() { |
| 576 var o = new core.List<api.Namespace>(); | 578 var o = new core.List<api.Namespace>(); |
| 577 o.add(buildNamespace()); | 579 o.add(buildNamespace()); |
| 578 o.add(buildNamespace()); | 580 o.add(buildNamespace()); |
| 579 return o; | 581 return o; |
| 580 } | 582 } |
| 581 | 583 |
| 582 checkUnnamed3372(core.List<api.Namespace> o) { | 584 checkUnnamed3468(core.List<api.Namespace> o) { |
| 583 unittest.expect(o, unittest.hasLength(2)); | 585 unittest.expect(o, unittest.hasLength(2)); |
| 584 checkNamespace(o[0]); | 586 checkNamespace(o[0]); |
| 585 checkNamespace(o[1]); | 587 checkNamespace(o[1]); |
| 586 } | 588 } |
| 587 | 589 |
| 588 core.int buildCounterListNamespacesResponse = 0; | 590 core.int buildCounterListNamespacesResponse = 0; |
| 589 buildListNamespacesResponse() { | 591 buildListNamespacesResponse() { |
| 590 var o = new api.ListNamespacesResponse(); | 592 var o = new api.ListNamespacesResponse(); |
| 591 buildCounterListNamespacesResponse++; | 593 buildCounterListNamespacesResponse++; |
| 592 if (buildCounterListNamespacesResponse < 3) { | 594 if (buildCounterListNamespacesResponse < 3) { |
| 593 o.namespaces = buildUnnamed3372(); | 595 o.namespaces = buildUnnamed3468(); |
| 594 } | 596 } |
| 595 buildCounterListNamespacesResponse--; | 597 buildCounterListNamespacesResponse--; |
| 596 return o; | 598 return o; |
| 597 } | 599 } |
| 598 | 600 |
| 599 checkListNamespacesResponse(api.ListNamespacesResponse o) { | 601 checkListNamespacesResponse(api.ListNamespacesResponse o) { |
| 600 buildCounterListNamespacesResponse++; | 602 buildCounterListNamespacesResponse++; |
| 601 if (buildCounterListNamespacesResponse < 3) { | 603 if (buildCounterListNamespacesResponse < 3) { |
| 602 checkUnnamed3372(o.namespaces); | 604 checkUnnamed3468(o.namespaces); |
| 603 } | 605 } |
| 604 buildCounterListNamespacesResponse--; | 606 buildCounterListNamespacesResponse--; |
| 605 } | 607 } |
| 606 | 608 |
| 607 core.int buildCounterNamespace = 0; | 609 core.int buildCounterNamespace = 0; |
| 608 buildNamespace() { | 610 buildNamespace() { |
| 609 var o = new api.Namespace(); | 611 var o = new api.Namespace(); |
| 610 buildCounterNamespace++; | 612 buildCounterNamespace++; |
| 611 if (buildCounterNamespace < 3) { | 613 if (buildCounterNamespace < 3) { |
| 612 o.namespaceName = "foo"; | 614 o.namespaceName = "foo"; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 "content-type" : "application/json; charset=utf-8", | 1027 "content-type" : "application/json; charset=utf-8", |
| 1026 }; | 1028 }; |
| 1027 var resp = convert.JSON.encode(buildEmpty()); | 1029 var resp = convert.JSON.encode(buildEmpty()); |
| 1028 return new async.Future.value(stringResponse(200, h, resp)); | 1030 return new async.Future.value(stringResponse(200, h, resp)); |
| 1029 }), true); | 1031 }), true); |
| 1030 res.decommission(arg_beaconName, projectId: arg_projectId).then(unittest.e
xpectAsync(((api.Empty response) { | 1032 res.decommission(arg_beaconName, projectId: arg_projectId).then(unittest.e
xpectAsync(((api.Empty response) { |
| 1031 checkEmpty(response); | 1033 checkEmpty(response); |
| 1032 }))); | 1034 }))); |
| 1033 }); | 1035 }); |
| 1034 | 1036 |
| 1037 unittest.test("method--delete", () { |
| 1038 |
| 1039 var mock = new HttpServerMock(); |
| 1040 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; |
| 1041 var arg_beaconName = "foo"; |
| 1042 var arg_projectId = "foo"; |
| 1043 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1044 var path = (req.url).path; |
| 1045 var pathOffset = 0; |
| 1046 var index; |
| 1047 var subPart; |
| 1048 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1049 pathOffset += 1; |
| 1050 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1051 pathOffset += 8; |
| 1052 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1053 |
| 1054 var query = (req.url).query; |
| 1055 var queryOffset = 0; |
| 1056 var queryMap = {}; |
| 1057 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1058 parseBool(n) { |
| 1059 if (n == "true") return true; |
| 1060 if (n == "false") return false; |
| 1061 if (n == null) return null; |
| 1062 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1063 } |
| 1064 if (query.length > 0) { |
| 1065 for (var part in query.split("&")) { |
| 1066 var keyvalue = part.split("="); |
| 1067 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1068 } |
| 1069 } |
| 1070 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
| 1071 |
| 1072 |
| 1073 var h = { |
| 1074 "content-type" : "application/json; charset=utf-8", |
| 1075 }; |
| 1076 var resp = convert.JSON.encode(buildEmpty()); |
| 1077 return new async.Future.value(stringResponse(200, h, resp)); |
| 1078 }), true); |
| 1079 res.delete(arg_beaconName, projectId: arg_projectId).then(unittest.expectA
sync(((api.Empty response) { |
| 1080 checkEmpty(response); |
| 1081 }))); |
| 1082 }); |
| 1083 |
| 1035 unittest.test("method--get", () { | 1084 unittest.test("method--get", () { |
| 1036 | 1085 |
| 1037 var mock = new HttpServerMock(); | 1086 var mock = new HttpServerMock(); |
| 1038 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; | 1087 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; |
| 1039 var arg_beaconName = "foo"; | 1088 var arg_beaconName = "foo"; |
| 1040 var arg_projectId = "foo"; | 1089 var arg_projectId = "foo"; |
| 1041 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1090 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1042 var path = (req.url).path; | 1091 var path = (req.url).path; |
| 1043 var pathOffset = 0; | 1092 var pathOffset = 0; |
| 1044 var index; | 1093 var index; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 }), true); | 1125 }), true); |
| 1077 res.get(arg_beaconName, projectId: arg_projectId).then(unittest.expectAsyn
c(((api.Beacon response) { | 1126 res.get(arg_beaconName, projectId: arg_projectId).then(unittest.expectAsyn
c(((api.Beacon response) { |
| 1078 checkBeacon(response); | 1127 checkBeacon(response); |
| 1079 }))); | 1128 }))); |
| 1080 }); | 1129 }); |
| 1081 | 1130 |
| 1082 unittest.test("method--list", () { | 1131 unittest.test("method--list", () { |
| 1083 | 1132 |
| 1084 var mock = new HttpServerMock(); | 1133 var mock = new HttpServerMock(); |
| 1085 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; | 1134 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; |
| 1135 var arg_pageToken = "foo"; |
| 1086 var arg_q = "foo"; | 1136 var arg_q = "foo"; |
| 1087 var arg_pageToken = "foo"; | |
| 1088 var arg_pageSize = 42; | 1137 var arg_pageSize = 42; |
| 1089 var arg_projectId = "foo"; | 1138 var arg_projectId = "foo"; |
| 1090 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1139 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1091 var path = (req.url).path; | 1140 var path = (req.url).path; |
| 1092 var pathOffset = 0; | 1141 var pathOffset = 0; |
| 1093 var index; | 1142 var index; |
| 1094 var subPart; | 1143 var subPart; |
| 1095 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1144 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1096 pathOffset += 1; | 1145 pathOffset += 1; |
| 1097 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1beta1/beacons")); | 1146 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1beta1/beacons")); |
| 1098 pathOffset += 15; | 1147 pathOffset += 15; |
| 1099 | 1148 |
| 1100 var query = (req.url).query; | 1149 var query = (req.url).query; |
| 1101 var queryOffset = 0; | 1150 var queryOffset = 0; |
| 1102 var queryMap = {}; | 1151 var queryMap = {}; |
| 1103 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1152 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1104 parseBool(n) { | 1153 parseBool(n) { |
| 1105 if (n == "true") return true; | 1154 if (n == "true") return true; |
| 1106 if (n == "false") return false; | 1155 if (n == "false") return false; |
| 1107 if (n == null) return null; | 1156 if (n == null) return null; |
| 1108 throw new core.ArgumentError("Invalid boolean: $n"); | 1157 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1109 } | 1158 } |
| 1110 if (query.length > 0) { | 1159 if (query.length > 0) { |
| 1111 for (var part in query.split("&")) { | 1160 for (var part in query.split("&")) { |
| 1112 var keyvalue = part.split("="); | 1161 var keyvalue = part.split("="); |
| 1113 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1162 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1114 } | 1163 } |
| 1115 } | 1164 } |
| 1165 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1116 unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); | 1166 unittest.expect(queryMap["q"].first, unittest.equals(arg_q)); |
| 1117 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1118 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1167 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1119 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); | 1168 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
| 1120 | 1169 |
| 1121 | 1170 |
| 1122 var h = { | 1171 var h = { |
| 1123 "content-type" : "application/json; charset=utf-8", | 1172 "content-type" : "application/json; charset=utf-8", |
| 1124 }; | 1173 }; |
| 1125 var resp = convert.JSON.encode(buildListBeaconsResponse()); | 1174 var resp = convert.JSON.encode(buildListBeaconsResponse()); |
| 1126 return new async.Future.value(stringResponse(200, h, resp)); | 1175 return new async.Future.value(stringResponse(200, h, resp)); |
| 1127 }), true); | 1176 }), true); |
| 1128 res.list(q: arg_q, pageToken: arg_pageToken, pageSize: arg_pageSize, proje
ctId: arg_projectId).then(unittest.expectAsync(((api.ListBeaconsResponse respons
e) { | 1177 res.list(pageToken: arg_pageToken, q: arg_q, pageSize: arg_pageSize, proje
ctId: arg_projectId).then(unittest.expectAsync(((api.ListBeaconsResponse respons
e) { |
| 1129 checkListBeaconsResponse(response); | 1178 checkListBeaconsResponse(response); |
| 1130 }))); | 1179 }))); |
| 1131 }); | 1180 }); |
| 1132 | 1181 |
| 1133 unittest.test("method--register", () { | 1182 unittest.test("method--register", () { |
| 1134 | 1183 |
| 1135 var mock = new HttpServerMock(); | 1184 var mock = new HttpServerMock(); |
| 1136 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; | 1185 api.BeaconsResourceApi res = new api.ProximitybeaconApi(mock).beacons; |
| 1137 var arg_request = buildBeacon(); | 1186 var arg_request = buildBeacon(); |
| 1138 var arg_projectId = "foo"; | 1187 var arg_projectId = "foo"; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 res.delete(arg_attachmentName, projectId: arg_projectId).then(unittest.exp
ectAsync(((api.Empty response) { | 1428 res.delete(arg_attachmentName, projectId: arg_projectId).then(unittest.exp
ectAsync(((api.Empty response) { |
| 1380 checkEmpty(response); | 1429 checkEmpty(response); |
| 1381 }))); | 1430 }))); |
| 1382 }); | 1431 }); |
| 1383 | 1432 |
| 1384 unittest.test("method--list", () { | 1433 unittest.test("method--list", () { |
| 1385 | 1434 |
| 1386 var mock = new HttpServerMock(); | 1435 var mock = new HttpServerMock(); |
| 1387 api.BeaconsAttachmentsResourceApi res = new api.ProximitybeaconApi(mock).b
eacons.attachments; | 1436 api.BeaconsAttachmentsResourceApi res = new api.ProximitybeaconApi(mock).b
eacons.attachments; |
| 1388 var arg_beaconName = "foo"; | 1437 var arg_beaconName = "foo"; |
| 1438 var arg_projectId = "foo"; |
| 1389 var arg_namespacedType = "foo"; | 1439 var arg_namespacedType = "foo"; |
| 1390 var arg_projectId = "foo"; | |
| 1391 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1440 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1392 var path = (req.url).path; | 1441 var path = (req.url).path; |
| 1393 var pathOffset = 0; | 1442 var pathOffset = 0; |
| 1394 var index; | 1443 var index; |
| 1395 var subPart; | 1444 var subPart; |
| 1396 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1445 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1397 pathOffset += 1; | 1446 pathOffset += 1; |
| 1398 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1447 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1399 pathOffset += 8; | 1448 pathOffset += 8; |
| 1400 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1449 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1401 | 1450 |
| 1402 var query = (req.url).query; | 1451 var query = (req.url).query; |
| 1403 var queryOffset = 0; | 1452 var queryOffset = 0; |
| 1404 var queryMap = {}; | 1453 var queryMap = {}; |
| 1405 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1454 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1406 parseBool(n) { | 1455 parseBool(n) { |
| 1407 if (n == "true") return true; | 1456 if (n == "true") return true; |
| 1408 if (n == "false") return false; | 1457 if (n == "false") return false; |
| 1409 if (n == null) return null; | 1458 if (n == null) return null; |
| 1410 throw new core.ArgumentError("Invalid boolean: $n"); | 1459 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1411 } | 1460 } |
| 1412 if (query.length > 0) { | 1461 if (query.length > 0) { |
| 1413 for (var part in query.split("&")) { | 1462 for (var part in query.split("&")) { |
| 1414 var keyvalue = part.split("="); | 1463 var keyvalue = part.split("="); |
| 1415 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1464 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1416 } | 1465 } |
| 1417 } | 1466 } |
| 1467 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
| 1418 unittest.expect(queryMap["namespacedType"].first, unittest.equals(arg_na
mespacedType)); | 1468 unittest.expect(queryMap["namespacedType"].first, unittest.equals(arg_na
mespacedType)); |
| 1419 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); | |
| 1420 | 1469 |
| 1421 | 1470 |
| 1422 var h = { | 1471 var h = { |
| 1423 "content-type" : "application/json; charset=utf-8", | 1472 "content-type" : "application/json; charset=utf-8", |
| 1424 }; | 1473 }; |
| 1425 var resp = convert.JSON.encode(buildListBeaconAttachmentsResponse()); | 1474 var resp = convert.JSON.encode(buildListBeaconAttachmentsResponse()); |
| 1426 return new async.Future.value(stringResponse(200, h, resp)); | 1475 return new async.Future.value(stringResponse(200, h, resp)); |
| 1427 }), true); | 1476 }), true); |
| 1428 res.list(arg_beaconName, namespacedType: arg_namespacedType, projectId: ar
g_projectId).then(unittest.expectAsync(((api.ListBeaconAttachmentsResponse respo
nse) { | 1477 res.list(arg_beaconName, projectId: arg_projectId, namespacedType: arg_nam
espacedType).then(unittest.expectAsync(((api.ListBeaconAttachmentsResponse respo
nse) { |
| 1429 checkListBeaconAttachmentsResponse(response); | 1478 checkListBeaconAttachmentsResponse(response); |
| 1430 }))); | 1479 }))); |
| 1431 }); | 1480 }); |
| 1432 | 1481 |
| 1433 }); | 1482 }); |
| 1434 | 1483 |
| 1435 | 1484 |
| 1436 unittest.group("resource-BeaconsDiagnosticsResourceApi", () { | 1485 unittest.group("resource-BeaconsDiagnosticsResourceApi", () { |
| 1437 unittest.test("method--list", () { | 1486 unittest.test("method--list", () { |
| 1438 | 1487 |
| 1439 var mock = new HttpServerMock(); | 1488 var mock = new HttpServerMock(); |
| 1440 api.BeaconsDiagnosticsResourceApi res = new api.ProximitybeaconApi(mock).b
eacons.diagnostics; | 1489 api.BeaconsDiagnosticsResourceApi res = new api.ProximitybeaconApi(mock).b
eacons.diagnostics; |
| 1441 var arg_beaconName = "foo"; | 1490 var arg_beaconName = "foo"; |
| 1442 var arg_pageSize = 42; | 1491 var arg_pageSize = 42; |
| 1443 var arg_pageToken = "foo"; | |
| 1444 var arg_alertFilter = "foo"; | 1492 var arg_alertFilter = "foo"; |
| 1445 var arg_projectId = "foo"; | 1493 var arg_projectId = "foo"; |
| 1494 var arg_pageToken = "foo"; |
| 1446 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1495 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1447 var path = (req.url).path; | 1496 var path = (req.url).path; |
| 1448 var pathOffset = 0; | 1497 var pathOffset = 0; |
| 1449 var index; | 1498 var index; |
| 1450 var subPart; | 1499 var subPart; |
| 1451 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1500 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1452 pathOffset += 1; | 1501 pathOffset += 1; |
| 1453 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1502 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1454 pathOffset += 8; | 1503 pathOffset += 8; |
| 1455 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1504 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1456 | 1505 |
| 1457 var query = (req.url).query; | 1506 var query = (req.url).query; |
| 1458 var queryOffset = 0; | 1507 var queryOffset = 0; |
| 1459 var queryMap = {}; | 1508 var queryMap = {}; |
| 1460 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1509 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1461 parseBool(n) { | 1510 parseBool(n) { |
| 1462 if (n == "true") return true; | 1511 if (n == "true") return true; |
| 1463 if (n == "false") return false; | 1512 if (n == "false") return false; |
| 1464 if (n == null) return null; | 1513 if (n == null) return null; |
| 1465 throw new core.ArgumentError("Invalid boolean: $n"); | 1514 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1466 } | 1515 } |
| 1467 if (query.length > 0) { | 1516 if (query.length > 0) { |
| 1468 for (var part in query.split("&")) { | 1517 for (var part in query.split("&")) { |
| 1469 var keyvalue = part.split("="); | 1518 var keyvalue = part.split("="); |
| 1470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1519 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1471 } | 1520 } |
| 1472 } | 1521 } |
| 1473 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1522 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1474 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1475 unittest.expect(queryMap["alertFilter"].first, unittest.equals(arg_alert
Filter)); | 1523 unittest.expect(queryMap["alertFilter"].first, unittest.equals(arg_alert
Filter)); |
| 1476 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); | 1524 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
| 1525 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1477 | 1526 |
| 1478 | 1527 |
| 1479 var h = { | 1528 var h = { |
| 1480 "content-type" : "application/json; charset=utf-8", | 1529 "content-type" : "application/json; charset=utf-8", |
| 1481 }; | 1530 }; |
| 1482 var resp = convert.JSON.encode(buildListDiagnosticsResponse()); | 1531 var resp = convert.JSON.encode(buildListDiagnosticsResponse()); |
| 1483 return new async.Future.value(stringResponse(200, h, resp)); | 1532 return new async.Future.value(stringResponse(200, h, resp)); |
| 1484 }), true); | 1533 }), true); |
| 1485 res.list(arg_beaconName, pageSize: arg_pageSize, pageToken: arg_pageToken,
alertFilter: arg_alertFilter, projectId: arg_projectId).then(unittest.expectAsy
nc(((api.ListDiagnosticsResponse response) { | 1534 res.list(arg_beaconName, pageSize: arg_pageSize, alertFilter: arg_alertFil
ter, projectId: arg_projectId, pageToken: arg_pageToken).then(unittest.expectAsy
nc(((api.ListDiagnosticsResponse response) { |
| 1486 checkListDiagnosticsResponse(response); | 1535 checkListDiagnosticsResponse(response); |
| 1487 }))); | 1536 }))); |
| 1488 }); | 1537 }); |
| 1489 | 1538 |
| 1490 }); | 1539 }); |
| 1491 | 1540 |
| 1492 | 1541 |
| 1493 unittest.group("resource-NamespacesResourceApi", () { | 1542 unittest.group("resource-NamespacesResourceApi", () { |
| 1494 unittest.test("method--list", () { | 1543 unittest.test("method--list", () { |
| 1495 | 1544 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 res.getEidparams().then(unittest.expectAsync(((api.EphemeralIdRegistration
Params response) { | 1681 res.getEidparams().then(unittest.expectAsync(((api.EphemeralIdRegistration
Params response) { |
| 1633 checkEphemeralIdRegistrationParams(response); | 1682 checkEphemeralIdRegistrationParams(response); |
| 1634 }))); | 1683 }))); |
| 1635 }); | 1684 }); |
| 1636 | 1685 |
| 1637 }); | 1686 }); |
| 1638 | 1687 |
| 1639 | 1688 |
| 1640 } | 1689 } |
| 1641 | 1690 |
| OLD | NEW |