use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.
the class ExtractorMajorPartQueryTest method shouldReturnMajorPartNegative.
@Test
public void shouldReturnMajorPartNegative() {
MonetaryAmount monetaryAmount = Money.parse("BHD -1.345");
Long result = query.queryFrom(monetaryAmount);
Long expected = -1L;
assertEquals(result, expected);
}
use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.
the class FastMoneyProducerTest method shouldCreateUsingFastMoneyImplementation.
@Test
public void shouldCreateUsingFastMoneyImplementation() {
Long value = 10L;
MonetaryAmount amount = producer.create(currency, value);
assertTrue(FastMoney.class.isInstance(amount));
}
use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.
the class ExtractorMinorPartQueryTest method shouldReturnMajorPartNegative.
@Test
public void shouldReturnMajorPartNegative() {
MonetaryAmount monetaryAmount = Money.parse("BHD -1.345");
Long result = query.queryFrom(monetaryAmount);
Long expected = -345L;
assertEquals(result, expected);
}
use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.
the class ExtractorMinorPartQueryTest method shouldReturnMajorPartPositive.
@Test
public void shouldReturnMajorPartPositive() {
MonetaryAmount monetaryAmount = Money.parse("EUR 2.35");
Long result = query.queryFrom(monetaryAmount);
Long expected = 35L;
assertEquals(result, expected);
}
use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.
the class MonetaryFunctionsAggregatorTest method shouldMaxCorretly.
@Test
public void shouldMaxCorretly() {
Stream<MonetaryAmount> stream = StreamFactory.streamNormal();
MonetaryAmount max = stream.reduce(max()).get();
Assert.assertTrue(max.getNumber().intValue() == 10);
}
Aggregations