| library googleapis.content.v2sandbox.test; |
| |
| import "dart:core" as core; |
| import "dart:async" as async; |
| import "dart:convert" as convert; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import 'package:googleapis/content/v2sandbox.dart' as api; |
| |
| class HttpServerMock extends http.BaseClient { |
| core.Function _callback; |
| core.bool _expectJson; |
| |
| void register(core.Function callback, core.bool expectJson) { |
| _callback = callback; |
| _expectJson = expectJson; |
| } |
| |
| async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| if (_expectJson) { |
| return request |
| .finalize() |
| .transform(convert.UTF8.decoder) |
| .join('') |
| .then((core.String jsonString) { |
| if (jsonString.isEmpty) { |
| return _callback(request, null); |
| } else { |
| return _callback(request, convert.JSON.decode(jsonString)); |
| } |
| }); |
| } else { |
| var stream = request.finalize(); |
| if (stream == null) { |
| return _callback(request, []); |
| } else { |
| return stream.toBytes().then((data) { |
| return _callback(request, data); |
| }); |
| } |
| } |
| } |
| } |
| |
| http.StreamedResponse stringResponse(core.int status, |
| core.Map<core.String, core.String> headers, core.String body) { |
| var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| return new http.StreamedResponse(stream, status, headers: headers); |
| } |
| |
| core.int buildCounterError = 0; |
| buildError() { |
| var o = new api.Error(); |
| buildCounterError++; |
| if (buildCounterError < 3) { |
| o.domain = "foo"; |
| o.message = "foo"; |
| o.reason = "foo"; |
| } |
| buildCounterError--; |
| return o; |
| } |
| |
| checkError(api.Error o) { |
| buildCounterError++; |
| if (buildCounterError < 3) { |
| unittest.expect(o.domain, unittest.equals('foo')); |
| unittest.expect(o.message, unittest.equals('foo')); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| } |
| buildCounterError--; |
| } |
| |
| buildUnnamed1558() { |
| var o = new core.List<api.Error>(); |
| o.add(buildError()); |
| o.add(buildError()); |
| return o; |
| } |
| |
| checkUnnamed1558(core.List<api.Error> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkError(o[0]); |
| checkError(o[1]); |
| } |
| |
| core.int buildCounterErrors = 0; |
| buildErrors() { |
| var o = new api.Errors(); |
| buildCounterErrors++; |
| if (buildCounterErrors < 3) { |
| o.code = 42; |
| o.errors = buildUnnamed1558(); |
| o.message = "foo"; |
| } |
| buildCounterErrors--; |
| return o; |
| } |
| |
| checkErrors(api.Errors o) { |
| buildCounterErrors++; |
| if (buildCounterErrors < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed1558(o.errors); |
| unittest.expect(o.message, unittest.equals('foo')); |
| } |
| buildCounterErrors--; |
| } |
| |
| buildUnnamed1559() { |
| var o = new core.List<api.OrderLineItem>(); |
| o.add(buildOrderLineItem()); |
| o.add(buildOrderLineItem()); |
| return o; |
| } |
| |
| checkUnnamed1559(core.List<api.OrderLineItem> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderLineItem(o[0]); |
| checkOrderLineItem(o[1]); |
| } |
| |
| buildUnnamed1560() { |
| var o = new core.List<api.OrderPromotion>(); |
| o.add(buildOrderPromotion()); |
| o.add(buildOrderPromotion()); |
| return o; |
| } |
| |
| checkUnnamed1560(core.List<api.OrderPromotion> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderPromotion(o[0]); |
| checkOrderPromotion(o[1]); |
| } |
| |
| buildUnnamed1561() { |
| var o = new core.List<api.OrderRefund>(); |
| o.add(buildOrderRefund()); |
| o.add(buildOrderRefund()); |
| return o; |
| } |
| |
| checkUnnamed1561(core.List<api.OrderRefund> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderRefund(o[0]); |
| checkOrderRefund(o[1]); |
| } |
| |
| buildUnnamed1562() { |
| var o = new core.List<api.OrderShipment>(); |
| o.add(buildOrderShipment()); |
| o.add(buildOrderShipment()); |
| return o; |
| } |
| |
| checkUnnamed1562(core.List<api.OrderShipment> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderShipment(o[0]); |
| checkOrderShipment(o[1]); |
| } |
| |
| core.int buildCounterOrder = 0; |
| buildOrder() { |
| var o = new api.Order(); |
| buildCounterOrder++; |
| if (buildCounterOrder < 3) { |
| o.acknowledged = true; |
| o.channelType = "foo"; |
| o.customer = buildOrderCustomer(); |
| o.deliveryDetails = buildOrderDeliveryDetails(); |
| o.id = "foo"; |
| o.kind = "foo"; |
| o.lineItems = buildUnnamed1559(); |
| o.merchantId = "foo"; |
| o.merchantOrderId = "foo"; |
| o.netAmount = buildPrice(); |
| o.paymentMethod = buildOrderPaymentMethod(); |
| o.paymentStatus = "foo"; |
| o.placedDate = "foo"; |
| o.promotions = buildUnnamed1560(); |
| o.refunds = buildUnnamed1561(); |
| o.shipments = buildUnnamed1562(); |
| o.shippingCost = buildPrice(); |
| o.shippingCostTax = buildPrice(); |
| o.shippingOption = "foo"; |
| o.status = "foo"; |
| } |
| buildCounterOrder--; |
| return o; |
| } |
| |
| checkOrder(api.Order o) { |
| buildCounterOrder++; |
| if (buildCounterOrder < 3) { |
| unittest.expect(o.acknowledged, unittest.isTrue); |
| unittest.expect(o.channelType, unittest.equals('foo')); |
| checkOrderCustomer(o.customer); |
| checkOrderDeliveryDetails(o.deliveryDetails); |
| unittest.expect(o.id, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkUnnamed1559(o.lineItems); |
| unittest.expect(o.merchantId, unittest.equals('foo')); |
| unittest.expect(o.merchantOrderId, unittest.equals('foo')); |
| checkPrice(o.netAmount); |
| checkOrderPaymentMethod(o.paymentMethod); |
| unittest.expect(o.paymentStatus, unittest.equals('foo')); |
| unittest.expect(o.placedDate, unittest.equals('foo')); |
| checkUnnamed1560(o.promotions); |
| checkUnnamed1561(o.refunds); |
| checkUnnamed1562(o.shipments); |
| checkPrice(o.shippingCost); |
| checkPrice(o.shippingCostTax); |
| unittest.expect(o.shippingOption, unittest.equals('foo')); |
| unittest.expect(o.status, unittest.equals('foo')); |
| } |
| buildCounterOrder--; |
| } |
| |
| buildUnnamed1563() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed1563(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')); |
| } |
| |
| buildUnnamed1564() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed1564(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterOrderAddress = 0; |
| buildOrderAddress() { |
| var o = new api.OrderAddress(); |
| buildCounterOrderAddress++; |
| if (buildCounterOrderAddress < 3) { |
| o.country = "foo"; |
| o.fullAddress = buildUnnamed1563(); |
| o.isPostOfficeBox = true; |
| o.locality = "foo"; |
| o.postalCode = "foo"; |
| o.recipientName = "foo"; |
| o.region = "foo"; |
| o.streetAddress = buildUnnamed1564(); |
| } |
| buildCounterOrderAddress--; |
| return o; |
| } |
| |
| checkOrderAddress(api.OrderAddress o) { |
| buildCounterOrderAddress++; |
| if (buildCounterOrderAddress < 3) { |
| unittest.expect(o.country, unittest.equals('foo')); |
| checkUnnamed1563(o.fullAddress); |
| unittest.expect(o.isPostOfficeBox, unittest.isTrue); |
| unittest.expect(o.locality, unittest.equals('foo')); |
| unittest.expect(o.postalCode, unittest.equals('foo')); |
| unittest.expect(o.recipientName, unittest.equals('foo')); |
| unittest.expect(o.region, unittest.equals('foo')); |
| checkUnnamed1564(o.streetAddress); |
| } |
| buildCounterOrderAddress--; |
| } |
| |
| core.int buildCounterOrderCancellation = 0; |
| buildOrderCancellation() { |
| var o = new api.OrderCancellation(); |
| buildCounterOrderCancellation++; |
| if (buildCounterOrderCancellation < 3) { |
| o.actor = "foo"; |
| o.creationDate = "foo"; |
| o.quantity = 42; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrderCancellation--; |
| return o; |
| } |
| |
| checkOrderCancellation(api.OrderCancellation o) { |
| buildCounterOrderCancellation++; |
| if (buildCounterOrderCancellation < 3) { |
| unittest.expect(o.actor, unittest.equals('foo')); |
| unittest.expect(o.creationDate, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrderCancellation--; |
| } |
| |
| core.int buildCounterOrderCustomer = 0; |
| buildOrderCustomer() { |
| var o = new api.OrderCustomer(); |
| buildCounterOrderCustomer++; |
| if (buildCounterOrderCustomer < 3) { |
| o.email = "foo"; |
| o.explicitMarketingPreference = true; |
| o.fullName = "foo"; |
| } |
| buildCounterOrderCustomer--; |
| return o; |
| } |
| |
| checkOrderCustomer(api.OrderCustomer o) { |
| buildCounterOrderCustomer++; |
| if (buildCounterOrderCustomer < 3) { |
| unittest.expect(o.email, unittest.equals('foo')); |
| unittest.expect(o.explicitMarketingPreference, unittest.isTrue); |
| unittest.expect(o.fullName, unittest.equals('foo')); |
| } |
| buildCounterOrderCustomer--; |
| } |
| |
| core.int buildCounterOrderDeliveryDetails = 0; |
| buildOrderDeliveryDetails() { |
| var o = new api.OrderDeliveryDetails(); |
| buildCounterOrderDeliveryDetails++; |
| if (buildCounterOrderDeliveryDetails < 3) { |
| o.address = buildOrderAddress(); |
| o.phoneNumber = "foo"; |
| } |
| buildCounterOrderDeliveryDetails--; |
| return o; |
| } |
| |
| checkOrderDeliveryDetails(api.OrderDeliveryDetails o) { |
| buildCounterOrderDeliveryDetails++; |
| if (buildCounterOrderDeliveryDetails < 3) { |
| checkOrderAddress(o.address); |
| unittest.expect(o.phoneNumber, unittest.equals('foo')); |
| } |
| buildCounterOrderDeliveryDetails--; |
| } |
| |
| buildUnnamed1565() { |
| var o = new core.List<api.OrderCancellation>(); |
| o.add(buildOrderCancellation()); |
| o.add(buildOrderCancellation()); |
| return o; |
| } |
| |
| checkUnnamed1565(core.List<api.OrderCancellation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderCancellation(o[0]); |
| checkOrderCancellation(o[1]); |
| } |
| |
| buildUnnamed1566() { |
| var o = new core.List<api.OrderReturn>(); |
| o.add(buildOrderReturn()); |
| o.add(buildOrderReturn()); |
| return o; |
| } |
| |
| checkUnnamed1566(core.List<api.OrderReturn> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderReturn(o[0]); |
| checkOrderReturn(o[1]); |
| } |
| |
| core.int buildCounterOrderLineItem = 0; |
| buildOrderLineItem() { |
| var o = new api.OrderLineItem(); |
| buildCounterOrderLineItem++; |
| if (buildCounterOrderLineItem < 3) { |
| o.cancellations = buildUnnamed1565(); |
| o.id = "foo"; |
| o.price = buildPrice(); |
| o.product = buildOrderLineItemProduct(); |
| o.quantityCanceled = 42; |
| o.quantityDelivered = 42; |
| o.quantityOrdered = 42; |
| o.quantityPending = 42; |
| o.quantityReturned = 42; |
| o.quantityShipped = 42; |
| o.returnInfo = buildOrderLineItemReturnInfo(); |
| o.returns = buildUnnamed1566(); |
| o.shippingDetails = buildOrderLineItemShippingDetails(); |
| o.tax = buildPrice(); |
| } |
| buildCounterOrderLineItem--; |
| return o; |
| } |
| |
| checkOrderLineItem(api.OrderLineItem o) { |
| buildCounterOrderLineItem++; |
| if (buildCounterOrderLineItem < 3) { |
| checkUnnamed1565(o.cancellations); |
| unittest.expect(o.id, unittest.equals('foo')); |
| checkPrice(o.price); |
| checkOrderLineItemProduct(o.product); |
| unittest.expect(o.quantityCanceled, unittest.equals(42)); |
| unittest.expect(o.quantityDelivered, unittest.equals(42)); |
| unittest.expect(o.quantityOrdered, unittest.equals(42)); |
| unittest.expect(o.quantityPending, unittest.equals(42)); |
| unittest.expect(o.quantityReturned, unittest.equals(42)); |
| unittest.expect(o.quantityShipped, unittest.equals(42)); |
| checkOrderLineItemReturnInfo(o.returnInfo); |
| checkUnnamed1566(o.returns); |
| checkOrderLineItemShippingDetails(o.shippingDetails); |
| checkPrice(o.tax); |
| } |
| buildCounterOrderLineItem--; |
| } |
| |
| buildUnnamed1567() { |
| var o = new core.List<api.OrderLineItemProductVariantAttribute>(); |
| o.add(buildOrderLineItemProductVariantAttribute()); |
| o.add(buildOrderLineItemProductVariantAttribute()); |
| return o; |
| } |
| |
| checkUnnamed1567(core.List<api.OrderLineItemProductVariantAttribute> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderLineItemProductVariantAttribute(o[0]); |
| checkOrderLineItemProductVariantAttribute(o[1]); |
| } |
| |
| core.int buildCounterOrderLineItemProduct = 0; |
| buildOrderLineItemProduct() { |
| var o = new api.OrderLineItemProduct(); |
| buildCounterOrderLineItemProduct++; |
| if (buildCounterOrderLineItemProduct < 3) { |
| o.brand = "foo"; |
| o.channel = "foo"; |
| o.condition = "foo"; |
| o.contentLanguage = "foo"; |
| o.gtin = "foo"; |
| o.id = "foo"; |
| o.imageLink = "foo"; |
| o.itemGroupId = "foo"; |
| o.mpn = "foo"; |
| o.offerId = "foo"; |
| o.price = buildPrice(); |
| o.shownImage = "foo"; |
| o.targetCountry = "foo"; |
| o.title = "foo"; |
| o.variantAttributes = buildUnnamed1567(); |
| } |
| buildCounterOrderLineItemProduct--; |
| return o; |
| } |
| |
| checkOrderLineItemProduct(api.OrderLineItemProduct o) { |
| buildCounterOrderLineItemProduct++; |
| if (buildCounterOrderLineItemProduct < 3) { |
| unittest.expect(o.brand, unittest.equals('foo')); |
| unittest.expect(o.channel, unittest.equals('foo')); |
| unittest.expect(o.condition, unittest.equals('foo')); |
| unittest.expect(o.contentLanguage, unittest.equals('foo')); |
| unittest.expect(o.gtin, unittest.equals('foo')); |
| unittest.expect(o.id, unittest.equals('foo')); |
| unittest.expect(o.imageLink, unittest.equals('foo')); |
| unittest.expect(o.itemGroupId, unittest.equals('foo')); |
| unittest.expect(o.mpn, unittest.equals('foo')); |
| unittest.expect(o.offerId, unittest.equals('foo')); |
| checkPrice(o.price); |
| unittest.expect(o.shownImage, unittest.equals('foo')); |
| unittest.expect(o.targetCountry, unittest.equals('foo')); |
| unittest.expect(o.title, unittest.equals('foo')); |
| checkUnnamed1567(o.variantAttributes); |
| } |
| buildCounterOrderLineItemProduct--; |
| } |
| |
| core.int buildCounterOrderLineItemProductVariantAttribute = 0; |
| buildOrderLineItemProductVariantAttribute() { |
| var o = new api.OrderLineItemProductVariantAttribute(); |
| buildCounterOrderLineItemProductVariantAttribute++; |
| if (buildCounterOrderLineItemProductVariantAttribute < 3) { |
| o.dimension = "foo"; |
| o.value = "foo"; |
| } |
| buildCounterOrderLineItemProductVariantAttribute--; |
| return o; |
| } |
| |
| checkOrderLineItemProductVariantAttribute( |
| api.OrderLineItemProductVariantAttribute o) { |
| buildCounterOrderLineItemProductVariantAttribute++; |
| if (buildCounterOrderLineItemProductVariantAttribute < 3) { |
| unittest.expect(o.dimension, unittest.equals('foo')); |
| unittest.expect(o.value, unittest.equals('foo')); |
| } |
| buildCounterOrderLineItemProductVariantAttribute--; |
| } |
| |
| core.int buildCounterOrderLineItemReturnInfo = 0; |
| buildOrderLineItemReturnInfo() { |
| var o = new api.OrderLineItemReturnInfo(); |
| buildCounterOrderLineItemReturnInfo++; |
| if (buildCounterOrderLineItemReturnInfo < 3) { |
| o.daysToReturn = 42; |
| o.isReturnable = true; |
| o.policyUrl = "foo"; |
| } |
| buildCounterOrderLineItemReturnInfo--; |
| return o; |
| } |
| |
| checkOrderLineItemReturnInfo(api.OrderLineItemReturnInfo o) { |
| buildCounterOrderLineItemReturnInfo++; |
| if (buildCounterOrderLineItemReturnInfo < 3) { |
| unittest.expect(o.daysToReturn, unittest.equals(42)); |
| unittest.expect(o.isReturnable, unittest.isTrue); |
| unittest.expect(o.policyUrl, unittest.equals('foo')); |
| } |
| buildCounterOrderLineItemReturnInfo--; |
| } |
| |
| core.int buildCounterOrderLineItemShippingDetails = 0; |
| buildOrderLineItemShippingDetails() { |
| var o = new api.OrderLineItemShippingDetails(); |
| buildCounterOrderLineItemShippingDetails++; |
| if (buildCounterOrderLineItemShippingDetails < 3) { |
| o.deliverByDate = "foo"; |
| o.method = buildOrderLineItemShippingDetailsMethod(); |
| o.shipByDate = "foo"; |
| } |
| buildCounterOrderLineItemShippingDetails--; |
| return o; |
| } |
| |
| checkOrderLineItemShippingDetails(api.OrderLineItemShippingDetails o) { |
| buildCounterOrderLineItemShippingDetails++; |
| if (buildCounterOrderLineItemShippingDetails < 3) { |
| unittest.expect(o.deliverByDate, unittest.equals('foo')); |
| checkOrderLineItemShippingDetailsMethod(o.method); |
| unittest.expect(o.shipByDate, unittest.equals('foo')); |
| } |
| buildCounterOrderLineItemShippingDetails--; |
| } |
| |
| core.int buildCounterOrderLineItemShippingDetailsMethod = 0; |
| buildOrderLineItemShippingDetailsMethod() { |
| var o = new api.OrderLineItemShippingDetailsMethod(); |
| buildCounterOrderLineItemShippingDetailsMethod++; |
| if (buildCounterOrderLineItemShippingDetailsMethod < 3) { |
| o.carrier = "foo"; |
| o.maxDaysInTransit = 42; |
| o.methodName = "foo"; |
| o.minDaysInTransit = 42; |
| } |
| buildCounterOrderLineItemShippingDetailsMethod--; |
| return o; |
| } |
| |
| checkOrderLineItemShippingDetailsMethod( |
| api.OrderLineItemShippingDetailsMethod o) { |
| buildCounterOrderLineItemShippingDetailsMethod++; |
| if (buildCounterOrderLineItemShippingDetailsMethod < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| unittest.expect(o.maxDaysInTransit, unittest.equals(42)); |
| unittest.expect(o.methodName, unittest.equals('foo')); |
| unittest.expect(o.minDaysInTransit, unittest.equals(42)); |
| } |
| buildCounterOrderLineItemShippingDetailsMethod--; |
| } |
| |
| core.int buildCounterOrderPaymentMethod = 0; |
| buildOrderPaymentMethod() { |
| var o = new api.OrderPaymentMethod(); |
| buildCounterOrderPaymentMethod++; |
| if (buildCounterOrderPaymentMethod < 3) { |
| o.billingAddress = buildOrderAddress(); |
| o.expirationMonth = 42; |
| o.expirationYear = 42; |
| o.lastFourDigits = "foo"; |
| o.phoneNumber = "foo"; |
| o.type = "foo"; |
| } |
| buildCounterOrderPaymentMethod--; |
| return o; |
| } |
| |
| checkOrderPaymentMethod(api.OrderPaymentMethod o) { |
| buildCounterOrderPaymentMethod++; |
| if (buildCounterOrderPaymentMethod < 3) { |
| checkOrderAddress(o.billingAddress); |
| unittest.expect(o.expirationMonth, unittest.equals(42)); |
| unittest.expect(o.expirationYear, unittest.equals(42)); |
| unittest.expect(o.lastFourDigits, unittest.equals('foo')); |
| unittest.expect(o.phoneNumber, unittest.equals('foo')); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterOrderPaymentMethod--; |
| } |
| |
| buildUnnamed1568() { |
| var o = new core.List<api.OrderPromotionBenefit>(); |
| o.add(buildOrderPromotionBenefit()); |
| o.add(buildOrderPromotionBenefit()); |
| return o; |
| } |
| |
| checkUnnamed1568(core.List<api.OrderPromotionBenefit> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderPromotionBenefit(o[0]); |
| checkOrderPromotionBenefit(o[1]); |
| } |
| |
| core.int buildCounterOrderPromotion = 0; |
| buildOrderPromotion() { |
| var o = new api.OrderPromotion(); |
| buildCounterOrderPromotion++; |
| if (buildCounterOrderPromotion < 3) { |
| o.benefits = buildUnnamed1568(); |
| o.effectiveDates = "foo"; |
| o.genericRedemptionCode = "foo"; |
| o.id = "foo"; |
| o.longTitle = "foo"; |
| o.productApplicability = "foo"; |
| o.redemptionChannel = "foo"; |
| } |
| buildCounterOrderPromotion--; |
| return o; |
| } |
| |
| checkOrderPromotion(api.OrderPromotion o) { |
| buildCounterOrderPromotion++; |
| if (buildCounterOrderPromotion < 3) { |
| checkUnnamed1568(o.benefits); |
| unittest.expect(o.effectiveDates, unittest.equals('foo')); |
| unittest.expect(o.genericRedemptionCode, unittest.equals('foo')); |
| unittest.expect(o.id, unittest.equals('foo')); |
| unittest.expect(o.longTitle, unittest.equals('foo')); |
| unittest.expect(o.productApplicability, unittest.equals('foo')); |
| unittest.expect(o.redemptionChannel, unittest.equals('foo')); |
| } |
| buildCounterOrderPromotion--; |
| } |
| |
| buildUnnamed1569() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed1569(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 buildCounterOrderPromotionBenefit = 0; |
| buildOrderPromotionBenefit() { |
| var o = new api.OrderPromotionBenefit(); |
| buildCounterOrderPromotionBenefit++; |
| if (buildCounterOrderPromotionBenefit < 3) { |
| o.discount = buildPrice(); |
| o.offerIds = buildUnnamed1569(); |
| o.subType = "foo"; |
| o.taxImpact = buildPrice(); |
| o.type = "foo"; |
| } |
| buildCounterOrderPromotionBenefit--; |
| return o; |
| } |
| |
| checkOrderPromotionBenefit(api.OrderPromotionBenefit o) { |
| buildCounterOrderPromotionBenefit++; |
| if (buildCounterOrderPromotionBenefit < 3) { |
| checkPrice(o.discount); |
| checkUnnamed1569(o.offerIds); |
| unittest.expect(o.subType, unittest.equals('foo')); |
| checkPrice(o.taxImpact); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterOrderPromotionBenefit--; |
| } |
| |
| core.int buildCounterOrderRefund = 0; |
| buildOrderRefund() { |
| var o = new api.OrderRefund(); |
| buildCounterOrderRefund++; |
| if (buildCounterOrderRefund < 3) { |
| o.actor = "foo"; |
| o.amount = buildPrice(); |
| o.creationDate = "foo"; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrderRefund--; |
| return o; |
| } |
| |
| checkOrderRefund(api.OrderRefund o) { |
| buildCounterOrderRefund++; |
| if (buildCounterOrderRefund < 3) { |
| unittest.expect(o.actor, unittest.equals('foo')); |
| checkPrice(o.amount); |
| unittest.expect(o.creationDate, unittest.equals('foo')); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrderRefund--; |
| } |
| |
| core.int buildCounterOrderReturn = 0; |
| buildOrderReturn() { |
| var o = new api.OrderReturn(); |
| buildCounterOrderReturn++; |
| if (buildCounterOrderReturn < 3) { |
| o.actor = "foo"; |
| o.creationDate = "foo"; |
| o.quantity = 42; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrderReturn--; |
| return o; |
| } |
| |
| checkOrderReturn(api.OrderReturn o) { |
| buildCounterOrderReturn++; |
| if (buildCounterOrderReturn < 3) { |
| unittest.expect(o.actor, unittest.equals('foo')); |
| unittest.expect(o.creationDate, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrderReturn--; |
| } |
| |
| buildUnnamed1570() { |
| var o = new core.List<api.OrderShipmentLineItemShipment>(); |
| o.add(buildOrderShipmentLineItemShipment()); |
| o.add(buildOrderShipmentLineItemShipment()); |
| return o; |
| } |
| |
| checkUnnamed1570(core.List<api.OrderShipmentLineItemShipment> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderShipmentLineItemShipment(o[0]); |
| checkOrderShipmentLineItemShipment(o[1]); |
| } |
| |
| core.int buildCounterOrderShipment = 0; |
| buildOrderShipment() { |
| var o = new api.OrderShipment(); |
| buildCounterOrderShipment++; |
| if (buildCounterOrderShipment < 3) { |
| o.carrier = "foo"; |
| o.creationDate = "foo"; |
| o.deliveryDate = "foo"; |
| o.id = "foo"; |
| o.lineItems = buildUnnamed1570(); |
| o.status = "foo"; |
| o.trackingId = "foo"; |
| } |
| buildCounterOrderShipment--; |
| return o; |
| } |
| |
| checkOrderShipment(api.OrderShipment o) { |
| buildCounterOrderShipment++; |
| if (buildCounterOrderShipment < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| unittest.expect(o.creationDate, unittest.equals('foo')); |
| unittest.expect(o.deliveryDate, unittest.equals('foo')); |
| unittest.expect(o.id, unittest.equals('foo')); |
| checkUnnamed1570(o.lineItems); |
| unittest.expect(o.status, unittest.equals('foo')); |
| unittest.expect(o.trackingId, unittest.equals('foo')); |
| } |
| buildCounterOrderShipment--; |
| } |
| |
| core.int buildCounterOrderShipmentLineItemShipment = 0; |
| buildOrderShipmentLineItemShipment() { |
| var o = new api.OrderShipmentLineItemShipment(); |
| buildCounterOrderShipmentLineItemShipment++; |
| if (buildCounterOrderShipmentLineItemShipment < 3) { |
| o.lineItemId = "foo"; |
| o.productId = "foo"; |
| o.quantity = 42; |
| } |
| buildCounterOrderShipmentLineItemShipment--; |
| return o; |
| } |
| |
| checkOrderShipmentLineItemShipment(api.OrderShipmentLineItemShipment o) { |
| buildCounterOrderShipmentLineItemShipment++; |
| if (buildCounterOrderShipmentLineItemShipment < 3) { |
| unittest.expect(o.lineItemId, unittest.equals('foo')); |
| unittest.expect(o.productId, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| } |
| buildCounterOrderShipmentLineItemShipment--; |
| } |
| |
| core.int buildCounterOrdersAcknowledgeRequest = 0; |
| buildOrdersAcknowledgeRequest() { |
| var o = new api.OrdersAcknowledgeRequest(); |
| buildCounterOrdersAcknowledgeRequest++; |
| if (buildCounterOrdersAcknowledgeRequest < 3) { |
| o.operationId = "foo"; |
| } |
| buildCounterOrdersAcknowledgeRequest--; |
| return o; |
| } |
| |
| checkOrdersAcknowledgeRequest(api.OrdersAcknowledgeRequest o) { |
| buildCounterOrdersAcknowledgeRequest++; |
| if (buildCounterOrdersAcknowledgeRequest < 3) { |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| } |
| buildCounterOrdersAcknowledgeRequest--; |
| } |
| |
| core.int buildCounterOrdersAcknowledgeResponse = 0; |
| buildOrdersAcknowledgeResponse() { |
| var o = new api.OrdersAcknowledgeResponse(); |
| buildCounterOrdersAcknowledgeResponse++; |
| if (buildCounterOrdersAcknowledgeResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersAcknowledgeResponse--; |
| return o; |
| } |
| |
| checkOrdersAcknowledgeResponse(api.OrdersAcknowledgeResponse o) { |
| buildCounterOrdersAcknowledgeResponse++; |
| if (buildCounterOrdersAcknowledgeResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersAcknowledgeResponse--; |
| } |
| |
| core.int buildCounterOrdersAdvanceTestOrderResponse = 0; |
| buildOrdersAdvanceTestOrderResponse() { |
| var o = new api.OrdersAdvanceTestOrderResponse(); |
| buildCounterOrdersAdvanceTestOrderResponse++; |
| if (buildCounterOrdersAdvanceTestOrderResponse < 3) { |
| o.kind = "foo"; |
| } |
| buildCounterOrdersAdvanceTestOrderResponse--; |
| return o; |
| } |
| |
| checkOrdersAdvanceTestOrderResponse(api.OrdersAdvanceTestOrderResponse o) { |
| buildCounterOrdersAdvanceTestOrderResponse++; |
| if (buildCounterOrdersAdvanceTestOrderResponse < 3) { |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersAdvanceTestOrderResponse--; |
| } |
| |
| core.int buildCounterOrdersCancelLineItemRequest = 0; |
| buildOrdersCancelLineItemRequest() { |
| var o = new api.OrdersCancelLineItemRequest(); |
| buildCounterOrdersCancelLineItemRequest++; |
| if (buildCounterOrdersCancelLineItemRequest < 3) { |
| o.amount = buildPrice(); |
| o.amountPretax = buildPrice(); |
| o.amountTax = buildPrice(); |
| o.lineItemId = "foo"; |
| o.operationId = "foo"; |
| o.productId = "foo"; |
| o.quantity = 42; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersCancelLineItemRequest--; |
| return o; |
| } |
| |
| checkOrdersCancelLineItemRequest(api.OrdersCancelLineItemRequest o) { |
| buildCounterOrdersCancelLineItemRequest++; |
| if (buildCounterOrdersCancelLineItemRequest < 3) { |
| checkPrice(o.amount); |
| checkPrice(o.amountPretax); |
| checkPrice(o.amountTax); |
| unittest.expect(o.lineItemId, unittest.equals('foo')); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.productId, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersCancelLineItemRequest--; |
| } |
| |
| core.int buildCounterOrdersCancelLineItemResponse = 0; |
| buildOrdersCancelLineItemResponse() { |
| var o = new api.OrdersCancelLineItemResponse(); |
| buildCounterOrdersCancelLineItemResponse++; |
| if (buildCounterOrdersCancelLineItemResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersCancelLineItemResponse--; |
| return o; |
| } |
| |
| checkOrdersCancelLineItemResponse(api.OrdersCancelLineItemResponse o) { |
| buildCounterOrdersCancelLineItemResponse++; |
| if (buildCounterOrdersCancelLineItemResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersCancelLineItemResponse--; |
| } |
| |
| core.int buildCounterOrdersCancelRequest = 0; |
| buildOrdersCancelRequest() { |
| var o = new api.OrdersCancelRequest(); |
| buildCounterOrdersCancelRequest++; |
| if (buildCounterOrdersCancelRequest < 3) { |
| o.operationId = "foo"; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersCancelRequest--; |
| return o; |
| } |
| |
| checkOrdersCancelRequest(api.OrdersCancelRequest o) { |
| buildCounterOrdersCancelRequest++; |
| if (buildCounterOrdersCancelRequest < 3) { |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersCancelRequest--; |
| } |
| |
| core.int buildCounterOrdersCancelResponse = 0; |
| buildOrdersCancelResponse() { |
| var o = new api.OrdersCancelResponse(); |
| buildCounterOrdersCancelResponse++; |
| if (buildCounterOrdersCancelResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersCancelResponse--; |
| return o; |
| } |
| |
| checkOrdersCancelResponse(api.OrdersCancelResponse o) { |
| buildCounterOrdersCancelResponse++; |
| if (buildCounterOrdersCancelResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersCancelResponse--; |
| } |
| |
| core.int buildCounterOrdersCreateTestOrderRequest = 0; |
| buildOrdersCreateTestOrderRequest() { |
| var o = new api.OrdersCreateTestOrderRequest(); |
| buildCounterOrdersCreateTestOrderRequest++; |
| if (buildCounterOrdersCreateTestOrderRequest < 3) { |
| o.templateName = "foo"; |
| o.testOrder = buildTestOrder(); |
| } |
| buildCounterOrdersCreateTestOrderRequest--; |
| return o; |
| } |
| |
| checkOrdersCreateTestOrderRequest(api.OrdersCreateTestOrderRequest o) { |
| buildCounterOrdersCreateTestOrderRequest++; |
| if (buildCounterOrdersCreateTestOrderRequest < 3) { |
| unittest.expect(o.templateName, unittest.equals('foo')); |
| checkTestOrder(o.testOrder); |
| } |
| buildCounterOrdersCreateTestOrderRequest--; |
| } |
| |
| core.int buildCounterOrdersCreateTestOrderResponse = 0; |
| buildOrdersCreateTestOrderResponse() { |
| var o = new api.OrdersCreateTestOrderResponse(); |
| buildCounterOrdersCreateTestOrderResponse++; |
| if (buildCounterOrdersCreateTestOrderResponse < 3) { |
| o.kind = "foo"; |
| o.orderId = "foo"; |
| } |
| buildCounterOrdersCreateTestOrderResponse--; |
| return o; |
| } |
| |
| checkOrdersCreateTestOrderResponse(api.OrdersCreateTestOrderResponse o) { |
| buildCounterOrdersCreateTestOrderResponse++; |
| if (buildCounterOrdersCreateTestOrderResponse < 3) { |
| unittest.expect(o.kind, unittest.equals('foo')); |
| unittest.expect(o.orderId, unittest.equals('foo')); |
| } |
| buildCounterOrdersCreateTestOrderResponse--; |
| } |
| |
| buildUnnamed1571() { |
| var o = new core.List<api.OrdersCustomBatchRequestEntry>(); |
| o.add(buildOrdersCustomBatchRequestEntry()); |
| o.add(buildOrdersCustomBatchRequestEntry()); |
| return o; |
| } |
| |
| checkUnnamed1571(core.List<api.OrdersCustomBatchRequestEntry> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrdersCustomBatchRequestEntry(o[0]); |
| checkOrdersCustomBatchRequestEntry(o[1]); |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequest = 0; |
| buildOrdersCustomBatchRequest() { |
| var o = new api.OrdersCustomBatchRequest(); |
| buildCounterOrdersCustomBatchRequest++; |
| if (buildCounterOrdersCustomBatchRequest < 3) { |
| o.entries = buildUnnamed1571(); |
| } |
| buildCounterOrdersCustomBatchRequest--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequest(api.OrdersCustomBatchRequest o) { |
| buildCounterOrdersCustomBatchRequest++; |
| if (buildCounterOrdersCustomBatchRequest < 3) { |
| checkUnnamed1571(o.entries); |
| } |
| buildCounterOrdersCustomBatchRequest--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntry = 0; |
| buildOrdersCustomBatchRequestEntry() { |
| var o = new api.OrdersCustomBatchRequestEntry(); |
| buildCounterOrdersCustomBatchRequestEntry++; |
| if (buildCounterOrdersCustomBatchRequestEntry < 3) { |
| o.batchId = 42; |
| o.cancel = buildOrdersCustomBatchRequestEntryCancel(); |
| o.cancelLineItem = buildOrdersCustomBatchRequestEntryCancelLineItem(); |
| o.merchantId = "foo"; |
| o.merchantOrderId = "foo"; |
| o.method = "foo"; |
| o.operationId = "foo"; |
| o.orderId = "foo"; |
| o.refund = buildOrdersCustomBatchRequestEntryRefund(); |
| o.returnLineItem = buildOrdersCustomBatchRequestEntryReturnLineItem(); |
| o.shipLineItems = buildOrdersCustomBatchRequestEntryShipLineItems(); |
| o.updateShipment = buildOrdersCustomBatchRequestEntryUpdateShipment(); |
| } |
| buildCounterOrdersCustomBatchRequestEntry--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntry(api.OrdersCustomBatchRequestEntry o) { |
| buildCounterOrdersCustomBatchRequestEntry++; |
| if (buildCounterOrdersCustomBatchRequestEntry < 3) { |
| unittest.expect(o.batchId, unittest.equals(42)); |
| checkOrdersCustomBatchRequestEntryCancel(o.cancel); |
| checkOrdersCustomBatchRequestEntryCancelLineItem(o.cancelLineItem); |
| unittest.expect(o.merchantId, unittest.equals('foo')); |
| unittest.expect(o.merchantOrderId, unittest.equals('foo')); |
| unittest.expect(o.method, unittest.equals('foo')); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.orderId, unittest.equals('foo')); |
| checkOrdersCustomBatchRequestEntryRefund(o.refund); |
| checkOrdersCustomBatchRequestEntryReturnLineItem(o.returnLineItem); |
| checkOrdersCustomBatchRequestEntryShipLineItems(o.shipLineItems); |
| checkOrdersCustomBatchRequestEntryUpdateShipment(o.updateShipment); |
| } |
| buildCounterOrdersCustomBatchRequestEntry--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryCancel = 0; |
| buildOrdersCustomBatchRequestEntryCancel() { |
| var o = new api.OrdersCustomBatchRequestEntryCancel(); |
| buildCounterOrdersCustomBatchRequestEntryCancel++; |
| if (buildCounterOrdersCustomBatchRequestEntryCancel < 3) { |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryCancel--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryCancel( |
| api.OrdersCustomBatchRequestEntryCancel o) { |
| buildCounterOrdersCustomBatchRequestEntryCancel++; |
| if (buildCounterOrdersCustomBatchRequestEntryCancel < 3) { |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryCancel--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryCancelLineItem = 0; |
| buildOrdersCustomBatchRequestEntryCancelLineItem() { |
| var o = new api.OrdersCustomBatchRequestEntryCancelLineItem(); |
| buildCounterOrdersCustomBatchRequestEntryCancelLineItem++; |
| if (buildCounterOrdersCustomBatchRequestEntryCancelLineItem < 3) { |
| o.amount = buildPrice(); |
| o.amountPretax = buildPrice(); |
| o.amountTax = buildPrice(); |
| o.lineItemId = "foo"; |
| o.productId = "foo"; |
| o.quantity = 42; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryCancelLineItem--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryCancelLineItem( |
| api.OrdersCustomBatchRequestEntryCancelLineItem o) { |
| buildCounterOrdersCustomBatchRequestEntryCancelLineItem++; |
| if (buildCounterOrdersCustomBatchRequestEntryCancelLineItem < 3) { |
| checkPrice(o.amount); |
| checkPrice(o.amountPretax); |
| checkPrice(o.amountTax); |
| unittest.expect(o.lineItemId, unittest.equals('foo')); |
| unittest.expect(o.productId, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryCancelLineItem--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryRefund = 0; |
| buildOrdersCustomBatchRequestEntryRefund() { |
| var o = new api.OrdersCustomBatchRequestEntryRefund(); |
| buildCounterOrdersCustomBatchRequestEntryRefund++; |
| if (buildCounterOrdersCustomBatchRequestEntryRefund < 3) { |
| o.amount = buildPrice(); |
| o.amountPretax = buildPrice(); |
| o.amountTax = buildPrice(); |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryRefund--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryRefund( |
| api.OrdersCustomBatchRequestEntryRefund o) { |
| buildCounterOrdersCustomBatchRequestEntryRefund++; |
| if (buildCounterOrdersCustomBatchRequestEntryRefund < 3) { |
| checkPrice(o.amount); |
| checkPrice(o.amountPretax); |
| checkPrice(o.amountTax); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryRefund--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryReturnLineItem = 0; |
| buildOrdersCustomBatchRequestEntryReturnLineItem() { |
| var o = new api.OrdersCustomBatchRequestEntryReturnLineItem(); |
| buildCounterOrdersCustomBatchRequestEntryReturnLineItem++; |
| if (buildCounterOrdersCustomBatchRequestEntryReturnLineItem < 3) { |
| o.lineItemId = "foo"; |
| o.productId = "foo"; |
| o.quantity = 42; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryReturnLineItem--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryReturnLineItem( |
| api.OrdersCustomBatchRequestEntryReturnLineItem o) { |
| buildCounterOrdersCustomBatchRequestEntryReturnLineItem++; |
| if (buildCounterOrdersCustomBatchRequestEntryReturnLineItem < 3) { |
| unittest.expect(o.lineItemId, unittest.equals('foo')); |
| unittest.expect(o.productId, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryReturnLineItem--; |
| } |
| |
| buildUnnamed1572() { |
| var o = new core.List<api.OrderShipmentLineItemShipment>(); |
| o.add(buildOrderShipmentLineItemShipment()); |
| o.add(buildOrderShipmentLineItemShipment()); |
| return o; |
| } |
| |
| checkUnnamed1572(core.List<api.OrderShipmentLineItemShipment> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderShipmentLineItemShipment(o[0]); |
| checkOrderShipmentLineItemShipment(o[1]); |
| } |
| |
| buildUnnamed1573() { |
| var o = new core |
| .List<api.OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo>(); |
| o.add(buildOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo()); |
| o.add(buildOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo()); |
| return o; |
| } |
| |
| checkUnnamed1573( |
| core.List<api.OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(o[0]); |
| checkOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(o[1]); |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryShipLineItems = 0; |
| buildOrdersCustomBatchRequestEntryShipLineItems() { |
| var o = new api.OrdersCustomBatchRequestEntryShipLineItems(); |
| buildCounterOrdersCustomBatchRequestEntryShipLineItems++; |
| if (buildCounterOrdersCustomBatchRequestEntryShipLineItems < 3) { |
| o.carrier = "foo"; |
| o.lineItems = buildUnnamed1572(); |
| o.shipmentId = "foo"; |
| o.shipmentInfos = buildUnnamed1573(); |
| o.trackingId = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryShipLineItems--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryShipLineItems( |
| api.OrdersCustomBatchRequestEntryShipLineItems o) { |
| buildCounterOrdersCustomBatchRequestEntryShipLineItems++; |
| if (buildCounterOrdersCustomBatchRequestEntryShipLineItems < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| checkUnnamed1572(o.lineItems); |
| unittest.expect(o.shipmentId, unittest.equals('foo')); |
| checkUnnamed1573(o.shipmentInfos); |
| unittest.expect(o.trackingId, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryShipLineItems--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo = 0; |
| buildOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo() { |
| var o = new api.OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(); |
| buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo++; |
| if (buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo < 3) { |
| o.carrier = "foo"; |
| o.shipmentId = "foo"; |
| o.trackingId = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo( |
| api.OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo o) { |
| buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo++; |
| if (buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| unittest.expect(o.shipmentId, unittest.equals('foo')); |
| unittest.expect(o.trackingId, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchRequestEntryUpdateShipment = 0; |
| buildOrdersCustomBatchRequestEntryUpdateShipment() { |
| var o = new api.OrdersCustomBatchRequestEntryUpdateShipment(); |
| buildCounterOrdersCustomBatchRequestEntryUpdateShipment++; |
| if (buildCounterOrdersCustomBatchRequestEntryUpdateShipment < 3) { |
| o.carrier = "foo"; |
| o.shipmentId = "foo"; |
| o.status = "foo"; |
| o.trackingId = "foo"; |
| } |
| buildCounterOrdersCustomBatchRequestEntryUpdateShipment--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchRequestEntryUpdateShipment( |
| api.OrdersCustomBatchRequestEntryUpdateShipment o) { |
| buildCounterOrdersCustomBatchRequestEntryUpdateShipment++; |
| if (buildCounterOrdersCustomBatchRequestEntryUpdateShipment < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| unittest.expect(o.shipmentId, unittest.equals('foo')); |
| unittest.expect(o.status, unittest.equals('foo')); |
| unittest.expect(o.trackingId, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchRequestEntryUpdateShipment--; |
| } |
| |
| buildUnnamed1574() { |
| var o = new core.List<api.OrdersCustomBatchResponseEntry>(); |
| o.add(buildOrdersCustomBatchResponseEntry()); |
| o.add(buildOrdersCustomBatchResponseEntry()); |
| return o; |
| } |
| |
| checkUnnamed1574(core.List<api.OrdersCustomBatchResponseEntry> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrdersCustomBatchResponseEntry(o[0]); |
| checkOrdersCustomBatchResponseEntry(o[1]); |
| } |
| |
| core.int buildCounterOrdersCustomBatchResponse = 0; |
| buildOrdersCustomBatchResponse() { |
| var o = new api.OrdersCustomBatchResponse(); |
| buildCounterOrdersCustomBatchResponse++; |
| if (buildCounterOrdersCustomBatchResponse < 3) { |
| o.entries = buildUnnamed1574(); |
| o.kind = "foo"; |
| } |
| buildCounterOrdersCustomBatchResponse--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchResponse(api.OrdersCustomBatchResponse o) { |
| buildCounterOrdersCustomBatchResponse++; |
| if (buildCounterOrdersCustomBatchResponse < 3) { |
| checkUnnamed1574(o.entries); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersCustomBatchResponse--; |
| } |
| |
| core.int buildCounterOrdersCustomBatchResponseEntry = 0; |
| buildOrdersCustomBatchResponseEntry() { |
| var o = new api.OrdersCustomBatchResponseEntry(); |
| buildCounterOrdersCustomBatchResponseEntry++; |
| if (buildCounterOrdersCustomBatchResponseEntry < 3) { |
| o.batchId = 42; |
| o.errors = buildErrors(); |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| o.order = buildOrder(); |
| } |
| buildCounterOrdersCustomBatchResponseEntry--; |
| return o; |
| } |
| |
| checkOrdersCustomBatchResponseEntry(api.OrdersCustomBatchResponseEntry o) { |
| buildCounterOrdersCustomBatchResponseEntry++; |
| if (buildCounterOrdersCustomBatchResponseEntry < 3) { |
| unittest.expect(o.batchId, unittest.equals(42)); |
| checkErrors(o.errors); |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkOrder(o.order); |
| } |
| buildCounterOrdersCustomBatchResponseEntry--; |
| } |
| |
| core.int buildCounterOrdersGetByMerchantOrderIdResponse = 0; |
| buildOrdersGetByMerchantOrderIdResponse() { |
| var o = new api.OrdersGetByMerchantOrderIdResponse(); |
| buildCounterOrdersGetByMerchantOrderIdResponse++; |
| if (buildCounterOrdersGetByMerchantOrderIdResponse < 3) { |
| o.kind = "foo"; |
| o.order = buildOrder(); |
| } |
| buildCounterOrdersGetByMerchantOrderIdResponse--; |
| return o; |
| } |
| |
| checkOrdersGetByMerchantOrderIdResponse( |
| api.OrdersGetByMerchantOrderIdResponse o) { |
| buildCounterOrdersGetByMerchantOrderIdResponse++; |
| if (buildCounterOrdersGetByMerchantOrderIdResponse < 3) { |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkOrder(o.order); |
| } |
| buildCounterOrdersGetByMerchantOrderIdResponse--; |
| } |
| |
| core.int buildCounterOrdersGetTestOrderTemplateResponse = 0; |
| buildOrdersGetTestOrderTemplateResponse() { |
| var o = new api.OrdersGetTestOrderTemplateResponse(); |
| buildCounterOrdersGetTestOrderTemplateResponse++; |
| if (buildCounterOrdersGetTestOrderTemplateResponse < 3) { |
| o.kind = "foo"; |
| o.template = buildTestOrder(); |
| } |
| buildCounterOrdersGetTestOrderTemplateResponse--; |
| return o; |
| } |
| |
| checkOrdersGetTestOrderTemplateResponse( |
| api.OrdersGetTestOrderTemplateResponse o) { |
| buildCounterOrdersGetTestOrderTemplateResponse++; |
| if (buildCounterOrdersGetTestOrderTemplateResponse < 3) { |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkTestOrder(o.template); |
| } |
| buildCounterOrdersGetTestOrderTemplateResponse--; |
| } |
| |
| buildUnnamed1575() { |
| var o = new core.List<api.Order>(); |
| o.add(buildOrder()); |
| o.add(buildOrder()); |
| return o; |
| } |
| |
| checkUnnamed1575(core.List<api.Order> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrder(o[0]); |
| checkOrder(o[1]); |
| } |
| |
| core.int buildCounterOrdersListResponse = 0; |
| buildOrdersListResponse() { |
| var o = new api.OrdersListResponse(); |
| buildCounterOrdersListResponse++; |
| if (buildCounterOrdersListResponse < 3) { |
| o.kind = "foo"; |
| o.nextPageToken = "foo"; |
| o.resources = buildUnnamed1575(); |
| } |
| buildCounterOrdersListResponse--; |
| return o; |
| } |
| |
| checkOrdersListResponse(api.OrdersListResponse o) { |
| buildCounterOrdersListResponse++; |
| if (buildCounterOrdersListResponse < 3) { |
| unittest.expect(o.kind, unittest.equals('foo')); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1575(o.resources); |
| } |
| buildCounterOrdersListResponse--; |
| } |
| |
| core.int buildCounterOrdersRefundRequest = 0; |
| buildOrdersRefundRequest() { |
| var o = new api.OrdersRefundRequest(); |
| buildCounterOrdersRefundRequest++; |
| if (buildCounterOrdersRefundRequest < 3) { |
| o.amount = buildPrice(); |
| o.amountPretax = buildPrice(); |
| o.amountTax = buildPrice(); |
| o.operationId = "foo"; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersRefundRequest--; |
| return o; |
| } |
| |
| checkOrdersRefundRequest(api.OrdersRefundRequest o) { |
| buildCounterOrdersRefundRequest++; |
| if (buildCounterOrdersRefundRequest < 3) { |
| checkPrice(o.amount); |
| checkPrice(o.amountPretax); |
| checkPrice(o.amountTax); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersRefundRequest--; |
| } |
| |
| core.int buildCounterOrdersRefundResponse = 0; |
| buildOrdersRefundResponse() { |
| var o = new api.OrdersRefundResponse(); |
| buildCounterOrdersRefundResponse++; |
| if (buildCounterOrdersRefundResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersRefundResponse--; |
| return o; |
| } |
| |
| checkOrdersRefundResponse(api.OrdersRefundResponse o) { |
| buildCounterOrdersRefundResponse++; |
| if (buildCounterOrdersRefundResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersRefundResponse--; |
| } |
| |
| core.int buildCounterOrdersReturnLineItemRequest = 0; |
| buildOrdersReturnLineItemRequest() { |
| var o = new api.OrdersReturnLineItemRequest(); |
| buildCounterOrdersReturnLineItemRequest++; |
| if (buildCounterOrdersReturnLineItemRequest < 3) { |
| o.lineItemId = "foo"; |
| o.operationId = "foo"; |
| o.productId = "foo"; |
| o.quantity = 42; |
| o.reason = "foo"; |
| o.reasonText = "foo"; |
| } |
| buildCounterOrdersReturnLineItemRequest--; |
| return o; |
| } |
| |
| checkOrdersReturnLineItemRequest(api.OrdersReturnLineItemRequest o) { |
| buildCounterOrdersReturnLineItemRequest++; |
| if (buildCounterOrdersReturnLineItemRequest < 3) { |
| unittest.expect(o.lineItemId, unittest.equals('foo')); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.productId, unittest.equals('foo')); |
| unittest.expect(o.quantity, unittest.equals(42)); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.reasonText, unittest.equals('foo')); |
| } |
| buildCounterOrdersReturnLineItemRequest--; |
| } |
| |
| core.int buildCounterOrdersReturnLineItemResponse = 0; |
| buildOrdersReturnLineItemResponse() { |
| var o = new api.OrdersReturnLineItemResponse(); |
| buildCounterOrdersReturnLineItemResponse++; |
| if (buildCounterOrdersReturnLineItemResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersReturnLineItemResponse--; |
| return o; |
| } |
| |
| checkOrdersReturnLineItemResponse(api.OrdersReturnLineItemResponse o) { |
| buildCounterOrdersReturnLineItemResponse++; |
| if (buildCounterOrdersReturnLineItemResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersReturnLineItemResponse--; |
| } |
| |
| buildUnnamed1576() { |
| var o = new core.List<api.OrderShipmentLineItemShipment>(); |
| o.add(buildOrderShipmentLineItemShipment()); |
| o.add(buildOrderShipmentLineItemShipment()); |
| return o; |
| } |
| |
| checkUnnamed1576(core.List<api.OrderShipmentLineItemShipment> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderShipmentLineItemShipment(o[0]); |
| checkOrderShipmentLineItemShipment(o[1]); |
| } |
| |
| buildUnnamed1577() { |
| var o = new core |
| .List<api.OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo>(); |
| o.add(buildOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo()); |
| o.add(buildOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo()); |
| return o; |
| } |
| |
| checkUnnamed1577( |
| core.List<api.OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(o[0]); |
| checkOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(o[1]); |
| } |
| |
| core.int buildCounterOrdersShipLineItemsRequest = 0; |
| buildOrdersShipLineItemsRequest() { |
| var o = new api.OrdersShipLineItemsRequest(); |
| buildCounterOrdersShipLineItemsRequest++; |
| if (buildCounterOrdersShipLineItemsRequest < 3) { |
| o.carrier = "foo"; |
| o.lineItems = buildUnnamed1576(); |
| o.operationId = "foo"; |
| o.shipmentId = "foo"; |
| o.shipmentInfos = buildUnnamed1577(); |
| o.trackingId = "foo"; |
| } |
| buildCounterOrdersShipLineItemsRequest--; |
| return o; |
| } |
| |
| checkOrdersShipLineItemsRequest(api.OrdersShipLineItemsRequest o) { |
| buildCounterOrdersShipLineItemsRequest++; |
| if (buildCounterOrdersShipLineItemsRequest < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| checkUnnamed1576(o.lineItems); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.shipmentId, unittest.equals('foo')); |
| checkUnnamed1577(o.shipmentInfos); |
| unittest.expect(o.trackingId, unittest.equals('foo')); |
| } |
| buildCounterOrdersShipLineItemsRequest--; |
| } |
| |
| core.int buildCounterOrdersShipLineItemsResponse = 0; |
| buildOrdersShipLineItemsResponse() { |
| var o = new api.OrdersShipLineItemsResponse(); |
| buildCounterOrdersShipLineItemsResponse++; |
| if (buildCounterOrdersShipLineItemsResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersShipLineItemsResponse--; |
| return o; |
| } |
| |
| checkOrdersShipLineItemsResponse(api.OrdersShipLineItemsResponse o) { |
| buildCounterOrdersShipLineItemsResponse++; |
| if (buildCounterOrdersShipLineItemsResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersShipLineItemsResponse--; |
| } |
| |
| core.int buildCounterOrdersUpdateMerchantOrderIdRequest = 0; |
| buildOrdersUpdateMerchantOrderIdRequest() { |
| var o = new api.OrdersUpdateMerchantOrderIdRequest(); |
| buildCounterOrdersUpdateMerchantOrderIdRequest++; |
| if (buildCounterOrdersUpdateMerchantOrderIdRequest < 3) { |
| o.merchantOrderId = "foo"; |
| o.operationId = "foo"; |
| } |
| buildCounterOrdersUpdateMerchantOrderIdRequest--; |
| return o; |
| } |
| |
| checkOrdersUpdateMerchantOrderIdRequest( |
| api.OrdersUpdateMerchantOrderIdRequest o) { |
| buildCounterOrdersUpdateMerchantOrderIdRequest++; |
| if (buildCounterOrdersUpdateMerchantOrderIdRequest < 3) { |
| unittest.expect(o.merchantOrderId, unittest.equals('foo')); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| } |
| buildCounterOrdersUpdateMerchantOrderIdRequest--; |
| } |
| |
| core.int buildCounterOrdersUpdateMerchantOrderIdResponse = 0; |
| buildOrdersUpdateMerchantOrderIdResponse() { |
| var o = new api.OrdersUpdateMerchantOrderIdResponse(); |
| buildCounterOrdersUpdateMerchantOrderIdResponse++; |
| if (buildCounterOrdersUpdateMerchantOrderIdResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersUpdateMerchantOrderIdResponse--; |
| return o; |
| } |
| |
| checkOrdersUpdateMerchantOrderIdResponse( |
| api.OrdersUpdateMerchantOrderIdResponse o) { |
| buildCounterOrdersUpdateMerchantOrderIdResponse++; |
| if (buildCounterOrdersUpdateMerchantOrderIdResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersUpdateMerchantOrderIdResponse--; |
| } |
| |
| core.int buildCounterOrdersUpdateShipmentRequest = 0; |
| buildOrdersUpdateShipmentRequest() { |
| var o = new api.OrdersUpdateShipmentRequest(); |
| buildCounterOrdersUpdateShipmentRequest++; |
| if (buildCounterOrdersUpdateShipmentRequest < 3) { |
| o.carrier = "foo"; |
| o.operationId = "foo"; |
| o.shipmentId = "foo"; |
| o.status = "foo"; |
| o.trackingId = "foo"; |
| } |
| buildCounterOrdersUpdateShipmentRequest--; |
| return o; |
| } |
| |
| checkOrdersUpdateShipmentRequest(api.OrdersUpdateShipmentRequest o) { |
| buildCounterOrdersUpdateShipmentRequest++; |
| if (buildCounterOrdersUpdateShipmentRequest < 3) { |
| unittest.expect(o.carrier, unittest.equals('foo')); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| unittest.expect(o.shipmentId, unittest.equals('foo')); |
| unittest.expect(o.status, unittest.equals('foo')); |
| unittest.expect(o.trackingId, unittest.equals('foo')); |
| } |
| buildCounterOrdersUpdateShipmentRequest--; |
| } |
| |
| core.int buildCounterOrdersUpdateShipmentResponse = 0; |
| buildOrdersUpdateShipmentResponse() { |
| var o = new api.OrdersUpdateShipmentResponse(); |
| buildCounterOrdersUpdateShipmentResponse++; |
| if (buildCounterOrdersUpdateShipmentResponse < 3) { |
| o.executionStatus = "foo"; |
| o.kind = "foo"; |
| } |
| buildCounterOrdersUpdateShipmentResponse--; |
| return o; |
| } |
| |
| checkOrdersUpdateShipmentResponse(api.OrdersUpdateShipmentResponse o) { |
| buildCounterOrdersUpdateShipmentResponse++; |
| if (buildCounterOrdersUpdateShipmentResponse < 3) { |
| unittest.expect(o.executionStatus, unittest.equals('foo')); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| } |
| buildCounterOrdersUpdateShipmentResponse--; |
| } |
| |
| core.int buildCounterPrice = 0; |
| buildPrice() { |
| var o = new api.Price(); |
| buildCounterPrice++; |
| if (buildCounterPrice < 3) { |
| o.currency = "foo"; |
| o.value = "foo"; |
| } |
| buildCounterPrice--; |
| return o; |
| } |
| |
| checkPrice(api.Price o) { |
| buildCounterPrice++; |
| if (buildCounterPrice < 3) { |
| unittest.expect(o.currency, unittest.equals('foo')); |
| unittest.expect(o.value, unittest.equals('foo')); |
| } |
| buildCounterPrice--; |
| } |
| |
| buildUnnamed1578() { |
| var o = new core.List<api.TestOrderLineItem>(); |
| o.add(buildTestOrderLineItem()); |
| o.add(buildTestOrderLineItem()); |
| return o; |
| } |
| |
| checkUnnamed1578(core.List<api.TestOrderLineItem> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTestOrderLineItem(o[0]); |
| checkTestOrderLineItem(o[1]); |
| } |
| |
| buildUnnamed1579() { |
| var o = new core.List<api.OrderPromotion>(); |
| o.add(buildOrderPromotion()); |
| o.add(buildOrderPromotion()); |
| return o; |
| } |
| |
| checkUnnamed1579(core.List<api.OrderPromotion> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderPromotion(o[0]); |
| checkOrderPromotion(o[1]); |
| } |
| |
| core.int buildCounterTestOrder = 0; |
| buildTestOrder() { |
| var o = new api.TestOrder(); |
| buildCounterTestOrder++; |
| if (buildCounterTestOrder < 3) { |
| o.customer = buildTestOrderCustomer(); |
| o.kind = "foo"; |
| o.lineItems = buildUnnamed1578(); |
| o.notificationMode = "foo"; |
| o.paymentMethod = buildTestOrderPaymentMethod(); |
| o.predefinedDeliveryAddress = "foo"; |
| o.promotions = buildUnnamed1579(); |
| o.shippingCost = buildPrice(); |
| o.shippingCostTax = buildPrice(); |
| o.shippingOption = "foo"; |
| } |
| buildCounterTestOrder--; |
| return o; |
| } |
| |
| checkTestOrder(api.TestOrder o) { |
| buildCounterTestOrder++; |
| if (buildCounterTestOrder < 3) { |
| checkTestOrderCustomer(o.customer); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkUnnamed1578(o.lineItems); |
| unittest.expect(o.notificationMode, unittest.equals('foo')); |
| checkTestOrderPaymentMethod(o.paymentMethod); |
| unittest.expect(o.predefinedDeliveryAddress, unittest.equals('foo')); |
| checkUnnamed1579(o.promotions); |
| checkPrice(o.shippingCost); |
| checkPrice(o.shippingCostTax); |
| unittest.expect(o.shippingOption, unittest.equals('foo')); |
| } |
| buildCounterTestOrder--; |
| } |
| |
| core.int buildCounterTestOrderCustomer = 0; |
| buildTestOrderCustomer() { |
| var o = new api.TestOrderCustomer(); |
| buildCounterTestOrderCustomer++; |
| if (buildCounterTestOrderCustomer < 3) { |
| o.email = "foo"; |
| o.explicitMarketingPreference = true; |
| o.fullName = "foo"; |
| } |
| buildCounterTestOrderCustomer--; |
| return o; |
| } |
| |
| checkTestOrderCustomer(api.TestOrderCustomer o) { |
| buildCounterTestOrderCustomer++; |
| if (buildCounterTestOrderCustomer < 3) { |
| unittest.expect(o.email, unittest.equals('foo')); |
| unittest.expect(o.explicitMarketingPreference, unittest.isTrue); |
| unittest.expect(o.fullName, unittest.equals('foo')); |
| } |
| buildCounterTestOrderCustomer--; |
| } |
| |
| core.int buildCounterTestOrderLineItem = 0; |
| buildTestOrderLineItem() { |
| var o = new api.TestOrderLineItem(); |
| buildCounterTestOrderLineItem++; |
| if (buildCounterTestOrderLineItem < 3) { |
| o.product = buildTestOrderLineItemProduct(); |
| o.quantityOrdered = 42; |
| o.returnInfo = buildOrderLineItemReturnInfo(); |
| o.shippingDetails = buildOrderLineItemShippingDetails(); |
| o.unitTax = buildPrice(); |
| } |
| buildCounterTestOrderLineItem--; |
| return o; |
| } |
| |
| checkTestOrderLineItem(api.TestOrderLineItem o) { |
| buildCounterTestOrderLineItem++; |
| if (buildCounterTestOrderLineItem < 3) { |
| checkTestOrderLineItemProduct(o.product); |
| unittest.expect(o.quantityOrdered, unittest.equals(42)); |
| checkOrderLineItemReturnInfo(o.returnInfo); |
| checkOrderLineItemShippingDetails(o.shippingDetails); |
| checkPrice(o.unitTax); |
| } |
| buildCounterTestOrderLineItem--; |
| } |
| |
| buildUnnamed1580() { |
| var o = new core.List<api.OrderLineItemProductVariantAttribute>(); |
| o.add(buildOrderLineItemProductVariantAttribute()); |
| o.add(buildOrderLineItemProductVariantAttribute()); |
| return o; |
| } |
| |
| checkUnnamed1580(core.List<api.OrderLineItemProductVariantAttribute> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderLineItemProductVariantAttribute(o[0]); |
| checkOrderLineItemProductVariantAttribute(o[1]); |
| } |
| |
| core.int buildCounterTestOrderLineItemProduct = 0; |
| buildTestOrderLineItemProduct() { |
| var o = new api.TestOrderLineItemProduct(); |
| buildCounterTestOrderLineItemProduct++; |
| if (buildCounterTestOrderLineItemProduct < 3) { |
| o.brand = "foo"; |
| o.channel = "foo"; |
| o.condition = "foo"; |
| o.contentLanguage = "foo"; |
| o.gtin = "foo"; |
| o.imageLink = "foo"; |
| o.itemGroupId = "foo"; |
| o.mpn = "foo"; |
| o.offerId = "foo"; |
| o.price = buildPrice(); |
| o.targetCountry = "foo"; |
| o.title = "foo"; |
| o.variantAttributes = buildUnnamed1580(); |
| } |
| buildCounterTestOrderLineItemProduct--; |
| return o; |
| } |
| |
| checkTestOrderLineItemProduct(api.TestOrderLineItemProduct o) { |
| buildCounterTestOrderLineItemProduct++; |
| if (buildCounterTestOrderLineItemProduct < 3) { |
| unittest.expect(o.brand, unittest.equals('foo')); |
| unittest.expect(o.channel, unittest.equals('foo')); |
| unittest.expect(o.condition, unittest.equals('foo')); |
| unittest.expect(o.contentLanguage, unittest.equals('foo')); |
| unittest.expect(o.gtin, unittest.equals('foo')); |
| unittest.expect(o.imageLink, unittest.equals('foo')); |
| unittest.expect(o.itemGroupId, unittest.equals('foo')); |
| unittest.expect(o.mpn, unittest.equals('foo')); |
| unittest.expect(o.offerId, unittest.equals('foo')); |
| checkPrice(o.price); |
| unittest.expect(o.targetCountry, unittest.equals('foo')); |
| unittest.expect(o.title, unittest.equals('foo')); |
| checkUnnamed1580(o.variantAttributes); |
| } |
| buildCounterTestOrderLineItemProduct--; |
| } |
| |
| core.int buildCounterTestOrderPaymentMethod = 0; |
| buildTestOrderPaymentMethod() { |
| var o = new api.TestOrderPaymentMethod(); |
| buildCounterTestOrderPaymentMethod++; |
| if (buildCounterTestOrderPaymentMethod < 3) { |
| o.expirationMonth = 42; |
| o.expirationYear = 42; |
| o.lastFourDigits = "foo"; |
| o.predefinedBillingAddress = "foo"; |
| o.type = "foo"; |
| } |
| buildCounterTestOrderPaymentMethod--; |
| return o; |
| } |
| |
| checkTestOrderPaymentMethod(api.TestOrderPaymentMethod o) { |
| buildCounterTestOrderPaymentMethod++; |
| if (buildCounterTestOrderPaymentMethod < 3) { |
| unittest.expect(o.expirationMonth, unittest.equals(42)); |
| unittest.expect(o.expirationYear, unittest.equals(42)); |
| unittest.expect(o.lastFourDigits, unittest.equals('foo')); |
| unittest.expect(o.predefinedBillingAddress, unittest.equals('foo')); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterTestOrderPaymentMethod--; |
| } |
| |
| buildUnnamed1581() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed1581(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-Error", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildError(); |
| var od = new api.Error.fromJson(o.toJson()); |
| checkError(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Errors", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildErrors(); |
| var od = new api.Errors.fromJson(o.toJson()); |
| checkErrors(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Order", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrder(); |
| var od = new api.Order.fromJson(o.toJson()); |
| checkOrder(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderAddress", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderAddress(); |
| var od = new api.OrderAddress.fromJson(o.toJson()); |
| checkOrderAddress(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderCancellation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderCancellation(); |
| var od = new api.OrderCancellation.fromJson(o.toJson()); |
| checkOrderCancellation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderCustomer", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderCustomer(); |
| var od = new api.OrderCustomer.fromJson(o.toJson()); |
| checkOrderCustomer(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderDeliveryDetails", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderDeliveryDetails(); |
| var od = new api.OrderDeliveryDetails.fromJson(o.toJson()); |
| checkOrderDeliveryDetails(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderLineItem", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderLineItem(); |
| var od = new api.OrderLineItem.fromJson(o.toJson()); |
| checkOrderLineItem(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderLineItemProduct", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderLineItemProduct(); |
| var od = new api.OrderLineItemProduct.fromJson(o.toJson()); |
| checkOrderLineItemProduct(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderLineItemProductVariantAttribute", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderLineItemProductVariantAttribute(); |
| var od = |
| new api.OrderLineItemProductVariantAttribute.fromJson(o.toJson()); |
| checkOrderLineItemProductVariantAttribute(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderLineItemReturnInfo", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderLineItemReturnInfo(); |
| var od = new api.OrderLineItemReturnInfo.fromJson(o.toJson()); |
| checkOrderLineItemReturnInfo(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderLineItemShippingDetails", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderLineItemShippingDetails(); |
| var od = new api.OrderLineItemShippingDetails.fromJson(o.toJson()); |
| checkOrderLineItemShippingDetails(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderLineItemShippingDetailsMethod", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderLineItemShippingDetailsMethod(); |
| var od = new api.OrderLineItemShippingDetailsMethod.fromJson(o.toJson()); |
| checkOrderLineItemShippingDetailsMethod(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderPaymentMethod", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderPaymentMethod(); |
| var od = new api.OrderPaymentMethod.fromJson(o.toJson()); |
| checkOrderPaymentMethod(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderPromotion", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderPromotion(); |
| var od = new api.OrderPromotion.fromJson(o.toJson()); |
| checkOrderPromotion(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderPromotionBenefit", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderPromotionBenefit(); |
| var od = new api.OrderPromotionBenefit.fromJson(o.toJson()); |
| checkOrderPromotionBenefit(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderRefund", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderRefund(); |
| var od = new api.OrderRefund.fromJson(o.toJson()); |
| checkOrderRefund(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderReturn", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderReturn(); |
| var od = new api.OrderReturn.fromJson(o.toJson()); |
| checkOrderReturn(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderShipment", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderShipment(); |
| var od = new api.OrderShipment.fromJson(o.toJson()); |
| checkOrderShipment(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderShipmentLineItemShipment", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderShipmentLineItemShipment(); |
| var od = new api.OrderShipmentLineItemShipment.fromJson(o.toJson()); |
| checkOrderShipmentLineItemShipment(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersAcknowledgeRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersAcknowledgeRequest(); |
| var od = new api.OrdersAcknowledgeRequest.fromJson(o.toJson()); |
| checkOrdersAcknowledgeRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersAcknowledgeResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersAcknowledgeResponse(); |
| var od = new api.OrdersAcknowledgeResponse.fromJson(o.toJson()); |
| checkOrdersAcknowledgeResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersAdvanceTestOrderResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersAdvanceTestOrderResponse(); |
| var od = new api.OrdersAdvanceTestOrderResponse.fromJson(o.toJson()); |
| checkOrdersAdvanceTestOrderResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCancelLineItemRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCancelLineItemRequest(); |
| var od = new api.OrdersCancelLineItemRequest.fromJson(o.toJson()); |
| checkOrdersCancelLineItemRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCancelLineItemResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCancelLineItemResponse(); |
| var od = new api.OrdersCancelLineItemResponse.fromJson(o.toJson()); |
| checkOrdersCancelLineItemResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCancelRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCancelRequest(); |
| var od = new api.OrdersCancelRequest.fromJson(o.toJson()); |
| checkOrdersCancelRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCancelResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCancelResponse(); |
| var od = new api.OrdersCancelResponse.fromJson(o.toJson()); |
| checkOrdersCancelResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCreateTestOrderRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCreateTestOrderRequest(); |
| var od = new api.OrdersCreateTestOrderRequest.fromJson(o.toJson()); |
| checkOrdersCreateTestOrderRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCreateTestOrderResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCreateTestOrderResponse(); |
| var od = new api.OrdersCreateTestOrderResponse.fromJson(o.toJson()); |
| checkOrdersCreateTestOrderResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequest(); |
| var od = new api.OrdersCustomBatchRequest.fromJson(o.toJson()); |
| checkOrdersCustomBatchRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntry", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntry(); |
| var od = new api.OrdersCustomBatchRequestEntry.fromJson(o.toJson()); |
| checkOrdersCustomBatchRequestEntry(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntryCancel", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryCancel(); |
| var od = new api.OrdersCustomBatchRequestEntryCancel.fromJson(o.toJson()); |
| checkOrdersCustomBatchRequestEntryCancel(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntryCancelLineItem", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryCancelLineItem(); |
| var od = new api.OrdersCustomBatchRequestEntryCancelLineItem.fromJson( |
| o.toJson()); |
| checkOrdersCustomBatchRequestEntryCancelLineItem(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntryRefund", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryRefund(); |
| var od = new api.OrdersCustomBatchRequestEntryRefund.fromJson(o.toJson()); |
| checkOrdersCustomBatchRequestEntryRefund(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntryReturnLineItem", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryReturnLineItem(); |
| var od = new api.OrdersCustomBatchRequestEntryReturnLineItem.fromJson( |
| o.toJson()); |
| checkOrdersCustomBatchRequestEntryReturnLineItem(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntryShipLineItems", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryShipLineItems(); |
| var od = new api.OrdersCustomBatchRequestEntryShipLineItems.fromJson( |
| o.toJson()); |
| checkOrdersCustomBatchRequestEntryShipLineItems(od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(); |
| var od = new api |
| .OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo.fromJson( |
| o.toJson()); |
| checkOrdersCustomBatchRequestEntryShipLineItemsShipmentInfo(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchRequestEntryUpdateShipment", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchRequestEntryUpdateShipment(); |
| var od = new api.OrdersCustomBatchRequestEntryUpdateShipment.fromJson( |
| o.toJson()); |
| checkOrdersCustomBatchRequestEntryUpdateShipment(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchResponse(); |
| var od = new api.OrdersCustomBatchResponse.fromJson(o.toJson()); |
| checkOrdersCustomBatchResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersCustomBatchResponseEntry", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersCustomBatchResponseEntry(); |
| var od = new api.OrdersCustomBatchResponseEntry.fromJson(o.toJson()); |
| checkOrdersCustomBatchResponseEntry(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersGetByMerchantOrderIdResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersGetByMerchantOrderIdResponse(); |
| var od = new api.OrdersGetByMerchantOrderIdResponse.fromJson(o.toJson()); |
| checkOrdersGetByMerchantOrderIdResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersGetTestOrderTemplateResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersGetTestOrderTemplateResponse(); |
| var od = new api.OrdersGetTestOrderTemplateResponse.fromJson(o.toJson()); |
| checkOrdersGetTestOrderTemplateResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersListResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersListResponse(); |
| var od = new api.OrdersListResponse.fromJson(o.toJson()); |
| checkOrdersListResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersRefundRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersRefundRequest(); |
| var od = new api.OrdersRefundRequest.fromJson(o.toJson()); |
| checkOrdersRefundRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersRefundResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersRefundResponse(); |
| var od = new api.OrdersRefundResponse.fromJson(o.toJson()); |
| checkOrdersRefundResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersReturnLineItemRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersReturnLineItemRequest(); |
| var od = new api.OrdersReturnLineItemRequest.fromJson(o.toJson()); |
| checkOrdersReturnLineItemRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersReturnLineItemResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersReturnLineItemResponse(); |
| var od = new api.OrdersReturnLineItemResponse.fromJson(o.toJson()); |
| checkOrdersReturnLineItemResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersShipLineItemsRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersShipLineItemsRequest(); |
| var od = new api.OrdersShipLineItemsRequest.fromJson(o.toJson()); |
| checkOrdersShipLineItemsRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersShipLineItemsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersShipLineItemsResponse(); |
| var od = new api.OrdersShipLineItemsResponse.fromJson(o.toJson()); |
| checkOrdersShipLineItemsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersUpdateMerchantOrderIdRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersUpdateMerchantOrderIdRequest(); |
| var od = new api.OrdersUpdateMerchantOrderIdRequest.fromJson(o.toJson()); |
| checkOrdersUpdateMerchantOrderIdRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersUpdateMerchantOrderIdResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersUpdateMerchantOrderIdResponse(); |
| var od = new api.OrdersUpdateMerchantOrderIdResponse.fromJson(o.toJson()); |
| checkOrdersUpdateMerchantOrderIdResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersUpdateShipmentRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersUpdateShipmentRequest(); |
| var od = new api.OrdersUpdateShipmentRequest.fromJson(o.toJson()); |
| checkOrdersUpdateShipmentRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrdersUpdateShipmentResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrdersUpdateShipmentResponse(); |
| var od = new api.OrdersUpdateShipmentResponse.fromJson(o.toJson()); |
| checkOrdersUpdateShipmentResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Price", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPrice(); |
| var od = new api.Price.fromJson(o.toJson()); |
| checkPrice(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestOrder", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestOrder(); |
| var od = new api.TestOrder.fromJson(o.toJson()); |
| checkTestOrder(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestOrderCustomer", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestOrderCustomer(); |
| var od = new api.TestOrderCustomer.fromJson(o.toJson()); |
| checkTestOrderCustomer(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestOrderLineItem", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestOrderLineItem(); |
| var od = new api.TestOrderLineItem.fromJson(o.toJson()); |
| checkTestOrderLineItem(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestOrderLineItemProduct", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestOrderLineItemProduct(); |
| var od = new api.TestOrderLineItemProduct.fromJson(o.toJson()); |
| checkTestOrderLineItemProduct(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestOrderPaymentMethod", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestOrderPaymentMethod(); |
| var od = new api.TestOrderPaymentMethod.fromJson(o.toJson()); |
| checkTestOrderPaymentMethod(od); |
| }); |
| }); |
| |
| unittest.group("resource-OrdersResourceApi", () { |
| unittest.test("method--acknowledge", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersAcknowledgeRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersAcknowledgeRequest.fromJson(json); |
| checkOrdersAcknowledgeRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersAcknowledgeResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .acknowledge(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then( |
| unittest.expectAsync1(((api.OrdersAcknowledgeResponse response) { |
| checkOrdersAcknowledgeResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--advancetestorder", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersAdvanceTestOrderResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .advancetestorder(arg_merchantId, arg_orderId, $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersAdvanceTestOrderResponse response) { |
| checkOrdersAdvanceTestOrderResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--cancel", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersCancelRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersCancelRequest.fromJson(json); |
| checkOrdersCancelRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersCancelResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.OrdersCancelResponse response) { |
| checkOrdersCancelResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--cancellineitem", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersCancelLineItemRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersCancelLineItemRequest.fromJson(json); |
| checkOrdersCancelLineItemRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersCancelLineItemResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancellineitem(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersCancelLineItemResponse response) { |
| checkOrdersCancelLineItemResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--createtestorder", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersCreateTestOrderRequest(); |
| var arg_merchantId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersCreateTestOrderRequest.fromJson(json); |
| checkOrdersCreateTestOrderRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersCreateTestOrderResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .createtestorder(arg_request, arg_merchantId, $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersCreateTestOrderResponse response) { |
| checkOrdersCreateTestOrderResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--custombatch", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersCustomBatchRequest(); |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersCustomBatchRequest.fromJson(json); |
| checkOrdersCustomBatchRequest(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 + 18), |
| unittest.equals("content/v2sandbox/")); |
| pathOffset += 18; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("orders/batch")); |
| pathOffset += 12; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersCustomBatchResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.custombatch(arg_request, $fields: arg_$fields).then( |
| unittest.expectAsync1(((api.OrdersCustomBatchResponse response) { |
| checkOrdersCustomBatchResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrder()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_merchantId, arg_orderId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.Order response) { |
| checkOrder(response); |
| }))); |
| }); |
| |
| unittest.test("method--getbymerchantorderid", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_merchantId = "foo"; |
| var arg_merchantOrderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = |
| convert.JSON.encode(buildOrdersGetByMerchantOrderIdResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getbymerchantorderid(arg_merchantId, arg_merchantOrderId, |
| $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersGetByMerchantOrderIdResponse response) { |
| checkOrdersGetByMerchantOrderIdResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--gettestordertemplate", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_merchantId = "foo"; |
| var arg_templateName = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = |
| convert.JSON.encode(buildOrdersGetTestOrderTemplateResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .gettestordertemplate(arg_merchantId, arg_templateName, |
| $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersGetTestOrderTemplateResponse response) { |
| checkOrdersGetTestOrderTemplateResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_merchantId = "foo"; |
| var arg_acknowledged = true; |
| var arg_maxResults = 42; |
| var arg_orderBy = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_placedDateEnd = "foo"; |
| var arg_placedDateStart = "foo"; |
| var arg_statuses = buildUnnamed1581(); |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["acknowledged"].first, |
| unittest.equals("$arg_acknowledged")); |
| unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| unittest.equals(arg_maxResults)); |
| unittest.expect( |
| queryMap["orderBy"].first, unittest.equals(arg_orderBy)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["placedDateEnd"].first, |
| unittest.equals(arg_placedDateEnd)); |
| unittest.expect(queryMap["placedDateStart"].first, |
| unittest.equals(arg_placedDateStart)); |
| unittest.expect(queryMap["statuses"], unittest.equals(arg_statuses)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersListResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_merchantId, |
| acknowledged: arg_acknowledged, |
| maxResults: arg_maxResults, |
| orderBy: arg_orderBy, |
| pageToken: arg_pageToken, |
| placedDateEnd: arg_placedDateEnd, |
| placedDateStart: arg_placedDateStart, |
| statuses: arg_statuses, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.OrdersListResponse response) { |
| checkOrdersListResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--refund", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersRefundRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersRefundRequest.fromJson(json); |
| checkOrdersRefundRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersRefundResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .refund(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.OrdersRefundResponse response) { |
| checkOrdersRefundResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--returnlineitem", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersReturnLineItemRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersReturnLineItemRequest.fromJson(json); |
| checkOrdersReturnLineItemRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersReturnLineItemResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .returnlineitem(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersReturnLineItemResponse response) { |
| checkOrdersReturnLineItemResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--shiplineitems", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersShipLineItemsRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersShipLineItemsRequest.fromJson(json); |
| checkOrdersShipLineItemsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersShipLineItemsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .shiplineitems(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersShipLineItemsResponse response) { |
| checkOrdersShipLineItemsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--updatemerchantorderid", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersUpdateMerchantOrderIdRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersUpdateMerchantOrderIdRequest.fromJson(json); |
| checkOrdersUpdateMerchantOrderIdRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = |
| convert.JSON.encode(buildOrdersUpdateMerchantOrderIdResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .updatemerchantorderid(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1( |
| ((api.OrdersUpdateMerchantOrderIdResponse response) { |
| checkOrdersUpdateMerchantOrderIdResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--updateshipment", () { |
| var mock = new HttpServerMock(); |
| api.OrdersResourceApi res = new api.ContentApi(mock).orders; |
| var arg_request = buildOrdersUpdateShipmentRequest(); |
| var arg_merchantId = "foo"; |
| var arg_orderId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.OrdersUpdateShipmentRequest.fromJson(json); |
| checkOrdersUpdateShipmentRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| |
| 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["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOrdersUpdateShipmentResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .updateshipment(arg_request, arg_merchantId, arg_orderId, |
| $fields: arg_$fields) |
| .then(unittest |
| .expectAsync1(((api.OrdersUpdateShipmentResponse response) { |
| checkOrdersUpdateShipmentResponse(response); |
| }))); |
| }); |
| }); |
| } |