| OLD | NEW |
| 1 library googleapis_beta.adexchangebuyer2.v2beta1.test; | 1 library googleapis_beta.adexchangebuyer2.v2beta1.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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 checkClientUserInvitation(api.ClientUserInvitation o) { | 125 checkClientUserInvitation(api.ClientUserInvitation o) { |
| 126 buildCounterClientUserInvitation++; | 126 buildCounterClientUserInvitation++; |
| 127 if (buildCounterClientUserInvitation < 3) { | 127 if (buildCounterClientUserInvitation < 3) { |
| 128 unittest.expect(o.clientAccountId, unittest.equals('foo')); | 128 unittest.expect(o.clientAccountId, unittest.equals('foo')); |
| 129 unittest.expect(o.email, unittest.equals('foo')); | 129 unittest.expect(o.email, unittest.equals('foo')); |
| 130 unittest.expect(o.invitationId, unittest.equals('foo')); | 130 unittest.expect(o.invitationId, unittest.equals('foo')); |
| 131 } | 131 } |
| 132 buildCounterClientUserInvitation--; | 132 buildCounterClientUserInvitation--; |
| 133 } | 133 } |
| 134 | 134 |
| 135 buildUnnamed3793() { | 135 buildUnnamed3885() { |
| 136 var o = new core.List<api.ClientUserInvitation>(); | 136 var o = new core.List<api.ClientUserInvitation>(); |
| 137 o.add(buildClientUserInvitation()); | 137 o.add(buildClientUserInvitation()); |
| 138 o.add(buildClientUserInvitation()); | 138 o.add(buildClientUserInvitation()); |
| 139 return o; | 139 return o; |
| 140 } | 140 } |
| 141 | 141 |
| 142 checkUnnamed3793(core.List<api.ClientUserInvitation> o) { | 142 checkUnnamed3885(core.List<api.ClientUserInvitation> o) { |
| 143 unittest.expect(o, unittest.hasLength(2)); | 143 unittest.expect(o, unittest.hasLength(2)); |
| 144 checkClientUserInvitation(o[0]); | 144 checkClientUserInvitation(o[0]); |
| 145 checkClientUserInvitation(o[1]); | 145 checkClientUserInvitation(o[1]); |
| 146 } | 146 } |
| 147 | 147 |
| 148 core.int buildCounterListClientUserInvitationsResponse = 0; | 148 core.int buildCounterListClientUserInvitationsResponse = 0; |
| 149 buildListClientUserInvitationsResponse() { | 149 buildListClientUserInvitationsResponse() { |
| 150 var o = new api.ListClientUserInvitationsResponse(); | 150 var o = new api.ListClientUserInvitationsResponse(); |
| 151 buildCounterListClientUserInvitationsResponse++; | 151 buildCounterListClientUserInvitationsResponse++; |
| 152 if (buildCounterListClientUserInvitationsResponse < 3) { | 152 if (buildCounterListClientUserInvitationsResponse < 3) { |
| 153 o.invitations = buildUnnamed3793(); | 153 o.invitations = buildUnnamed3885(); |
| 154 o.nextPageToken = "foo"; | 154 o.nextPageToken = "foo"; |
| 155 } | 155 } |
| 156 buildCounterListClientUserInvitationsResponse--; | 156 buildCounterListClientUserInvitationsResponse--; |
| 157 return o; | 157 return o; |
| 158 } | 158 } |
| 159 | 159 |
| 160 checkListClientUserInvitationsResponse(api.ListClientUserInvitationsResponse o)
{ | 160 checkListClientUserInvitationsResponse(api.ListClientUserInvitationsResponse o)
{ |
| 161 buildCounterListClientUserInvitationsResponse++; | 161 buildCounterListClientUserInvitationsResponse++; |
| 162 if (buildCounterListClientUserInvitationsResponse < 3) { | 162 if (buildCounterListClientUserInvitationsResponse < 3) { |
| 163 checkUnnamed3793(o.invitations); | 163 checkUnnamed3885(o.invitations); |
| 164 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 164 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 165 } | 165 } |
| 166 buildCounterListClientUserInvitationsResponse--; | 166 buildCounterListClientUserInvitationsResponse--; |
| 167 } | 167 } |
| 168 | 168 |
| 169 buildUnnamed3794() { | 169 buildUnnamed3886() { |
| 170 var o = new core.List<api.ClientUser>(); | 170 var o = new core.List<api.ClientUser>(); |
| 171 o.add(buildClientUser()); | 171 o.add(buildClientUser()); |
| 172 o.add(buildClientUser()); | 172 o.add(buildClientUser()); |
| 173 return o; | 173 return o; |
| 174 } | 174 } |
| 175 | 175 |
| 176 checkUnnamed3794(core.List<api.ClientUser> o) { | 176 checkUnnamed3886(core.List<api.ClientUser> o) { |
| 177 unittest.expect(o, unittest.hasLength(2)); | 177 unittest.expect(o, unittest.hasLength(2)); |
| 178 checkClientUser(o[0]); | 178 checkClientUser(o[0]); |
| 179 checkClientUser(o[1]); | 179 checkClientUser(o[1]); |
| 180 } | 180 } |
| 181 | 181 |
| 182 core.int buildCounterListClientUsersResponse = 0; | 182 core.int buildCounterListClientUsersResponse = 0; |
| 183 buildListClientUsersResponse() { | 183 buildListClientUsersResponse() { |
| 184 var o = new api.ListClientUsersResponse(); | 184 var o = new api.ListClientUsersResponse(); |
| 185 buildCounterListClientUsersResponse++; | 185 buildCounterListClientUsersResponse++; |
| 186 if (buildCounterListClientUsersResponse < 3) { | 186 if (buildCounterListClientUsersResponse < 3) { |
| 187 o.nextPageToken = "foo"; | 187 o.nextPageToken = "foo"; |
| 188 o.users = buildUnnamed3794(); | 188 o.users = buildUnnamed3886(); |
| 189 } | 189 } |
| 190 buildCounterListClientUsersResponse--; | 190 buildCounterListClientUsersResponse--; |
| 191 return o; | 191 return o; |
| 192 } | 192 } |
| 193 | 193 |
| 194 checkListClientUsersResponse(api.ListClientUsersResponse o) { | 194 checkListClientUsersResponse(api.ListClientUsersResponse o) { |
| 195 buildCounterListClientUsersResponse++; | 195 buildCounterListClientUsersResponse++; |
| 196 if (buildCounterListClientUsersResponse < 3) { | 196 if (buildCounterListClientUsersResponse < 3) { |
| 197 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 197 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 198 checkUnnamed3794(o.users); | 198 checkUnnamed3886(o.users); |
| 199 } | 199 } |
| 200 buildCounterListClientUsersResponse--; | 200 buildCounterListClientUsersResponse--; |
| 201 } | 201 } |
| 202 | 202 |
| 203 buildUnnamed3795() { | 203 buildUnnamed3887() { |
| 204 var o = new core.List<api.Client>(); | 204 var o = new core.List<api.Client>(); |
| 205 o.add(buildClient()); | 205 o.add(buildClient()); |
| 206 o.add(buildClient()); | 206 o.add(buildClient()); |
| 207 return o; | 207 return o; |
| 208 } | 208 } |
| 209 | 209 |
| 210 checkUnnamed3795(core.List<api.Client> o) { | 210 checkUnnamed3887(core.List<api.Client> o) { |
| 211 unittest.expect(o, unittest.hasLength(2)); | 211 unittest.expect(o, unittest.hasLength(2)); |
| 212 checkClient(o[0]); | 212 checkClient(o[0]); |
| 213 checkClient(o[1]); | 213 checkClient(o[1]); |
| 214 } | 214 } |
| 215 | 215 |
| 216 core.int buildCounterListClientsResponse = 0; | 216 core.int buildCounterListClientsResponse = 0; |
| 217 buildListClientsResponse() { | 217 buildListClientsResponse() { |
| 218 var o = new api.ListClientsResponse(); | 218 var o = new api.ListClientsResponse(); |
| 219 buildCounterListClientsResponse++; | 219 buildCounterListClientsResponse++; |
| 220 if (buildCounterListClientsResponse < 3) { | 220 if (buildCounterListClientsResponse < 3) { |
| 221 o.clients = buildUnnamed3795(); | 221 o.clients = buildUnnamed3887(); |
| 222 o.nextPageToken = "foo"; | 222 o.nextPageToken = "foo"; |
| 223 } | 223 } |
| 224 buildCounterListClientsResponse--; | 224 buildCounterListClientsResponse--; |
| 225 return o; | 225 return o; |
| 226 } | 226 } |
| 227 | 227 |
| 228 checkListClientsResponse(api.ListClientsResponse o) { | 228 checkListClientsResponse(api.ListClientsResponse o) { |
| 229 buildCounterListClientsResponse++; | 229 buildCounterListClientsResponse++; |
| 230 if (buildCounterListClientsResponse < 3) { | 230 if (buildCounterListClientsResponse < 3) { |
| 231 checkUnnamed3795(o.clients); | 231 checkUnnamed3887(o.clients); |
| 232 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 232 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 233 } | 233 } |
| 234 buildCounterListClientsResponse--; | 234 buildCounterListClientsResponse--; |
| 235 } | 235 } |
| 236 | 236 |
| 237 | 237 |
| 238 main() { | 238 main() { |
| 239 unittest.group("obj-schema-Client", () { | 239 unittest.group("obj-schema-Client", () { |
| 240 unittest.test("to-json--from-json", () { | 240 unittest.test("to-json--from-json", () { |
| 241 var o = buildClient(); | 241 var o = buildClient(); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 checkClientUserInvitation(response); | 644 checkClientUserInvitation(response); |
| 645 }))); | 645 }))); |
| 646 }); | 646 }); |
| 647 | 647 |
| 648 unittest.test("method--list", () { | 648 unittest.test("method--list", () { |
| 649 | 649 |
| 650 var mock = new HttpServerMock(); | 650 var mock = new HttpServerMock(); |
| 651 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; | 651 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; |
| 652 var arg_accountId = "foo"; | 652 var arg_accountId = "foo"; |
| 653 var arg_clientAccountId = "foo"; | 653 var arg_clientAccountId = "foo"; |
| 654 var arg_pageToken = "foo"; |
| 654 var arg_pageSize = 42; | 655 var arg_pageSize = 42; |
| 655 var arg_pageToken = "foo"; | |
| 656 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 656 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 657 var path = (req.url).path; | 657 var path = (req.url).path; |
| 658 var pathOffset = 0; | 658 var pathOffset = 0; |
| 659 var index; | 659 var index; |
| 660 var subPart; | 660 var subPart; |
| 661 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 661 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 662 pathOffset += 1; | 662 pathOffset += 1; |
| 663 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 663 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 664 pathOffset += 17; | 664 pathOffset += 17; |
| 665 index = path.indexOf("/clients/", pathOffset); | 665 index = path.indexOf("/clients/", pathOffset); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 686 if (n == "false") return false; | 686 if (n == "false") return false; |
| 687 if (n == null) return null; | 687 if (n == null) return null; |
| 688 throw new core.ArgumentError("Invalid boolean: $n"); | 688 throw new core.ArgumentError("Invalid boolean: $n"); |
| 689 } | 689 } |
| 690 if (query.length > 0) { | 690 if (query.length > 0) { |
| 691 for (var part in query.split("&")) { | 691 for (var part in query.split("&")) { |
| 692 var keyvalue = part.split("="); | 692 var keyvalue = part.split("="); |
| 693 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 693 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 696 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 697 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 697 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 698 | 698 |
| 699 | 699 |
| 700 var h = { | 700 var h = { |
| 701 "content-type" : "application/json; charset=utf-8", | 701 "content-type" : "application/json; charset=utf-8", |
| 702 }; | 702 }; |
| 703 var resp = convert.JSON.encode(buildListClientUserInvitationsResponse())
; | 703 var resp = convert.JSON.encode(buildListClientUserInvitationsResponse())
; |
| 704 return new async.Future.value(stringResponse(200, h, resp)); | 704 return new async.Future.value(stringResponse(200, h, resp)); |
| 705 }), true); | 705 }), true); |
| 706 res.list(arg_accountId, arg_clientAccountId, pageSize: arg_pageSize, pageT
oken: arg_pageToken).then(unittest.expectAsync(((api.ListClientUserInvitationsRe
sponse response) { | 706 res.list(arg_accountId, arg_clientAccountId, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListClientUserInvitationsRe
sponse response) { |
| 707 checkListClientUserInvitationsResponse(response); | 707 checkListClientUserInvitationsResponse(response); |
| 708 }))); | 708 }))); |
| 709 }); | 709 }); |
| 710 | 710 |
| 711 }); | 711 }); |
| 712 | 712 |
| 713 | 713 |
| 714 unittest.group("resource-AccountsClientsUsersResourceApi", () { | 714 unittest.group("resource-AccountsClientsUsersResourceApi", () { |
| 715 unittest.test("method--get", () { | 715 unittest.test("method--get", () { |
| 716 | 716 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 checkClientUser(response); | 774 checkClientUser(response); |
| 775 }))); | 775 }))); |
| 776 }); | 776 }); |
| 777 | 777 |
| 778 unittest.test("method--list", () { | 778 unittest.test("method--list", () { |
| 779 | 779 |
| 780 var mock = new HttpServerMock(); | 780 var mock = new HttpServerMock(); |
| 781 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; | 781 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; |
| 782 var arg_accountId = "foo"; | 782 var arg_accountId = "foo"; |
| 783 var arg_clientAccountId = "foo"; | 783 var arg_clientAccountId = "foo"; |
| 784 var arg_pageToken = "foo"; |
| 784 var arg_pageSize = 42; | 785 var arg_pageSize = 42; |
| 785 var arg_pageToken = "foo"; | |
| 786 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 786 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 787 var path = (req.url).path; | 787 var path = (req.url).path; |
| 788 var pathOffset = 0; | 788 var pathOffset = 0; |
| 789 var index; | 789 var index; |
| 790 var subPart; | 790 var subPart; |
| 791 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 791 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 792 pathOffset += 1; | 792 pathOffset += 1; |
| 793 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 793 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 794 pathOffset += 17; | 794 pathOffset += 17; |
| 795 index = path.indexOf("/clients/", pathOffset); | 795 index = path.indexOf("/clients/", pathOffset); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 816 if (n == "false") return false; | 816 if (n == "false") return false; |
| 817 if (n == null) return null; | 817 if (n == null) return null; |
| 818 throw new core.ArgumentError("Invalid boolean: $n"); | 818 throw new core.ArgumentError("Invalid boolean: $n"); |
| 819 } | 819 } |
| 820 if (query.length > 0) { | 820 if (query.length > 0) { |
| 821 for (var part in query.split("&")) { | 821 for (var part in query.split("&")) { |
| 822 var keyvalue = part.split("="); | 822 var keyvalue = part.split("="); |
| 823 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 823 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 824 } | 824 } |
| 825 } | 825 } |
| 826 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 826 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 827 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 827 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 828 | 828 |
| 829 | 829 |
| 830 var h = { | 830 var h = { |
| 831 "content-type" : "application/json; charset=utf-8", | 831 "content-type" : "application/json; charset=utf-8", |
| 832 }; | 832 }; |
| 833 var resp = convert.JSON.encode(buildListClientUsersResponse()); | 833 var resp = convert.JSON.encode(buildListClientUsersResponse()); |
| 834 return new async.Future.value(stringResponse(200, h, resp)); | 834 return new async.Future.value(stringResponse(200, h, resp)); |
| 835 }), true); | 835 }), true); |
| 836 res.list(arg_accountId, arg_clientAccountId, pageSize: arg_pageSize, pageT
oken: arg_pageToken).then(unittest.expectAsync(((api.ListClientUsersResponse res
ponse) { | 836 res.list(arg_accountId, arg_clientAccountId, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListClientUsersResponse res
ponse) { |
| 837 checkListClientUsersResponse(response); | 837 checkListClientUsersResponse(response); |
| 838 }))); | 838 }))); |
| 839 }); | 839 }); |
| 840 | 840 |
| 841 unittest.test("method--update", () { | 841 unittest.test("method--update", () { |
| 842 | 842 |
| 843 var mock = new HttpServerMock(); | 843 var mock = new HttpServerMock(); |
| 844 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; | 844 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; |
| 845 var arg_request = buildClientUser(); | 845 var arg_request = buildClientUser(); |
| 846 var arg_accountId = "foo"; | 846 var arg_accountId = "foo"; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 res.update(arg_request, arg_accountId, arg_clientAccountId, arg_userId).th
en(unittest.expectAsync(((api.ClientUser response) { | 903 res.update(arg_request, arg_accountId, arg_clientAccountId, arg_userId).th
en(unittest.expectAsync(((api.ClientUser response) { |
| 904 checkClientUser(response); | 904 checkClientUser(response); |
| 905 }))); | 905 }))); |
| 906 }); | 906 }); |
| 907 | 907 |
| 908 }); | 908 }); |
| 909 | 909 |
| 910 | 910 |
| 911 } | 911 } |
| 912 | 912 |
| OLD | NEW |