Index: generated/googleapis/test/manufacturers/v1_test.dart |
diff --git a/generated/googleapis/test/manufacturers/v1_test.dart b/generated/googleapis/test/manufacturers/v1_test.dart |
index 9eace3f4acded9d47e653a1303c26e02976ea46e..fbe7da75f905b70d26dae91b04ce69a9f3806c65 100644 |
--- a/generated/googleapis/test/manufacturers/v1_test.dart |
+++ b/generated/googleapis/test/manufacturers/v1_test.dart |
@@ -51,79 +51,79 @@ http.StreamedResponse stringResponse( |
return new http.StreamedResponse(stream, status, headers: headers); |
} |
-buildUnnamed1468() { |
+buildUnnamed1560() { |
var o = new core.List<api.Image>(); |
o.add(buildImage()); |
o.add(buildImage()); |
return o; |
} |
-checkUnnamed1468(core.List<api.Image> o) { |
+checkUnnamed1560(core.List<api.Image> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkImage(o[0]); |
checkImage(o[1]); |
} |
-buildUnnamed1469() { |
+buildUnnamed1561() { |
var o = new core.List<api.FeatureDescription>(); |
o.add(buildFeatureDescription()); |
o.add(buildFeatureDescription()); |
return o; |
} |
-checkUnnamed1469(core.List<api.FeatureDescription> o) { |
+checkUnnamed1561(core.List<api.FeatureDescription> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkFeatureDescription(o[0]); |
checkFeatureDescription(o[1]); |
} |
-buildUnnamed1470() { |
+buildUnnamed1562() { |
var o = new core.List<core.String>(); |
o.add("foo"); |
o.add("foo"); |
return o; |
} |
-checkUnnamed1470(core.List<core.String> o) { |
+checkUnnamed1562(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')); |
} |
-buildUnnamed1471() { |
+buildUnnamed1563() { |
var o = new core.List<api.ProductDetail>(); |
o.add(buildProductDetail()); |
o.add(buildProductDetail()); |
return o; |
} |
-checkUnnamed1471(core.List<api.ProductDetail> o) { |
+checkUnnamed1563(core.List<api.ProductDetail> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkProductDetail(o[0]); |
checkProductDetail(o[1]); |
} |
-buildUnnamed1472() { |
+buildUnnamed1564() { |
var o = new core.List<core.String>(); |
o.add("foo"); |
o.add("foo"); |
return o; |
} |
-checkUnnamed1472(core.List<core.String> o) { |
+checkUnnamed1564(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')); |
} |
-buildUnnamed1473() { |
+buildUnnamed1565() { |
var o = new core.List<core.String>(); |
o.add("foo"); |
o.add("foo"); |
return o; |
} |
-checkUnnamed1473(core.List<core.String> o) { |
+checkUnnamed1565(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')); |
@@ -134,7 +134,7 @@ buildAttributes() { |
var o = new api.Attributes(); |
buildCounterAttributes++; |
if (buildCounterAttributes < 3) { |
- o.additionalImageLink = buildUnnamed1468(); |
+ o.additionalImageLink = buildUnnamed1560(); |
o.ageGroup = "foo"; |
o.brand = "foo"; |
o.capacity = buildCapacity(); |
@@ -142,21 +142,21 @@ buildAttributes() { |
o.count = buildCount(); |
o.description = "foo"; |
o.disclosureDate = "foo"; |
- o.featureDescription = buildUnnamed1469(); |
+ o.featureDescription = buildUnnamed1561(); |
o.flavor = "foo"; |
o.format = "foo"; |
o.gender = "foo"; |
- o.gtin = buildUnnamed1470(); |
+ o.gtin = buildUnnamed1562(); |
o.imageLink = buildImage(); |
o.itemGroupId = "foo"; |
o.material = "foo"; |
o.mpn = "foo"; |
o.pattern = "foo"; |
- o.productDetail = buildUnnamed1471(); |
+ o.productDetail = buildUnnamed1563(); |
o.productLine = "foo"; |
o.productName = "foo"; |
o.productPageUrl = "foo"; |
- o.productType = buildUnnamed1472(); |
+ o.productType = buildUnnamed1564(); |
o.releaseDate = "foo"; |
o.scent = "foo"; |
o.size = "foo"; |
@@ -165,7 +165,7 @@ buildAttributes() { |
o.suggestedRetailPrice = buildPrice(); |
o.theme = "foo"; |
o.title = "foo"; |
- o.videoLink = buildUnnamed1473(); |
+ o.videoLink = buildUnnamed1565(); |
} |
buildCounterAttributes--; |
return o; |
@@ -174,7 +174,7 @@ buildAttributes() { |
checkAttributes(api.Attributes o) { |
buildCounterAttributes++; |
if (buildCounterAttributes < 3) { |
- checkUnnamed1468(o.additionalImageLink); |
+ checkUnnamed1560(o.additionalImageLink); |
unittest.expect(o.ageGroup, unittest.equals('foo')); |
unittest.expect(o.brand, unittest.equals('foo')); |
checkCapacity(o.capacity); |
@@ -182,21 +182,21 @@ checkAttributes(api.Attributes o) { |
checkCount(o.count); |
unittest.expect(o.description, unittest.equals('foo')); |
unittest.expect(o.disclosureDate, unittest.equals('foo')); |
- checkUnnamed1469(o.featureDescription); |
+ checkUnnamed1561(o.featureDescription); |
unittest.expect(o.flavor, unittest.equals('foo')); |
unittest.expect(o.format, unittest.equals('foo')); |
unittest.expect(o.gender, unittest.equals('foo')); |
- checkUnnamed1470(o.gtin); |
+ checkUnnamed1562(o.gtin); |
checkImage(o.imageLink); |
unittest.expect(o.itemGroupId, unittest.equals('foo')); |
unittest.expect(o.material, unittest.equals('foo')); |
unittest.expect(o.mpn, unittest.equals('foo')); |
unittest.expect(o.pattern, unittest.equals('foo')); |
- checkUnnamed1471(o.productDetail); |
+ checkUnnamed1563(o.productDetail); |
unittest.expect(o.productLine, unittest.equals('foo')); |
unittest.expect(o.productName, unittest.equals('foo')); |
unittest.expect(o.productPageUrl, unittest.equals('foo')); |
- checkUnnamed1472(o.productType); |
+ checkUnnamed1564(o.productType); |
unittest.expect(o.releaseDate, unittest.equals('foo')); |
unittest.expect(o.scent, unittest.equals('foo')); |
unittest.expect(o.size, unittest.equals('foo')); |
@@ -205,7 +205,7 @@ checkAttributes(api.Attributes o) { |
checkPrice(o.suggestedRetailPrice); |
unittest.expect(o.theme, unittest.equals('foo')); |
unittest.expect(o.title, unittest.equals('foo')); |
- checkUnnamed1473(o.videoLink); |
+ checkUnnamed1565(o.videoLink); |
} |
buildCounterAttributes--; |
} |
@@ -252,6 +252,23 @@ checkCount(api.Count o) { |
buildCounterCount--; |
} |
+core.int buildCounterEmpty = 0; |
+buildEmpty() { |
+ var o = new api.Empty(); |
+ buildCounterEmpty++; |
+ if (buildCounterEmpty < 3) { |
+ } |
+ buildCounterEmpty--; |
+ return o; |
+} |
+ |
+checkEmpty(api.Empty o) { |
+ buildCounterEmpty++; |
+ if (buildCounterEmpty < 3) { |
+ } |
+ buildCounterEmpty--; |
+} |
+ |
core.int buildCounterFeatureDescription = 0; |
buildFeatureDescription() { |
var o = new api.FeatureDescription(); |
@@ -325,14 +342,14 @@ checkIssue(api.Issue o) { |
buildCounterIssue--; |
} |
-buildUnnamed1474() { |
+buildUnnamed1566() { |
var o = new core.List<api.Product>(); |
o.add(buildProduct()); |
o.add(buildProduct()); |
return o; |
} |
-checkUnnamed1474(core.List<api.Product> o) { |
+checkUnnamed1566(core.List<api.Product> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkProduct(o[0]); |
checkProduct(o[1]); |
@@ -344,7 +361,7 @@ buildListProductsResponse() { |
buildCounterListProductsResponse++; |
if (buildCounterListProductsResponse < 3) { |
o.nextPageToken = "foo"; |
- o.products = buildUnnamed1474(); |
+ o.products = buildUnnamed1566(); |
} |
buildCounterListProductsResponse--; |
return o; |
@@ -354,7 +371,7 @@ checkListProductsResponse(api.ListProductsResponse o) { |
buildCounterListProductsResponse++; |
if (buildCounterListProductsResponse < 3) { |
unittest.expect(o.nextPageToken, unittest.equals('foo')); |
- checkUnnamed1474(o.products); |
+ checkUnnamed1566(o.products); |
} |
buildCounterListProductsResponse--; |
} |
@@ -380,27 +397,27 @@ checkPrice(api.Price o) { |
buildCounterPrice--; |
} |
-buildUnnamed1475() { |
+buildUnnamed1567() { |
var o = new core.List<api.Issue>(); |
o.add(buildIssue()); |
o.add(buildIssue()); |
return o; |
} |
-checkUnnamed1475(core.List<api.Issue> o) { |
+checkUnnamed1567(core.List<api.Issue> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkIssue(o[0]); |
checkIssue(o[1]); |
} |
-buildUnnamed1476() { |
+buildUnnamed1568() { |
var o = new core.List<core.String>(); |
o.add("foo"); |
o.add("foo"); |
return o; |
} |
-checkUnnamed1476(core.List<core.String> o) { |
+checkUnnamed1568(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')); |
@@ -413,8 +430,8 @@ buildProduct() { |
if (buildCounterProduct < 3) { |
o.contentLanguage = "foo"; |
o.finalAttributes = buildAttributes(); |
- o.issues = buildUnnamed1475(); |
- o.manuallyDeletedAttributes = buildUnnamed1476(); |
+ o.issues = buildUnnamed1567(); |
+ o.manuallyDeletedAttributes = buildUnnamed1568(); |
o.manuallyProvidedAttributes = buildAttributes(); |
o.name = "foo"; |
o.parent = "foo"; |
@@ -431,8 +448,8 @@ checkProduct(api.Product o) { |
if (buildCounterProduct < 3) { |
unittest.expect(o.contentLanguage, unittest.equals('foo')); |
checkAttributes(o.finalAttributes); |
- checkUnnamed1475(o.issues); |
- checkUnnamed1476(o.manuallyDeletedAttributes); |
+ checkUnnamed1567(o.issues); |
+ checkUnnamed1568(o.manuallyDeletedAttributes); |
checkAttributes(o.manuallyProvidedAttributes); |
unittest.expect(o.name, unittest.equals('foo')); |
unittest.expect(o.parent, unittest.equals('foo')); |
@@ -495,6 +512,15 @@ main() { |
}); |
+ unittest.group("obj-schema-Empty", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildEmpty(); |
+ var od = new api.Empty.fromJson(o.toJson()); |
+ checkEmpty(od); |
+ }); |
+ }); |
+ |
+ |
unittest.group("obj-schema-FeatureDescription", () { |
unittest.test("to-json--from-json", () { |
var o = buildFeatureDescription(); |
@@ -559,6 +585,52 @@ main() { |
unittest.group("resource-AccountsProductsResourceApi", () { |
+ unittest.test("method--delete", () { |
+ |
+ var mock = new HttpServerMock(); |
+ api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accounts.products; |
+ var arg_parent = "foo"; |
+ var arg_name = "foo"; |
+ mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
+ pathOffset += 3; |
+ // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
+ |
+ 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])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildEmpty()); |
+ return new async.Future.value(stringResponse(200, h, resp)); |
+ }), true); |
+ res.delete(arg_parent, arg_name).then(unittest.expectAsync1(((api.Empty response) { |
+ checkEmpty(response); |
+ }))); |
+ }); |
+ |
unittest.test("method--get", () { |
var mock = new HttpServerMock(); |
@@ -654,6 +726,56 @@ main() { |
}))); |
}); |
+ unittest.test("method--update", () { |
+ |
+ var mock = new HttpServerMock(); |
+ api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accounts.products; |
+ var arg_request = buildProduct(); |
+ var arg_parent = "foo"; |
+ var arg_name = "foo"; |
+ mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
+ var obj = new api.Product.fromJson(json); |
+ checkProduct(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
+ pathOffset += 3; |
+ // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
+ |
+ 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])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildProduct()); |
+ return new async.Future.value(stringResponse(200, h, resp)); |
+ }), true); |
+ res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1(((api.Product response) { |
+ checkProduct(response); |
+ }))); |
+ }); |
+ |
}); |