Search in sources :

Example 6 with Money

use of com.dexels.navajo.document.types.Money in project navajo by Dexels.

the class UtilsMoneyTest method testAddMoneyAndDouble.

@Test
public void testAddMoneyAndDouble() {
    Money a = new Money(15);
    Double b = 10.0;
    Money result = (Money) Utils.add(a, b, "ToMoney(15) + 10.0");
    assertEquals(new Money(25), result);
}
Also used : Money(com.dexels.navajo.document.types.Money) Test(org.junit.Test)

Example 7 with Money

use of com.dexels.navajo.document.types.Money in project navajo by Dexels.

the class UtilsMoneyTest method testSubtractDoubleAndMoney.

@Test
public void testSubtractDoubleAndMoney() {
    Double a = 15.0;
    Money b = new Money(10);
    Money result = (Money) Utils.subtract(a, b, "15.0 - ToMoney(10)");
    assertEquals(new Money(5), result);
}
Also used : Money(com.dexels.navajo.document.types.Money) Test(org.junit.Test)

Example 8 with Money

use of com.dexels.navajo.document.types.Money in project navajo by Dexels.

the class UtilsMoneyTest method testAddDoubleAndMoney.

@Test
public void testAddDoubleAndMoney() {
    Double a = 15.0;
    Money b = new Money(10);
    Money result = (Money) Utils.add(a, b, "15.0 + ToMoney(10)");
    assertEquals(new Money(25), result);
}
Also used : Money(com.dexels.navajo.document.types.Money) Test(org.junit.Test)

Example 9 with Money

use of com.dexels.navajo.document.types.Money in project navajo by Dexels.

the class UtilsMoneyTest method testAddIntegerAndMoney.

@Test
public void testAddIntegerAndMoney() {
    Integer a = 15;
    Money b = new Money(10);
    Money result = (Money) Utils.add(a, b, "15 + ToMoney(10)");
    assertEquals(new Money(25), result);
}
Also used : Money(com.dexels.navajo.document.types.Money) Test(org.junit.Test)

Example 10 with Money

use of com.dexels.navajo.document.types.Money in project navajo by Dexels.

the class UtilsMoneyTest method testAddMoneyAndLong.

@Test
public void testAddMoneyAndLong() {
    Money a = new Money(15);
    Long b = 10L;
    Money result = (Money) Utils.add(a, b, "ToMoney(15) + ToLong(10)");
    assertEquals(new Money(25), result);
}
Also used : Money(com.dexels.navajo.document.types.Money) Test(org.junit.Test)

Aggregations

Money (com.dexels.navajo.document.types.Money)39 Test (org.junit.Test)25 Percentage (com.dexels.navajo.document.types.Percentage)10 TMLExpressionException (com.dexels.navajo.expression.api.TMLExpressionException)8 ClockTime (com.dexels.navajo.document.types.ClockTime)6 Navajo (com.dexels.navajo.document.Navajo)5 Property (com.dexels.navajo.document.Property)5 Date (java.util.Date)5 Operand (com.dexels.navajo.document.Operand)4 Message (com.dexels.navajo.document.Message)3 NavajoException (com.dexels.navajo.document.NavajoException)3 Binary (com.dexels.navajo.document.types.Binary)3 StopwatchTime (com.dexels.navajo.document.types.StopwatchTime)3 StringWriter (java.io.StringWriter)3 DatePattern (com.dexels.navajo.document.types.DatePattern)2 SystemException (com.dexels.navajo.script.api.SystemException)2 StringReader (java.io.StringReader)2 ExpressionChangedException (com.dexels.navajo.document.ExpressionChangedException)1 PropertyTypeException (com.dexels.navajo.document.PropertyTypeException)1 BaseMessageImpl (com.dexels.navajo.document.base.BaseMessageImpl)1