public void Reduce_different_currencies() { Bank bank = new Bank(); bank.AddRate("CHF", "USD", 2); Money result = bank.Reduce(Money.Franc(2), "USD"); Assert.AreEqual(Money.Dollar(1), result); }
public void Mixed_addition() { IExpression fiveBucks = Money.Dollar(5); IExpression tenFrancs = Money.Franc(10); Bank bank = new Bank(); bank.AddRate("CHF", "USD", 2); Money result = bank.Reduce(fiveBucks.Plus(tenFrancs), "USD"); Assert.AreEqual(Money.Dollar(10), result); }
public void Simple_addition() { Bank bank = new Bank(); Money five = Money.Dollar(5); IExpression sum = five.Plus(five); Money reduced = bank.Reduce(sum, "USD"); Assert.AreEqual(Money.Dollar(10), reduced); }
public void Reduce() { Bank bank = new Bank(); Money result = bank.Reduce(Money.Dollar(1), "USD"); Assert.AreEqual(Money.Dollar(1), result); }