Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 public void Reduce()
 {
     Bank bank = new Bank();
       Money result = bank.Reduce(Money.Dollar(1), "USD");
       Assert.AreEqual(Money.Dollar(1), result);
 }