Exemplo n.º 1
0
        public async Task IS_GetAmountInBase_List_Correct()
        {
            var balances = new List <BalanceRecord>
            {
                new BalanceRecord {
                    AssetId = "CHF", Balance = 10
                },
                new BalanceRecord {
                    AssetId = "BTC", Balance = 1
                }
            };

            var balancesWithBaseAsset = (await _service.GetAmountInBase(balances, "USD")).ToList();

            Assert.Equal(2, balancesWithBaseAsset.Count);
            Assert.Equal(10.14, balancesWithBaseAsset[0].Balance);
            Assert.Equal(2652, balancesWithBaseAsset[1].Balance);
        }
 public async Task <double> GetAmountInBase(string assetFrom, string assetTo, double amount)
 {
     return(await _rateCalculatorService.GetAmountInBase(assetFrom, amount, assetTo));
 }