예제 #1
0
        public void CreateInventoryRequestOrder()
        {
            var inventoryBase = new AirtableItemLookup();

            var test             = new Automation();
            var component        = inventoryBase.GetComponentByName("ZZZ - Dummy", false);
            var previousQuantity = component.Quantity;
            var previousPending  = component.Pending;

            test.GenerateInventoryRequest(component, 3);
            Assert.Equal(component.Quantity, previousQuantity);
            Assert.True(component.Pending - previousPending == 3);
            previousPending = component.Pending;

            test.GenerateInventoryRequest(component);
            component = inventoryBase.GetComponentByName("ZZZ - Dummy", false);
            Assert.Equal(component.Quantity, previousQuantity);
            Assert.True(component.Pending - previousPending == component.NumberOfBatches * component.BatchSize);
        }
예제 #2
0
        public static bool CreateAutomaticInventoryOrder(string componentID)
        {
            var inventoryBase = new AirtableItemLookup();
            var auto          = new Automation();
            var component     = inventoryBase.GetComponentByID(componentID);

            if (component != null)
            {
                auto.GenerateInventoryRequest(component);
                return(true);
            }
            return(false);
        }