Ejemplo n.º 1
0
        static async Task Main(string[] args)
        {
            try
            {
                Startup.CreateHostBuilder(args).Build();

                var option = "";
                do
                {
                    var appService = new RateAppService(Startup.IRateService);
                    var result     = (await appService.Sumary()).Result;

                    foreach (var item in result)
                    {
                        Console.WriteLine(item.ResultString);
                    }

                    Console.WriteLine("Type '#' to exit");
                    option = Console.ReadLine();
                    Console.Clear();
                } while (option != "#");
            }
            catch (AppBaseException ex)
            {
                //Console.Beep();
                Console.Clear();
                Console.WriteLine("Error: " + ex.Message);
            }
            catch (Exception ex)
            {
                //Console.Beep();
                Console.Clear();
                Console.WriteLine("Error: System could not calculate the rates");
            }
        }
Ejemplo n.º 2
0
 public RateTest() : base()
 {
     _service.Setup(x => x.GetRateAsync(It.IsAny <ECurrency>(), It.IsAny <ECurrency>())).ReturnsAsync(It.IsAny <AppResult <Rate_vw> >());
     _appService = new RateAppService(_service.Object);
 }