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

Unified Diff: generated/googleapis/test/androidenterprise/v1_test.dart

Issue 1268013003: Api-roll 21: 2015-08-04 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 5 years, 4 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/androidenterprise/v1_test.dart
diff --git a/generated/googleapis/test/androidenterprise/v1_test.dart b/generated/googleapis/test/androidenterprise/v1_test.dart
index ccacba86c4678d8400f079e71ee517e82261b670..6abf5f9592597ce2c5572f1089a6c664a2fd5222 100644
--- a/generated/googleapis/test/androidenterprise/v1_test.dart
+++ b/generated/googleapis/test/androidenterprise/v1_test.dart
@@ -51,14 +51,14 @@ http.StreamedResponse stringResponse(
return new http.StreamedResponse(stream, status, headers: headers);
}
-buildUnnamed1202() {
+buildUnnamed292() {
var o = new core.List<api.AppRestrictionsSchemaRestriction>();
o.add(buildAppRestrictionsSchemaRestriction());
o.add(buildAppRestrictionsSchemaRestriction());
return o;
}
-checkUnnamed1202(core.List<api.AppRestrictionsSchemaRestriction> o) {
+checkUnnamed292(core.List<api.AppRestrictionsSchemaRestriction> o) {
unittest.expect(o, unittest.hasLength(2));
checkAppRestrictionsSchemaRestriction(o[0]);
checkAppRestrictionsSchemaRestriction(o[1]);
@@ -69,7 +69,8 @@ buildAppRestrictionsSchema() {
var o = new api.AppRestrictionsSchema();
buildCounterAppRestrictionsSchema++;
if (buildCounterAppRestrictionsSchema < 3) {
- o.restrictions = buildUnnamed1202();
+ o.kind = "foo";
+ o.restrictions = buildUnnamed292();
}
buildCounterAppRestrictionsSchema--;
return o;
@@ -78,32 +79,33 @@ buildAppRestrictionsSchema() {
checkAppRestrictionsSchema(api.AppRestrictionsSchema o) {
buildCounterAppRestrictionsSchema++;
if (buildCounterAppRestrictionsSchema < 3) {
- checkUnnamed1202(o.restrictions);
+ unittest.expect(o.kind, unittest.equals('foo'));
+ checkUnnamed292(o.restrictions);
}
buildCounterAppRestrictionsSchema--;
}
-buildUnnamed1203() {
+buildUnnamed293() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
-checkUnnamed1203(core.List<core.String> o) {
+checkUnnamed293(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'));
}
-buildUnnamed1204() {
+buildUnnamed294() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
-checkUnnamed1204(core.List<core.String> o) {
+checkUnnamed294(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'));
@@ -116,8 +118,8 @@ buildAppRestrictionsSchemaRestriction() {
if (buildCounterAppRestrictionsSchemaRestriction < 3) {
o.defaultValue = buildAppRestrictionsSchemaRestrictionRestrictionValue();
o.description = "foo";
- o.entry = buildUnnamed1203();
- o.entryValue = buildUnnamed1204();
+ o.entry = buildUnnamed293();
+ o.entryValue = buildUnnamed294();
o.key = "foo";
o.restrictionType = "foo";
o.title = "foo";
@@ -131,8 +133,8 @@ checkAppRestrictionsSchemaRestriction(api.AppRestrictionsSchemaRestriction o) {
if (buildCounterAppRestrictionsSchemaRestriction < 3) {
checkAppRestrictionsSchemaRestrictionRestrictionValue(o.defaultValue);
unittest.expect(o.description, unittest.equals('foo'));
- checkUnnamed1203(o.entry);
- checkUnnamed1204(o.entryValue);
+ checkUnnamed293(o.entry);
+ checkUnnamed294(o.entryValue);
unittest.expect(o.key, unittest.equals('foo'));
unittest.expect(o.restrictionType, unittest.equals('foo'));
unittest.expect(o.title, unittest.equals('foo'));
@@ -140,14 +142,14 @@ checkAppRestrictionsSchemaRestriction(api.AppRestrictionsSchemaRestriction o) {
buildCounterAppRestrictionsSchemaRestriction--;
}
-buildUnnamed1205() {
+buildUnnamed295() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
-checkUnnamed1205(core.List<core.String> o) {
+checkUnnamed295(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'));
@@ -161,7 +163,7 @@ buildAppRestrictionsSchemaRestrictionRestrictionValue() {
o.type = "foo";
o.valueBool = true;
o.valueInteger = 42;
- o.valueMultiselect = buildUnnamed1205();
+ o.valueMultiselect = buildUnnamed295();
o.valueString = "foo";
}
buildCounterAppRestrictionsSchemaRestrictionRestrictionValue--;
@@ -174,7 +176,7 @@ checkAppRestrictionsSchemaRestrictionRestrictionValue(api.AppRestrictionsSchemaR
unittest.expect(o.type, unittest.equals('foo'));
unittest.expect(o.valueBool, unittest.isTrue);
unittest.expect(o.valueInteger, unittest.equals(42));
- checkUnnamed1205(o.valueMultiselect);
+ checkUnnamed295(o.valueMultiselect);
unittest.expect(o.valueString, unittest.equals('foo'));
}
buildCounterAppRestrictionsSchemaRestrictionRestrictionValue--;
@@ -222,14 +224,14 @@ checkApprovalUrlInfo(api.ApprovalUrlInfo o) {
buildCounterApprovalUrlInfo--;
}
-buildUnnamed1206() {
+buildUnnamed296() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
-checkUnnamed1206(core.List<core.String> o) {
+checkUnnamed296(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'));
@@ -243,7 +245,7 @@ buildCollection() {
o.collectionId = "foo";
o.kind = "foo";
o.name = "foo";
- o.productId = buildUnnamed1206();
+ o.productId = buildUnnamed296();
o.visibility = "foo";
}
buildCounterCollection--;
@@ -256,20 +258,20 @@ checkCollection(api.Collection o) {
unittest.expect(o.collectionId, unittest.equals('foo'));
unittest.expect(o.kind, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
- checkUnnamed1206(o.productId);
+ checkUnnamed296(o.productId);
unittest.expect(o.visibility, unittest.equals('foo'));
}
buildCounterCollection--;
}
-buildUnnamed1207() {
+buildUnnamed297() {
var o = new core.List<api.User>();
o.add(buildUser());
o.add(buildUser());
return o;
}
-checkUnnamed1207(core.List<api.User> o) {
+checkUnnamed297(core.List<api.User> o) {
unittest.expect(o, unittest.hasLength(2));
checkUser(o[0]);
checkUser(o[1]);
@@ -281,7 +283,7 @@ buildCollectionViewersListResponse() {
buildCounterCollectionViewersListResponse++;
if (buildCounterCollectionViewersListResponse < 3) {
o.kind = "foo";
- o.user = buildUnnamed1207();
+ o.user = buildUnnamed297();
}
buildCounterCollectionViewersListResponse--;
return o;
@@ -291,19 +293,19 @@ checkCollectionViewersListResponse(api.CollectionViewersListResponse o) {
buildCounterCollectionViewersListResponse++;
if (buildCounterCollectionViewersListResponse < 3) {
unittest.expect(o.kind, unittest.equals('foo'));
- checkUnnamed1207(o.user);
+ checkUnnamed297(o.user);
}
buildCounterCollectionViewersListResponse--;
}
-buildUnnamed1208() {
+buildUnnamed298() {
var o = new core.List<api.Collection>();
o.add(buildCollection());
o.add(buildCollection());
return o;
}
-checkUnnamed1208(core.List<api.Collection> o) {
+checkUnnamed298(core.List<api.Collection> o) {
unittest.expect(o, unittest.hasLength(2));
checkCollection(o[0]);
checkCollection(o[1]);
@@ -314,7 +316,7 @@ buildCollectionsListResponse() {
var o = new api.CollectionsListResponse();
buildCounterCollectionsListResponse++;
if (buildCounterCollectionsListResponse < 3) {
- o.collection = buildUnnamed1208();
+ o.collection = buildUnnamed298();
o.kind = "foo";
}
buildCounterCollectionsListResponse--;
@@ -324,7 +326,7 @@ buildCollectionsListResponse() {
checkCollectionsListResponse(api.CollectionsListResponse o) {
buildCounterCollectionsListResponse++;
if (buildCounterCollectionsListResponse < 3) {
- checkUnnamed1208(o.collection);
+ checkUnnamed298(o.collection);
unittest.expect(o.kind, unittest.equals('foo'));
}
buildCounterCollectionsListResponse--;
@@ -374,14 +376,14 @@ checkDeviceState(api.DeviceState o) {
buildCounterDeviceState--;
}
-buildUnnamed1209() {
+buildUnnamed299() {
var o = new core.List<api.Device>();
o.add(buildDevice());
o.add(buildDevice());
return o;
}
-checkUnnamed1209(core.List<api.Device> o) {
+checkUnnamed299(core.List<api.Device> o) {
unittest.expect(o, unittest.hasLength(2));
checkDevice(o[0]);
checkDevice(o[1]);
@@ -392,7 +394,7 @@ buildDevicesListResponse() {
var o = new api.DevicesListResponse();
buildCounterDevicesListResponse++;
if (buildCounterDevicesListResponse < 3) {
- o.device = buildUnnamed1209();
+ o.device = buildUnnamed299();
o.kind = "foo";
}
buildCounterDevicesListResponse--;
@@ -402,7 +404,7 @@ buildDevicesListResponse() {
checkDevicesListResponse(api.DevicesListResponse o) {
buildCounterDevicesListResponse++;
if (buildCounterDevicesListResponse < 3) {
- checkUnnamed1209(o.device);
+ checkUnnamed299(o.device);
unittest.expect(o.kind, unittest.equals('foo'));
}
buildCounterDevicesListResponse--;
@@ -454,14 +456,14 @@ checkEnterpriseAccount(api.EnterpriseAccount o) {
buildCounterEnterpriseAccount--;
}
-buildUnnamed1210() {
+buildUnnamed300() {
var o = new core.List<api.Enterprise>();
o.add(buildEnterprise());
o.add(buildEnterprise());
return o;
}
-checkUnnamed1210(core.List<api.Enterprise> o) {
+checkUnnamed300(core.List<api.Enterprise> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnterprise(o[0]);
checkEnterprise(o[1]);
@@ -472,7 +474,7 @@ buildEnterprisesListResponse() {
var o = new api.EnterprisesListResponse();
buildCounterEnterprisesListResponse++;
if (buildCounterEnterprisesListResponse < 3) {
- o.enterprise = buildUnnamed1210();
+ o.enterprise = buildUnnamed300();
o.kind = "foo";
}
buildCounterEnterprisesListResponse--;
@@ -482,7 +484,7 @@ buildEnterprisesListResponse() {
checkEnterprisesListResponse(api.EnterprisesListResponse o) {
buildCounterEnterprisesListResponse++;
if (buildCounterEnterprisesListResponse < 3) {
- checkUnnamed1210(o.enterprise);
+ checkUnnamed300(o.enterprise);
unittest.expect(o.kind, unittest.equals('foo'));
}
buildCounterEnterprisesListResponse--;
@@ -511,14 +513,14 @@ checkEntitlement(api.Entitlement o) {
buildCounterEntitlement--;
}
-buildUnnamed1211() {
+buildUnnamed301() {
var o = new core.List<api.Entitlement>();
o.add(buildEntitlement());
o.add(buildEntitlement());
return o;
}
-checkUnnamed1211(core.List<api.Entitlement> o) {
+checkUnnamed301(core.List<api.Entitlement> o) {
unittest.expect(o, unittest.hasLength(2));
checkEntitlement(o[0]);
checkEntitlement(o[1]);
@@ -529,7 +531,7 @@ buildEntitlementsListResponse() {
var o = new api.EntitlementsListResponse();
buildCounterEntitlementsListResponse++;
if (buildCounterEntitlementsListResponse < 3) {
- o.entitlement = buildUnnamed1211();
+ o.entitlement = buildUnnamed301();
o.kind = "foo";
}
buildCounterEntitlementsListResponse--;
@@ -539,7 +541,7 @@ buildEntitlementsListResponse() {
checkEntitlementsListResponse(api.EntitlementsListResponse o) {
buildCounterEntitlementsListResponse++;
if (buildCounterEntitlementsListResponse < 3) {
- checkUnnamed1211(o.entitlement);
+ checkUnnamed301(o.entitlement);
unittest.expect(o.kind, unittest.equals('foo'));
}
buildCounterEntitlementsListResponse--;
@@ -574,14 +576,14 @@ checkGroupLicense(api.GroupLicense o) {
buildCounterGroupLicense--;
}
-buildUnnamed1212() {
+buildUnnamed302() {
var o = new core.List<api.User>();
o.add(buildUser());
o.add(buildUser());
return o;
}
-checkUnnamed1212(core.List<api.User> o) {
+checkUnnamed302(core.List<api.User> o) {
unittest.expect(o, unittest.hasLength(2));
checkUser(o[0]);
checkUser(o[1]);
@@ -593,7 +595,7 @@ buildGroupLicenseUsersListResponse() {
buildCounterGroupLicenseUsersListResponse++;
if (buildCounterGroupLicenseUsersListResponse < 3) {
o.kind = "foo";
- o.user = buildUnnamed1212();
+ o.user = buildUnnamed302();
}
buildCounterGroupLicenseUsersListResponse--;
return o;
@@ -603,19 +605,19 @@ checkGroupLicenseUsersListResponse(api.GroupLicenseUsersListResponse o) {
buildCounterGroupLicenseUsersListResponse++;
if (buildCounterGroupLicenseUsersListResponse < 3) {
unittest.expect(o.kind, unittest.equals('foo'));
- checkUnnamed1212(o.user);
+ checkUnnamed302(o.user);
}
buildCounterGroupLicenseUsersListResponse--;
}
-buildUnnamed1213() {
+buildUnnamed303() {
var o = new core.List<api.GroupLicense>();
o.add(buildGroupLicense());
o.add(buildGroupLicense());
return o;
}
-checkUnnamed1213(core.List<api.GroupLicense> o) {
+checkUnnamed303(core.List<api.GroupLicense> o) {
unittest.expect(o, unittest.hasLength(2));
checkGroupLicense(o[0]);
checkGroupLicense(o[1]);
@@ -626,7 +628,7 @@ buildGroupLicensesListResponse() {
var o = new api.GroupLicensesListResponse();
buildCounterGroupLicensesListResponse++;
if (buildCounterGroupLicensesListResponse < 3) {
- o.groupLicense = buildUnnamed1213();
+ o.groupLicense = buildUnnamed303();
o.kind = "foo";
}
buildCounterGroupLicensesListResponse--;
@@ -636,7 +638,7 @@ buildGroupLicensesListResponse() {
checkGroupLicensesListResponse(api.GroupLicensesListResponse o) {
buildCounterGroupLicensesListResponse++;
if (buildCounterGroupLicensesListResponse < 3) {
- checkUnnamed1213(o.groupLicense);
+ checkUnnamed303(o.groupLicense);
unittest.expect(o.kind, unittest.equals('foo'));
}
buildCounterGroupLicensesListResponse--;
@@ -667,14 +669,14 @@ checkInstall(api.Install o) {
buildCounterInstall--;
}
-buildUnnamed1214() {
+buildUnnamed304() {
var o = new core.List<api.Install>();
o.add(buildInstall());
o.add(buildInstall());
return o;
}
-checkUnnamed1214(core.List<api.Install> o) {
+checkUnnamed304(core.List<api.Install> o) {
unittest.expect(o, unittest.hasLength(2));
checkInstall(o[0]);
checkInstall(o[1]);
@@ -685,7 +687,7 @@ buildInstallsListResponse() {
var o = new api.InstallsListResponse();
buildCounterInstallsListResponse++;
if (buildCounterInstallsListResponse < 3) {
- o.install = buildUnnamed1214();
+ o.install = buildUnnamed304();
o.kind = "foo";
}
buildCounterInstallsListResponse--;
@@ -695,7 +697,7 @@ buildInstallsListResponse() {
checkInstallsListResponse(api.InstallsListResponse o) {
buildCounterInstallsListResponse++;
if (buildCounterInstallsListResponse < 3) {
- checkUnnamed1214(o.install);
+ checkUnnamed304(o.install);
unittest.expect(o.kind, unittest.equals('foo'));
}
buildCounterInstallsListResponse--;
@@ -726,14 +728,14 @@ checkPermission(api.Permission o) {
buildCounterPermission--;
}
-buildUnnamed1215() {
+buildUnnamed305() {
var o = new core.List<api.AppVersion>();
o.add(buildAppVersion());
o.add(buildAppVersion());
return o;
}
-checkUnnamed1215(core.List<api.AppVersion> o) {
+checkUnnamed305(core.List<api.AppVersion> o) {
unittest.expect(o, unittest.hasLength(2));
checkAppVersion(o[0]);
checkAppVersion(o[1]);
@@ -744,7 +746,7 @@ buildProduct() {
var o = new api.Product();
buildCounterProduct++;
if (buildCounterProduct < 3) {
- o.appVersion = buildUnnamed1215();
+ o.appVersion = buildUnnamed305();
o.authorName = "foo";
o.detailsUrl = "foo";
o.distributionChannel = "foo";
@@ -762,7 +764,7 @@ buildProduct() {
checkProduct(api.Product o) {
buildCounterProduct++;
if (buildCounterProduct < 3) {
- checkUnnamed1215(o.appVersion);
+ checkUnnamed305(o.appVersion);
unittest.expect(o.authorName, unittest.equals('foo'));
unittest.expect(o.detailsUrl, unittest.equals('foo'));
unittest.expect(o.distributionChannel, unittest.equals('foo'));
@@ -797,14 +799,14 @@ checkProductPermission(api.ProductPermission o) {
buildCounterProductPermission--;
}
-buildUnnamed1216() {
+buildUnnamed306() {
var o = new core.List<api.ProductPermission>();
o.add(buildProductPermission());
o.add(buildProductPermission());
return o;
}
-checkUnnamed1216(core.List<api.ProductPermission> o) {
+checkUnnamed306(core.List<api.ProductPermission> o) {
unittest.expect(o, unittest.hasLength(2));
checkProductPermission(o[0]);
checkProductPermission(o[1]);
@@ -816,7 +818,7 @@ buildProductPermissions() {
buildCounterProductPermissions++;
if (buildCounterProductPermissions < 3) {
o.kind = "foo";
- o.permission = buildUnnamed1216();
+ o.permission = buildUnnamed306();
o.productId = "foo";
}
buildCounterProductPermissions--;
@@ -827,12 +829,46 @@ checkProductPermissions(api.ProductPermissions o) {
buildCounterProductPermissions++;
if (buildCounterProductPermissions < 3) {
unittest.expect(o.kind, unittest.equals('foo'));
- checkUnnamed1216(o.permission);
+ checkUnnamed306(o.permission);
unittest.expect(o.productId, unittest.equals('foo'));
}
buildCounterProductPermissions--;
}
+buildUnnamed307() {
+ var o = new core.List<core.String>();
+ o.add("foo");
+ o.add("foo");
+ return o;
+}
+
+checkUnnamed307(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'));
+}
+
+core.int buildCounterProductSet = 0;
+buildProductSet() {
+ var o = new api.ProductSet();
+ buildCounterProductSet++;
+ if (buildCounterProductSet < 3) {
+ o.kind = "foo";
+ o.productId = buildUnnamed307();
+ }
+ buildCounterProductSet--;
+ return o;
+}
+
+checkProductSet(api.ProductSet o) {
+ buildCounterProductSet++;
+ if (buildCounterProductSet < 3) {
+ unittest.expect(o.kind, unittest.equals('foo'));
+ checkUnnamed307(o.productId);
+ }
+ buildCounterProductSet--;
+}
+
core.int buildCounterProductsApproveRequest = 0;
buildProductsApproveRequest() {
var o = new api.ProductsApproveRequest();
@@ -917,14 +953,14 @@ checkUserToken(api.UserToken o) {
buildCounterUserToken--;
}
-buildUnnamed1217() {
+buildUnnamed308() {
var o = new core.List<api.User>();
o.add(buildUser());
o.add(buildUser());
return o;
}
-checkUnnamed1217(core.List<api.User> o) {
+checkUnnamed308(core.List<api.User> o) {
unittest.expect(o, unittest.hasLength(2));
checkUser(o[0]);
checkUser(o[1]);
@@ -936,7 +972,7 @@ buildUsersListResponse() {
buildCounterUsersListResponse++;
if (buildCounterUsersListResponse < 3) {
o.kind = "foo";
- o.user = buildUnnamed1217();
+ o.user = buildUnnamed308();
}
buildCounterUsersListResponse--;
return o;
@@ -946,7 +982,7 @@ checkUsersListResponse(api.UsersListResponse o) {
buildCounterUsersListResponse++;
if (buildCounterUsersListResponse < 3) {
unittest.expect(o.kind, unittest.equals('foo'));
- checkUnnamed1217(o.user);
+ checkUnnamed308(o.user);
}
buildCounterUsersListResponse--;
}
@@ -1178,6 +1214,15 @@ main() {
});
+ unittest.group("obj-schema-ProductSet", () {
+ unittest.test("to-json--from-json", () {
+ var o = buildProductSet();
+ var od = new api.ProductSet.fromJson(o.toJson());
+ checkProductSet(od);
+ });
+ });
+
+
unittest.group("obj-schema-ProductsApproveRequest", () {
unittest.test("to-json--from-json", () {
var o = buildProductsApproveRequest();
@@ -3968,6 +4013,67 @@ main() {
})));
});
+ unittest.test("method--getAvailableProductSet", () {
+
+ var mock = new HttpServerMock();
+ api.UsersResourceApi res = new api.AndroidenterpriseApi(mock).users;
+ var arg_enterpriseId = "foo";
+ var arg_userId = "foo";
+ 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 + 1), unittest.equals("/"));
+ pathOffset += 1;
+ unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.equals("androidenterprise/v1/"));
+ pathOffset += 21;
+ unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("enterprises/"));
+ pathOffset += 12;
+ index = path.indexOf("/users/", pathOffset);
+ unittest.expect(index >= 0, unittest.isTrue);
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
+ pathOffset = index;
+ unittest.expect(subPart, unittest.equals("$arg_enterpriseId"));
+ unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("/users/"));
+ pathOffset += 7;
+ index = path.indexOf("/availableProductSet", pathOffset);
+ unittest.expect(index >= 0, unittest.isTrue);
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
+ pathOffset = index;
+ unittest.expect(subPart, unittest.equals("$arg_userId"));
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("/availableProductSet"));
+ pathOffset += 20;
+
+ 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(buildProductSet());
+ return new async.Future.value(stringResponse(200, h, resp));
+ }), true);
+ res.getAvailableProductSet(arg_enterpriseId, arg_userId).then(unittest.expectAsync(((api.ProductSet response) {
+ checkProductSet(response);
+ })));
+ });
+
unittest.test("method--list", () {
var mock = new HttpServerMock();
@@ -4082,6 +4188,71 @@ main() {
res.revokeToken(arg_enterpriseId, arg_userId).then(unittest.expectAsync((_) {}));
});
+ unittest.test("method--setAvailableProductSet", () {
+
+ var mock = new HttpServerMock();
+ api.UsersResourceApi res = new api.AndroidenterpriseApi(mock).users;
+ var arg_request = buildProductSet();
+ var arg_enterpriseId = "foo";
+ var arg_userId = "foo";
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) {
+ var obj = new api.ProductSet.fromJson(json);
+ checkProductSet(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 + 21), unittest.equals("androidenterprise/v1/"));
+ pathOffset += 21;
+ unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("enterprises/"));
+ pathOffset += 12;
+ index = path.indexOf("/users/", pathOffset);
+ unittest.expect(index >= 0, unittest.isTrue);
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
+ pathOffset = index;
+ unittest.expect(subPart, unittest.equals("$arg_enterpriseId"));
+ unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("/users/"));
+ pathOffset += 7;
+ index = path.indexOf("/availableProductSet", pathOffset);
+ unittest.expect(index >= 0, unittest.isTrue);
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
+ pathOffset = index;
+ unittest.expect(subPart, unittest.equals("$arg_userId"));
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("/availableProductSet"));
+ pathOffset += 20;
+
+ 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(buildProductSet());
+ return new async.Future.value(stringResponse(200, h, resp));
+ }), true);
+ res.setAvailableProductSet(arg_request, arg_enterpriseId, arg_userId).then(unittest.expectAsync(((api.ProductSet response) {
+ checkProductSet(response);
+ })));
+ });
+
});

Powered by Google App Engine
This is Rietveld 408576698