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:test/test.dart' as unittest; | 10 import 'package:test/test.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<core.String, core.String> headers, core.String bod
y) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed769() { | 54 buildUnnamed787() { |
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 checkUnnamed769(core.List<api.StringCount> o) { | 61 checkUnnamed787(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 buildUnnamed770() { | 67 buildUnnamed788() { |
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 checkUnnamed770(core.List<api.StringCount> o) { | 74 checkUnnamed788(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 buildUnnamed771() { | 80 buildUnnamed789() { |
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 checkUnnamed771(core.List<api.StringCount> o) { | 87 checkUnnamed789(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 buildUnnamed772() { | 93 buildUnnamed790() { |
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 checkUnnamed772(core.List<api.StringCount> o) { | 100 checkUnnamed790(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 = buildUnnamed769(); | 111 o.browsers = buildUnnamed787(); |
112 o.countries = buildUnnamed770(); | 112 o.countries = buildUnnamed788(); |
113 o.longUrlClicks = "foo"; | 113 o.longUrlClicks = "foo"; |
114 o.platforms = buildUnnamed771(); | 114 o.platforms = buildUnnamed789(); |
115 o.referrers = buildUnnamed772(); | 115 o.referrers = buildUnnamed790(); |
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 checkUnnamed769(o.browsers); | 125 checkUnnamed787(o.browsers); |
126 checkUnnamed770(o.countries); | 126 checkUnnamed788(o.countries); |
127 unittest.expect(o.longUrlClicks, unittest.equals('foo')); | 127 unittest.expect(o.longUrlClicks, unittest.equals('foo')); |
128 checkUnnamed771(o.platforms); | 128 checkUnnamed789(o.platforms); |
129 checkUnnamed772(o.referrers); | 129 checkUnnamed790(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 buildUnnamed773() { | 212 buildUnnamed791() { |
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 checkUnnamed773(core.List<api.Url> o) { | 219 checkUnnamed791(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 = buildUnnamed773(); | 230 o.items = buildUnnamed791(); |
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 checkUnnamed773(o.items); | 243 checkUnnamed791(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.expectAsync1(((api.UrlHistory response) { | 442 res.list(projection: arg_projection, start_token: arg_start_token).then(un
ittest.expectAsync1(((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 |