| OLD | NEW |
| 1 library googleapis.urlshortener.v1.test; | 1 library googleapis.urlshortener.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed663() { | 54 buildUnnamed670() { |
| 55 var o = new core.List<api.StringCount>(); | 55 var o = new core.List<api.StringCount>(); |
| 56 o.add(buildStringCount()); | 56 o.add(buildStringCount()); |
| 57 o.add(buildStringCount()); | 57 o.add(buildStringCount()); |
| 58 return o; | 58 return o; |
| 59 } | 59 } |
| 60 | 60 |
| 61 checkUnnamed663(core.List<api.StringCount> o) { | 61 checkUnnamed670(core.List<api.StringCount> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 checkStringCount(o[0]); | 63 checkStringCount(o[0]); |
| 64 checkStringCount(o[1]); | 64 checkStringCount(o[1]); |
| 65 } | 65 } |
| 66 | 66 |
| 67 buildUnnamed664() { | 67 buildUnnamed671() { |
| 68 var o = new core.List<api.StringCount>(); | 68 var o = new core.List<api.StringCount>(); |
| 69 o.add(buildStringCount()); | 69 o.add(buildStringCount()); |
| 70 o.add(buildStringCount()); | 70 o.add(buildStringCount()); |
| 71 return o; | 71 return o; |
| 72 } | 72 } |
| 73 | 73 |
| 74 checkUnnamed664(core.List<api.StringCount> o) { | 74 checkUnnamed671(core.List<api.StringCount> o) { |
| 75 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
| 76 checkStringCount(o[0]); | 76 checkStringCount(o[0]); |
| 77 checkStringCount(o[1]); | 77 checkStringCount(o[1]); |
| 78 } | 78 } |
| 79 | 79 |
| 80 buildUnnamed665() { | 80 buildUnnamed672() { |
| 81 var o = new core.List<api.StringCount>(); | 81 var o = new core.List<api.StringCount>(); |
| 82 o.add(buildStringCount()); | 82 o.add(buildStringCount()); |
| 83 o.add(buildStringCount()); | 83 o.add(buildStringCount()); |
| 84 return o; | 84 return o; |
| 85 } | 85 } |
| 86 | 86 |
| 87 checkUnnamed665(core.List<api.StringCount> o) { | 87 checkUnnamed672(core.List<api.StringCount> o) { |
| 88 unittest.expect(o, unittest.hasLength(2)); | 88 unittest.expect(o, unittest.hasLength(2)); |
| 89 checkStringCount(o[0]); | 89 checkStringCount(o[0]); |
| 90 checkStringCount(o[1]); | 90 checkStringCount(o[1]); |
| 91 } | 91 } |
| 92 | 92 |
| 93 buildUnnamed666() { | 93 buildUnnamed673() { |
| 94 var o = new core.List<api.StringCount>(); | 94 var o = new core.List<api.StringCount>(); |
| 95 o.add(buildStringCount()); | 95 o.add(buildStringCount()); |
| 96 o.add(buildStringCount()); | 96 o.add(buildStringCount()); |
| 97 return o; | 97 return o; |
| 98 } | 98 } |
| 99 | 99 |
| 100 checkUnnamed666(core.List<api.StringCount> o) { | 100 checkUnnamed673(core.List<api.StringCount> o) { |
| 101 unittest.expect(o, unittest.hasLength(2)); | 101 unittest.expect(o, unittest.hasLength(2)); |
| 102 checkStringCount(o[0]); | 102 checkStringCount(o[0]); |
| 103 checkStringCount(o[1]); | 103 checkStringCount(o[1]); |
| 104 } | 104 } |
| 105 | 105 |
| 106 core.int buildCounterAnalyticsSnapshot = 0; | 106 core.int buildCounterAnalyticsSnapshot = 0; |
| 107 buildAnalyticsSnapshot() { | 107 buildAnalyticsSnapshot() { |
| 108 var o = new api.AnalyticsSnapshot(); | 108 var o = new api.AnalyticsSnapshot(); |
| 109 buildCounterAnalyticsSnapshot++; | 109 buildCounterAnalyticsSnapshot++; |
| 110 if (buildCounterAnalyticsSnapshot < 3) { | 110 if (buildCounterAnalyticsSnapshot < 3) { |
| 111 o.browsers = buildUnnamed663(); | 111 o.browsers = buildUnnamed670(); |
| 112 o.countries = buildUnnamed664(); | 112 o.countries = buildUnnamed671(); |
| 113 o.longUrlClicks = "foo"; | 113 o.longUrlClicks = "foo"; |
| 114 o.platforms = buildUnnamed665(); | 114 o.platforms = buildUnnamed672(); |
| 115 o.referrers = buildUnnamed666(); | 115 o.referrers = buildUnnamed673(); |
| 116 o.shortUrlClicks = "foo"; | 116 o.shortUrlClicks = "foo"; |
| 117 } | 117 } |
| 118 buildCounterAnalyticsSnapshot--; | 118 buildCounterAnalyticsSnapshot--; |
| 119 return o; | 119 return o; |
| 120 } | 120 } |
| 121 | 121 |
| 122 checkAnalyticsSnapshot(api.AnalyticsSnapshot o) { | 122 checkAnalyticsSnapshot(api.AnalyticsSnapshot o) { |
| 123 buildCounterAnalyticsSnapshot++; | 123 buildCounterAnalyticsSnapshot++; |
| 124 if (buildCounterAnalyticsSnapshot < 3) { | 124 if (buildCounterAnalyticsSnapshot < 3) { |
| 125 checkUnnamed663(o.browsers); | 125 checkUnnamed670(o.browsers); |
| 126 checkUnnamed664(o.countries); | 126 checkUnnamed671(o.countries); |
| 127 unittest.expect(o.longUrlClicks, unittest.equals('foo')); | 127 unittest.expect(o.longUrlClicks, unittest.equals('foo')); |
| 128 checkUnnamed665(o.platforms); | 128 checkUnnamed672(o.platforms); |
| 129 checkUnnamed666(o.referrers); | 129 checkUnnamed673(o.referrers); |
| 130 unittest.expect(o.shortUrlClicks, unittest.equals('foo')); | 130 unittest.expect(o.shortUrlClicks, unittest.equals('foo')); |
| 131 } | 131 } |
| 132 buildCounterAnalyticsSnapshot--; | 132 buildCounterAnalyticsSnapshot--; |
| 133 } | 133 } |
| 134 | 134 |
| 135 core.int buildCounterAnalyticsSummary = 0; | 135 core.int buildCounterAnalyticsSummary = 0; |
| 136 buildAnalyticsSummary() { | 136 buildAnalyticsSummary() { |
| 137 var o = new api.AnalyticsSummary(); | 137 var o = new api.AnalyticsSummary(); |
| 138 buildCounterAnalyticsSummary++; | 138 buildCounterAnalyticsSummary++; |
| 139 if (buildCounterAnalyticsSummary < 3) { | 139 if (buildCounterAnalyticsSummary < 3) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 checkAnalyticsSummary(o.analytics); | 202 checkAnalyticsSummary(o.analytics); |
| 203 unittest.expect(o.created, unittest.equals('foo')); | 203 unittest.expect(o.created, unittest.equals('foo')); |
| 204 unittest.expect(o.id, unittest.equals('foo')); | 204 unittest.expect(o.id, unittest.equals('foo')); |
| 205 unittest.expect(o.kind, unittest.equals('foo')); | 205 unittest.expect(o.kind, unittest.equals('foo')); |
| 206 unittest.expect(o.longUrl, unittest.equals('foo')); | 206 unittest.expect(o.longUrl, unittest.equals('foo')); |
| 207 unittest.expect(o.status, unittest.equals('foo')); | 207 unittest.expect(o.status, unittest.equals('foo')); |
| 208 } | 208 } |
| 209 buildCounterUrl--; | 209 buildCounterUrl--; |
| 210 } | 210 } |
| 211 | 211 |
| 212 buildUnnamed667() { | 212 buildUnnamed674() { |
| 213 var o = new core.List<api.Url>(); | 213 var o = new core.List<api.Url>(); |
| 214 o.add(buildUrl()); | 214 o.add(buildUrl()); |
| 215 o.add(buildUrl()); | 215 o.add(buildUrl()); |
| 216 return o; | 216 return o; |
| 217 } | 217 } |
| 218 | 218 |
| 219 checkUnnamed667(core.List<api.Url> o) { | 219 checkUnnamed674(core.List<api.Url> o) { |
| 220 unittest.expect(o, unittest.hasLength(2)); | 220 unittest.expect(o, unittest.hasLength(2)); |
| 221 checkUrl(o[0]); | 221 checkUrl(o[0]); |
| 222 checkUrl(o[1]); | 222 checkUrl(o[1]); |
| 223 } | 223 } |
| 224 | 224 |
| 225 core.int buildCounterUrlHistory = 0; | 225 core.int buildCounterUrlHistory = 0; |
| 226 buildUrlHistory() { | 226 buildUrlHistory() { |
| 227 var o = new api.UrlHistory(); | 227 var o = new api.UrlHistory(); |
| 228 buildCounterUrlHistory++; | 228 buildCounterUrlHistory++; |
| 229 if (buildCounterUrlHistory < 3) { | 229 if (buildCounterUrlHistory < 3) { |
| 230 o.items = buildUnnamed667(); | 230 o.items = buildUnnamed674(); |
| 231 o.itemsPerPage = 42; | 231 o.itemsPerPage = 42; |
| 232 o.kind = "foo"; | 232 o.kind = "foo"; |
| 233 o.nextPageToken = "foo"; | 233 o.nextPageToken = "foo"; |
| 234 o.totalItems = 42; | 234 o.totalItems = 42; |
| 235 } | 235 } |
| 236 buildCounterUrlHistory--; | 236 buildCounterUrlHistory--; |
| 237 return o; | 237 return o; |
| 238 } | 238 } |
| 239 | 239 |
| 240 checkUrlHistory(api.UrlHistory o) { | 240 checkUrlHistory(api.UrlHistory o) { |
| 241 buildCounterUrlHistory++; | 241 buildCounterUrlHistory++; |
| 242 if (buildCounterUrlHistory < 3) { | 242 if (buildCounterUrlHistory < 3) { |
| 243 checkUnnamed667(o.items); | 243 checkUnnamed674(o.items); |
| 244 unittest.expect(o.itemsPerPage, unittest.equals(42)); | 244 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 245 unittest.expect(o.kind, unittest.equals('foo')); | 245 unittest.expect(o.kind, unittest.equals('foo')); |
| 246 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 246 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 247 unittest.expect(o.totalItems, unittest.equals(42)); | 247 unittest.expect(o.totalItems, unittest.equals(42)); |
| 248 } | 248 } |
| 249 buildCounterUrlHistory--; | 249 buildCounterUrlHistory--; |
| 250 } | 250 } |
| 251 | 251 |
| 252 | 252 |
| 253 main() { | 253 main() { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 res.list(projection: arg_projection, start_token: arg_start_token).then(un
ittest.expectAsync(((api.UrlHistory response) { | 442 res.list(projection: arg_projection, start_token: arg_start_token).then(un
ittest.expectAsync(((api.UrlHistory response) { |
| 443 checkUrlHistory(response); | 443 checkUrlHistory(response); |
| 444 }))); | 444 }))); |
| 445 }); | 445 }); |
| 446 | 446 |
| 447 }); | 447 }); |
| 448 | 448 |
| 449 | 449 |
| 450 } | 450 } |
| 451 | 451 |
| OLD | NEW |