public static async Task <ShippoCollection <Rate> > GetDefaultObject() { Shipment testObject = await ShipmentTest.GetDefaultObject(); // Use Synchronized rates method return(await GetShippoClient().GetShippingRatesSync(testObject.ObjectId, "USD")); }
public void testValidRetrieve() { Shipment testObject = ShipmentTest.getDefaultObject(); Shipment retrievedObject; retrievedObject = apiResource.RetrieveShipment((string)testObject.ObjectId); Assert.AreEqual(testObject.ObjectId, retrievedObject.ObjectId); }
public async Task TestValidRetrieve() { Shipment testObject = await ShipmentTest.GetDefaultObject(); Shipment retrievedObject; retrievedObject = await shippoClient.RetrieveShipment(testObject.ObjectId); Assert.AreEqual(testObject.ObjectId, retrievedObject.ObjectId); }
public static ShippoCollection<Rate> getDefaultObject () { Shipment testObject = ShipmentTest.getDefaultObject (); Hashtable parameters = new Hashtable (); parameters.Add ("id", testObject.ObjectId); parameters.Add ("currency_code", "USD"); // Use Synchronized rates method return getAPIResource ().GetShippingRatesSync (parameters); }
public void TestValidAddShipmentToBatch() { Batch batch = getDefaultObject(); Assert.AreEqual(batch.Status, ShippoEnums.Statuses.VALIDATING); List <String> shipmentIds = new List <String> (); Shipment shipment = ShipmentTest.getDefaultObject(); shipmentIds.Add(shipment.ObjectId); Batch retrieve = getValidBatch(batch.ObjectId); Batch newBatch = getAPIResource().AddShipmentsToBatch(retrieve.ObjectId, shipmentIds); Assert.AreEqual(retrieve.BatchShipments.Count + shipmentIds.Count, newBatch.BatchShipments.Count); }
public async Task TestValidAddShipmentToBatch() { Batch batch = await GetDefaultObject(); Assert.AreEqual(batch.Status, ShippoEnums.Statuses.VALIDATING); Shipment shipment = await ShipmentTest.GetDefaultObject(); Batch retrieve = await GetValidBatch(batch.ObjectId); Batch newBatch = await GetShippoClient().AddShipmentsToBatch(retrieve.ObjectId, new CreateBatchShipment[] { new CreateBatchShipment { Shipment = shipment.ObjectId } }); Assert.AreEqual(retrieve.BatchShipments.Count + 1, newBatch.BatchShipments.Count); }
public void TestValidRemoveShipmentsFromBatch() { Batch batch = getDefaultObject(); Assert.AreEqual(batch.Status, ShippoEnums.Statuses.VALIDATING); List <String> shipmentIds = new List <String> (); Shipment shipment = ShipmentTest.getDefaultObject(); shipmentIds.Add(shipment.ObjectId); Batch retrieve = getValidBatch(batch.ObjectId); Batch addBatch = getAPIResource().AddShipmentsToBatch(retrieve.ObjectId, shipmentIds); string removeId = addBatch.BatchShipments.Results [0].ObjectId; List <String> shipmentsToRemove = new List <String> (); shipmentsToRemove.Add(removeId); Batch removeBatch = getAPIResource().RemoveShipmentsFromBatch(batch.ObjectId, shipmentsToRemove); Assert.AreEqual(retrieve.BatchShipments.Count, removeBatch.BatchShipments.Count); }
public async Task TestValidRemoveShipmentsFromBatch() { Batch batch = await GetDefaultObject(); Assert.AreEqual(batch.Status, ShippoEnums.Statuses.VALIDATING); var shipmentIds = new List <string>(); Shipment shipment = await ShipmentTest.GetDefaultObject(); shipmentIds.Add(shipment.ObjectId); Batch retrieve = await GetValidBatch(batch.ObjectId); Batch addBatch = await GetShippoClient().AddShipmentsToBatch(retrieve.ObjectId, shipmentIds); string removeId = addBatch.BatchShipments.Results[0].ObjectId; var shipmentsToRemove = new List <string>(); shipmentsToRemove.Add(removeId); Batch removeBatch = await GetShippoClient().RemoveShipmentsFromBatch(batch.ObjectId, shipmentsToRemove); Assert.AreEqual(retrieve.BatchShipments.Count, removeBatch.BatchShipments.Count); }
public async Task TestValidCreate() { Shipment testObject = await ShipmentTest.GetDefaultObject(); Assert.AreEqual(ShippoEnums.ShippingStatuses.SUCCESS, testObject.Status); }
public void TestValidCreate() { Shipment testObject = ShipmentTest.getDefaultObject(); Assert.AreEqual("SUCCESS", testObject.Status); }
public void TestValidCreate() { Shipment testObject = ShipmentTest.getDefaultObject(); Assert.AreEqual("VALID", testObject.ObjectState); }