Exemple #1
0
        public async Task Is_FillBaseAssetData_Correct()
        {
            var balances = new List <BalanceRecord>
            {
                new BalanceRecord {
                    AssetId = "CHF", Balance = 10
                },
                new BalanceRecord {
                    AssetId = "BTC", Balance = 1
                }
            };
            var balancesWithBaseAsset = (await _service.FillBaseAssetData(balances, "USD")).ToList();

            Assert.Equal(2, balancesWithBaseAsset.Count);
            Assert.Equal(2652, balancesWithBaseAsset.First(item => item.AssetId == "BTC").AmountInBase);
            Assert.Equal(10.14, balancesWithBaseAsset.First(item => item.AssetId == "CHF").AmountInBase);
        }
 public async Task <BalanceRecordWithBase> FillBaseAssetData(string baseAssetId, [FromBody] BalanceRecord balanceRecord)
 {
     return(await _rateCalculatorService.FillBaseAssetData(balanceRecord, baseAssetId));
 }