Search in sources :

Example 66 with MonetaryAmount

use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.

the class MonetaryFunctionsFilterTest method isLessThanOrEqualToTest.

@Test
public void isLessThanOrEqualToTest() {
    MonetaryAmount money = FastMoney.of(1, BRAZILIAN_REAL);
    List<MonetaryAmount> justRealList = currencies().filter(isCurrency(BRAZILIAN_REAL).and(isLessThanOrEqualTo(money))).collect(Collectors.toList());
    Assert.assertEquals(2, justRealList.size());
}
Also used : MonetaryAmount(javax.money.MonetaryAmount) Test(org.testng.annotations.Test)

Example 67 with MonetaryAmount

use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.

the class MonetaryFunctionsFilterTest method isGreaterThanOrEqualToTest.

@Test
public void isGreaterThanOrEqualToTest() {
    MonetaryAmount money = FastMoney.of(1, BRAZILIAN_REAL);
    List<MonetaryAmount> justRealList = currencies().filter(isCurrency(BRAZILIAN_REAL).and(isGreaterThanOrEqualTo(money))).collect(Collectors.toList());
    Assert.assertEquals(2, justRealList.size());
}
Also used : MonetaryAmount(javax.money.MonetaryAmount) Test(org.testng.annotations.Test)

Example 68 with MonetaryAmount

use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.

the class MonetaryFunctionsFilterTest method isLessThanTest.

@Test
public void isLessThanTest() {
    MonetaryAmount money = FastMoney.of(1, BRAZILIAN_REAL);
    List<MonetaryAmount> justRealList = currencies().filter(isCurrency(BRAZILIAN_REAL).and(isLessThan(money))).collect(Collectors.toList());
    Assert.assertEquals(1, justRealList.size());
}
Also used : MonetaryAmount(javax.money.MonetaryAmount) Test(org.testng.annotations.Test)

Example 69 with MonetaryAmount

use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.

the class MonetaryFunctionsFilterTest method isBetweenTest.

@Test
public void isBetweenTest() {
    MonetaryAmount min = FastMoney.of(0, BRAZILIAN_REAL);
    MonetaryAmount max = FastMoney.of(10, BRAZILIAN_REAL);
    List<MonetaryAmount> justRealList = currencies().filter(isCurrency(BRAZILIAN_REAL).and(isBetween(min, max))).collect(Collectors.toList());
    Assert.assertEquals(3, justRealList.size());
}
Also used : MonetaryAmount(javax.money.MonetaryAmount) Test(org.testng.annotations.Test)

Example 70 with MonetaryAmount

use of javax.money.MonetaryAmount in project jsr354-ri by JavaMoney.

the class MonetaryFunctionsFilterTest method isGreaterThanTest.

@Test
public void isGreaterThanTest() {
    MonetaryAmount money = FastMoney.of(1, BRAZILIAN_REAL);
    List<MonetaryAmount> justRealList = currencies().filter(isCurrency(BRAZILIAN_REAL).and(isGreaterThan(money))).collect(Collectors.toList());
    Assert.assertEquals(1, justRealList.size());
}
Also used : MonetaryAmount(javax.money.MonetaryAmount) Test(org.testng.annotations.Test)

Aggregations

MonetaryAmount (javax.money.MonetaryAmount)275 Test (org.testng.annotations.Test)260 CurrencyConversion (javax.money.convert.CurrencyConversion)88 BeforeTest (org.testng.annotations.BeforeTest)83 BigDecimal (java.math.BigDecimal)64 CurrencyUnit (javax.money.CurrencyUnit)57 ConversionQuery (javax.money.convert.ConversionQuery)10 RoundedMoney (org.javamoney.moneta.RoundedMoney)10 LocalDate (java.time.LocalDate)9 ExchangeRateProvider (javax.money.convert.ExchangeRateProvider)9 Test (org.junit.Test)9 FastMoney (org.javamoney.moneta.FastMoney)6 Money (org.javamoney.moneta.Money)6 MathContext (java.math.MathContext)4 MonetaryOperator (javax.money.MonetaryOperator)4 MonetaryAmountFormat (javax.money.format.MonetaryAmountFormat)4 MonetaryAmountFactory (javax.money.MonetaryAmountFactory)3 BookingBean (com.github.drbookings.model.data.BookingBean)2 Calendar (java.util.Calendar)2 GregorianCalendar (java.util.GregorianCalendar)2