public void TestPredefinedPackage() { Parcel parcel = new Parcel() { weight = 1.8, predefined_package = "SMALLFLATRATEBOX" }; Shipment shipment = new Shipment() { parcel = parcel }; shipment.Create(); Assert.AreEqual(null, shipment.parcel.height); Assert.AreEqual("SMALLFLATRATEBOX", shipment.parcel.predefined_package); }
public void TestCarrierAccounts() { Address to = Address.Create(toAddress); Address from = Address.Create(fromAddress); Parcel parcel = Parcel.Create(new Dictionary<string, object>() { {"length", 8}, {"width", 6}, {"height", 5}, {"weight", 10} }); CustomsItem item = new CustomsItem() { description = "description" }; CustomsInfo info = new CustomsInfo() { customs_certify = "TRUE", eel_pfc = "NOEEI 30.37(a)", customs_items = new List<CustomsItem>() { item } }; Shipment shipment = new Shipment(); shipment.to_address = to; shipment.from_address = from; shipment.parcel = parcel; shipment.carrier_accounts = new List<CarrierAccount> { new CarrierAccount { id = "ca_qn6QC6fd" } }; shipment.Create(); if (shipment.rates.Count > 0) Assert.IsTrue(shipment.rates.TrueForAll(r => r.carrier_account_id == "ca_qn6QC6fd")); }
public void TestCreateWithId() { Shipment shipment = new Shipment() { id = "shp_asdlf" }; shipment.Create(); }