Esempio n. 1
0
        static void Main(string[] args)
        {
            var server = new BorexServer();

            foreach (var e in server.Rates)
            {
                Console.WriteLine("{0,-6}{1,8:0.00}{2,8:0.00}",
                                  e.Currency,
                                  e.Cost,
                                  e.Growth);
            }
            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var account = new Account();

            account[Currencies.USD] = 100;
            var server = new BorexServer();

            server.Exchange(account, Currencies.USD, Currencies.EUR, 50);
            foreach (Currencies e in Enum.GetValues(typeof(Currencies)))
            {
                Console.WriteLine("{0,-7}{1:0.00}", e, account[e]);
            }
            Console.ReadKey();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var account = CreateAccount(100, 100, 100, 100);

            var server = new BorexServer();

            var currencies = server
                             .Rates
                             .OrderBy(z => - z.RelativeGrowth)
                             .Select(z => z.Currency)
                             .GetFirstAndLast();

            server.Convert(account, currencies.Item1, currencies.Item2, 100);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var account = new AccountSet();

            account[Currencies.USD]     = account[Currencies.EUR] =
                account[Currencies.PLN] = account[Currencies.CZK] = 100;
            var server = new BorexServer();

            var currencies = server
                             .Rates
                             .OrderBy(z => z.RelativeGrowth)
                             .Select(z => z.Currency)
                             .ToArray();

            server.Convert(account, currencies.First(), currencies.Last(), 100);
        }