예제 #1
0
        private void AddSomeItemsToInventory()
        {
            var vendingItems = new List <VendingItem>();

            for (int i = 1; i < 100; i++)
            {
                vendingItems.Add(new VendingItem {
                    Name = string.Format("Can{0}", i), Price = 0.5f
                });
            }
            _machine.AddInventory(vendingItems);
        }
        /// <summary>
        ///  Add initial inventory.
        /// </summary>

        private static void BootUpVendingMachine()
        {
            List <VendingItem> items = new List <VendingItem>();

            for (int iVar = 1; iVar <= VendingMachine.SystemCapacity; iVar++)
            {
                items.Add(new VendingItem {
                    Name = string.Format("Can {0}", iVar), Price = 0.5f
                });
            }
            _vendingMachineInstance.AddInventory(items);
        }