Exemple #1
0
        static async Task Main(string[] args)
        {
            System.Console.WriteLine("View ReadMe for a list of commands");
            var cmd = System.Console.ReadLine();

            while (cmd != Commands.EXIT)
            {
                IMagazineService service = new MagazineService();
                API.Model.ApiResponse <API.Model.AnswerResponse> response = null;
                switch (cmd.Trim())
                {
                case Commands.EXIT:
                    break;

                case Commands.RUN:
                    response = service.Challenge();
                    System.Console.WriteLine(response.ToString());
                    break;

                case Commands.RUNASYNC:
                    response = await service.ChallengeAsync();

                    System.Console.WriteLine(response.ToString());
                    break;

                case Commands.HELP:
                default:
                    break;
                }
                cmd = System.Console.ReadLine();
            }
        }