01: package org.hanseltest;
02:
03: /**
04: * Simple code to be covered bythe testcases.
05: * @author Niklas Mehner
06: */
07: public class CoverExpression {
08:
09: /**
10: * Simple method to test covering a 'not' expression
11: * @param b some boolean.
12: * @return !b
13: */
14: public boolean coverNot(boolean b) {
15: return !b;
16: }
17:
18: /**
19: * Simple method to test covering an 'and' expression
20: * @param a some boolean.
21: * @param b some boolean.
22: * @return !b
23: */
24: public boolean coverAnd(boolean a, boolean b) {
25: return a && b;
26: }
27:
28: /**
29: * Simple method to test covering an 'or' expression
30: * @param a some boolean.
31: * @param b some boolean.
32: * @return !b
33: */
34: public boolean coverOr(boolean a, boolean b) {
35: return a || b;
36: }
37:
38: /**
39: * Simple method to test covering a complex expression
40: * @param a some boolean.
41: * @param b some boolean.
42: * @param c some boolean.
43: * @param d some boolean.
44: * @return !b
45: */
46: public boolean coverComplex(boolean a, boolean b, boolean c,
47: boolean d) {
48: return (a && b) || (c && d);
49: }
50: }
|