Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: generated/googleapis/test/freebase/v1.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: generated/googleapis/test/freebase/v1.dart
diff --git a/generated/googleapis/test/freebase/v1.dart b/generated/googleapis/test/freebase/v1.dart
new file mode 100644
index 0000000000000000000000000000000000000000..55cf1b2139326524dcde3f85bfb5a20cf4ce82d1
--- /dev/null
+++ b/generated/googleapis/test/freebase/v1.dart
@@ -0,0 +1,488 @@
+library googleapis.freebase.v1.test;
+
+import "dart:core" as core;
+import "dart:collection" as collection;
+import "dart:async" as async;
+import "dart:convert" as convert;
+
+import 'package:http/http.dart' as http;
+import 'package:http/testing.dart' as http_testing;
+import 'package:unittest/unittest.dart' as unittest;
+import 'package:googleapis/common/common.dart' as common;
+import 'package:googleapis/src/common_internal.dart' as common_internal;
+import '../common/common_internal_test.dart' as common_test;
+
+import 'package:googleapis/freebase/v1.dart' as api;
+
+
+
+core.int buildCounterReconcileCandidateNotable = 0;
+buildReconcileCandidateNotable() {
+ var o = new api.ReconcileCandidateNotable();
+ buildCounterReconcileCandidateNotable++;
+ if (buildCounterReconcileCandidateNotable < 3) {
+ o.id = "foo";
+ o.name = "foo";
+ }
+ buildCounterReconcileCandidateNotable--;
+ return o;
+}
+
+checkReconcileCandidateNotable(api.ReconcileCandidateNotable o) {
+ buildCounterReconcileCandidateNotable++;
+ if (buildCounterReconcileCandidateNotable < 3) {
+ unittest.expect(o.id, unittest.equals('foo'));
+ unittest.expect(o.name, unittest.equals('foo'));
+ }
+ buildCounterReconcileCandidateNotable--;
+}
+
+core.int buildCounterReconcileCandidate = 0;
+buildReconcileCandidate() {
+ var o = new api.ReconcileCandidate();
+ buildCounterReconcileCandidate++;
+ if (buildCounterReconcileCandidate < 3) {
+ o.confidence = 42.0;
+ o.lang = "foo";
+ o.mid = "foo";
+ o.name = "foo";
+ o.notable = buildReconcileCandidateNotable();
+ }
+ buildCounterReconcileCandidate--;
+ return o;
+}
+
+checkReconcileCandidate(api.ReconcileCandidate o) {
+ buildCounterReconcileCandidate++;
+ if (buildCounterReconcileCandidate < 3) {
+ unittest.expect(o.confidence, unittest.equals(42.0));
+ unittest.expect(o.lang, unittest.equals('foo'));
+ unittest.expect(o.mid, unittest.equals('foo'));
+ unittest.expect(o.name, unittest.equals('foo'));
+ checkReconcileCandidateNotable(o.notable);
+ }
+ buildCounterReconcileCandidate--;
+}
+
+buildUnnamed719() {
+ var o = new core.List<api.ReconcileCandidate>();
+ o.add(buildReconcileCandidate());
+ o.add(buildReconcileCandidate());
+ return o;
+}
+
+checkUnnamed719(core.List<api.ReconcileCandidate> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ checkReconcileCandidate(o[0]);
+ checkReconcileCandidate(o[1]);
+}
+
+core.int buildCounterReconcileGetCosts = 0;
+buildReconcileGetCosts() {
+ var o = new api.ReconcileGetCosts();
+ buildCounterReconcileGetCosts++;
+ if (buildCounterReconcileGetCosts < 3) {
+ o.hits = 42;
+ o.ms = 42;
+ }
+ buildCounterReconcileGetCosts--;
+ return o;
+}
+
+checkReconcileGetCosts(api.ReconcileGetCosts o) {
+ buildCounterReconcileGetCosts++;
+ if (buildCounterReconcileGetCosts < 3) {
+ unittest.expect(o.hits, unittest.equals(42));
+ unittest.expect(o.ms, unittest.equals(42));
+ }
+ buildCounterReconcileGetCosts--;
+}
+
+core.int buildCounterReconcileGetWarning = 0;
+buildReconcileGetWarning() {
+ var o = new api.ReconcileGetWarning();
+ buildCounterReconcileGetWarning++;
+ if (buildCounterReconcileGetWarning < 3) {
+ o.location = "foo";
+ o.message = "foo";
+ o.reason = "foo";
+ }
+ buildCounterReconcileGetWarning--;
+ return o;
+}
+
+checkReconcileGetWarning(api.ReconcileGetWarning o) {
+ buildCounterReconcileGetWarning++;
+ if (buildCounterReconcileGetWarning < 3) {
+ unittest.expect(o.location, unittest.equals('foo'));
+ unittest.expect(o.message, unittest.equals('foo'));
+ unittest.expect(o.reason, unittest.equals('foo'));
+ }
+ buildCounterReconcileGetWarning--;
+}
+
+buildUnnamed720() {
+ var o = new core.List<api.ReconcileGetWarning>();
+ o.add(buildReconcileGetWarning());
+ o.add(buildReconcileGetWarning());
+ return o;
+}
+
+checkUnnamed720(core.List<api.ReconcileGetWarning> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ checkReconcileGetWarning(o[0]);
+ checkReconcileGetWarning(o[1]);
+}
+
+core.int buildCounterReconcileGet = 0;
+buildReconcileGet() {
+ var o = new api.ReconcileGet();
+ buildCounterReconcileGet++;
+ if (buildCounterReconcileGet < 3) {
+ o.candidate = buildUnnamed719();
+ o.costs = buildReconcileGetCosts();
+ o.match = buildReconcileCandidate();
+ o.warning = buildUnnamed720();
+ }
+ buildCounterReconcileGet--;
+ return o;
+}
+
+checkReconcileGet(api.ReconcileGet o) {
+ buildCounterReconcileGet++;
+ if (buildCounterReconcileGet < 3) {
+ checkUnnamed719(o.candidate);
+ checkReconcileGetCosts(o.costs);
+ checkReconcileCandidate(o.match);
+ checkUnnamed720(o.warning);
+ }
+ buildCounterReconcileGet--;
+}
+
+buildUnnamed721() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed721(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed722() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed722(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed723() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed723(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed724() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed724(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed725() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed725(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed726() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed726(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed727() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed727(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed728() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed728(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed729() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed729(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+buildUnnamed730() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed730(core.List<core.String> o) {
+ unittest.expect(o, unittest.hasLength(2));
+ unittest.expect(o[0], unittest.equals('foo'));
+ unittest.expect(o[1], unittest.equals('foo'));
+}
+
+
+main() {
+ unittest.group("obj-schema-ReconcileCandidateNotable", () {
+ unittest.test("to-json--from-json", () {
+ var o = buildReconcileCandidateNotable();
+ var od = new api.ReconcileCandidateNotable.fromJson(o.toJson());
+ checkReconcileCandidateNotable(od);
+ });
+ });
+
+
+ unittest.group("obj-schema-ReconcileCandidate", () {
+ unittest.test("to-json--from-json", () {
+ var o = buildReconcileCandidate();
+ var od = new api.ReconcileCandidate.fromJson(o.toJson());
+ checkReconcileCandidate(od);
+ });
+ });
+
+
+ unittest.group("obj-schema-ReconcileGetCosts", () {
+ unittest.test("to-json--from-json", () {
+ var o = buildReconcileGetCosts();
+ var od = new api.ReconcileGetCosts.fromJson(o.toJson());
+ checkReconcileGetCosts(od);
+ });
+ });
+
+
+ unittest.group("obj-schema-ReconcileGetWarning", () {
+ unittest.test("to-json--from-json", () {
+ var o = buildReconcileGetWarning();
+ var od = new api.ReconcileGetWarning.fromJson(o.toJson());
+ checkReconcileGetWarning(od);
+ });
+ });
+
+
+ unittest.group("obj-schema-ReconcileGet", () {
+ unittest.test("to-json--from-json", () {
+ var o = buildReconcileGet();
+ var od = new api.ReconcileGet.fromJson(o.toJson());
+ checkReconcileGet(od);
+ });
+ });
+
+
+ unittest.group("resource-FreebaseApi", () {
+ unittest.test("method--reconcile", () {
+
+ var mock = new common_test.HttpServerMock();
+ api.FreebaseApi res = new api.FreebaseApi(mock);
+ var arg_confidence = 42.0;
+ var arg_kind = buildUnnamed721();
+ var arg_lang = buildUnnamed722();
+ var arg_limit = 42;
+ var arg_name = "foo";
+ var arg_prop = buildUnnamed723();
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) {
+ var path = (req.url).path;
+ var pathOffset = 0;
+ var index;
+ var subPart;
+ unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("/freebase/v1/"));
+ pathOffset += 13;
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("reconcile"));
+ pathOffset += 9;
+
+ var query = (req.url).query;
+ var queryOffset = 0;
+ var queryMap = {};
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
+ parseBool(n) {
+ if (n == "true") return true;
+ if (n == "false") return false;
+ if (n == null) return null;
+ throw new core.ArgumentError("Invalid boolean: $n");
+ }
+ if (query.length > 0) {
+ for (var part in query.split("&")) {
+ var keyvalue = part.split("=");
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
+ }
+ }
+ unittest.expect(core.num.parse(queryMap["confidence"].first), unittest.equals(arg_confidence));
+ unittest.expect(queryMap["kind"], unittest.equals(arg_kind));
+ unittest.expect(queryMap["lang"], unittest.equals(arg_lang));
+ unittest.expect(core.int.parse(queryMap["limit"].first), unittest.equals(arg_limit));
+ unittest.expect(queryMap["name"].first, unittest.equals(arg_name));
+ unittest.expect(queryMap["prop"], unittest.equals(arg_prop));
+
+
+ var h = {
+ "content-type" : "application/json; charset=utf-8",
+ };
+ var resp = convert.JSON.encode(buildReconcileGet());
+ return new async.Future.value(common_test.stringResponse(200, h, resp));
+ }), true);
+ res.reconcile(confidence: arg_confidence, kind: arg_kind, lang: arg_lang, limit: arg_limit, name: arg_name, prop: arg_prop).then(unittest.expectAsync(((api.ReconcileGet response) {
+ checkReconcileGet(response);
+ })));
+ });
+
+ unittest.test("method--search", () {
+ // TODO: Implement tests for media upload;
+ // TODO: Implement tests for media download;
+
+ var mock = new common_test.HttpServerMock();
+ api.FreebaseApi res = new api.FreebaseApi(mock);
+ var arg_asOfTime = "foo";
+ var arg_callback = "foo";
+ var arg_cursor = 42;
+ var arg_domain = buildUnnamed724();
+ var arg_encode = "foo";
+ var arg_exact = true;
+ var arg_filter = buildUnnamed725();
+ var arg_format = "foo";
+ var arg_help = "foo";
+ var arg_indent = true;
+ var arg_lang = buildUnnamed726();
+ var arg_limit = 42;
+ var arg_mid = buildUnnamed727();
+ var arg_mqlOutput = "foo";
+ var arg_output = "foo";
+ var arg_prefixed = true;
+ var arg_query = "foo";
+ var arg_scoring = "foo";
+ var arg_spell = "foo";
+ var arg_stemmed = true;
+ var arg_type = buildUnnamed728();
+ var arg_with_ = buildUnnamed729();
+ var arg_without = buildUnnamed730();
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) {
+ var path = (req.url).path;
+ var pathOffset = 0;
+ var index;
+ var subPart;
+ unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.equals("/freebase/v1/"));
+ pathOffset += 13;
+ unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("search"));
+ pathOffset += 6;
+
+ var query = (req.url).query;
+ var queryOffset = 0;
+ var queryMap = {};
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
+ parseBool(n) {
+ if (n == "true") return true;
+ if (n == "false") return false;
+ if (n == null) return null;
+ throw new core.ArgumentError("Invalid boolean: $n");
+ }
+ if (query.length > 0) {
+ for (var part in query.split("&")) {
+ var keyvalue = part.split("=");
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
+ }
+ }
+ unittest.expect(queryMap["as_of_time"].first, unittest.equals(arg_asOfTime));
+ unittest.expect(queryMap["callback"].first, unittest.equals(arg_callback));
+ unittest.expect(core.int.parse(queryMap["cursor"].first), unittest.equals(arg_cursor));
+ unittest.expect(queryMap["domain"], unittest.equals(arg_domain));
+ unittest.expect(queryMap["encode"].first, unittest.equals(arg_encode));
+ unittest.expect(queryMap["exact"].first, unittest.equals("$arg_exact"));
+ unittest.expect(queryMap["filter"], unittest.equals(arg_filter));
+ unittest.expect(queryMap["format"].first, unittest.equals(arg_format));
+ unittest.expect(queryMap["help"].first, unittest.equals(arg_help));
+ unittest.expect(queryMap["indent"].first, unittest.equals("$arg_indent"));
+ unittest.expect(queryMap["lang"], unittest.equals(arg_lang));
+ unittest.expect(core.int.parse(queryMap["limit"].first), unittest.equals(arg_limit));
+ unittest.expect(queryMap["mid"], unittest.equals(arg_mid));
+ unittest.expect(queryMap["mql_output"].first, unittest.equals(arg_mqlOutput));
+ unittest.expect(queryMap["output"].first, unittest.equals(arg_output));
+ unittest.expect(queryMap["prefixed"].first, unittest.equals("$arg_prefixed"));
+ unittest.expect(queryMap["query"].first, unittest.equals(arg_query));
+ unittest.expect(queryMap["scoring"].first, unittest.equals(arg_scoring));
+ unittest.expect(queryMap["spell"].first, unittest.equals(arg_spell));
+ unittest.expect(queryMap["stemmed"].first, unittest.equals("$arg_stemmed"));
+ unittest.expect(queryMap["type"], unittest.equals(arg_type));
+ unittest.expect(queryMap["with"], unittest.equals(arg_with_));
+ unittest.expect(queryMap["without"], unittest.equals(arg_without));
+
+
+ var h = {
+ "content-type" : "application/json; charset=utf-8",
+ };
+ var resp = "";
+ return new async.Future.value(common_test.stringResponse(200, h, resp));
+ }), true);
+ res.search(asOfTime: arg_asOfTime, callback: arg_callback, cursor: arg_cursor, domain: arg_domain, encode: arg_encode, exact: arg_exact, filter: arg_filter, format: arg_format, help: arg_help, indent: arg_indent, lang: arg_lang, limit: arg_limit, mid: arg_mid, mqlOutput: arg_mqlOutput, output: arg_output, prefixed: arg_prefixed, query: arg_query, scoring: arg_scoring, spell: arg_spell, stemmed: arg_stemmed, type: arg_type, with_: arg_with_, without: arg_without).then(unittest.expectAsync((_) {}));
+ });
+
+ });
+
+
+}
+

Powered by Google App Engine
This is Rietveld 408576698