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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (buildCounterReconcileCandidate < 3) { | 92 if (buildCounterReconcileCandidate < 3) { |
93 unittest.expect(o.confidence, unittest.equals(42.0)); | 93 unittest.expect(o.confidence, unittest.equals(42.0)); |
94 unittest.expect(o.lang, unittest.equals('foo')); | 94 unittest.expect(o.lang, unittest.equals('foo')); |
95 unittest.expect(o.mid, unittest.equals('foo')); | 95 unittest.expect(o.mid, unittest.equals('foo')); |
96 unittest.expect(o.name, unittest.equals('foo')); | 96 unittest.expect(o.name, unittest.equals('foo')); |
97 checkReconcileCandidateNotable(o.notable); | 97 checkReconcileCandidateNotable(o.notable); |
98 } | 98 } |
99 buildCounterReconcileCandidate--; | 99 buildCounterReconcileCandidate--; |
100 } | 100 } |
101 | 101 |
102 buildUnnamed1036() { | 102 buildUnnamed1665() { |
103 var o = new core.List<api.ReconcileCandidate>(); | 103 var o = new core.List<api.ReconcileCandidate>(); |
104 o.add(buildReconcileCandidate()); | 104 o.add(buildReconcileCandidate()); |
105 o.add(buildReconcileCandidate()); | 105 o.add(buildReconcileCandidate()); |
106 return o; | 106 return o; |
107 } | 107 } |
108 | 108 |
109 checkUnnamed1036(core.List<api.ReconcileCandidate> o) { | 109 checkUnnamed1665(core.List<api.ReconcileCandidate> o) { |
110 unittest.expect(o, unittest.hasLength(2)); | 110 unittest.expect(o, unittest.hasLength(2)); |
111 checkReconcileCandidate(o[0]); | 111 checkReconcileCandidate(o[0]); |
112 checkReconcileCandidate(o[1]); | 112 checkReconcileCandidate(o[1]); |
113 } | 113 } |
114 | 114 |
115 core.int buildCounterReconcileGetCosts = 0; | 115 core.int buildCounterReconcileGetCosts = 0; |
116 buildReconcileGetCosts() { | 116 buildReconcileGetCosts() { |
117 var o = new api.ReconcileGetCosts(); | 117 var o = new api.ReconcileGetCosts(); |
118 buildCounterReconcileGetCosts++; | 118 buildCounterReconcileGetCosts++; |
119 if (buildCounterReconcileGetCosts < 3) { | 119 if (buildCounterReconcileGetCosts < 3) { |
(...skipping 29 matching lines...) Expand all Loading... |
149 checkReconcileGetWarning(api.ReconcileGetWarning o) { | 149 checkReconcileGetWarning(api.ReconcileGetWarning o) { |
150 buildCounterReconcileGetWarning++; | 150 buildCounterReconcileGetWarning++; |
151 if (buildCounterReconcileGetWarning < 3) { | 151 if (buildCounterReconcileGetWarning < 3) { |
152 unittest.expect(o.location, unittest.equals('foo')); | 152 unittest.expect(o.location, unittest.equals('foo')); |
153 unittest.expect(o.message, unittest.equals('foo')); | 153 unittest.expect(o.message, unittest.equals('foo')); |
154 unittest.expect(o.reason, unittest.equals('foo')); | 154 unittest.expect(o.reason, unittest.equals('foo')); |
155 } | 155 } |
156 buildCounterReconcileGetWarning--; | 156 buildCounterReconcileGetWarning--; |
157 } | 157 } |
158 | 158 |
159 buildUnnamed1037() { | 159 buildUnnamed1666() { |
160 var o = new core.List<api.ReconcileGetWarning>(); | 160 var o = new core.List<api.ReconcileGetWarning>(); |
161 o.add(buildReconcileGetWarning()); | 161 o.add(buildReconcileGetWarning()); |
162 o.add(buildReconcileGetWarning()); | 162 o.add(buildReconcileGetWarning()); |
163 return o; | 163 return o; |
164 } | 164 } |
165 | 165 |
166 checkUnnamed1037(core.List<api.ReconcileGetWarning> o) { | 166 checkUnnamed1666(core.List<api.ReconcileGetWarning> o) { |
167 unittest.expect(o, unittest.hasLength(2)); | 167 unittest.expect(o, unittest.hasLength(2)); |
168 checkReconcileGetWarning(o[0]); | 168 checkReconcileGetWarning(o[0]); |
169 checkReconcileGetWarning(o[1]); | 169 checkReconcileGetWarning(o[1]); |
170 } | 170 } |
171 | 171 |
172 core.int buildCounterReconcileGet = 0; | 172 core.int buildCounterReconcileGet = 0; |
173 buildReconcileGet() { | 173 buildReconcileGet() { |
174 var o = new api.ReconcileGet(); | 174 var o = new api.ReconcileGet(); |
175 buildCounterReconcileGet++; | 175 buildCounterReconcileGet++; |
176 if (buildCounterReconcileGet < 3) { | 176 if (buildCounterReconcileGet < 3) { |
177 o.candidate = buildUnnamed1036(); | 177 o.candidate = buildUnnamed1665(); |
178 o.costs = buildReconcileGetCosts(); | 178 o.costs = buildReconcileGetCosts(); |
179 o.match = buildReconcileCandidate(); | 179 o.match = buildReconcileCandidate(); |
180 o.warning = buildUnnamed1037(); | 180 o.warning = buildUnnamed1666(); |
181 } | 181 } |
182 buildCounterReconcileGet--; | 182 buildCounterReconcileGet--; |
183 return o; | 183 return o; |
184 } | 184 } |
185 | 185 |
186 checkReconcileGet(api.ReconcileGet o) { | 186 checkReconcileGet(api.ReconcileGet o) { |
187 buildCounterReconcileGet++; | 187 buildCounterReconcileGet++; |
188 if (buildCounterReconcileGet < 3) { | 188 if (buildCounterReconcileGet < 3) { |
189 checkUnnamed1036(o.candidate); | 189 checkUnnamed1665(o.candidate); |
190 checkReconcileGetCosts(o.costs); | 190 checkReconcileGetCosts(o.costs); |
191 checkReconcileCandidate(o.match); | 191 checkReconcileCandidate(o.match); |
192 checkUnnamed1037(o.warning); | 192 checkUnnamed1666(o.warning); |
193 } | 193 } |
194 buildCounterReconcileGet--; | 194 buildCounterReconcileGet--; |
195 } | 195 } |
196 | 196 |
197 buildUnnamed1038() { | 197 buildUnnamed1667() { |
198 var o = new core.List<core.String>(); | 198 var o = new core.List<core.String>(); |
199 o.add("foo"); | 199 o.add("foo"); |
200 o.add("foo"); | 200 o.add("foo"); |
201 return o; | 201 return o; |
202 } | 202 } |
203 | 203 |
204 checkUnnamed1038(core.List<core.String> o) { | 204 checkUnnamed1667(core.List<core.String> o) { |
205 unittest.expect(o, unittest.hasLength(2)); | 205 unittest.expect(o, unittest.hasLength(2)); |
206 unittest.expect(o[0], unittest.equals('foo')); | 206 unittest.expect(o[0], unittest.equals('foo')); |
207 unittest.expect(o[1], unittest.equals('foo')); | 207 unittest.expect(o[1], unittest.equals('foo')); |
208 } | 208 } |
209 | 209 |
210 buildUnnamed1039() { | 210 buildUnnamed1668() { |
211 var o = new core.List<core.String>(); | 211 var o = new core.List<core.String>(); |
212 o.add("foo"); | 212 o.add("foo"); |
213 o.add("foo"); | 213 o.add("foo"); |
214 return o; | 214 return o; |
215 } | 215 } |
216 | 216 |
217 checkUnnamed1039(core.List<core.String> o) { | 217 checkUnnamed1668(core.List<core.String> o) { |
218 unittest.expect(o, unittest.hasLength(2)); | 218 unittest.expect(o, unittest.hasLength(2)); |
219 unittest.expect(o[0], unittest.equals('foo')); | 219 unittest.expect(o[0], unittest.equals('foo')); |
220 unittest.expect(o[1], unittest.equals('foo')); | 220 unittest.expect(o[1], unittest.equals('foo')); |
221 } | 221 } |
222 | 222 |
223 buildUnnamed1040() { | 223 buildUnnamed1669() { |
224 var o = new core.List<core.String>(); | 224 var o = new core.List<core.String>(); |
225 o.add("foo"); | 225 o.add("foo"); |
226 o.add("foo"); | 226 o.add("foo"); |
227 return o; | 227 return o; |
228 } | 228 } |
229 | 229 |
230 checkUnnamed1040(core.List<core.String> o) { | 230 checkUnnamed1669(core.List<core.String> o) { |
231 unittest.expect(o, unittest.hasLength(2)); | 231 unittest.expect(o, unittest.hasLength(2)); |
232 unittest.expect(o[0], unittest.equals('foo')); | 232 unittest.expect(o[0], unittest.equals('foo')); |
233 unittest.expect(o[1], unittest.equals('foo')); | 233 unittest.expect(o[1], unittest.equals('foo')); |
234 } | 234 } |
235 | 235 |
236 buildUnnamed1041() { | 236 buildUnnamed1670() { |
237 var o = new core.List<core.String>(); | 237 var o = new core.List<core.String>(); |
238 o.add("foo"); | 238 o.add("foo"); |
239 o.add("foo"); | 239 o.add("foo"); |
240 return o; | 240 return o; |
241 } | 241 } |
242 | 242 |
243 checkUnnamed1041(core.List<core.String> o) { | 243 checkUnnamed1670(core.List<core.String> o) { |
244 unittest.expect(o, unittest.hasLength(2)); | 244 unittest.expect(o, unittest.hasLength(2)); |
245 unittest.expect(o[0], unittest.equals('foo')); | 245 unittest.expect(o[0], unittest.equals('foo')); |
246 unittest.expect(o[1], unittest.equals('foo')); | 246 unittest.expect(o[1], unittest.equals('foo')); |
247 } | 247 } |
248 | 248 |
249 buildUnnamed1042() { | 249 buildUnnamed1671() { |
250 var o = new core.List<core.String>(); | 250 var o = new core.List<core.String>(); |
251 o.add("foo"); | 251 o.add("foo"); |
252 o.add("foo"); | 252 o.add("foo"); |
253 return o; | 253 return o; |
254 } | 254 } |
255 | 255 |
256 checkUnnamed1042(core.List<core.String> o) { | 256 checkUnnamed1671(core.List<core.String> o) { |
257 unittest.expect(o, unittest.hasLength(2)); | 257 unittest.expect(o, unittest.hasLength(2)); |
258 unittest.expect(o[0], unittest.equals('foo')); | 258 unittest.expect(o[0], unittest.equals('foo')); |
259 unittest.expect(o[1], unittest.equals('foo')); | 259 unittest.expect(o[1], unittest.equals('foo')); |
260 } | 260 } |
261 | 261 |
262 buildUnnamed1043() { | 262 buildUnnamed1672() { |
263 var o = new core.List<core.String>(); | 263 var o = new core.List<core.String>(); |
264 o.add("foo"); | 264 o.add("foo"); |
265 o.add("foo"); | 265 o.add("foo"); |
266 return o; | 266 return o; |
267 } | 267 } |
268 | 268 |
269 checkUnnamed1043(core.List<core.String> o) { | 269 checkUnnamed1672(core.List<core.String> o) { |
270 unittest.expect(o, unittest.hasLength(2)); | 270 unittest.expect(o, unittest.hasLength(2)); |
271 unittest.expect(o[0], unittest.equals('foo')); | 271 unittest.expect(o[0], unittest.equals('foo')); |
272 unittest.expect(o[1], unittest.equals('foo')); | 272 unittest.expect(o[1], unittest.equals('foo')); |
273 } | 273 } |
274 | 274 |
275 buildUnnamed1044() { | 275 buildUnnamed1673() { |
276 var o = new core.List<core.String>(); | 276 var o = new core.List<core.String>(); |
277 o.add("foo"); | 277 o.add("foo"); |
278 o.add("foo"); | 278 o.add("foo"); |
279 return o; | 279 return o; |
280 } | 280 } |
281 | 281 |
282 checkUnnamed1044(core.List<core.String> o) { | 282 checkUnnamed1673(core.List<core.String> o) { |
283 unittest.expect(o, unittest.hasLength(2)); | 283 unittest.expect(o, unittest.hasLength(2)); |
284 unittest.expect(o[0], unittest.equals('foo')); | 284 unittest.expect(o[0], unittest.equals('foo')); |
285 unittest.expect(o[1], unittest.equals('foo')); | 285 unittest.expect(o[1], unittest.equals('foo')); |
286 } | 286 } |
287 | 287 |
288 buildUnnamed1045() { | 288 buildUnnamed1674() { |
289 var o = new core.List<core.String>(); | 289 var o = new core.List<core.String>(); |
290 o.add("foo"); | 290 o.add("foo"); |
291 o.add("foo"); | 291 o.add("foo"); |
292 return o; | 292 return o; |
293 } | 293 } |
294 | 294 |
295 checkUnnamed1045(core.List<core.String> o) { | 295 checkUnnamed1674(core.List<core.String> o) { |
296 unittest.expect(o, unittest.hasLength(2)); | 296 unittest.expect(o, unittest.hasLength(2)); |
297 unittest.expect(o[0], unittest.equals('foo')); | 297 unittest.expect(o[0], unittest.equals('foo')); |
298 unittest.expect(o[1], unittest.equals('foo')); | 298 unittest.expect(o[1], unittest.equals('foo')); |
299 } | 299 } |
300 | 300 |
301 buildUnnamed1046() { | 301 buildUnnamed1675() { |
302 var o = new core.List<core.String>(); | 302 var o = new core.List<core.String>(); |
303 o.add("foo"); | 303 o.add("foo"); |
304 o.add("foo"); | 304 o.add("foo"); |
305 return o; | 305 return o; |
306 } | 306 } |
307 | 307 |
308 checkUnnamed1046(core.List<core.String> o) { | 308 checkUnnamed1675(core.List<core.String> o) { |
309 unittest.expect(o, unittest.hasLength(2)); | 309 unittest.expect(o, unittest.hasLength(2)); |
310 unittest.expect(o[0], unittest.equals('foo')); | 310 unittest.expect(o[0], unittest.equals('foo')); |
311 unittest.expect(o[1], unittest.equals('foo')); | 311 unittest.expect(o[1], unittest.equals('foo')); |
312 } | 312 } |
313 | 313 |
314 buildUnnamed1047() { | 314 buildUnnamed1676() { |
315 var o = new core.List<core.String>(); | 315 var o = new core.List<core.String>(); |
316 o.add("foo"); | 316 o.add("foo"); |
317 o.add("foo"); | 317 o.add("foo"); |
318 return o; | 318 return o; |
319 } | 319 } |
320 | 320 |
321 checkUnnamed1047(core.List<core.String> o) { | 321 checkUnnamed1676(core.List<core.String> o) { |
322 unittest.expect(o, unittest.hasLength(2)); | 322 unittest.expect(o, unittest.hasLength(2)); |
323 unittest.expect(o[0], unittest.equals('foo')); | 323 unittest.expect(o[0], unittest.equals('foo')); |
324 unittest.expect(o[1], unittest.equals('foo')); | 324 unittest.expect(o[1], unittest.equals('foo')); |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 main() { | 328 main() { |
329 unittest.group("obj-schema-ReconcileCandidateNotable", () { | 329 unittest.group("obj-schema-ReconcileCandidateNotable", () { |
330 unittest.test("to-json--from-json", () { | 330 unittest.test("to-json--from-json", () { |
331 var o = buildReconcileCandidateNotable(); | 331 var o = buildReconcileCandidateNotable(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 }); | 370 }); |
371 }); | 371 }); |
372 | 372 |
373 | 373 |
374 unittest.group("resource-FreebaseApi", () { | 374 unittest.group("resource-FreebaseApi", () { |
375 unittest.test("method--reconcile", () { | 375 unittest.test("method--reconcile", () { |
376 | 376 |
377 var mock = new HttpServerMock(); | 377 var mock = new HttpServerMock(); |
378 api.FreebaseApi res = new api.FreebaseApi(mock); | 378 api.FreebaseApi res = new api.FreebaseApi(mock); |
379 var arg_confidence = 42.0; | 379 var arg_confidence = 42.0; |
380 var arg_kind = buildUnnamed1038(); | 380 var arg_kind = buildUnnamed1667(); |
381 var arg_lang = buildUnnamed1039(); | 381 var arg_lang = buildUnnamed1668(); |
382 var arg_limit = 42; | 382 var arg_limit = 42; |
383 var arg_name = "foo"; | 383 var arg_name = "foo"; |
384 var arg_prop = buildUnnamed1040(); | 384 var arg_prop = buildUnnamed1669(); |
385 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 385 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
386 var path = (req.url).path; | 386 var path = (req.url).path; |
387 var pathOffset = 0; | 387 var pathOffset = 0; |
388 var index; | 388 var index; |
389 var subPart; | 389 var subPart; |
390 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 390 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
391 pathOffset += 1; | 391 pathOffset += 1; |
392 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); | 392 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); |
393 pathOffset += 12; | 393 pathOffset += 12; |
394 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("reconcile")); | 394 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("reconcile")); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 unittest.test("method--search", () { | 432 unittest.test("method--search", () { |
433 // TODO: Implement tests for media upload; | 433 // TODO: Implement tests for media upload; |
434 // TODO: Implement tests for media download; | 434 // TODO: Implement tests for media download; |
435 | 435 |
436 var mock = new HttpServerMock(); | 436 var mock = new HttpServerMock(); |
437 api.FreebaseApi res = new api.FreebaseApi(mock); | 437 api.FreebaseApi res = new api.FreebaseApi(mock); |
438 var arg_asOfTime = "foo"; | 438 var arg_asOfTime = "foo"; |
439 var arg_callback = "foo"; | 439 var arg_callback = "foo"; |
440 var arg_cursor = 42; | 440 var arg_cursor = 42; |
441 var arg_domain = buildUnnamed1041(); | 441 var arg_domain = buildUnnamed1670(); |
442 var arg_encode = "foo"; | 442 var arg_encode = "foo"; |
443 var arg_exact = true; | 443 var arg_exact = true; |
444 var arg_filter = buildUnnamed1042(); | 444 var arg_filter = buildUnnamed1671(); |
445 var arg_format = "foo"; | 445 var arg_format = "foo"; |
446 var arg_help = "foo"; | 446 var arg_help = "foo"; |
447 var arg_indent = true; | 447 var arg_indent = true; |
448 var arg_lang = buildUnnamed1043(); | 448 var arg_lang = buildUnnamed1672(); |
449 var arg_limit = 42; | 449 var arg_limit = 42; |
450 var arg_mid = buildUnnamed1044(); | 450 var arg_mid = buildUnnamed1673(); |
451 var arg_mqlOutput = "foo"; | 451 var arg_mqlOutput = "foo"; |
452 var arg_output = "foo"; | 452 var arg_output = "foo"; |
453 var arg_prefixed = true; | 453 var arg_prefixed = true; |
454 var arg_query = "foo"; | 454 var arg_query = "foo"; |
455 var arg_scoring = "foo"; | 455 var arg_scoring = "foo"; |
456 var arg_spell = "foo"; | 456 var arg_spell = "foo"; |
457 var arg_stemmed = true; | 457 var arg_stemmed = true; |
458 var arg_type = buildUnnamed1045(); | 458 var arg_type = buildUnnamed1674(); |
459 var arg_with_ = buildUnnamed1046(); | 459 var arg_with_ = buildUnnamed1675(); |
460 var arg_without = buildUnnamed1047(); | 460 var arg_without = buildUnnamed1676(); |
461 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 461 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
462 var path = (req.url).path; | 462 var path = (req.url).path; |
463 var pathOffset = 0; | 463 var pathOffset = 0; |
464 var index; | 464 var index; |
465 var subPart; | 465 var subPart; |
466 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 466 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
467 pathOffset += 1; | 467 pathOffset += 1; |
468 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); | 468 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("freebase/v1/")); |
469 pathOffset += 12; | 469 pathOffset += 12; |
470 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("search")); | 470 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("search")); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 return new async.Future.value(stringResponse(200, h, resp)); | 518 return new async.Future.value(stringResponse(200, h, resp)); |
519 }), true); | 519 }), true); |
520 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((_) {})); | 520 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((_) {})); |
521 }); | 521 }); |
522 | 522 |
523 }); | 523 }); |
524 | 524 |
525 | 525 |
526 } | 526 } |
527 | 527 |
OLD | NEW |