| OLD | NEW |
| 1 library googleapis.doubleclickbidmanager.v1.test; | 1 library googleapis.doubleclickbidmanager.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis/common/common.dart' as common; | |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
| 13 import '../common/common_internal_test.dart' as common_test; | |
| 14 | 11 |
| 15 import 'package:googleapis/doubleclickbidmanager/v1.dart' as api; | 12 import 'package:googleapis/doubleclickbidmanager/v1.dart' as api; |
| 16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 18 | 22 |
| 19 buildUnnamed1016() { | 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 53 |
| 54 buildUnnamed952() { |
| 20 var o = new core.List<core.String>(); | 55 var o = new core.List<core.String>(); |
| 21 o.add("foo"); | 56 o.add("foo"); |
| 22 o.add("foo"); | 57 o.add("foo"); |
| 23 return o; | 58 return o; |
| 24 } | 59 } |
| 25 | 60 |
| 26 checkUnnamed1016(core.List<core.String> o) { | 61 checkUnnamed952(core.List<core.String> o) { |
| 27 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 28 unittest.expect(o[0], unittest.equals('foo')); | 63 unittest.expect(o[0], unittest.equals('foo')); |
| 29 unittest.expect(o[1], unittest.equals('foo')); | 64 unittest.expect(o[1], unittest.equals('foo')); |
| 30 } | 65 } |
| 31 | 66 |
| 32 core.int buildCounterDownloadLineItemsRequest = 0; | 67 core.int buildCounterDownloadLineItemsRequest = 0; |
| 33 buildDownloadLineItemsRequest() { | 68 buildDownloadLineItemsRequest() { |
| 34 var o = new api.DownloadLineItemsRequest(); | 69 var o = new api.DownloadLineItemsRequest(); |
| 35 buildCounterDownloadLineItemsRequest++; | 70 buildCounterDownloadLineItemsRequest++; |
| 36 if (buildCounterDownloadLineItemsRequest < 3) { | 71 if (buildCounterDownloadLineItemsRequest < 3) { |
| 37 o.filterIds = buildUnnamed1016(); | 72 o.filterIds = buildUnnamed952(); |
| 38 o.filterType = "foo"; | 73 o.filterType = "foo"; |
| 39 o.format = "foo"; | 74 o.format = "foo"; |
| 40 } | 75 } |
| 41 buildCounterDownloadLineItemsRequest--; | 76 buildCounterDownloadLineItemsRequest--; |
| 42 return o; | 77 return o; |
| 43 } | 78 } |
| 44 | 79 |
| 45 checkDownloadLineItemsRequest(api.DownloadLineItemsRequest o) { | 80 checkDownloadLineItemsRequest(api.DownloadLineItemsRequest o) { |
| 46 buildCounterDownloadLineItemsRequest++; | 81 buildCounterDownloadLineItemsRequest++; |
| 47 if (buildCounterDownloadLineItemsRequest < 3) { | 82 if (buildCounterDownloadLineItemsRequest < 3) { |
| 48 checkUnnamed1016(o.filterIds); | 83 checkUnnamed952(o.filterIds); |
| 49 unittest.expect(o.filterType, unittest.equals('foo')); | 84 unittest.expect(o.filterType, unittest.equals('foo')); |
| 50 unittest.expect(o.format, unittest.equals('foo')); | 85 unittest.expect(o.format, unittest.equals('foo')); |
| 51 } | 86 } |
| 52 buildCounterDownloadLineItemsRequest--; | 87 buildCounterDownloadLineItemsRequest--; |
| 53 } | 88 } |
| 54 | 89 |
| 55 core.int buildCounterDownloadLineItemsResponse = 0; | 90 core.int buildCounterDownloadLineItemsResponse = 0; |
| 56 buildDownloadLineItemsResponse() { | 91 buildDownloadLineItemsResponse() { |
| 57 var o = new api.DownloadLineItemsResponse(); | 92 var o = new api.DownloadLineItemsResponse(); |
| 58 buildCounterDownloadLineItemsResponse++; | 93 buildCounterDownloadLineItemsResponse++; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 85 | 120 |
| 86 checkFilterPair(api.FilterPair o) { | 121 checkFilterPair(api.FilterPair o) { |
| 87 buildCounterFilterPair++; | 122 buildCounterFilterPair++; |
| 88 if (buildCounterFilterPair < 3) { | 123 if (buildCounterFilterPair < 3) { |
| 89 unittest.expect(o.type, unittest.equals('foo')); | 124 unittest.expect(o.type, unittest.equals('foo')); |
| 90 unittest.expect(o.value, unittest.equals('foo')); | 125 unittest.expect(o.value, unittest.equals('foo')); |
| 91 } | 126 } |
| 92 buildCounterFilterPair--; | 127 buildCounterFilterPair--; |
| 93 } | 128 } |
| 94 | 129 |
| 95 buildUnnamed1017() { | 130 buildUnnamed953() { |
| 96 var o = new core.List<api.Query>(); | 131 var o = new core.List<api.Query>(); |
| 97 o.add(buildQuery()); | 132 o.add(buildQuery()); |
| 98 o.add(buildQuery()); | 133 o.add(buildQuery()); |
| 99 return o; | 134 return o; |
| 100 } | 135 } |
| 101 | 136 |
| 102 checkUnnamed1017(core.List<api.Query> o) { | 137 checkUnnamed953(core.List<api.Query> o) { |
| 103 unittest.expect(o, unittest.hasLength(2)); | 138 unittest.expect(o, unittest.hasLength(2)); |
| 104 checkQuery(o[0]); | 139 checkQuery(o[0]); |
| 105 checkQuery(o[1]); | 140 checkQuery(o[1]); |
| 106 } | 141 } |
| 107 | 142 |
| 108 core.int buildCounterListQueriesResponse = 0; | 143 core.int buildCounterListQueriesResponse = 0; |
| 109 buildListQueriesResponse() { | 144 buildListQueriesResponse() { |
| 110 var o = new api.ListQueriesResponse(); | 145 var o = new api.ListQueriesResponse(); |
| 111 buildCounterListQueriesResponse++; | 146 buildCounterListQueriesResponse++; |
| 112 if (buildCounterListQueriesResponse < 3) { | 147 if (buildCounterListQueriesResponse < 3) { |
| 113 o.kind = "foo"; | 148 o.kind = "foo"; |
| 114 o.queries = buildUnnamed1017(); | 149 o.queries = buildUnnamed953(); |
| 115 } | 150 } |
| 116 buildCounterListQueriesResponse--; | 151 buildCounterListQueriesResponse--; |
| 117 return o; | 152 return o; |
| 118 } | 153 } |
| 119 | 154 |
| 120 checkListQueriesResponse(api.ListQueriesResponse o) { | 155 checkListQueriesResponse(api.ListQueriesResponse o) { |
| 121 buildCounterListQueriesResponse++; | 156 buildCounterListQueriesResponse++; |
| 122 if (buildCounterListQueriesResponse < 3) { | 157 if (buildCounterListQueriesResponse < 3) { |
| 123 unittest.expect(o.kind, unittest.equals('foo')); | 158 unittest.expect(o.kind, unittest.equals('foo')); |
| 124 checkUnnamed1017(o.queries); | 159 checkUnnamed953(o.queries); |
| 125 } | 160 } |
| 126 buildCounterListQueriesResponse--; | 161 buildCounterListQueriesResponse--; |
| 127 } | 162 } |
| 128 | 163 |
| 129 buildUnnamed1018() { | 164 buildUnnamed954() { |
| 130 var o = new core.List<api.Report>(); | 165 var o = new core.List<api.Report>(); |
| 131 o.add(buildReport()); | 166 o.add(buildReport()); |
| 132 o.add(buildReport()); | 167 o.add(buildReport()); |
| 133 return o; | 168 return o; |
| 134 } | 169 } |
| 135 | 170 |
| 136 checkUnnamed1018(core.List<api.Report> o) { | 171 checkUnnamed954(core.List<api.Report> o) { |
| 137 unittest.expect(o, unittest.hasLength(2)); | 172 unittest.expect(o, unittest.hasLength(2)); |
| 138 checkReport(o[0]); | 173 checkReport(o[0]); |
| 139 checkReport(o[1]); | 174 checkReport(o[1]); |
| 140 } | 175 } |
| 141 | 176 |
| 142 core.int buildCounterListReportsResponse = 0; | 177 core.int buildCounterListReportsResponse = 0; |
| 143 buildListReportsResponse() { | 178 buildListReportsResponse() { |
| 144 var o = new api.ListReportsResponse(); | 179 var o = new api.ListReportsResponse(); |
| 145 buildCounterListReportsResponse++; | 180 buildCounterListReportsResponse++; |
| 146 if (buildCounterListReportsResponse < 3) { | 181 if (buildCounterListReportsResponse < 3) { |
| 147 o.kind = "foo"; | 182 o.kind = "foo"; |
| 148 o.reports = buildUnnamed1018(); | 183 o.reports = buildUnnamed954(); |
| 149 } | 184 } |
| 150 buildCounterListReportsResponse--; | 185 buildCounterListReportsResponse--; |
| 151 return o; | 186 return o; |
| 152 } | 187 } |
| 153 | 188 |
| 154 checkListReportsResponse(api.ListReportsResponse o) { | 189 checkListReportsResponse(api.ListReportsResponse o) { |
| 155 buildCounterListReportsResponse++; | 190 buildCounterListReportsResponse++; |
| 156 if (buildCounterListReportsResponse < 3) { | 191 if (buildCounterListReportsResponse < 3) { |
| 157 unittest.expect(o.kind, unittest.equals('foo')); | 192 unittest.expect(o.kind, unittest.equals('foo')); |
| 158 checkUnnamed1018(o.reports); | 193 checkUnnamed954(o.reports); |
| 159 } | 194 } |
| 160 buildCounterListReportsResponse--; | 195 buildCounterListReportsResponse--; |
| 161 } | 196 } |
| 162 | 197 |
| 163 buildUnnamed1019() { | 198 buildUnnamed955() { |
| 164 var o = new core.List<api.FilterPair>(); | 199 var o = new core.List<api.FilterPair>(); |
| 165 o.add(buildFilterPair()); | 200 o.add(buildFilterPair()); |
| 166 o.add(buildFilterPair()); | 201 o.add(buildFilterPair()); |
| 167 return o; | 202 return o; |
| 168 } | 203 } |
| 169 | 204 |
| 170 checkUnnamed1019(core.List<api.FilterPair> o) { | 205 checkUnnamed955(core.List<api.FilterPair> o) { |
| 171 unittest.expect(o, unittest.hasLength(2)); | 206 unittest.expect(o, unittest.hasLength(2)); |
| 172 checkFilterPair(o[0]); | 207 checkFilterPair(o[0]); |
| 173 checkFilterPair(o[1]); | 208 checkFilterPair(o[1]); |
| 174 } | 209 } |
| 175 | 210 |
| 176 buildUnnamed1020() { | 211 buildUnnamed956() { |
| 177 var o = new core.List<core.String>(); | 212 var o = new core.List<core.String>(); |
| 178 o.add("foo"); | 213 o.add("foo"); |
| 179 o.add("foo"); | 214 o.add("foo"); |
| 180 return o; | 215 return o; |
| 181 } | 216 } |
| 182 | 217 |
| 183 checkUnnamed1020(core.List<core.String> o) { | 218 checkUnnamed956(core.List<core.String> o) { |
| 184 unittest.expect(o, unittest.hasLength(2)); | 219 unittest.expect(o, unittest.hasLength(2)); |
| 185 unittest.expect(o[0], unittest.equals('foo')); | 220 unittest.expect(o[0], unittest.equals('foo')); |
| 186 unittest.expect(o[1], unittest.equals('foo')); | 221 unittest.expect(o[1], unittest.equals('foo')); |
| 187 } | 222 } |
| 188 | 223 |
| 189 buildUnnamed1021() { | 224 buildUnnamed957() { |
| 190 var o = new core.List<core.String>(); | 225 var o = new core.List<core.String>(); |
| 191 o.add("foo"); | 226 o.add("foo"); |
| 192 o.add("foo"); | 227 o.add("foo"); |
| 193 return o; | 228 return o; |
| 194 } | 229 } |
| 195 | 230 |
| 196 checkUnnamed1021(core.List<core.String> o) { | 231 checkUnnamed957(core.List<core.String> o) { |
| 197 unittest.expect(o, unittest.hasLength(2)); | 232 unittest.expect(o, unittest.hasLength(2)); |
| 198 unittest.expect(o[0], unittest.equals('foo')); | 233 unittest.expect(o[0], unittest.equals('foo')); |
| 199 unittest.expect(o[1], unittest.equals('foo')); | 234 unittest.expect(o[1], unittest.equals('foo')); |
| 200 } | 235 } |
| 201 | 236 |
| 202 core.int buildCounterParameters = 0; | 237 core.int buildCounterParameters = 0; |
| 203 buildParameters() { | 238 buildParameters() { |
| 204 var o = new api.Parameters(); | 239 var o = new api.Parameters(); |
| 205 buildCounterParameters++; | 240 buildCounterParameters++; |
| 206 if (buildCounterParameters < 3) { | 241 if (buildCounterParameters < 3) { |
| 207 o.filters = buildUnnamed1019(); | 242 o.filters = buildUnnamed955(); |
| 208 o.groupBys = buildUnnamed1020(); | 243 o.groupBys = buildUnnamed956(); |
| 209 o.includeInviteData = true; | 244 o.includeInviteData = true; |
| 210 o.metrics = buildUnnamed1021(); | 245 o.metrics = buildUnnamed957(); |
| 211 o.type = "foo"; | 246 o.type = "foo"; |
| 212 } | 247 } |
| 213 buildCounterParameters--; | 248 buildCounterParameters--; |
| 214 return o; | 249 return o; |
| 215 } | 250 } |
| 216 | 251 |
| 217 checkParameters(api.Parameters o) { | 252 checkParameters(api.Parameters o) { |
| 218 buildCounterParameters++; | 253 buildCounterParameters++; |
| 219 if (buildCounterParameters < 3) { | 254 if (buildCounterParameters < 3) { |
| 220 checkUnnamed1019(o.filters); | 255 checkUnnamed955(o.filters); |
| 221 checkUnnamed1020(o.groupBys); | 256 checkUnnamed956(o.groupBys); |
| 222 unittest.expect(o.includeInviteData, unittest.isTrue); | 257 unittest.expect(o.includeInviteData, unittest.isTrue); |
| 223 checkUnnamed1021(o.metrics); | 258 checkUnnamed957(o.metrics); |
| 224 unittest.expect(o.type, unittest.equals('foo')); | 259 unittest.expect(o.type, unittest.equals('foo')); |
| 225 } | 260 } |
| 226 buildCounterParameters--; | 261 buildCounterParameters--; |
| 227 } | 262 } |
| 228 | 263 |
| 229 core.int buildCounterQuery = 0; | 264 core.int buildCounterQuery = 0; |
| 230 buildQuery() { | 265 buildQuery() { |
| 231 var o = new api.Query(); | 266 var o = new api.Query(); |
| 232 buildCounterQuery++; | 267 buildCounterQuery++; |
| 233 if (buildCounterQuery < 3) { | 268 if (buildCounterQuery < 3) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 252 checkParameters(o.params); | 287 checkParameters(o.params); |
| 253 unittest.expect(o.queryId, unittest.equals('foo')); | 288 unittest.expect(o.queryId, unittest.equals('foo')); |
| 254 unittest.expect(o.reportDataEndTimeMs, unittest.equals('foo')); | 289 unittest.expect(o.reportDataEndTimeMs, unittest.equals('foo')); |
| 255 unittest.expect(o.reportDataStartTimeMs, unittest.equals('foo')); | 290 unittest.expect(o.reportDataStartTimeMs, unittest.equals('foo')); |
| 256 checkQuerySchedule(o.schedule); | 291 checkQuerySchedule(o.schedule); |
| 257 unittest.expect(o.timezoneCode, unittest.equals('foo')); | 292 unittest.expect(o.timezoneCode, unittest.equals('foo')); |
| 258 } | 293 } |
| 259 buildCounterQuery--; | 294 buildCounterQuery--; |
| 260 } | 295 } |
| 261 | 296 |
| 262 buildUnnamed1022() { | 297 buildUnnamed958() { |
| 263 var o = new core.List<core.String>(); | 298 var o = new core.List<core.String>(); |
| 264 o.add("foo"); | 299 o.add("foo"); |
| 265 o.add("foo"); | 300 o.add("foo"); |
| 266 return o; | 301 return o; |
| 267 } | 302 } |
| 268 | 303 |
| 269 checkUnnamed1022(core.List<core.String> o) { | 304 checkUnnamed958(core.List<core.String> o) { |
| 270 unittest.expect(o, unittest.hasLength(2)); | 305 unittest.expect(o, unittest.hasLength(2)); |
| 271 unittest.expect(o[0], unittest.equals('foo')); | 306 unittest.expect(o[0], unittest.equals('foo')); |
| 272 unittest.expect(o[1], unittest.equals('foo')); | 307 unittest.expect(o[1], unittest.equals('foo')); |
| 273 } | 308 } |
| 274 | 309 |
| 275 core.int buildCounterQueryMetadata = 0; | 310 core.int buildCounterQueryMetadata = 0; |
| 276 buildQueryMetadata() { | 311 buildQueryMetadata() { |
| 277 var o = new api.QueryMetadata(); | 312 var o = new api.QueryMetadata(); |
| 278 buildCounterQueryMetadata++; | 313 buildCounterQueryMetadata++; |
| 279 if (buildCounterQueryMetadata < 3) { | 314 if (buildCounterQueryMetadata < 3) { |
| 280 o.dataRange = "foo"; | 315 o.dataRange = "foo"; |
| 281 o.format = "foo"; | 316 o.format = "foo"; |
| 282 o.googleCloudStoragePathForLatestReport = "foo"; | 317 o.googleCloudStoragePathForLatestReport = "foo"; |
| 283 o.googleDrivePathForLatestReport = "foo"; | 318 o.googleDrivePathForLatestReport = "foo"; |
| 284 o.latestReportRunTimeMs = "foo"; | 319 o.latestReportRunTimeMs = "foo"; |
| 285 o.locale = "foo"; | 320 o.locale = "foo"; |
| 286 o.reportCount = 42; | 321 o.reportCount = 42; |
| 287 o.running = true; | 322 o.running = true; |
| 288 o.sendNotification = true; | 323 o.sendNotification = true; |
| 289 o.shareEmailAddress = buildUnnamed1022(); | 324 o.shareEmailAddress = buildUnnamed958(); |
| 290 o.title = "foo"; | 325 o.title = "foo"; |
| 291 } | 326 } |
| 292 buildCounterQueryMetadata--; | 327 buildCounterQueryMetadata--; |
| 293 return o; | 328 return o; |
| 294 } | 329 } |
| 295 | 330 |
| 296 checkQueryMetadata(api.QueryMetadata o) { | 331 checkQueryMetadata(api.QueryMetadata o) { |
| 297 buildCounterQueryMetadata++; | 332 buildCounterQueryMetadata++; |
| 298 if (buildCounterQueryMetadata < 3) { | 333 if (buildCounterQueryMetadata < 3) { |
| 299 unittest.expect(o.dataRange, unittest.equals('foo')); | 334 unittest.expect(o.dataRange, unittest.equals('foo')); |
| 300 unittest.expect(o.format, unittest.equals('foo')); | 335 unittest.expect(o.format, unittest.equals('foo')); |
| 301 unittest.expect(o.googleCloudStoragePathForLatestReport, unittest.equals('fo
o')); | 336 unittest.expect(o.googleCloudStoragePathForLatestReport, unittest.equals('fo
o')); |
| 302 unittest.expect(o.googleDrivePathForLatestReport, unittest.equals('foo')); | 337 unittest.expect(o.googleDrivePathForLatestReport, unittest.equals('foo')); |
| 303 unittest.expect(o.latestReportRunTimeMs, unittest.equals('foo')); | 338 unittest.expect(o.latestReportRunTimeMs, unittest.equals('foo')); |
| 304 unittest.expect(o.locale, unittest.equals('foo')); | 339 unittest.expect(o.locale, unittest.equals('foo')); |
| 305 unittest.expect(o.reportCount, unittest.equals(42)); | 340 unittest.expect(o.reportCount, unittest.equals(42)); |
| 306 unittest.expect(o.running, unittest.isTrue); | 341 unittest.expect(o.running, unittest.isTrue); |
| 307 unittest.expect(o.sendNotification, unittest.isTrue); | 342 unittest.expect(o.sendNotification, unittest.isTrue); |
| 308 checkUnnamed1022(o.shareEmailAddress); | 343 checkUnnamed958(o.shareEmailAddress); |
| 309 unittest.expect(o.title, unittest.equals('foo')); | 344 unittest.expect(o.title, unittest.equals('foo')); |
| 310 } | 345 } |
| 311 buildCounterQueryMetadata--; | 346 buildCounterQueryMetadata--; |
| 312 } | 347 } |
| 313 | 348 |
| 314 core.int buildCounterQuerySchedule = 0; | 349 core.int buildCounterQuerySchedule = 0; |
| 315 buildQuerySchedule() { | 350 buildQuerySchedule() { |
| 316 var o = new api.QuerySchedule(); | 351 var o = new api.QuerySchedule(); |
| 317 buildCounterQuerySchedule++; | 352 buildCounterQuerySchedule++; |
| 318 if (buildCounterQuerySchedule < 3) { | 353 if (buildCounterQuerySchedule < 3) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 buildCounterReportStatus++; | 477 buildCounterReportStatus++; |
| 443 if (buildCounterReportStatus < 3) { | 478 if (buildCounterReportStatus < 3) { |
| 444 checkReportFailure(o.failure); | 479 checkReportFailure(o.failure); |
| 445 unittest.expect(o.finishTimeMs, unittest.equals('foo')); | 480 unittest.expect(o.finishTimeMs, unittest.equals('foo')); |
| 446 unittest.expect(o.format, unittest.equals('foo')); | 481 unittest.expect(o.format, unittest.equals('foo')); |
| 447 unittest.expect(o.state, unittest.equals('foo')); | 482 unittest.expect(o.state, unittest.equals('foo')); |
| 448 } | 483 } |
| 449 buildCounterReportStatus--; | 484 buildCounterReportStatus--; |
| 450 } | 485 } |
| 451 | 486 |
| 452 buildUnnamed1023() { | 487 buildUnnamed959() { |
| 453 var o = new core.List<core.String>(); | 488 var o = new core.List<core.String>(); |
| 454 o.add("foo"); | 489 o.add("foo"); |
| 455 o.add("foo"); | 490 o.add("foo"); |
| 456 return o; | 491 return o; |
| 457 } | 492 } |
| 458 | 493 |
| 459 checkUnnamed1023(core.List<core.String> o) { | 494 checkUnnamed959(core.List<core.String> o) { |
| 460 unittest.expect(o, unittest.hasLength(2)); | 495 unittest.expect(o, unittest.hasLength(2)); |
| 461 unittest.expect(o[0], unittest.equals('foo')); | 496 unittest.expect(o[0], unittest.equals('foo')); |
| 462 unittest.expect(o[1], unittest.equals('foo')); | 497 unittest.expect(o[1], unittest.equals('foo')); |
| 463 } | 498 } |
| 464 | 499 |
| 465 core.int buildCounterRowStatus = 0; | 500 core.int buildCounterRowStatus = 0; |
| 466 buildRowStatus() { | 501 buildRowStatus() { |
| 467 var o = new api.RowStatus(); | 502 var o = new api.RowStatus(); |
| 468 buildCounterRowStatus++; | 503 buildCounterRowStatus++; |
| 469 if (buildCounterRowStatus < 3) { | 504 if (buildCounterRowStatus < 3) { |
| 470 o.changed = true; | 505 o.changed = true; |
| 471 o.entityId = "foo"; | 506 o.entityId = "foo"; |
| 472 o.entityName = "foo"; | 507 o.entityName = "foo"; |
| 473 o.errors = buildUnnamed1023(); | 508 o.errors = buildUnnamed959(); |
| 474 o.persisted = true; | 509 o.persisted = true; |
| 475 o.rowNumber = 42; | 510 o.rowNumber = 42; |
| 476 } | 511 } |
| 477 buildCounterRowStatus--; | 512 buildCounterRowStatus--; |
| 478 return o; | 513 return o; |
| 479 } | 514 } |
| 480 | 515 |
| 481 checkRowStatus(api.RowStatus o) { | 516 checkRowStatus(api.RowStatus o) { |
| 482 buildCounterRowStatus++; | 517 buildCounterRowStatus++; |
| 483 if (buildCounterRowStatus < 3) { | 518 if (buildCounterRowStatus < 3) { |
| 484 unittest.expect(o.changed, unittest.isTrue); | 519 unittest.expect(o.changed, unittest.isTrue); |
| 485 unittest.expect(o.entityId, unittest.equals('foo')); | 520 unittest.expect(o.entityId, unittest.equals('foo')); |
| 486 unittest.expect(o.entityName, unittest.equals('foo')); | 521 unittest.expect(o.entityName, unittest.equals('foo')); |
| 487 checkUnnamed1023(o.errors); | 522 checkUnnamed959(o.errors); |
| 488 unittest.expect(o.persisted, unittest.isTrue); | 523 unittest.expect(o.persisted, unittest.isTrue); |
| 489 unittest.expect(o.rowNumber, unittest.equals(42)); | 524 unittest.expect(o.rowNumber, unittest.equals(42)); |
| 490 } | 525 } |
| 491 buildCounterRowStatus--; | 526 buildCounterRowStatus--; |
| 492 } | 527 } |
| 493 | 528 |
| 494 core.int buildCounterRunQueryRequest = 0; | 529 core.int buildCounterRunQueryRequest = 0; |
| 495 buildRunQueryRequest() { | 530 buildRunQueryRequest() { |
| 496 var o = new api.RunQueryRequest(); | 531 var o = new api.RunQueryRequest(); |
| 497 buildCounterRunQueryRequest++; | 532 buildCounterRunQueryRequest++; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } | 586 } |
| 552 | 587 |
| 553 checkUploadLineItemsResponse(api.UploadLineItemsResponse o) { | 588 checkUploadLineItemsResponse(api.UploadLineItemsResponse o) { |
| 554 buildCounterUploadLineItemsResponse++; | 589 buildCounterUploadLineItemsResponse++; |
| 555 if (buildCounterUploadLineItemsResponse < 3) { | 590 if (buildCounterUploadLineItemsResponse < 3) { |
| 556 checkUploadStatus(o.uploadStatus); | 591 checkUploadStatus(o.uploadStatus); |
| 557 } | 592 } |
| 558 buildCounterUploadLineItemsResponse--; | 593 buildCounterUploadLineItemsResponse--; |
| 559 } | 594 } |
| 560 | 595 |
| 561 buildUnnamed1024() { | 596 buildUnnamed960() { |
| 562 var o = new core.List<core.String>(); | 597 var o = new core.List<core.String>(); |
| 563 o.add("foo"); | 598 o.add("foo"); |
| 564 o.add("foo"); | 599 o.add("foo"); |
| 565 return o; | 600 return o; |
| 566 } | 601 } |
| 567 | 602 |
| 568 checkUnnamed1024(core.List<core.String> o) { | 603 checkUnnamed960(core.List<core.String> o) { |
| 569 unittest.expect(o, unittest.hasLength(2)); | 604 unittest.expect(o, unittest.hasLength(2)); |
| 570 unittest.expect(o[0], unittest.equals('foo')); | 605 unittest.expect(o[0], unittest.equals('foo')); |
| 571 unittest.expect(o[1], unittest.equals('foo')); | 606 unittest.expect(o[1], unittest.equals('foo')); |
| 572 } | 607 } |
| 573 | 608 |
| 574 buildUnnamed1025() { | 609 buildUnnamed961() { |
| 575 var o = new core.List<api.RowStatus>(); | 610 var o = new core.List<api.RowStatus>(); |
| 576 o.add(buildRowStatus()); | 611 o.add(buildRowStatus()); |
| 577 o.add(buildRowStatus()); | 612 o.add(buildRowStatus()); |
| 578 return o; | 613 return o; |
| 579 } | 614 } |
| 580 | 615 |
| 581 checkUnnamed1025(core.List<api.RowStatus> o) { | 616 checkUnnamed961(core.List<api.RowStatus> o) { |
| 582 unittest.expect(o, unittest.hasLength(2)); | 617 unittest.expect(o, unittest.hasLength(2)); |
| 583 checkRowStatus(o[0]); | 618 checkRowStatus(o[0]); |
| 584 checkRowStatus(o[1]); | 619 checkRowStatus(o[1]); |
| 585 } | 620 } |
| 586 | 621 |
| 587 core.int buildCounterUploadStatus = 0; | 622 core.int buildCounterUploadStatus = 0; |
| 588 buildUploadStatus() { | 623 buildUploadStatus() { |
| 589 var o = new api.UploadStatus(); | 624 var o = new api.UploadStatus(); |
| 590 buildCounterUploadStatus++; | 625 buildCounterUploadStatus++; |
| 591 if (buildCounterUploadStatus < 3) { | 626 if (buildCounterUploadStatus < 3) { |
| 592 o.errors = buildUnnamed1024(); | 627 o.errors = buildUnnamed960(); |
| 593 o.rowStatus = buildUnnamed1025(); | 628 o.rowStatus = buildUnnamed961(); |
| 594 } | 629 } |
| 595 buildCounterUploadStatus--; | 630 buildCounterUploadStatus--; |
| 596 return o; | 631 return o; |
| 597 } | 632 } |
| 598 | 633 |
| 599 checkUploadStatus(api.UploadStatus o) { | 634 checkUploadStatus(api.UploadStatus o) { |
| 600 buildCounterUploadStatus++; | 635 buildCounterUploadStatus++; |
| 601 if (buildCounterUploadStatus < 3) { | 636 if (buildCounterUploadStatus < 3) { |
| 602 checkUnnamed1024(o.errors); | 637 checkUnnamed960(o.errors); |
| 603 checkUnnamed1025(o.rowStatus); | 638 checkUnnamed961(o.rowStatus); |
| 604 } | 639 } |
| 605 buildCounterUploadStatus--; | 640 buildCounterUploadStatus--; |
| 606 } | 641 } |
| 607 | 642 |
| 608 | 643 |
| 609 main() { | 644 main() { |
| 610 unittest.group("obj-schema-DownloadLineItemsRequest", () { | 645 unittest.group("obj-schema-DownloadLineItemsRequest", () { |
| 611 unittest.test("to-json--from-json", () { | 646 unittest.test("to-json--from-json", () { |
| 612 var o = buildDownloadLineItemsRequest(); | 647 var o = buildDownloadLineItemsRequest(); |
| 613 var od = new api.DownloadLineItemsRequest.fromJson(o.toJson()); | 648 var od = new api.DownloadLineItemsRequest.fromJson(o.toJson()); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 var o = buildUploadStatus(); | 809 var o = buildUploadStatus(); |
| 775 var od = new api.UploadStatus.fromJson(o.toJson()); | 810 var od = new api.UploadStatus.fromJson(o.toJson()); |
| 776 checkUploadStatus(od); | 811 checkUploadStatus(od); |
| 777 }); | 812 }); |
| 778 }); | 813 }); |
| 779 | 814 |
| 780 | 815 |
| 781 unittest.group("resource-LineitemsResourceApi", () { | 816 unittest.group("resource-LineitemsResourceApi", () { |
| 782 unittest.test("method--downloadlineitems", () { | 817 unittest.test("method--downloadlineitems", () { |
| 783 | 818 |
| 784 var mock = new common_test.HttpServerMock(); | 819 var mock = new HttpServerMock(); |
| 785 api.LineitemsResourceApi res = new api.DoubleclickbidmanagerApi(mock).line
items; | 820 api.LineitemsResourceApi res = new api.DoubleclickbidmanagerApi(mock).line
items; |
| 786 var arg_request = buildDownloadLineItemsRequest(); | 821 var arg_request = buildDownloadLineItemsRequest(); |
| 787 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 822 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 788 var obj = new api.DownloadLineItemsRequest.fromJson(json); | 823 var obj = new api.DownloadLineItemsRequest.fromJson(json); |
| 789 checkDownloadLineItemsRequest(obj); | 824 checkDownloadLineItemsRequest(obj); |
| 790 | 825 |
| 791 var path = (req.url).path; | 826 var path = (req.url).path; |
| 792 var pathOffset = 0; | 827 var pathOffset = 0; |
| 793 var index; | 828 var index; |
| 794 var subPart; | 829 var subPart; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 814 var keyvalue = part.split("="); | 849 var keyvalue = part.split("="); |
| 815 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 850 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 816 } | 851 } |
| 817 } | 852 } |
| 818 | 853 |
| 819 | 854 |
| 820 var h = { | 855 var h = { |
| 821 "content-type" : "application/json; charset=utf-8", | 856 "content-type" : "application/json; charset=utf-8", |
| 822 }; | 857 }; |
| 823 var resp = convert.JSON.encode(buildDownloadLineItemsResponse()); | 858 var resp = convert.JSON.encode(buildDownloadLineItemsResponse()); |
| 824 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 859 return new async.Future.value(stringResponse(200, h, resp)); |
| 825 }), true); | 860 }), true); |
| 826 res.downloadlineitems(arg_request).then(unittest.expectAsync(((api.Downloa
dLineItemsResponse response) { | 861 res.downloadlineitems(arg_request).then(unittest.expectAsync(((api.Downloa
dLineItemsResponse response) { |
| 827 checkDownloadLineItemsResponse(response); | 862 checkDownloadLineItemsResponse(response); |
| 828 }))); | 863 }))); |
| 829 }); | 864 }); |
| 830 | 865 |
| 831 unittest.test("method--uploadlineitems", () { | 866 unittest.test("method--uploadlineitems", () { |
| 832 | 867 |
| 833 var mock = new common_test.HttpServerMock(); | 868 var mock = new HttpServerMock(); |
| 834 api.LineitemsResourceApi res = new api.DoubleclickbidmanagerApi(mock).line
items; | 869 api.LineitemsResourceApi res = new api.DoubleclickbidmanagerApi(mock).line
items; |
| 835 var arg_request = buildUploadLineItemsRequest(); | 870 var arg_request = buildUploadLineItemsRequest(); |
| 836 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 871 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 837 var obj = new api.UploadLineItemsRequest.fromJson(json); | 872 var obj = new api.UploadLineItemsRequest.fromJson(json); |
| 838 checkUploadLineItemsRequest(obj); | 873 checkUploadLineItemsRequest(obj); |
| 839 | 874 |
| 840 var path = (req.url).path; | 875 var path = (req.url).path; |
| 841 var pathOffset = 0; | 876 var pathOffset = 0; |
| 842 var index; | 877 var index; |
| 843 var subPart; | 878 var subPart; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 863 var keyvalue = part.split("="); | 898 var keyvalue = part.split("="); |
| 864 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 899 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 865 } | 900 } |
| 866 } | 901 } |
| 867 | 902 |
| 868 | 903 |
| 869 var h = { | 904 var h = { |
| 870 "content-type" : "application/json; charset=utf-8", | 905 "content-type" : "application/json; charset=utf-8", |
| 871 }; | 906 }; |
| 872 var resp = convert.JSON.encode(buildUploadLineItemsResponse()); | 907 var resp = convert.JSON.encode(buildUploadLineItemsResponse()); |
| 873 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 908 return new async.Future.value(stringResponse(200, h, resp)); |
| 874 }), true); | 909 }), true); |
| 875 res.uploadlineitems(arg_request).then(unittest.expectAsync(((api.UploadLin
eItemsResponse response) { | 910 res.uploadlineitems(arg_request).then(unittest.expectAsync(((api.UploadLin
eItemsResponse response) { |
| 876 checkUploadLineItemsResponse(response); | 911 checkUploadLineItemsResponse(response); |
| 877 }))); | 912 }))); |
| 878 }); | 913 }); |
| 879 | 914 |
| 880 }); | 915 }); |
| 881 | 916 |
| 882 | 917 |
| 883 unittest.group("resource-QueriesResourceApi", () { | 918 unittest.group("resource-QueriesResourceApi", () { |
| 884 unittest.test("method--createquery", () { | 919 unittest.test("method--createquery", () { |
| 885 | 920 |
| 886 var mock = new common_test.HttpServerMock(); | 921 var mock = new HttpServerMock(); |
| 887 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 922 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; |
| 888 var arg_request = buildQuery(); | 923 var arg_request = buildQuery(); |
| 889 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 924 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 890 var obj = new api.Query.fromJson(json); | 925 var obj = new api.Query.fromJson(json); |
| 891 checkQuery(obj); | 926 checkQuery(obj); |
| 892 | 927 |
| 893 var path = (req.url).path; | 928 var path = (req.url).path; |
| 894 var pathOffset = 0; | 929 var pathOffset = 0; |
| 895 var index; | 930 var index; |
| 896 var subPart; | 931 var subPart; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 916 var keyvalue = part.split("="); | 951 var keyvalue = part.split("="); |
| 917 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 952 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 918 } | 953 } |
| 919 } | 954 } |
| 920 | 955 |
| 921 | 956 |
| 922 var h = { | 957 var h = { |
| 923 "content-type" : "application/json; charset=utf-8", | 958 "content-type" : "application/json; charset=utf-8", |
| 924 }; | 959 }; |
| 925 var resp = convert.JSON.encode(buildQuery()); | 960 var resp = convert.JSON.encode(buildQuery()); |
| 926 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 961 return new async.Future.value(stringResponse(200, h, resp)); |
| 927 }), true); | 962 }), true); |
| 928 res.createquery(arg_request).then(unittest.expectAsync(((api.Query respons
e) { | 963 res.createquery(arg_request).then(unittest.expectAsync(((api.Query respons
e) { |
| 929 checkQuery(response); | 964 checkQuery(response); |
| 930 }))); | 965 }))); |
| 931 }); | 966 }); |
| 932 | 967 |
| 933 unittest.test("method--deletequery", () { | 968 unittest.test("method--deletequery", () { |
| 934 | 969 |
| 935 var mock = new common_test.HttpServerMock(); | 970 var mock = new HttpServerMock(); |
| 936 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 971 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; |
| 937 var arg_queryId = "foo"; | 972 var arg_queryId = "foo"; |
| 938 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 973 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 939 var path = (req.url).path; | 974 var path = (req.url).path; |
| 940 var pathOffset = 0; | 975 var pathOffset = 0; |
| 941 var index; | 976 var index; |
| 942 var subPart; | 977 var subPart; |
| 943 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 978 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 944 pathOffset += 1; | 979 pathOffset += 1; |
| 945 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 980 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 965 var keyvalue = part.split("="); | 1000 var keyvalue = part.split("="); |
| 966 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1001 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 967 } | 1002 } |
| 968 } | 1003 } |
| 969 | 1004 |
| 970 | 1005 |
| 971 var h = { | 1006 var h = { |
| 972 "content-type" : "application/json; charset=utf-8", | 1007 "content-type" : "application/json; charset=utf-8", |
| 973 }; | 1008 }; |
| 974 var resp = ""; | 1009 var resp = ""; |
| 975 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1010 return new async.Future.value(stringResponse(200, h, resp)); |
| 976 }), true); | 1011 }), true); |
| 977 res.deletequery(arg_queryId).then(unittest.expectAsync((_) {})); | 1012 res.deletequery(arg_queryId).then(unittest.expectAsync((_) {})); |
| 978 }); | 1013 }); |
| 979 | 1014 |
| 980 unittest.test("method--getquery", () { | 1015 unittest.test("method--getquery", () { |
| 981 | 1016 |
| 982 var mock = new common_test.HttpServerMock(); | 1017 var mock = new HttpServerMock(); |
| 983 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1018 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; |
| 984 var arg_queryId = "foo"; | 1019 var arg_queryId = "foo"; |
| 985 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1020 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 986 var path = (req.url).path; | 1021 var path = (req.url).path; |
| 987 var pathOffset = 0; | 1022 var pathOffset = 0; |
| 988 var index; | 1023 var index; |
| 989 var subPart; | 1024 var subPart; |
| 990 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1025 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 991 pathOffset += 1; | 1026 pathOffset += 1; |
| 992 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1027 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1012 var keyvalue = part.split("="); | 1047 var keyvalue = part.split("="); |
| 1013 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1048 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1014 } | 1049 } |
| 1015 } | 1050 } |
| 1016 | 1051 |
| 1017 | 1052 |
| 1018 var h = { | 1053 var h = { |
| 1019 "content-type" : "application/json; charset=utf-8", | 1054 "content-type" : "application/json; charset=utf-8", |
| 1020 }; | 1055 }; |
| 1021 var resp = convert.JSON.encode(buildQuery()); | 1056 var resp = convert.JSON.encode(buildQuery()); |
| 1022 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1057 return new async.Future.value(stringResponse(200, h, resp)); |
| 1023 }), true); | 1058 }), true); |
| 1024 res.getquery(arg_queryId).then(unittest.expectAsync(((api.Query response)
{ | 1059 res.getquery(arg_queryId).then(unittest.expectAsync(((api.Query response)
{ |
| 1025 checkQuery(response); | 1060 checkQuery(response); |
| 1026 }))); | 1061 }))); |
| 1027 }); | 1062 }); |
| 1028 | 1063 |
| 1029 unittest.test("method--listqueries", () { | 1064 unittest.test("method--listqueries", () { |
| 1030 | 1065 |
| 1031 var mock = new common_test.HttpServerMock(); | 1066 var mock = new HttpServerMock(); |
| 1032 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1067 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; |
| 1033 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1068 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1034 var path = (req.url).path; | 1069 var path = (req.url).path; |
| 1035 var pathOffset = 0; | 1070 var pathOffset = 0; |
| 1036 var index; | 1071 var index; |
| 1037 var subPart; | 1072 var subPart; |
| 1038 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1073 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1039 pathOffset += 1; | 1074 pathOffset += 1; |
| 1040 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1075 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); |
| 1041 pathOffset += 25; | 1076 pathOffset += 25; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1057 var keyvalue = part.split("="); | 1092 var keyvalue = part.split("="); |
| 1058 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1093 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1059 } | 1094 } |
| 1060 } | 1095 } |
| 1061 | 1096 |
| 1062 | 1097 |
| 1063 var h = { | 1098 var h = { |
| 1064 "content-type" : "application/json; charset=utf-8", | 1099 "content-type" : "application/json; charset=utf-8", |
| 1065 }; | 1100 }; |
| 1066 var resp = convert.JSON.encode(buildListQueriesResponse()); | 1101 var resp = convert.JSON.encode(buildListQueriesResponse()); |
| 1067 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1102 return new async.Future.value(stringResponse(200, h, resp)); |
| 1068 }), true); | 1103 }), true); |
| 1069 res.listqueries().then(unittest.expectAsync(((api.ListQueriesResponse resp
onse) { | 1104 res.listqueries().then(unittest.expectAsync(((api.ListQueriesResponse resp
onse) { |
| 1070 checkListQueriesResponse(response); | 1105 checkListQueriesResponse(response); |
| 1071 }))); | 1106 }))); |
| 1072 }); | 1107 }); |
| 1073 | 1108 |
| 1074 unittest.test("method--runquery", () { | 1109 unittest.test("method--runquery", () { |
| 1075 | 1110 |
| 1076 var mock = new common_test.HttpServerMock(); | 1111 var mock = new HttpServerMock(); |
| 1077 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; | 1112 api.QueriesResourceApi res = new api.DoubleclickbidmanagerApi(mock).querie
s; |
| 1078 var arg_request = buildRunQueryRequest(); | 1113 var arg_request = buildRunQueryRequest(); |
| 1079 var arg_queryId = "foo"; | 1114 var arg_queryId = "foo"; |
| 1080 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1115 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1081 var obj = new api.RunQueryRequest.fromJson(json); | 1116 var obj = new api.RunQueryRequest.fromJson(json); |
| 1082 checkRunQueryRequest(obj); | 1117 checkRunQueryRequest(obj); |
| 1083 | 1118 |
| 1084 var path = (req.url).path; | 1119 var path = (req.url).path; |
| 1085 var pathOffset = 0; | 1120 var pathOffset = 0; |
| 1086 var index; | 1121 var index; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1110 var keyvalue = part.split("="); | 1145 var keyvalue = part.split("="); |
| 1111 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1146 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1112 } | 1147 } |
| 1113 } | 1148 } |
| 1114 | 1149 |
| 1115 | 1150 |
| 1116 var h = { | 1151 var h = { |
| 1117 "content-type" : "application/json; charset=utf-8", | 1152 "content-type" : "application/json; charset=utf-8", |
| 1118 }; | 1153 }; |
| 1119 var resp = ""; | 1154 var resp = ""; |
| 1120 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1155 return new async.Future.value(stringResponse(200, h, resp)); |
| 1121 }), true); | 1156 }), true); |
| 1122 res.runquery(arg_request, arg_queryId).then(unittest.expectAsync((_) {})); | 1157 res.runquery(arg_request, arg_queryId).then(unittest.expectAsync((_) {})); |
| 1123 }); | 1158 }); |
| 1124 | 1159 |
| 1125 }); | 1160 }); |
| 1126 | 1161 |
| 1127 | 1162 |
| 1128 unittest.group("resource-ReportsResourceApi", () { | 1163 unittest.group("resource-ReportsResourceApi", () { |
| 1129 unittest.test("method--listreports", () { | 1164 unittest.test("method--listreports", () { |
| 1130 | 1165 |
| 1131 var mock = new common_test.HttpServerMock(); | 1166 var mock = new HttpServerMock(); |
| 1132 api.ReportsResourceApi res = new api.DoubleclickbidmanagerApi(mock).report
s; | 1167 api.ReportsResourceApi res = new api.DoubleclickbidmanagerApi(mock).report
s; |
| 1133 var arg_queryId = "foo"; | 1168 var arg_queryId = "foo"; |
| 1134 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1169 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1135 var path = (req.url).path; | 1170 var path = (req.url).path; |
| 1136 var pathOffset = 0; | 1171 var pathOffset = 0; |
| 1137 var index; | 1172 var index; |
| 1138 var subPart; | 1173 var subPart; |
| 1139 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1174 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1140 pathOffset += 1; | 1175 pathOffset += 1; |
| 1141 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); | 1176 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("doubleclickbidmanager/v1/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1165 var keyvalue = part.split("="); | 1200 var keyvalue = part.split("="); |
| 1166 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1201 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1167 } | 1202 } |
| 1168 } | 1203 } |
| 1169 | 1204 |
| 1170 | 1205 |
| 1171 var h = { | 1206 var h = { |
| 1172 "content-type" : "application/json; charset=utf-8", | 1207 "content-type" : "application/json; charset=utf-8", |
| 1173 }; | 1208 }; |
| 1174 var resp = convert.JSON.encode(buildListReportsResponse()); | 1209 var resp = convert.JSON.encode(buildListReportsResponse()); |
| 1175 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1210 return new async.Future.value(stringResponse(200, h, resp)); |
| 1176 }), true); | 1211 }), true); |
| 1177 res.listreports(arg_queryId).then(unittest.expectAsync(((api.ListReportsRe
sponse response) { | 1212 res.listreports(arg_queryId).then(unittest.expectAsync(((api.ListReportsRe
sponse response) { |
| 1178 checkListReportsResponse(response); | 1213 checkListReportsResponse(response); |
| 1179 }))); | 1214 }))); |
| 1180 }); | 1215 }); |
| 1181 | 1216 |
| 1182 }); | 1217 }); |
| 1183 | 1218 |
| 1184 | 1219 |
| 1185 } | 1220 } |
| 1186 | 1221 |
| OLD | NEW |