public void TestReduceSum() { Expression sum = new Sum(Money.Dollar(3), Money.Dollar(4)); Bank bank = new Bank(); Money actual = bank.Reduce(sum, "USD"); Assert.Equal(Money.Dollar(7), actual); }
public void TestSumTimes() { Expression fiveBucks = Money.Dollar(5); Expression tenFrancs = Money.Franc(10); Bank bank = new Bank(); bank.AddRate("CHF", "USD", 2); Expression sum = new Sum(fiveBucks, tenFrancs).Times(2); Money actual = bank.Reduce(sum, "USD"); Assert.Equal(Money.Dollar(20), actual); }