public void TestBitcoinWithdraw() { Bitcoin bitcoin = new Bitcoin(); double expected = 14.7; bitcoin.Withdraw(13.3); Assert.AreEqual(expected, bitcoin.GetBalance()); }
public void TestBitcoinDeposit() { Bitcoin bitcoin = new Bitcoin(); double expected = 30.9; bitcoin.Deposit(2.9); Assert.AreEqual(expected, bitcoin.GetBalance()); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); MallardDuck duck = new MallardDuck(); WildTurkey turkey = new WildTurkey(); IDuck turkeyAdapter = new TurkeyAdapter(turkey); Console.WriteLine("The Turkey says..."); turkey.Gobble(); turkey.Fly(); Console.WriteLine("\nThe Duck says..."); testDuck(duck); Console.WriteLine("\nThe TurkeyAdapter says..."); testDuck(turkeyAdapter); Bitcoin bitcoin = new Bitcoin(); USDollars usd = new USDollars(); IBit bitAdapter = new BitcoinToUSDollarsAdapter(bitcoin); IUSD usdAdapter = new USDollarToBitcoinAdapter(usd); Console.WriteLine($"\nYou have ${usd.GetBalance()} in your account."); Console.WriteLine($"\nYou have {bitcoin.GetBalance()} bitcoins in your account."); bitAdapter.Deposit(5000); usdAdapter.Deposit(1.5); Console.WriteLine($"\nYou have ${usd.GetBalance()} in your account."); Console.WriteLine($"\nYou have {bitcoin.GetBalance()} bitcoins in your account."); }