FileDocCategorySizeDatePackage
BigNumCalcTest.javaAPI DocExample953Sat Mar 06 20:46:58 GMT 2004None

BigNumCalcTest

public class BigNumCalcTest extends TestCase

Fields Summary
BigNumCalc
calc
Constructors Summary
Methods Summary
public voidsetUp()

		calc = new BigNumCalc();
	
public voidtestAdd()

		Object[] testData = new Object[] {
			new BigDecimal(22),
			new BigDecimal(11),
			"+"
		};
		assertEquals(new BigDecimal(33),
			calc.calculate(testData));
	
public voidtestDivide()

		Object[] testData = new Object[] {
			new BigDecimal(22),
			new BigDecimal(11),
			"/"
		};
		assertEquals(new BigDecimal(2),
			calc.calculate(testData));
	
public voidtestMultipy()

		Object[] testData = new Object[] {
			new BigDecimal(22),
			new BigDecimal(11),
			"*"
		};
		assertEquals(new BigDecimal(242),
			calc.calculate(testData));
	
public voidtestSubtract()

		Object[] testData = new Object[] {
			new BigDecimal(22),
			new BigDecimal(11),
			"-"
		};
		assertEquals(new BigDecimal(11),
			calc.calculate(testData));