package gov.va.med.fw.rule;

import java.math.BigDecimal;

import junit.framework.TestCase;

public class SimpleRuleMethodTest extends TestCase {
    public void testAdd() {
        SimpleRuleMethod simpleRuleMethod = new SimpleRuleMethod();
        BigDecimal b = simpleRuleMethod
                .add(new BigDecimal(123.45), new BigDecimal(10));
        assertEquals((new BigDecimal(133.45)).setScale(2,
                BigDecimal.ROUND_HALF_UP), b);
    }

    public void testPercentageOf() {
        SimpleRuleMethod simpleRuleMethod = new SimpleRuleMethod();
        BigDecimal b = simpleRuleMethod
                .percentageOf(new BigDecimal(123.45), 10);
        assertEquals((new BigDecimal(12.35)).setScale(2,
                BigDecimal.ROUND_HALF_UP), b);
    }
}
