KickJava   Java API By Example, From Geeks To Geeks.

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


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

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