Package com.wesabe.api.util.money

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


      assertEquals(0, zeroDollars.signum());
    }

    @Test
    public void shouldBeEqualToZeroDollars() throws Exception {
      Money zeroDollars = new Money(decimal("0.00"), USD);
      Money anotherZeroDollars = new Money(decimal("0.00"), USD);
      assertTrue(zeroDollars.equals(anotherZeroDollars));
    }
View Full Code Here


      assertTrue(zeroDollars.equals(anotherZeroDollars));
    }

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

      assertTrue(zeroDollars.equals(zeroDollars));
    }

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

      assertFalse(zeroDollars.equals(null));
    }

    @Test
    public void shouldHaveTheSameHashCodeAsZeroDollars() throws Exception {
      Money zeroDollars = new Money(decimal("0.00"), USD);
      Money anotherZeroDollars = new Money(decimal("0.00"), USD);
      assertEquals(anotherZeroDollars.hashCode(), zeroDollars.hashCode());
    }
View Full Code Here

      assertEquals(anotherZeroDollars.hashCode(), zeroDollars.hashCode());
    }

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

      assertFalse(zeroDollars.equals(oneDollar));
    }

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

      assertFalse(oneDollar.hashCode() == zeroDollars.hashCode());
    }

    @Test
    public void shouldNotHaveTheSameHashCodeAsZeroEuros() throws Exception {
      Money zeroDollars = new Money(decimal("0.00"), USD);
      Money zeroEuros = new Money(decimal("0.00"), EUR);
      assertFalse(zeroEuros.hashCode() == zeroDollars.hashCode());
    }
View Full Code Here

      assertFalse(zeroEuros.hashCode() == zeroDollars.hashCode());
    }

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

      assertFalse(zeroDollars.equals(zeroEuros));
    }

    @Test
    public void shouldStillBeZeroWhenNegated() throws Exception {
      Money zeroDollars = new Money(decimal("0.00"), USD);
      assertTrue(zeroDollars.equals(zeroDollars.negate()));
    }
View Full Code Here

    }

    @Test
    public void shouldBeZeroEurosWhenConverted() throws Exception {
      CurrencyExchangeRateMap exchangeRates = new CurrencyExchangeRateMap();
      Money zeroDollars = new Money(decimal("0.00"), USD);
      Money zeroEuros = new Money(decimal("0.00"), EUR);
      assertEquals(zeroEuros, zeroDollars.convert(exchangeRates, EUR, now()));
    }
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.