Package com.wesabe.api.util.money

Examples of com.wesabe.api.util.money.Money


      assertFalse(oneDollar.isZero());
    }

    @Test
    public void shouldHaveASignOfOne() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      assertEquals(1, oneDollar.signum());
    }
View Full Code Here


      assertEquals(1, oneDollar.signum());
    }

    @Test
    public void shouldBeEqualToOneDollar() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money anotherDollar = new Money(decimal("1.00"), USD);
      assertTrue(oneDollar.equals(anotherDollar));
    }
View Full Code Here

      assertTrue(oneDollar.equals(anotherDollar));
    }

    @Test
    public void shouldNotBeEqualToZeroDollars() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money zeroDollars = new Money(decimal("0.00"), USD);
      assertFalse(oneDollar.equals(zeroDollars));
    }
View Full Code Here

      assertFalse(oneDollar.equals(zeroDollars));
    }

    @Test
    public void shouldNotBeEqualToOneEuro() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money oneEuro = new Money(decimal("1.00"), EUR);
      assertFalse(oneDollar.equals(oneEuro));
    }
View Full Code Here

      assertFalse(oneDollar.equals(oneEuro));
    }

    @Test
    public void shouldNotEqualANonMoneyObject() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      assertFalse(oneDollar.equals("this is not my beautiful house"));
    }
View Full Code Here

      assertFalse(oneDollar.equals("this is not my beautiful house"));
    }

    @Test
    public void shouldBeNegativeOneDollarWhenNegated() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money minusOneDollar = new Money(decimal("-1.00"), USD);
      assertEquals(minusOneDollar, oneDollar.negate());
    }
View Full Code Here

      assertEquals(minusOneDollar, oneDollar.negate());
    }

    @Test
    public void shoudlHaveAnAbsoluteValueOfOneDollar() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      assertEquals(oneDollar, oneDollar.abs());
    }
View Full Code Here

      assertEquals(oneDollar, oneDollar.abs());
    }
   
    @Test
    public void shouldConvertItselfToAMachineReadableString() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      assertEquals("1.00", oneDollar.toPlainString());
    }
View Full Code Here

  public static class One_Dollar_Plus_One_Dollar {

    @Test
    public void shouldBeTwoDollars() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money twoDollars = new Money(decimal("2.00"), USD);
      assertEquals(twoDollars, oneDollar.add(oneDollar));
    }
View Full Code Here

  public static class Two_Dollars_Minus_One_Dollar {

    @Test
    public void shouldBeOneDollar() throws Exception {
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money twoDollars = new Money(decimal("2.00"), USD);
      assertEquals(oneDollar, twoDollars.subtract(oneDollar));
    }
View Full Code Here

TOP

Related Classes of com.wesabe.api.util.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.