OLD | NEW |
1 library googleapis.freebase.v1.test; | 1 library googleapis.freebase.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if (buildCounterReconcileCandidate < 3) { | 57 if (buildCounterReconcileCandidate < 3) { |
58 unittest.expect(o.confidence, unittest.equals(42.0)); | 58 unittest.expect(o.confidence, unittest.equals(42.0)); |
59 unittest.expect(o.lang, unittest.equals('foo')); | 59 unittest.expect(o.lang, unittest.equals('foo')); |
60 unittest.expect(o.mid, unittest.equals('foo')); | 60 unittest.expect(o.mid, unittest.equals('foo')); |
61 unittest.expect(o.name, unittest.equals('foo')); | 61 unittest.expect(o.name, unittest.equals('foo')); |
62 checkReconcileCandidateNotable(o.notable); | 62 checkReconcileCandidateNotable(o.notable); |
63 } | 63 } |
64 buildCounterReconcileCandidate--; | 64 buildCounterReconcileCandidate--; |
65 } | 65 } |
66 | 66 |
67 buildUnnamed1030() { | 67 buildUnnamed730() { |
68 var o = new core.List<api.ReconcileCandidate>(); | 68 var o = new core.List<api.ReconcileCandidate>(); |
69 o.add(buildReconcileCandidate()); | 69 o.add(buildReconcileCandidate()); |
70 o.add(buildReconcileCandidate()); | 70 o.add(buildReconcileCandidate()); |
71 return o; | 71 return o; |
72 } | 72 } |
73 | 73 |
74 checkUnnamed1030(core.List<api.ReconcileCandidate> o) { | 74 checkUnnamed730(core.List<api.ReconcileCandidate> o) { |
75 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
76 checkReconcileCandidate(o[0]); | 76 checkReconcileCandidate(o[0]); |
77 checkReconcileCandidate(o[1]); | 77 checkReconcileCandidate(o[1]); |
78 } | 78 } |
79 | 79 |
80 core.int buildCounterReconcileGetCosts = 0; | 80 core.int buildCounterReconcileGetCosts = 0; |
81 buildReconcileGetCosts() { | 81 buildReconcileGetCosts() { |
82 var o = new api.ReconcileGetCosts(); | 82 var o = new api.ReconcileGetCosts(); |
83 buildCounterReconcileGetCosts++; | 83 buildCounterReconcileGetCosts++; |
84 if (buildCounterReconcileGetCosts < 3) { | 84 if (buildCounterReconcileGetCosts < 3) { |
(...skipping 29 matching lines...) Expand all Loading... |
114 checkReconcileGetWarning(api.ReconcileGetWarning o) { | 114 checkReconcileGetWarning(api.ReconcileGetWarning o) { |
115 buildCounterReconcileGetWarning++; | 115 buildCounterReconcileGetWarning++; |
116 if (buildCounterReconcileGetWarning < 3) { | 116 if (buildCounterReconcileGetWarning < 3) { |
117 unittest.expect(o.location, unittest.equals('foo')); | 117 unittest.expect(o.location, unittest.equals('foo')); |
118 unittest.expect(o.message, unittest.equals('foo')); | 118 unittest.expect(o.message, unittest.equals('foo')); |
119 unittest.expect(o.reason, unittest.equals('foo')); | 119 unittest.expect(o.reason, unittest.equals('foo')); |
120 } | 120 } |
121 buildCounterReconcileGetWarning--; | 121 buildCounterReconcileGetWarning--; |
122 } | 122 } |
123 | 123 |
124 buildUnnamed1031() { | 124 buildUnnamed731() { |
125 var o = new core.List<api.ReconcileGetWarning>(); | 125 var o = new core.List<api.ReconcileGetWarning>(); |
126 o.add(buildReconcileGetWarning()); | 126 o.add(buildReconcileGetWarning()); |
127 o.add(buildReconcileGetWarning()); | 127 o.add(buildReconcileGetWarning()); |
128 return o; | 128 return o; |
129 } | 129 } |
130 | 130 |
131 checkUnnamed1031(core.List<api.ReconcileGetWarning> o) { | 131 checkUnnamed731(core.List<api.ReconcileGetWarning> o) { |
132 unittest.expect(o, unittest.hasLength(2)); | 132 unittest.expect(o, unittest.hasLength(2)); |
133 checkReconcileGetWarning(o[0]); | 133 checkReconcileGetWarning(o[0]); |
134 checkReconcileGetWarning(o[1]); | 134 checkReconcileGetWarning(o[1]); |
135 } | 135 } |
136 | 136 |
137 core.int buildCounterReconcileGet = 0; | 137 core.int buildCounterReconcileGet = 0; |
138 buildReconcileGet() { | 138 buildReconcileGet() { |
139 var o = new api.ReconcileGet(); | 139 var o = new api.ReconcileGet(); |
140 buildCounterReconcileGet++; | 140 buildCounterReconcileGet++; |
141 if (buildCounterReconcileGet < 3) { | 141 if (buildCounterReconcileGet < 3) { |
142 o.candidate = buildUnnamed1030(); | 142 o.candidate = buildUnnamed730(); |
143 o.costs = buildReconcileGetCosts(); | 143 o.costs = buildReconcileGetCosts(); |
144 o.match = buildReconcileCandidate(); | 144 o.match = buildReconcileCandidate(); |
145 o.warning = buildUnnamed1031(); | 145 o.warning = buildUnnamed731(); |
146 } | 146 } |
147 buildCounterReconcileGet--; | 147 buildCounterReconcileGet--; |
148 return o; | 148 return o; |
149 } | 149 } |
150 | 150 |
151 checkReconcileGet(api.ReconcileGet o) { | 151 checkReconcileGet(api.ReconcileGet o) { |
152 buildCounterReconcileGet++; | 152 buildCounterReconcileGet++; |
153 if (buildCounterReconcileGet < 3) { | 153 if (buildCounterReconcileGet < 3) { |
154 checkUnnamed1030(o.candidate); | 154 checkUnnamed730(o.candidate); |
155 checkReconcileGetCosts(o.costs); | 155 checkReconcileGetCosts(o.costs); |
156 checkReconcileCandidate(o.match); | 156 checkReconcileCandidate(o.match); |
157 checkUnnamed1031(o.warning); | 157 checkUnnamed731(o.warning); |
158 } | 158 } |
159 buildCounterReconcileGet--; | 159 buildCounterReconcileGet--; |
160 } | 160 } |
161 | 161 |
162 buildUnnamed1032() { | 162 buildUnnamed732() { |
163 var o = new core.List<core.String>(); | 163 var o = new core.List<core.String>(); |
164 o.add("foo"); | 164 o.add("foo"); |
165 o.add("foo"); | 165 o.add("foo"); |
166 return o; | 166 return o; |
167 } | 167 } |
168 | 168 |
169 checkUnnamed1032(core.List<core.String> o) { | 169 checkUnnamed732(core.List<core.String> o) { |
170 unittest.expect(o, unittest.hasLength(2)); | 170 unittest.expect(o, unittest.hasLength(2)); |
171 unittest.expect(o[0], unittest.equals('foo')); | 171 unittest.expect(o[0], unittest.equals('foo')); |
172 unittest.expect(o[1], unittest.equals('foo')); | 172 unittest.expect(o[1], unittest.equals('foo')); |
173 } | 173 } |
174 | 174 |
175 buildUnnamed1033() { | 175 buildUnnamed733() { |
176 var o = new core.List<core.String>(); | 176 var o = new core.List<core.String>(); |
177 o.add("foo"); | 177 o.add("foo"); |
178 o.add("foo"); | 178 o.add("foo"); |
179 return o; | 179 return o; |
180 } | 180 } |
181 | 181 |
182 checkUnnamed1033(core.List<core.String> o) { | 182 checkUnnamed733(core.List<core.String> o) { |
183 unittest.expect(o, unittest.hasLength(2)); | 183 unittest.expect(o, unittest.hasLength(2)); |
184 unittest.expect(o[0], unittest.equals('foo')); | 184 unittest.expect(o[0], unittest.equals('foo')); |
185 unittest.expect(o[1], unittest.equals('foo')); | 185 unittest.expect(o[1], unittest.equals('foo')); |
186 } | 186 } |
187 | 187 |
188 buildUnnamed1034() { | 188 buildUnnamed734() { |
189 var o = new core.List<core.String>(); | 189 var o = new core.List<core.String>(); |
190 o.add("foo"); | 190 o.add("foo"); |
191 o.add("foo"); | 191 o.add("foo"); |
192 return o; | 192 return o; |
193 } | 193 } |
194 | 194 |
195 checkUnnamed1034(core.List<core.String> o) { | 195 checkUnnamed734(core.List<core.String> o) { |
196 unittest.expect(o, unittest.hasLength(2)); | 196 unittest.expect(o, unittest.hasLength(2)); |
197 unittest.expect(o[0], unittest.equals('foo')); | 197 unittest.expect(o[0], unittest.equals('foo')); |
198 unittest.expect(o[1], unittest.equals('foo')); | 198 unittest.expect(o[1], unittest.equals('foo')); |
199 } | 199 } |
200 | 200 |
201 buildUnnamed1035() { | 201 buildUnnamed735() { |
202 var o = new core.List<core.String>(); | 202 var o = new core.List<core.String>(); |
203 o.add("foo"); | 203 o.add("foo"); |
204 o.add("foo"); | 204 o.add("foo"); |
205 return o; | 205 return o; |
206 } | 206 } |
207 | 207 |
208 checkUnnamed1035(core.List<core.String> o) { | 208 checkUnnamed735(core.List<core.String> o) { |
209 unittest.expect(o, unittest.hasLength(2)); | 209 unittest.expect(o, unittest.hasLength(2)); |
210 unittest.expect(o[0], unittest.equals('foo')); | 210 unittest.expect(o[0], unittest.equals('foo')); |
211 unittest.expect(o[1], unittest.equals('foo')); | 211 unittest.expect(o[1], unittest.equals('foo')); |
212 } | 212 } |
213 | 213 |
214 buildUnnamed1036() { | 214 buildUnnamed736() { |
215 var o = new core.List<core.String>(); | 215 var o = new core.List<core.String>(); |
216 o.add("foo"); | 216 o.add("foo"); |
217 o.add("foo"); | 217 o.add("foo"); |
218 return o; | 218 return o; |
219 } | 219 } |
220 | 220 |
221 checkUnnamed1036(core.List<core.String> o) { | 221 checkUnnamed736(core.List<core.String> o) { |
222 unittest.expect(o, unittest.hasLength(2)); | 222 unittest.expect(o, unittest.hasLength(2)); |
223 unittest.expect(o[0], unittest.equals('foo')); | 223 unittest.expect(o[0], unittest.equals('foo')); |
224 unittest.expect(o[1], unittest.equals('foo')); | 224 unittest.expect(o[1], unittest.equals('foo')); |
225 } | 225 } |
226 | 226 |
227 buildUnnamed1037() { | 227 buildUnnamed737() { |
228 var o = new core.List<core.String>(); | 228 var o = new core.List<core.String>(); |
229 o.add("foo"); | 229 o.add("foo"); |
230 o.add("foo"); | 230 o.add("foo"); |
231 return o; | 231 return o; |
232 } | 232 } |
233 | 233 |
234 checkUnnamed1037(core.List<core.String> o) { | 234 checkUnnamed737(core.List<core.String> o) { |
235 unittest.expect(o, unittest.hasLength(2)); | 235 unittest.expect(o, unittest.hasLength(2)); |
236 unittest.expect(o[0], unittest.equals('foo')); | 236 unittest.expect(o[0], unittest.equals('foo')); |
237 unittest.expect(o[1], unittest.equals('foo')); | 237 unittest.expect(o[1], unittest.equals('foo')); |
238 } | 238 } |
239 | 239 |
240 buildUnnamed1038() { | 240 buildUnnamed738() { |
241 var o = new core.List<core.String>(); | 241 var o = new core.List<core.String>(); |
242 o.add("foo"); | 242 o.add("foo"); |
243 o.add("foo"); | 243 o.add("foo"); |
244 return o; | 244 return o; |
245 } | 245 } |
246 | 246 |
247 checkUnnamed1038(core.List<core.String> o) { | 247 checkUnnamed738(core.List<core.String> o) { |
248 unittest.expect(o, unittest.hasLength(2)); | 248 unittest.expect(o, unittest.hasLength(2)); |
249 unittest.expect(o[0], unittest.equals('foo')); | 249 unittest.expect(o[0], unittest.equals('foo')); |
250 unittest.expect(o[1], unittest.equals('foo')); | 250 unittest.expect(o[1], unittest.equals('foo')); |
251 } | 251 } |
252 | 252 |
253 buildUnnamed1039() { | 253 buildUnnamed739() { |
254 var o = new core.List<core.String>(); | 254 var o = new core.List<core.String>(); |
255 o.add("foo"); | 255 o.add("foo"); |
256 o.add("foo"); | 256 o.add("foo"); |
257 return o; | 257 return o; |
258 } | 258 } |
259 | 259 |
260 checkUnnamed1039(core.List<core.String> o) { | 260 checkUnnamed739(core.List<core.String> o) { |
261 unittest.expect(o, unittest.hasLength(2)); | 261 unittest.expect(o, unittest.hasLength(2)); |
262 unittest.expect(o[0], unittest.equals('foo')); | 262 unittest.expect(o[0], unittest.equals('foo')); |
263 unittest.expect(o[1], unittest.equals('foo')); | 263 unittest.expect(o[1], unittest.equals('foo')); |
264 } | 264 } |
265 | 265 |
266 buildUnnamed1040() { | 266 buildUnnamed740() { |
267 var o = new core.List<core.String>(); | 267 var o = new core.List<core.String>(); |
268 o.add("foo"); | 268 o.add("foo"); |
269 o.add("foo"); | 269 o.add("foo"); |
270 return o; | 270 return o; |
271 } | 271 } |
272 | 272 |
273 checkUnnamed1040(core.List<core.String> o) { | 273 checkUnnamed740(core.List<core.String> o) { |
274 unittest.expect(o, unittest.hasLength(2)); | 274 unittest.expect(o, unittest.hasLength(2)); |
275 unittest.expect(o[0], unittest.equals('foo')); | 275 unittest.expect(o[0], unittest.equals('foo')); |
276 unittest.expect(o[1], unittest.equals('foo')); | 276 unittest.expect(o[1], unittest.equals('foo')); |
277 } | 277 } |
278 | 278 |
279 buildUnnamed1041() { | 279 buildUnnamed741() { |
280 var o = new core.List<core.String>(); | 280 var o = new core.List<core.String>(); |
281 o.add("foo"); | 281 o.add("foo"); |
282 o.add("foo"); | 282 o.add("foo"); |
283 return o; | 283 return o; |
284 } | 284 } |
285 | 285 |
286 checkUnnamed1041(core.List<core.String> o) { | 286 checkUnnamed741(core.List<core.String> o) { |
287 unittest.expect(o, unittest.hasLength(2)); | 287 unittest.expect(o, unittest.hasLength(2)); |
288 unittest.expect(o[0], unittest.equals('foo')); | 288 unittest.expect(o[0], unittest.equals('foo')); |
289 unittest.expect(o[1], unittest.equals('foo')); | 289 unittest.expect(o[1], unittest.equals('foo')); |
290 } | 290 } |
291 | 291 |
292 | 292 |
293 main() { | 293 main() { |
294 unittest.group("obj-schema-ReconcileCandidateNotable", () { | 294 unittest.group("obj-schema-ReconcileCandidateNotable", () { |
295 unittest.test("to-json--from-json", () { | 295 unittest.test("to-json--from-json", () { |
296 var o = buildReconcileCandidateNotable(); | 296 var o = buildReconcileCandidateNotable(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 }); | 335 }); |
336 }); | 336 }); |
337 | 337 |
338 | 338 |
339 unittest.group("resource-FreebaseApi", () { | 339 unittest.group("resource-FreebaseApi", () { |
340 unittest.test("method--reconcile", () { | 340 unittest.test("method--reconcile", () { |
341 | 341 |
342 var mock = new common_test.HttpServerMock(); | 342 var mock = new common_test.HttpServerMock(); |
343 api.FreebaseApi res = new api.FreebaseApi(mock); | 343 api.FreebaseApi res = new api.FreebaseApi(mock); |
344 var arg_confidence = 42.0; | 344 var arg_confidence = 42.0; |
345 var arg_kind = buildUnnamed1032(); | 345 var arg_kind = buildUnnamed732(); |
346 var arg_lang = buildUnnamed1033(); | 346 var arg_lang = buildUnnamed733(); |
347 var arg_limit = 42; | 347 var arg_limit = 42; |
348 var arg_name = "foo"; | 348 var arg_name = "foo"; |
349 var arg_prop = buildUnnamed1034(); | 349 var arg_prop = buildUnnamed734(); |
350 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 350 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
351 var path = (req.url).path; | 351 var path = (req.url).path; |
352 var pathOffset = 0; | 352 var pathOffset = 0; |
353 var index; | 353 var index; |
354 var subPart; | 354 var subPart; |
355 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 355 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
356 pathOffset += 1; | 356 pathOffset += 1; |
357 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); | 357 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); |
358 pathOffset += 12; | 358 pathOffset += 12; |
359 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("reconcile")); | 359 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("reconcile")); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 396 |
397 unittest.test("method--search", () { | 397 unittest.test("method--search", () { |
398 // TODO: Implement tests for media upload; | 398 // TODO: Implement tests for media upload; |
399 // TODO: Implement tests for media download; | 399 // TODO: Implement tests for media download; |
400 | 400 |
401 var mock = new common_test.HttpServerMock(); | 401 var mock = new common_test.HttpServerMock(); |
402 api.FreebaseApi res = new api.FreebaseApi(mock); | 402 api.FreebaseApi res = new api.FreebaseApi(mock); |
403 var arg_asOfTime = "foo"; | 403 var arg_asOfTime = "foo"; |
404 var arg_callback = "foo"; | 404 var arg_callback = "foo"; |
405 var arg_cursor = 42; | 405 var arg_cursor = 42; |
406 var arg_domain = buildUnnamed1035(); | 406 var arg_domain = buildUnnamed735(); |
407 var arg_encode = "foo"; | 407 var arg_encode = "foo"; |
408 var arg_exact = true; | 408 var arg_exact = true; |
409 var arg_filter = buildUnnamed1036(); | 409 var arg_filter = buildUnnamed736(); |
410 var arg_format = "foo"; | 410 var arg_format = "foo"; |
411 var arg_help = "foo"; | 411 var arg_help = "foo"; |
412 var arg_indent = true; | 412 var arg_indent = true; |
413 var arg_lang = buildUnnamed1037(); | 413 var arg_lang = buildUnnamed737(); |
414 var arg_limit = 42; | 414 var arg_limit = 42; |
415 var arg_mid = buildUnnamed1038(); | 415 var arg_mid = buildUnnamed738(); |
416 var arg_mqlOutput = "foo"; | 416 var arg_mqlOutput = "foo"; |
417 var arg_output = "foo"; | 417 var arg_output = "foo"; |
418 var arg_prefixed = true; | 418 var arg_prefixed = true; |
419 var arg_query = "foo"; | 419 var arg_query = "foo"; |
420 var arg_scoring = "foo"; | 420 var arg_scoring = "foo"; |
421 var arg_spell = "foo"; | 421 var arg_spell = "foo"; |
422 var arg_stemmed = true; | 422 var arg_stemmed = true; |
423 var arg_type = buildUnnamed1039(); | 423 var arg_type = buildUnnamed739(); |
424 var arg_with_ = buildUnnamed1040(); | 424 var arg_with_ = buildUnnamed740(); |
425 var arg_without = buildUnnamed1041(); | 425 var arg_without = buildUnnamed741(); |
426 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 426 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
427 var path = (req.url).path; | 427 var path = (req.url).path; |
428 var pathOffset = 0; | 428 var pathOffset = 0; |
429 var index; | 429 var index; |
430 var subPart; | 430 var subPart; |
431 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 431 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
432 pathOffset += 1; | 432 pathOffset += 1; |
433 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); | 433 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); |
434 pathOffset += 12; | 434 pathOffset += 12; |
435 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("search")); | 435 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("search")); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 483 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
484 }), true); | 484 }), true); |
485 res.search(asOfTime: arg_asOfTime, callback: arg_callback, cursor: arg_cur
sor, domain: arg_domain, encode: arg_encode, exact: arg_exact, filter: arg_filte
r, format: arg_format, help: arg_help, indent: arg_indent, lang: arg_lang, limit
: arg_limit, mid: arg_mid, mqlOutput: arg_mqlOutput, output: arg_output, prefixe
d: arg_prefixed, query: arg_query, scoring: arg_scoring, spell: arg_spell, stemm
ed: arg_stemmed, type: arg_type, with_: arg_with_, without: arg_without).then(un
ittest.expectAsync((_) {})); | 485 res.search(asOfTime: arg_asOfTime, callback: arg_callback, cursor: arg_cur
sor, domain: arg_domain, encode: arg_encode, exact: arg_exact, filter: arg_filte
r, format: arg_format, help: arg_help, indent: arg_indent, lang: arg_lang, limit
: arg_limit, mid: arg_mid, mqlOutput: arg_mqlOutput, output: arg_output, prefixe
d: arg_prefixed, query: arg_query, scoring: arg_scoring, spell: arg_spell, stemm
ed: arg_stemmed, type: arg_type, with_: arg_with_, without: arg_without).then(un
ittest.expectAsync((_) {})); |
486 }); | 486 }); |
487 | 487 |
488 }); | 488 }); |
489 | 489 |
490 | 490 |
491 } | 491 } |
492 | 492 |
OLD | NEW |