Beispiel #1
0
        static void Main(string[] args)
        {
            string stockFilename = "vendingmachine.csv";
            string logFilename   = "Log.txt";

            // Check if we're passed a commandline argument, and if we are, use that for our stockfile
            // HACK: Extension idea: add more commandline arguments and implement switches.
            if (args.Length > 0)
            {
                stockFilename = args[0];
            }

            // First we need to set up our file IO
            IDataManager dataManager = new DataManager(logFilename);

            // Then we need to load up our stock items
            List <VendingMachineItem> items = dataManager.LoadItems(stockFilename);

            // Here we initialize the vending machine with its stock and our UI manager
            VendingMachine vendingMachine = new VendingMachine(items);
            IUIManager     uiManager      = new ConsoleManager();

            // And we're off to the races!
            UserInterface userInterface = new UserInterface(vendingMachine, dataManager, uiManager);

            userInterface.RunInterface();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            VendingMachine vendingMachine = new VendingMachine();
            UserInterface  userInterface  = new UserInterface(vendingMachine);

            userInterface.RunInterface();
        }
        static void Main(string[] args)
        {
            //should not change//
            UserInterface userInterface = new UserInterface();

            userInterface.RunInterface();
            //should not change//
        }
        static void Main(string[] args)
        {
            //This is the only code that goes here
            //Do not change this code
            UserInterface userInterface = new UserInterface();

            userInterface.RunInterface();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");


            UserInterface ui = new UserInterface(connectionString);

            ui.RunInterface();
        }
Beispiel #6
0
        static void Main(string[] args)
        {//leave this as is
            UserInterface userInterface = new UserInterface();

            userInterface.RunInterface();
        }
        static void Main(string[] args) /************No editing allowed*********/
        {
            UserInterface userInterface = new UserInterface();

            userInterface.RunInterface();
        }
        static void Main(string[] args)
        {
            UserInterface userInterface = new UserInterface();

            userInterface.RunInterface();
        }