public void InventoryIsLessThanAmountOfTheOrder()
        {
            //Assign
            orderList = new Dictionary <string, int>();
            orderList.Add("Apples", 10);
            orderList.Add("Pears", 10);
            orders    = new Orders(orderList);
            wareHouse = new WareHouse("owd");
            locations = new Locations();
            locations.setWareHouse(wareHouse);
            wareHouse.SetInventoryAmount("Apples", 5);
            wareHouse.SetInventoryAmount("Pears", 5);
            InventoryAllocator inventoryAllocator = new InventoryAllocator();

            //Act
            inventoryAllocator.AllocateOrderAmongLocations(orders, locations);
            //Assert
            Assert.IsTrue(inventoryAllocator.OrderAmount > 0);
        }
        public void OrderHasNegativeAmount()
        {
            //Assign
            orderList = new Dictionary <string, int>();
            orderList.Add("Apples", -1);
            orderList.Add("Pears", 5);
            orders    = new Orders(orderList);
            wareHouse = new WareHouse("owd");
            locations = new Locations();
            locations.setWareHouse(wareHouse);
            wareHouse.SetInventoryAmount("Apples", 5);
            wareHouse.SetInventoryAmount("Watermelon", 5);
            InventoryAllocator inventoryAllocator = new InventoryAllocator();

            //Act

            //Assert
            Assert.IsTrue(inventoryAllocator.AllocateOrderAmongLocations(orders, locations) == null);
        }
        public void InventoryMatchTheOrder()
        {
            //Assign
            orderList = new Dictionary <string, int>();
            orderList.Add("Apples", 5);
            orderList.Add("Pears", 5);
            orders    = new Orders(orderList);
            wareHouse = new WareHouse("owd");
            locations = new Locations();
            locations.setWareHouse(wareHouse);
            wareHouse.SetInventoryAmount("Apples", 5);
            wareHouse.SetInventoryAmount("Pears", 5);
            InventoryAllocator inventoryAllocator = new InventoryAllocator();

            //Act
            inventoryAllocator.AllocateOrderAmongLocations(orders, locations);
            //Assert
            Assert.IsTrue(wareHouse.InventoryAmounts["Apples"] == 0);
            Assert.IsTrue(wareHouse.StoredInventory["Apples"] == 5);
            Assert.IsTrue(wareHouse.InventoryAmounts["Pears"] == 0);
            Assert.IsTrue(wareHouse.StoredInventory["Pears"] == 5);
        }