package testCal;

import junit.framework.TestCase;
import cal.ParserFactory;

public class ParserFactoryTest extends TestCase {

    private ParserFactory factory;

    @Override
    public void setUp() throws Exception {
	factory = new ParserFactory();

    }

    @Override
    public void tearDown() throws Exception {
	factory = null;
    }

    public void testIsExpression1() {
	boolean expected = true;
	boolean actual = factory.isExpression("1");
	assertEquals(expected, actual);
    }

    public void testIsExpression2() {
	boolean expected = true;
	boolean actual = factory.isExpression("10+1-1*100/10");
	assertEquals(expected, actual);
    }

    public void testIsExpression3() {
	boolean expected = true;
	boolean actual = factory.isExpression("(1+22)*3");
	assertEquals(expected, actual);
    }

    public void testIsExpression4() {
	boolean expected = true;
	boolean actual = factory.isExpression("(-1)-1");
	assertEquals(expected, actual);
    }

    public void testIsExpression5() {
	boolean expected = true;
	boolean actual = factory.isExpression("2.11*3.99999");
	assertEquals(expected, actual);
    }

    public void testIsExpression6() {
	boolean expected = true;
	boolean actual = factory.isExpression("1*(22+3.33)");
	assertEquals(expected, actual);
    }

    public void testIsExpression7() {
	boolean expected = true;
	boolean actual = factory.isExpression("1*(2+3)");
	assertEquals(expected, actual);
    }
}

@@ -1432,10 +1432,670 @@
 ;%0A    %7D%0A
+    %0A    public void testIsExpression8() %7B%0A%09boolean expected = true;%0A%09boolean actual = factory.isExpression(%22sin90+cos30+tan45%22);%0A%09assertEquals(expected, actual);%0A    %7D%0A    %0A    public void testIsExpression9() %7B%0A%09boolean expected = true;%0A%09boolean actual = factory.isExpression(%22csc30-(sec30*cot45)%22);%0A%09assertEquals(expected, actual);%0A    %7D%0A    %0A%09public void testIsExpression10() %7B%0A%09%09boolean expected = true;%0A%09%09boolean actual = factory.isExpression(%222%5E4.3!%22);%0A%09%09assertEquals(expected, actual);%0A    %7D%0A%09%0A%09public void testIsExpression11() %7B%0A%09%09boolean expected = true;%0A%09%09boolean actual = factory.isExpression(%22cos30+(4!-3)%5E2%22);%0A%09%09assertEquals(expected, actual);%0A%09%7D%0A
 %7D%0A

add test case for parserFactory