| library googleapis.adexchangebuyer.v1_3.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/adexchangebuyer/v1_3.dart' as api; |
| |
| |
| |
| core.int buildCounterAccountBidderLocation = 0; |
| buildAccountBidderLocation() { |
| var o = new api.AccountBidderLocation(); |
| buildCounterAccountBidderLocation++; |
| if (buildCounterAccountBidderLocation < 3) { |
| o.maximumQps = 42; |
| o.region = "foo"; |
| o.url = "foo"; |
| } |
| buildCounterAccountBidderLocation--; |
| return o; |
| } |
| |
| checkAccountBidderLocation(api.AccountBidderLocation o) { |
| buildCounterAccountBidderLocation++; |
| if (buildCounterAccountBidderLocation < 3) { |
| unittest.expect(o.maximumQps, unittest.equals(42)); |
| unittest.expect(o.region, unittest.equals('foo')); |
| unittest.expect(o.url, unittest.equals('foo')); |
| } |
| buildCounterAccountBidderLocation--; |
| } |
| |
| buildUnnamed0() { |
| var o = new core.List<api.AccountBidderLocation>(); |
| o.add(buildAccountBidderLocation()); |
| o.add(buildAccountBidderLocation()); |
| return o; |
| } |
| |
| checkUnnamed0(core.List<api.AccountBidderLocation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAccountBidderLocation(o[0]); |
| checkAccountBidderLocation(o[1]); |
| } |
| |
| core.int buildCounterAccount = 0; |
| buildAccount() { |
| var o = new api.Account(); |
| buildCounterAccount++; |
| if (buildCounterAccount < 3) { |
| o.bidderLocation = buildUnnamed0(); |
| o.cookieMatchingNid = "foo"; |
| o.cookieMatchingUrl = "foo"; |
| o.id = 42; |
| o.kind = "foo"; |
| o.maximumActiveCreatives = 42; |
| o.maximumTotalQps = 42; |
| o.numberActiveCreatives = 42; |
| } |
| buildCounterAccount--; |
| return o; |
| } |
| |
| checkAccount(api.Account o) { |
| buildCounterAccount++; |
| if (buildCounterAccount < 3) { |
| checkUnnamed0(o.bidderLocation); |
| unittest.expect(o.cookieMatchingNid, unittest.equals('foo')); |
| unittest.expect(o.cookieMatchingUrl, unittest.equals('foo')); |
| unittest.expect(o.id, unittest.equals(42)); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| unittest.expect(o.maximumActiveCreatives, unittest.equals(42)); |
| unittest.expect(o.maximumTotalQps, unittest.equals(42)); |
| unittest.expect(o.numberActiveCreatives, unittest.equals(42)); |
| } |
| buildCounterAccount--; |
| } |
| |
| buildUnnamed1() { |
| var o = new core.List<api.Account>(); |
| o.add(buildAccount()); |
| o.add(buildAccount()); |
| return o; |
| } |
| |
| checkUnnamed1(core.List<api.Account> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAccount(o[0]); |
| checkAccount(o[1]); |
| } |
| |
| core.int buildCounterAccountsList = 0; |
| buildAccountsList() { |
| var o = new api.AccountsList(); |
| buildCounterAccountsList++; |
| if (buildCounterAccountsList < 3) { |
| o.items = buildUnnamed1(); |
| o.kind = "foo"; |
| } |
| buildCounterAccountsList--; |
| return o; |
| } |
| |
| checkAccountsList(api.AccountsList o) { |
| buildCounterAccountsList++; |
| if (buildCounterAccountsList < 3) { |
| checkUnnamed1(o.items); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterAccountsList--; |
| } |
| |
| buildUnnamed2() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2(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 buildCounterBillingInfo = 0; |
| buildBillingInfo() { |
| var o = new api.BillingInfo(); |
| buildCounterBillingInfo++; |
| if (buildCounterBillingInfo < 3) { |
| o.accountId = 42; |
| o.accountName = "foo"; |
| o.billingId = buildUnnamed2(); |
| o.kind = "foo"; |
| } |
| buildCounterBillingInfo--; |
| return o; |
| } |
| |
| checkBillingInfo(api.BillingInfo o) { |
| buildCounterBillingInfo++; |
| if (buildCounterBillingInfo < 3) { |
| unittest.expect(o.accountId, unittest.equals(42)); |
| unittest.expect(o.accountName, unittest.equals('foo')); |
| checkUnnamed2(o.billingId); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterBillingInfo--; |
| } |
| |
| buildUnnamed3() { |
| var o = new core.List<api.BillingInfo>(); |
| o.add(buildBillingInfo()); |
| o.add(buildBillingInfo()); |
| return o; |
| } |
| |
| checkUnnamed3(core.List<api.BillingInfo> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBillingInfo(o[0]); |
| checkBillingInfo(o[1]); |
| } |
| |
| core.int buildCounterBillingInfoList = 0; |
| buildBillingInfoList() { |
| var o = new api.BillingInfoList(); |
| buildCounterBillingInfoList++; |
| if (buildCounterBillingInfoList < 3) { |
| o.items = buildUnnamed3(); |
| o.kind = "foo"; |
| } |
| buildCounterBillingInfoList--; |
| return o; |
| } |
| |
| checkBillingInfoList(api.BillingInfoList o) { |
| buildCounterBillingInfoList++; |
| if (buildCounterBillingInfoList < 3) { |
| checkUnnamed3(o.items); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterBillingInfoList--; |
| } |
| |
| buildUnnamed4() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed4(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')); |
| } |
| |
| buildUnnamed5() { |
| var o = new core.List<core.int>(); |
| o.add(42); |
| o.add(42); |
| return o; |
| } |
| |
| checkUnnamed5(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| buildUnnamed6() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed6(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')); |
| } |
| |
| buildUnnamed7() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed7(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 buildCounterCreativeCorrections = 0; |
| buildCreativeCorrections() { |
| var o = new api.CreativeCorrections(); |
| buildCounterCreativeCorrections++; |
| if (buildCounterCreativeCorrections < 3) { |
| o.details = buildUnnamed7(); |
| o.reason = "foo"; |
| } |
| buildCounterCreativeCorrections--; |
| return o; |
| } |
| |
| checkCreativeCorrections(api.CreativeCorrections o) { |
| buildCounterCreativeCorrections++; |
| if (buildCounterCreativeCorrections < 3) { |
| checkUnnamed7(o.details); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| } |
| buildCounterCreativeCorrections--; |
| } |
| |
| buildUnnamed8() { |
| var o = new core.List<api.CreativeCorrections>(); |
| o.add(buildCreativeCorrections()); |
| o.add(buildCreativeCorrections()); |
| return o; |
| } |
| |
| checkUnnamed8(core.List<api.CreativeCorrections> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCreativeCorrections(o[0]); |
| checkCreativeCorrections(o[1]); |
| } |
| |
| buildUnnamed9() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed9(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 buildCounterCreativeDisapprovalReasons = 0; |
| buildCreativeDisapprovalReasons() { |
| var o = new api.CreativeDisapprovalReasons(); |
| buildCounterCreativeDisapprovalReasons++; |
| if (buildCounterCreativeDisapprovalReasons < 3) { |
| o.details = buildUnnamed9(); |
| o.reason = "foo"; |
| } |
| buildCounterCreativeDisapprovalReasons--; |
| return o; |
| } |
| |
| checkCreativeDisapprovalReasons(api.CreativeDisapprovalReasons o) { |
| buildCounterCreativeDisapprovalReasons++; |
| if (buildCounterCreativeDisapprovalReasons < 3) { |
| checkUnnamed9(o.details); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| } |
| buildCounterCreativeDisapprovalReasons--; |
| } |
| |
| buildUnnamed10() { |
| var o = new core.List<api.CreativeDisapprovalReasons>(); |
| o.add(buildCreativeDisapprovalReasons()); |
| o.add(buildCreativeDisapprovalReasons()); |
| return o; |
| } |
| |
| checkUnnamed10(core.List<api.CreativeDisapprovalReasons> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCreativeDisapprovalReasons(o[0]); |
| checkCreativeDisapprovalReasons(o[1]); |
| } |
| |
| core.int buildCounterCreativeFilteringReasonsReasons = 0; |
| buildCreativeFilteringReasonsReasons() { |
| var o = new api.CreativeFilteringReasonsReasons(); |
| buildCounterCreativeFilteringReasonsReasons++; |
| if (buildCounterCreativeFilteringReasonsReasons < 3) { |
| o.filteringCount = "foo"; |
| o.filteringStatus = 42; |
| } |
| buildCounterCreativeFilteringReasonsReasons--; |
| return o; |
| } |
| |
| checkCreativeFilteringReasonsReasons(api.CreativeFilteringReasonsReasons o) { |
| buildCounterCreativeFilteringReasonsReasons++; |
| if (buildCounterCreativeFilteringReasonsReasons < 3) { |
| unittest.expect(o.filteringCount, unittest.equals('foo')); |
| unittest.expect(o.filteringStatus, unittest.equals(42)); |
| } |
| buildCounterCreativeFilteringReasonsReasons--; |
| } |
| |
| buildUnnamed11() { |
| var o = new core.List<api.CreativeFilteringReasonsReasons>(); |
| o.add(buildCreativeFilteringReasonsReasons()); |
| o.add(buildCreativeFilteringReasonsReasons()); |
| return o; |
| } |
| |
| checkUnnamed11(core.List<api.CreativeFilteringReasonsReasons> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCreativeFilteringReasonsReasons(o[0]); |
| checkCreativeFilteringReasonsReasons(o[1]); |
| } |
| |
| core.int buildCounterCreativeFilteringReasons = 0; |
| buildCreativeFilteringReasons() { |
| var o = new api.CreativeFilteringReasons(); |
| buildCounterCreativeFilteringReasons++; |
| if (buildCounterCreativeFilteringReasons < 3) { |
| o.date = "foo"; |
| o.reasons = buildUnnamed11(); |
| } |
| buildCounterCreativeFilteringReasons--; |
| return o; |
| } |
| |
| checkCreativeFilteringReasons(api.CreativeFilteringReasons o) { |
| buildCounterCreativeFilteringReasons++; |
| if (buildCounterCreativeFilteringReasons < 3) { |
| unittest.expect(o.date, unittest.equals('foo')); |
| checkUnnamed11(o.reasons); |
| } |
| buildCounterCreativeFilteringReasons--; |
| } |
| |
| buildUnnamed12() { |
| var o = new core.List<core.int>(); |
| o.add(42); |
| o.add(42); |
| return o; |
| } |
| |
| checkUnnamed12(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| buildUnnamed13() { |
| var o = new core.List<core.int>(); |
| o.add(42); |
| o.add(42); |
| return o; |
| } |
| |
| checkUnnamed13(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| buildUnnamed14() { |
| var o = new core.List<core.int>(); |
| o.add(42); |
| o.add(42); |
| return o; |
| } |
| |
| checkUnnamed14(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| buildUnnamed15() { |
| var o = new core.List<core.int>(); |
| o.add(42); |
| o.add(42); |
| return o; |
| } |
| |
| checkUnnamed15(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| core.int buildCounterCreative = 0; |
| buildCreative() { |
| var o = new api.Creative(); |
| buildCounterCreative++; |
| if (buildCounterCreative < 3) { |
| o.HTMLSnippet = "foo"; |
| o.accountId = 42; |
| o.advertiserId = buildUnnamed4(); |
| o.advertiserName = "foo"; |
| o.agencyId = "foo"; |
| o.attribute = buildUnnamed5(); |
| o.buyerCreativeId = "foo"; |
| o.clickThroughUrl = buildUnnamed6(); |
| o.corrections = buildUnnamed8(); |
| o.disapprovalReasons = buildUnnamed10(); |
| o.filteringReasons = buildCreativeFilteringReasons(); |
| o.height = 42; |
| o.kind = "foo"; |
| o.productCategories = buildUnnamed12(); |
| o.restrictedCategories = buildUnnamed13(); |
| o.sensitiveCategories = buildUnnamed14(); |
| o.status = "foo"; |
| o.vendorType = buildUnnamed15(); |
| o.videoURL = "foo"; |
| o.width = 42; |
| } |
| buildCounterCreative--; |
| return o; |
| } |
| |
| checkCreative(api.Creative o) { |
| buildCounterCreative++; |
| if (buildCounterCreative < 3) { |
| unittest.expect(o.HTMLSnippet, unittest.equals('foo')); |
| unittest.expect(o.accountId, unittest.equals(42)); |
| checkUnnamed4(o.advertiserId); |
| unittest.expect(o.advertiserName, unittest.equals('foo')); |
| unittest.expect(o.agencyId, unittest.equals('foo')); |
| checkUnnamed5(o.attribute); |
| unittest.expect(o.buyerCreativeId, unittest.equals('foo')); |
| checkUnnamed6(o.clickThroughUrl); |
| checkUnnamed8(o.corrections); |
| checkUnnamed10(o.disapprovalReasons); |
| checkCreativeFilteringReasons(o.filteringReasons); |
| unittest.expect(o.height, unittest.equals(42)); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkUnnamed12(o.productCategories); |
| checkUnnamed13(o.restrictedCategories); |
| checkUnnamed14(o.sensitiveCategories); |
| unittest.expect(o.status, unittest.equals('foo')); |
| checkUnnamed15(o.vendorType); |
| unittest.expect(o.videoURL, unittest.equals('foo')); |
| unittest.expect(o.width, unittest.equals(42)); |
| } |
| buildCounterCreative--; |
| } |
| |
| buildUnnamed16() { |
| var o = new core.List<api.Creative>(); |
| o.add(buildCreative()); |
| o.add(buildCreative()); |
| return o; |
| } |
| |
| checkUnnamed16(core.List<api.Creative> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCreative(o[0]); |
| checkCreative(o[1]); |
| } |
| |
| core.int buildCounterCreativesList = 0; |
| buildCreativesList() { |
| var o = new api.CreativesList(); |
| buildCounterCreativesList++; |
| if (buildCounterCreativesList < 3) { |
| o.items = buildUnnamed16(); |
| o.kind = "foo"; |
| o.nextPageToken = "foo"; |
| } |
| buildCounterCreativesList--; |
| return o; |
| } |
| |
| checkCreativesList(api.CreativesList o) { |
| buildCounterCreativesList++; |
| if (buildCounterCreativesList < 3) { |
| checkUnnamed16(o.items); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterCreativesList--; |
| } |
| |
| core.int buildCounterDirectDeal = 0; |
| buildDirectDeal() { |
| var o = new api.DirectDeal(); |
| buildCounterDirectDeal++; |
| if (buildCounterDirectDeal < 3) { |
| o.accountId = 42; |
| o.advertiser = "foo"; |
| o.currencyCode = "foo"; |
| o.endTime = "foo"; |
| o.fixedCpm = "foo"; |
| o.id = "foo"; |
| o.kind = "foo"; |
| o.name = "foo"; |
| o.privateExchangeMinCpm = "foo"; |
| o.publisherBlocksOverriden = true; |
| o.sellerNetwork = "foo"; |
| o.startTime = "foo"; |
| } |
| buildCounterDirectDeal--; |
| return o; |
| } |
| |
| checkDirectDeal(api.DirectDeal o) { |
| buildCounterDirectDeal++; |
| if (buildCounterDirectDeal < 3) { |
| unittest.expect(o.accountId, unittest.equals(42)); |
| unittest.expect(o.advertiser, unittest.equals('foo')); |
| unittest.expect(o.currencyCode, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.fixedCpm, unittest.equals('foo')); |
| unittest.expect(o.id, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.privateExchangeMinCpm, unittest.equals('foo')); |
| unittest.expect(o.publisherBlocksOverriden, unittest.isTrue); |
| unittest.expect(o.sellerNetwork, unittest.equals('foo')); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| } |
| buildCounterDirectDeal--; |
| } |
| |
| buildUnnamed17() { |
| var o = new core.List<api.DirectDeal>(); |
| o.add(buildDirectDeal()); |
| o.add(buildDirectDeal()); |
| return o; |
| } |
| |
| checkUnnamed17(core.List<api.DirectDeal> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDirectDeal(o[0]); |
| checkDirectDeal(o[1]); |
| } |
| |
| core.int buildCounterDirectDealsList = 0; |
| buildDirectDealsList() { |
| var o = new api.DirectDealsList(); |
| buildCounterDirectDealsList++; |
| if (buildCounterDirectDealsList < 3) { |
| o.directDeals = buildUnnamed17(); |
| o.kind = "foo"; |
| } |
| buildCounterDirectDealsList--; |
| return o; |
| } |
| |
| checkDirectDealsList(api.DirectDealsList o) { |
| buildCounterDirectDealsList++; |
| if (buildCounterDirectDealsList < 3) { |
| checkUnnamed17(o.directDeals); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterDirectDealsList--; |
| } |
| |
| buildUnnamed18() { |
| var o = new core.List<core.Object>(); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| return o; |
| } |
| |
| checkUnnamed18(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); |
| var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed19() { |
| var o = new core.List<core.Object>(); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| return o; |
| } |
| |
| checkUnnamed19(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o[0]) as core.Map; unittest.expect(casted3, unittest.hasLength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); |
| var casted4 = (o[1]) as core.Map; unittest.expect(casted4, unittest.hasLength(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed20() { |
| var o = new core.List<core.Object>(); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| return o; |
| } |
| |
| checkUnnamed20(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted5 = (o[0]) as core.Map; unittest.expect(casted5, unittest.hasLength(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo')); |
| var casted6 = (o[1]) as core.Map; unittest.expect(casted6, unittest.hasLength(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed21() { |
| var o = new core.List<core.Object>(); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| return o; |
| } |
| |
| checkUnnamed21(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted7 = (o[0]) as core.Map; unittest.expect(casted7, unittest.hasLength(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.expect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"], unittest.equals('foo')); |
| var casted8 = (o[1]) as core.Map; unittest.expect(casted8, unittest.hasLength(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.expect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPerformanceReport = 0; |
| buildPerformanceReport() { |
| var o = new api.PerformanceReport(); |
| buildCounterPerformanceReport++; |
| if (buildCounterPerformanceReport < 3) { |
| o.calloutStatusRate = buildUnnamed18(); |
| o.cookieMatcherStatusRate = buildUnnamed19(); |
| o.creativeStatusRate = buildUnnamed20(); |
| o.hostedMatchStatusRate = buildUnnamed21(); |
| o.kind = "foo"; |
| o.latency50thPercentile = 42.0; |
| o.latency85thPercentile = 42.0; |
| o.latency95thPercentile = 42.0; |
| o.noQuotaInRegion = 42.0; |
| o.outOfQuota = 42.0; |
| o.pixelMatchRequests = 42.0; |
| o.pixelMatchResponses = 42.0; |
| o.quotaConfiguredLimit = 42.0; |
| o.quotaThrottledLimit = 42.0; |
| o.region = "foo"; |
| o.timestamp = "foo"; |
| } |
| buildCounterPerformanceReport--; |
| return o; |
| } |
| |
| checkPerformanceReport(api.PerformanceReport o) { |
| buildCounterPerformanceReport++; |
| if (buildCounterPerformanceReport < 3) { |
| checkUnnamed18(o.calloutStatusRate); |
| checkUnnamed19(o.cookieMatcherStatusRate); |
| checkUnnamed20(o.creativeStatusRate); |
| checkUnnamed21(o.hostedMatchStatusRate); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| unittest.expect(o.latency50thPercentile, unittest.equals(42.0)); |
| unittest.expect(o.latency85thPercentile, unittest.equals(42.0)); |
| unittest.expect(o.latency95thPercentile, unittest.equals(42.0)); |
| unittest.expect(o.noQuotaInRegion, unittest.equals(42.0)); |
| unittest.expect(o.outOfQuota, unittest.equals(42.0)); |
| unittest.expect(o.pixelMatchRequests, unittest.equals(42.0)); |
| unittest.expect(o.pixelMatchResponses, unittest.equals(42.0)); |
| unittest.expect(o.quotaConfiguredLimit, unittest.equals(42.0)); |
| unittest.expect(o.quotaThrottledLimit, unittest.equals(42.0)); |
| unittest.expect(o.region, unittest.equals('foo')); |
| unittest.expect(o.timestamp, unittest.equals('foo')); |
| } |
| buildCounterPerformanceReport--; |
| } |
| |
| buildUnnamed22() { |
| var o = new core.List<api.PerformanceReport>(); |
| o.add(buildPerformanceReport()); |
| o.add(buildPerformanceReport()); |
| return o; |
| } |
| |
| checkUnnamed22(core.List<api.PerformanceReport> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPerformanceReport(o[0]); |
| checkPerformanceReport(o[1]); |
| } |
| |
| core.int buildCounterPerformanceReportList = 0; |
| buildPerformanceReportList() { |
| var o = new api.PerformanceReportList(); |
| buildCounterPerformanceReportList++; |
| if (buildCounterPerformanceReportList < 3) { |
| o.kind = "foo"; |
| o.performanceReport = buildUnnamed22(); |
| } |
| buildCounterPerformanceReportList--; |
| return o; |
| } |
| |
| checkPerformanceReportList(api.PerformanceReportList o) { |
| buildCounterPerformanceReportList++; |
| if (buildCounterPerformanceReportList < 3) { |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkUnnamed22(o.performanceReport); |
| } |
| buildCounterPerformanceReportList--; |
| } |
| |
| buildUnnamed23() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed23(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 buildCounterPretargetingConfigDimensions = 0; |
| buildPretargetingConfigDimensions() { |
| var o = new api.PretargetingConfigDimensions(); |
| buildCounterPretargetingConfigDimensions++; |
| if (buildCounterPretargetingConfigDimensions < 3) { |
| o.height = "foo"; |
| o.width = "foo"; |
| } |
| buildCounterPretargetingConfigDimensions--; |
| return o; |
| } |
| |
| checkPretargetingConfigDimensions(api.PretargetingConfigDimensions o) { |
| buildCounterPretargetingConfigDimensions++; |
| if (buildCounterPretargetingConfigDimensions < 3) { |
| unittest.expect(o.height, unittest.equals('foo')); |
| unittest.expect(o.width, unittest.equals('foo')); |
| } |
| buildCounterPretargetingConfigDimensions--; |
| } |
| |
| buildUnnamed24() { |
| var o = new core.List<api.PretargetingConfigDimensions>(); |
| o.add(buildPretargetingConfigDimensions()); |
| o.add(buildPretargetingConfigDimensions()); |
| return o; |
| } |
| |
| checkUnnamed24(core.List<api.PretargetingConfigDimensions> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPretargetingConfigDimensions(o[0]); |
| checkPretargetingConfigDimensions(o[1]); |
| } |
| |
| buildUnnamed25() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed25(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')); |
| } |
| |
| buildUnnamed26() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed26(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 buildCounterPretargetingConfigExcludedPlacements = 0; |
| buildPretargetingConfigExcludedPlacements() { |
| var o = new api.PretargetingConfigExcludedPlacements(); |
| buildCounterPretargetingConfigExcludedPlacements++; |
| if (buildCounterPretargetingConfigExcludedPlacements < 3) { |
| o.token = "foo"; |
| o.type = "foo"; |
| } |
| buildCounterPretargetingConfigExcludedPlacements--; |
| return o; |
| } |
| |
| checkPretargetingConfigExcludedPlacements(api.PretargetingConfigExcludedPlacements o) { |
| buildCounterPretargetingConfigExcludedPlacements++; |
| if (buildCounterPretargetingConfigExcludedPlacements < 3) { |
| unittest.expect(o.token, unittest.equals('foo')); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterPretargetingConfigExcludedPlacements--; |
| } |
| |
| buildUnnamed27() { |
| var o = new core.List<api.PretargetingConfigExcludedPlacements>(); |
| o.add(buildPretargetingConfigExcludedPlacements()); |
| o.add(buildPretargetingConfigExcludedPlacements()); |
| return o; |
| } |
| |
| checkUnnamed27(core.List<api.PretargetingConfigExcludedPlacements> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPretargetingConfigExcludedPlacements(o[0]); |
| checkPretargetingConfigExcludedPlacements(o[1]); |
| } |
| |
| buildUnnamed28() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed28(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')); |
| } |
| |
| buildUnnamed29() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed29(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')); |
| } |
| |
| buildUnnamed30() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed30(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')); |
| } |
| |
| buildUnnamed31() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed31(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')); |
| } |
| |
| buildUnnamed32() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed32(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')); |
| } |
| |
| buildUnnamed33() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed33(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')); |
| } |
| |
| buildUnnamed34() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed34(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 buildCounterPretargetingConfigPlacements = 0; |
| buildPretargetingConfigPlacements() { |
| var o = new api.PretargetingConfigPlacements(); |
| buildCounterPretargetingConfigPlacements++; |
| if (buildCounterPretargetingConfigPlacements < 3) { |
| o.token = "foo"; |
| o.type = "foo"; |
| } |
| buildCounterPretargetingConfigPlacements--; |
| return o; |
| } |
| |
| checkPretargetingConfigPlacements(api.PretargetingConfigPlacements o) { |
| buildCounterPretargetingConfigPlacements++; |
| if (buildCounterPretargetingConfigPlacements < 3) { |
| unittest.expect(o.token, unittest.equals('foo')); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterPretargetingConfigPlacements--; |
| } |
| |
| buildUnnamed35() { |
| var o = new core.List<api.PretargetingConfigPlacements>(); |
| o.add(buildPretargetingConfigPlacements()); |
| o.add(buildPretargetingConfigPlacements()); |
| return o; |
| } |
| |
| checkUnnamed35(core.List<api.PretargetingConfigPlacements> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPretargetingConfigPlacements(o[0]); |
| checkPretargetingConfigPlacements(o[1]); |
| } |
| |
| buildUnnamed36() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed36(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')); |
| } |
| |
| buildUnnamed37() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed37(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')); |
| } |
| |
| buildUnnamed38() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed38(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')); |
| } |
| |
| buildUnnamed39() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed39(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')); |
| } |
| |
| buildUnnamed40() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed40(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 buildCounterPretargetingConfig = 0; |
| buildPretargetingConfig() { |
| var o = new api.PretargetingConfig(); |
| buildCounterPretargetingConfig++; |
| if (buildCounterPretargetingConfig < 3) { |
| o.billingId = "foo"; |
| o.configId = "foo"; |
| o.configName = "foo"; |
| o.creativeType = buildUnnamed23(); |
| o.dimensions = buildUnnamed24(); |
| o.excludedContentLabels = buildUnnamed25(); |
| o.excludedGeoCriteriaIds = buildUnnamed26(); |
| o.excludedPlacements = buildUnnamed27(); |
| o.excludedUserLists = buildUnnamed28(); |
| o.excludedVerticals = buildUnnamed29(); |
| o.geoCriteriaIds = buildUnnamed30(); |
| o.isActive = true; |
| o.kind = "foo"; |
| o.languages = buildUnnamed31(); |
| o.mobileCarriers = buildUnnamed32(); |
| o.mobileDevices = buildUnnamed33(); |
| o.mobileOperatingSystemVersions = buildUnnamed34(); |
| o.placements = buildUnnamed35(); |
| o.platforms = buildUnnamed36(); |
| o.supportedCreativeAttributes = buildUnnamed37(); |
| o.userLists = buildUnnamed38(); |
| o.vendorTypes = buildUnnamed39(); |
| o.verticals = buildUnnamed40(); |
| } |
| buildCounterPretargetingConfig--; |
| return o; |
| } |
| |
| checkPretargetingConfig(api.PretargetingConfig o) { |
| buildCounterPretargetingConfig++; |
| if (buildCounterPretargetingConfig < 3) { |
| unittest.expect(o.billingId, unittest.equals('foo')); |
| unittest.expect(o.configId, unittest.equals('foo')); |
| unittest.expect(o.configName, unittest.equals('foo')); |
| checkUnnamed23(o.creativeType); |
| checkUnnamed24(o.dimensions); |
| checkUnnamed25(o.excludedContentLabels); |
| checkUnnamed26(o.excludedGeoCriteriaIds); |
| checkUnnamed27(o.excludedPlacements); |
| checkUnnamed28(o.excludedUserLists); |
| checkUnnamed29(o.excludedVerticals); |
| checkUnnamed30(o.geoCriteriaIds); |
| unittest.expect(o.isActive, unittest.isTrue); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkUnnamed31(o.languages); |
| checkUnnamed32(o.mobileCarriers); |
| checkUnnamed33(o.mobileDevices); |
| checkUnnamed34(o.mobileOperatingSystemVersions); |
| checkUnnamed35(o.placements); |
| checkUnnamed36(o.platforms); |
| checkUnnamed37(o.supportedCreativeAttributes); |
| checkUnnamed38(o.userLists); |
| checkUnnamed39(o.vendorTypes); |
| checkUnnamed40(o.verticals); |
| } |
| buildCounterPretargetingConfig--; |
| } |
| |
| buildUnnamed41() { |
| var o = new core.List<api.PretargetingConfig>(); |
| o.add(buildPretargetingConfig()); |
| o.add(buildPretargetingConfig()); |
| return o; |
| } |
| |
| checkUnnamed41(core.List<api.PretargetingConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPretargetingConfig(o[0]); |
| checkPretargetingConfig(o[1]); |
| } |
| |
| core.int buildCounterPretargetingConfigList = 0; |
| buildPretargetingConfigList() { |
| var o = new api.PretargetingConfigList(); |
| buildCounterPretargetingConfigList++; |
| if (buildCounterPretargetingConfigList < 3) { |
| o.items = buildUnnamed41(); |
| o.kind = "foo"; |
| } |
| buildCounterPretargetingConfigList--; |
| return o; |
| } |
| |
| checkPretargetingConfigList(api.PretargetingConfigList o) { |
| buildCounterPretargetingConfigList++; |
| if (buildCounterPretargetingConfigList < 3) { |
| checkUnnamed41(o.items); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterPretargetingConfigList--; |
| } |
| |
| buildUnnamed42() { |
| var o = new core.List<core.int>(); |
| o.add(42); |
| o.add(42); |
| return o; |
| } |
| |
| checkUnnamed42(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| buildUnnamed43() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed43(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-AccountBidderLocation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAccountBidderLocation(); |
| var od = new api.AccountBidderLocation.fromJson(o.toJson()); |
| checkAccountBidderLocation(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Account", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAccount(); |
| var od = new api.Account.fromJson(o.toJson()); |
| checkAccount(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-AccountsList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAccountsList(); |
| var od = new api.AccountsList.fromJson(o.toJson()); |
| checkAccountsList(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-BillingInfo", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBillingInfo(); |
| var od = new api.BillingInfo.fromJson(o.toJson()); |
| checkBillingInfo(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-BillingInfoList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBillingInfoList(); |
| var od = new api.BillingInfoList.fromJson(o.toJson()); |
| checkBillingInfoList(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-CreativeCorrections", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreativeCorrections(); |
| var od = new api.CreativeCorrections.fromJson(o.toJson()); |
| checkCreativeCorrections(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-CreativeDisapprovalReasons", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreativeDisapprovalReasons(); |
| var od = new api.CreativeDisapprovalReasons.fromJson(o.toJson()); |
| checkCreativeDisapprovalReasons(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-CreativeFilteringReasonsReasons", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreativeFilteringReasonsReasons(); |
| var od = new api.CreativeFilteringReasonsReasons.fromJson(o.toJson()); |
| checkCreativeFilteringReasonsReasons(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-CreativeFilteringReasons", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreativeFilteringReasons(); |
| var od = new api.CreativeFilteringReasons.fromJson(o.toJson()); |
| checkCreativeFilteringReasons(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Creative", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreative(); |
| var od = new api.Creative.fromJson(o.toJson()); |
| checkCreative(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-CreativesList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreativesList(); |
| var od = new api.CreativesList.fromJson(o.toJson()); |
| checkCreativesList(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-DirectDeal", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDirectDeal(); |
| var od = new api.DirectDeal.fromJson(o.toJson()); |
| checkDirectDeal(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-DirectDealsList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDirectDealsList(); |
| var od = new api.DirectDealsList.fromJson(o.toJson()); |
| checkDirectDealsList(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PerformanceReport", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPerformanceReport(); |
| var od = new api.PerformanceReport.fromJson(o.toJson()); |
| checkPerformanceReport(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PerformanceReportList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPerformanceReportList(); |
| var od = new api.PerformanceReportList.fromJson(o.toJson()); |
| checkPerformanceReportList(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PretargetingConfigDimensions", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPretargetingConfigDimensions(); |
| var od = new api.PretargetingConfigDimensions.fromJson(o.toJson()); |
| checkPretargetingConfigDimensions(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PretargetingConfigExcludedPlacements", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPretargetingConfigExcludedPlacements(); |
| var od = new api.PretargetingConfigExcludedPlacements.fromJson(o.toJson()); |
| checkPretargetingConfigExcludedPlacements(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PretargetingConfigPlacements", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPretargetingConfigPlacements(); |
| var od = new api.PretargetingConfigPlacements.fromJson(o.toJson()); |
| checkPretargetingConfigPlacements(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PretargetingConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPretargetingConfig(); |
| var od = new api.PretargetingConfig.fromJson(o.toJson()); |
| checkPretargetingConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PretargetingConfigList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPretargetingConfigList(); |
| var od = new api.PretargetingConfigList.fromJson(o.toJson()); |
| checkPretargetingConfigList(od); |
| }); |
| }); |
| |
| |
| unittest.group("resource-AccountsResourceApi", () { |
| unittest.test("method--get", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
| var arg_id = 42; |
| 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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("accounts/")); |
| pathOffset += 9; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_id")); |
| |
| 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(buildAccount()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_id).then(unittest.expectAsync(((api.Account response) { |
| checkAccount(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
| 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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("accounts")); |
| pathOffset += 8; |
| |
| 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(buildAccountsList()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.list().then(unittest.expectAsync(((api.AccountsList response) { |
| checkAccountsList(response); |
| }))); |
| }); |
| |
| unittest.test("method--patch", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
| var arg_request = buildAccount(); |
| var arg_id = 42; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.Account.fromJson(json); |
| checkAccount(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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("accounts/")); |
| pathOffset += 9; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_id")); |
| |
| 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(buildAccount()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.Account response) { |
| checkAccount(response); |
| }))); |
| }); |
| |
| unittest.test("method--update", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
| var arg_request = buildAccount(); |
| var arg_id = 42; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.Account.fromJson(json); |
| checkAccount(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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("accounts/")); |
| pathOffset += 9; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_id")); |
| |
| 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(buildAccount()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Account response) { |
| checkAccount(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-BillingInfoResourceApi", () { |
| unittest.test("method--get", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.BillingInfoResourceApi res = new api.AdexchangebuyerApi(mock).billingInfo; |
| var arg_accountId = 42; |
| 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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("billinginfo/")); |
| pathOffset += 12; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| |
| 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(buildBillingInfo()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_accountId).then(unittest.expectAsync(((api.BillingInfo response) { |
| checkBillingInfo(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.BillingInfoResourceApi res = new api.AdexchangebuyerApi(mock).billingInfo; |
| 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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("billinginfo")); |
| pathOffset += 11; |
| |
| 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(buildBillingInfoList()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.list().then(unittest.expectAsync(((api.BillingInfoList response) { |
| checkBillingInfoList(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-CreativesResourceApi", () { |
| unittest.test("method--get", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; |
| var arg_accountId = 42; |
| var arg_buyerCreativeId = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("creatives/")); |
| pathOffset += 10; |
| index = path.indexOf("/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_buyerCreativeId")); |
| |
| 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(buildCreative()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_accountId, arg_buyerCreativeId).then(unittest.expectAsync(((api.Creative response) { |
| checkCreative(response); |
| }))); |
| }); |
| |
| unittest.test("method--insert", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; |
| var arg_request = buildCreative(); |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.Creative.fromJson(json); |
| checkCreative(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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("creatives")); |
| 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])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildCreative()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.insert(arg_request).then(unittest.expectAsync(((api.Creative response) { |
| checkCreative(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; |
| var arg_accountId = buildUnnamed42(); |
| var arg_buyerCreativeId = buildUnnamed43(); |
| var arg_maxResults = 42; |
| var arg_pageToken = "foo"; |
| var arg_statusFilter = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("creatives")); |
| 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(queryMap["accountId"].map(core.int.parse).toList(), unittest.equals(arg_accountId)); |
| unittest.expect(queryMap["buyerCreativeId"], unittest.equals(arg_buyerCreativeId)); |
| unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["statusFilter"].first, unittest.equals(arg_statusFilter)); |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildCreativesList()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.list(accountId: arg_accountId, buyerCreativeId: arg_buyerCreativeId, maxResults: arg_maxResults, pageToken: arg_pageToken, statusFilter: arg_statusFilter).then(unittest.expectAsync(((api.CreativesList response) { |
| checkCreativesList(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-DirectDealsResourceApi", () { |
| unittest.test("method--get", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.DirectDealsResourceApi res = new api.AdexchangebuyerApi(mock).directDeals; |
| var arg_id = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("directdeals/")); |
| pathOffset += 12; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_id")); |
| |
| 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(buildDirectDeal()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_id).then(unittest.expectAsync(((api.DirectDeal response) { |
| checkDirectDeal(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.DirectDealsResourceApi res = new api.AdexchangebuyerApi(mock).directDeals; |
| 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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("directdeals")); |
| pathOffset += 11; |
| |
| 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(buildDirectDealsList()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.list().then(unittest.expectAsync(((api.DirectDealsList response) { |
| checkDirectDealsList(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-PerformanceReportResourceApi", () { |
| unittest.test("method--list", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PerformanceReportResourceApi res = new api.AdexchangebuyerApi(mock).performanceReport; |
| var arg_accountId = "foo"; |
| var arg_endDateTime = "foo"; |
| var arg_startDateTime = "foo"; |
| var arg_maxResults = 42; |
| var arg_pageToken = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.equals("performancereport")); |
| pathOffset += 17; |
| |
| 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["accountId"].first, unittest.equals(arg_accountId)); |
| unittest.expect(queryMap["endDateTime"].first, unittest.equals(arg_endDateTime)); |
| unittest.expect(queryMap["startDateTime"].first, unittest.equals(arg_startDateTime)); |
| unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
| unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildPerformanceReportList()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.list(arg_accountId, arg_endDateTime, arg_startDateTime, maxResults: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PerformanceReportList response) { |
| checkPerformanceReportList(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-PretargetingConfigResourceApi", () { |
| unittest.test("method--delete", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
| var arg_accountId = "foo"; |
| var arg_configId = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
| pathOffset += 20; |
| index = path.indexOf("/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_configId")); |
| |
| 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 = ""; |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.delete(arg_accountId, arg_configId).then(unittest.expectAsync((_) {})); |
| }); |
| |
| unittest.test("method--get", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
| var arg_accountId = "foo"; |
| var arg_configId = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
| pathOffset += 20; |
| index = path.indexOf("/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_configId")); |
| |
| 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(buildPretargetingConfig()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_accountId, arg_configId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
| checkPretargetingConfig(response); |
| }))); |
| }); |
| |
| unittest.test("method--insert", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
| var arg_request = buildPretargetingConfig(); |
| var arg_accountId = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.PretargetingConfig.fromJson(json); |
| checkPretargetingConfig(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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
| pathOffset += 20; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| |
| 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(buildPretargetingConfig()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.insert(arg_request, arg_accountId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
| checkPretargetingConfig(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
| var arg_accountId = "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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
| pathOffset += 20; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| |
| 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(buildPretargetingConfigList()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.list(arg_accountId).then(unittest.expectAsync(((api.PretargetingConfigList response) { |
| checkPretargetingConfigList(response); |
| }))); |
| }); |
| |
| unittest.test("method--patch", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
| var arg_request = buildPretargetingConfig(); |
| var arg_accountId = "foo"; |
| var arg_configId = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.PretargetingConfig.fromJson(json); |
| checkPretargetingConfig(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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
| pathOffset += 20; |
| index = path.indexOf("/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_configId")); |
| |
| 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(buildPretargetingConfig()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.patch(arg_request, arg_accountId, arg_configId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
| checkPretargetingConfig(response); |
| }))); |
| }); |
| |
| unittest.test("method--update", () { |
| |
| var mock = new common_test.HttpServerMock(); |
| api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
| var arg_request = buildPretargetingConfig(); |
| var arg_accountId = "foo"; |
| var arg_configId = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.PretargetingConfig.fromJson(json); |
| checkPretargetingConfig(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("adexchangebuyer/v1.3/")); |
| pathOffset += 21; |
| unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
| pathOffset += 20; |
| index = path.indexOf("/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_configId")); |
| |
| 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(buildPretargetingConfig()); |
| return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| }), true); |
| res.update(arg_request, arg_accountId, arg_configId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
| checkPretargetingConfig(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| } |
| |