Package junit.samples.money

Examples of junit.samples.money.Money


    IMoney expected= MoneyBag.create(new Money(26, "CHF"), new Money(7, "USD"));
    assertEquals(expected, f14CHF.add(fMB1));
  }
  @Test public void testSimpleMultiply() {
    // [14 CHF] *2 == [28 CHF]
    Money expected= new Money(28, "CHF");
    assertEquals(expected, f14CHF.multiply(2));
  }
View Full Code Here


    Money expected= new Money(28, "CHF");
    assertEquals(expected, f14CHF.multiply(2));
  }
  @Test public void testSimpleNegate() {
    // [14 CHF] negate == [-14 CHF]
    Money expected= new Money(-14, "CHF");
    assertEquals(expected, f14CHF.negate());
  }
View Full Code Here

    Money expected= new Money(-14, "CHF");
    assertEquals(expected, f14CHF.negate());
  }
  @Test public void testSimpleSubtract() {
    // [14 CHF] - [12 CHF] == [2 CHF]
    Money expected= new Money(2, "CHF");
    assertEquals(expected, f14CHF.subtract(f12CHF));
  }
View Full Code Here

  public static junit.framework.Test suite() {
     return new JUnit4TestAdapter(MoneyTest.class);
  }

  @Before public void setUp() {
    f12CHF= new Money(12, "CHF");
    f14CHF= new Money(14, "CHF");
    f7USD= new Money( 7, "USD");
    f21USD= new Money(21, "USD");

    fMB1= MoneyBag.create(f12CHF, f7USD);
    fMB2= MoneyBag.create(f14CHF, f21USD);
  }
View Full Code Here

TOP

Related Classes of junit.samples.money.Money

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.