Esempio n. 1
0
        public VendingMachineLogic()
        {
            VendingMachineFileReader filereader = new VendingMachineFileReader();

            Inventory = filereader.GetInventory();
            foreach (var kvp in Inventory)
            {
                NamesOfItems.Add(kvp.Value[0].NameOfItem);
            }
        }
        /// <summary>
        /// Runs the Last Resort Vending Program
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            VendingMachineFileReader  vmfr  = new VendingMachineFileReader();
            List <VendingMachineItem> stock = vmfr.ReadFile();
            VendingMachine            vm    = new VendingMachine(stock);

            MainMenuCLI mainMenu = new MainMenuCLI(vm);

            mainMenu.Display();
        }
        static void Main(string[] args)
        {
            VendingMachineFileReader reader = new VendingMachineFileReader("vendingmachine.csv");
            var inventory = reader.GetInventory();

            VendingMachine vm = new VendingMachine(inventory);

            VendingMachineCLI cli = new VendingMachineCLI(vm);

            cli.Run();
        }