Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Wired Brain Coffee - Info Tool!");

            Console.WriteLine("Type help to see available coffee shop, and quit to exit!");

            var  data  = new CoffeeShopDataProvider();
            var  line  = Console.ReadLine();
            bool valid = true;

            while (valid)
            {
                if (string.Equals("quit", line, StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }

                if (string.Equals("help", line, StringComparison.OrdinalIgnoreCase))
                {
                    var coffeeShops = data.LoadCoffeeShop();
                    Console.WriteLine("Available coffee shops!");
                    foreach (var shop in coffeeShops)
                    {
                        Console.WriteLine($"> {shop.Locations}");
                    }
                    Console.ReadLine();
                }
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to WiredBrain Coffee Shop. Your number one Coffee Shop.");
            Console.WriteLine("Write 'help' to list available Coffee Shop commands.Write 'quite' to Exit.");
            var coffeeShopDataProvider = new CoffeeShopDataProvider();

            while (true)
            {
                var line        = Console.ReadLine();
                var coffeeShops = coffeeShopDataProvider.LoadCoffeeShop();

                if (string.Equals("quit", line, StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }
                if (string.Equals("help", line, StringComparison.OrdinalIgnoreCase))
                {
                    Console.WriteLine("> Available Coffee Commands:");
                    foreach (var coffeeShop in coffeeShops)
                    {
                        Console.WriteLine($"> {coffeeShop.Location}");
                    }
                }
            }
        }