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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (23) |
Complexity: 2 |
Complexity Density: 0.1 |
|
9 |
|
public class BooleanFunctionTest { |
10 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1
PASS
|
|
11 |
1
|
@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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1
PASS
|
|
23 |
1
|
@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 |
|
} |