Clover Coverage Report - KS Common Util 1.2.1-SNAPSHOT
Coverage timestamp: Wed Nov 2 2011 05:02:05 EST
21   41   2   10.5
0   34   0.1   2
2     1  
1    
 
  BooleanFunctionTest       Line # 9 21 0% 2 0 100% 1.0
 
  (2)
 
1    package org.kuali.student.common.messagebuilder.booleanmessage.ast;
2   
3    import java.util.List;
4   
5    import org.junit.Assert;
6    import org.junit.Test;
7    import org.kuali.student.common.messagebuilder.booleanmessage.ast.BooleanFunction;
8   
 
9    public class BooleanFunctionTest {
10   
 
11  1 toggle @Test
12    public void testVariables() throws Exception {
13  1 BooleanFunction bf = new BooleanFunction("(A*B)+(C*D)");
14  1 List<String> variables = bf.getVariables();
15   
16  1 Assert.assertEquals(4, variables.size());
17  1 Assert.assertTrue(variables.contains("A"));
18  1 Assert.assertTrue(variables.contains("B"));
19  1 Assert.assertTrue(variables.contains("C"));
20  1 Assert.assertTrue(variables.contains("D"));
21    }
22   
 
23  1 toggle @Test
24    public void testSymbols() throws Exception {
25  1 BooleanFunction bf = new BooleanFunction("(A*B)+(C*D)");
26  1 List<String> symbols = bf.getSymbols();
27   
28  1 Assert.assertEquals(11, symbols.size());
29  1 Assert.assertTrue(symbols.contains("("));
30  1 Assert.assertTrue(symbols.contains("A"));
31  1 Assert.assertTrue(symbols.contains("*"));
32  1 Assert.assertTrue(symbols.contains("B"));
33  1 Assert.assertTrue(symbols.contains(")"));
34  1 Assert.assertTrue(symbols.contains("+"));
35  1 Assert.assertTrue(symbols.contains("("));
36  1 Assert.assertTrue(symbols.contains("C"));
37  1 Assert.assertTrue(symbols.contains("*"));
38  1 Assert.assertTrue(symbols.contains("D"));
39  1 Assert.assertTrue(symbols.contains(")"));
40    }
41    }