public double GetCurrentValueInDollars(double bitcoinQuantity, BitcoinPriceService priceService) { //BitcoinPriceService bitcoinPriceService = new BitcoinPriceService(); //double bitcoinValueInDollars = bitcoinQuantity * bitcoinPriceService.GetCurrentBitcoinPriceInDollars(); double bitcoinValueInDollars = bitcoinQuantity * priceService.GetCurrentBitcoinPriceInDollars(); Console.Write("\nThe current value in dollars is: " + bitcoinValueInDollars); return(bitcoinValueInDollars); }
static void Main(string[] args) { BitcoinWallet wallet = new BitcoinWallet(); BitcoinPriceService priceService = new BitcoinPriceService(); string walletAddress = wallet.GetAddres(); double walletNumberOfBitcoins = wallet.GetNumberOfBitcoins(); //double walletValueInDollars = wallet.GetCurrentValueInDollars(walletNumberOfBitcoins); double walletValueInDollars = wallet.GetCurrentValueInDollars(walletNumberOfBitcoins, priceService); Console.ReadKey(); }