示例#1
0
        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);
        }
示例#2
0
        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();
        }