public async Task CreateOrderFromShipmentsWithError()
        {
            string accountNumber = AppConfiguration.AusPostAccountNumber;
            string username      = AppConfiguration.AusPostUsername;
            string password      = AppConfiguration.AusPostPassword;

            var client = new ShippingClient(accountNumber, username, password);

            client.Testing = true;

            var createShipmentRequest = CreateCreateShipmentsRequest();

            var createShipmentResponse = await client.CreateShipmentsAsync(createShipmentRequest);

            Assert.AreEqual(true, createShipmentResponse.Succeeded, string.Join(", ", createShipmentResponse.Errors.Select(e => e.Message)));
            Assert.AreEqual(1, createShipmentResponse.Shipments.Count);
            Assert.AreEqual(1, createShipmentResponse.Shipments[0].Items.Count);

            // Create the order without creating labels first

            var createOrderRequest = CreateCreateOrderFromShipmentsRequest(createShipmentResponse.Shipments[0].ShipmentID);

            var createOrderResponse = await client.CreateOrderFromShipmentsAsync(createOrderRequest);

            Assert.AreEqual(false, createOrderResponse.Succeeded);
            Assert.AreEqual(1, createOrderResponse.Errors.Count);
            Assert.AreEqual(0, createOrderResponse.Warnings.Count);
        }
        public async Task CreateOrderFromShipments()
        {
            string accountNumber = AppConfiguration.AusPostAccountNumber;
            string username      = AppConfiguration.AusPostUsername;
            string password      = AppConfiguration.AusPostPassword;

            var client = new ShippingClient(accountNumber, username, password);

            client.Testing = true;

            var createShipmentsRequest = CreateCreateShipmentsRequest();

            var createShipmentsResponse = await client.CreateShipmentsAsync(createShipmentsRequest);

            Assert.AreEqual(true, createShipmentsResponse.Succeeded, string.Join(", ", createShipmentsResponse.Errors.Select(e => e.Message)));
            Assert.AreEqual(1, createShipmentsResponse.Shipments.Count);
            Assert.AreEqual(1, createShipmentsResponse.Shipments[0].Items.Count);

            // You have to create labels before orders, although the API reference has it the other way around
            var updateRequest = CreateCreateLabelsRequest(createShipmentsResponse.Shipments[0].ShipmentID);

            var updateResponse = await client.CreateLabelsAsync(updateRequest);

            Assert.AreEqual(true, updateResponse.Succeeded, string.Join(", ", updateResponse.Errors.Select(e => e.Message)));
            Assert.AreEqual(1, updateResponse.Labels.Count);
            Assert.AreEqual(LabelStatus.Pending, updateResponse.Labels[0].Status);
            Assert.AreEqual(0, updateResponse.Errors.Count);
            Assert.AreEqual(0, updateResponse.Warnings.Count);

            // HACK: Wait for the labels to be generated...
            System.Threading.Thread.Sleep(5000);

            var createOrderRequest = CreateCreateOrderFromShipmentsRequest(createShipmentsResponse.Shipments[0].ShipmentID);

            var createOrderResponse = await client.CreateOrderFromShipmentsAsync(createOrderRequest);

            Assert.AreEqual(true, createOrderResponse.Succeeded, string.Join(", ", createOrderResponse.Errors.Select(e => e.Message)));
            Assert.AreEqual(true, !string.IsNullOrEmpty(createOrderResponse.Order.OrderID));
            Assert.AreEqual(0, createOrderResponse.Errors.Count);
            Assert.AreEqual(0, createOrderResponse.Warnings.Count);
        }