KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > jmock > core > constraint > OrTest


1 /* Copyright (c) 2000-2004 jMock.org
2  */

3 package test.jmock.core.constraint;
4
5 import org.jmock.core.constraint.Or;
6
7
8 public class OrTest extends AbstractConstraintsTest
9 {
10     public void testEvaluatesToTheTheLogicalDisjunctionOfTwoOtherConstraint() {
11         assertTrue(new Or(TRUE_CONSTRAINT, TRUE_CONSTRAINT).eval(ARGUMENT_IGNORED));
12         assertTrue(new Or(FALSE_CONSTRAINT, TRUE_CONSTRAINT).eval(ARGUMENT_IGNORED));
13         assertTrue(new Or(TRUE_CONSTRAINT, FALSE_CONSTRAINT).eval(ARGUMENT_IGNORED));
14         assertFalse(new Or(FALSE_CONSTRAINT, FALSE_CONSTRAINT).eval(ARGUMENT_IGNORED));
15     }
16
17
18     public void testEvaluatesArgumentsLeftToRightAndShortCircuitsEvaluation() {
19         assertTrue(new Or(TRUE_CONSTRAINT, NEVER_EVALUATED).eval(ARGUMENT_IGNORED));
20     }
21 }
22
Popular Tags