Пример #1
0
        public void TestMethod1()
        {
            AirtableOrders ATbase = new AirtableOrders();

            var order = ATbase.newOrderData(1234567);

            order.Notes        = "this is a test order";
            order.ShippingCost = 10.21;
            order.TotalPrice   = 504.23;
            order.Description  = "test order";
            //  order.PrintOperator = "Al Billington";
            //   order.Shipper = "Leah";
            // order.ShippingCharge = Math.Min(7;
            order.MaterialCost = 12.34;
            order.DueDate      = DateTime.Now;
            order.Channel      = "Etsy";
            ATbase.CreateOrderRecord(order);

            ATbase.CreateOrderRecord(order);
        }
Пример #2
0
        public void CreateAndUpdateOrder()
        {
            AirtableOrders ATbase  = new AirtableOrders(true);
            string         orderID = "1234567";
            var            order   = ATbase.newOrderData(orderID);

            order.Notes        = "this is a test order";
            order.ShippingCost = 10.21;
            order.Description  = "test\n order";

            order.Channel       = "Direct";
            order.AsanaTaskID   = "3242342634652352";
            order.PrintOperator = "Kyle Perkuhn";

            ATbase.CreateOrderRecord(order);

            order.TotalPrice       = 504.23;
            order.ValueOfInventory = 233.04;
            order.AmountRefunded   = 5;

            //            order.ShipDate = DateTime.Now;
            var retrievedRecord = ATbase.GetRecordByOrderID(orderID, out _);

            Assert.Equal(order.Notes, retrievedRecord.Notes);
            Assert.Equal(order.ShippingCost, retrievedRecord.ShippingCost);
            Assert.Equal(order.Description, retrievedRecord.Description);
            Assert.Equal(order.Channel, retrievedRecord.Channel);
            Assert.Equal(order.AsanaTaskID, retrievedRecord.AsanaTaskID);
            Assert.NotEqual(order.TotalPrice, retrievedRecord.TotalPrice);

            ATbase.CreateOrderRecord(order, true);

            retrievedRecord = ATbase.GetRecordByOrderID(orderID, out _);

            Assert.Equal(order.TotalPrice, retrievedRecord.TotalPrice);
            Assert.Equal(order.ValueOfInventory, retrievedRecord.ValueOfInventory);

            ATbase.DeleteOrderRecord(order);
        }