1 package uk.co.jezuk.mango; 2 3 import junit.framework.*; 4 5 public class BinaryOrTest extends TestCase 6 { 7 public BinaryOrTest(String name) { super(name); } 8 public static Test suite() { return new TestSuite(BinaryOrTest.class); } 9 10 private static class t implements BinaryPredicate { public boolean test(Object x, Object y) { return true; } } 11 private static class f implements BinaryPredicate { public boolean test(Object x, Object y) { return false; } } 12 13 public void test1() 14 { 15 BinaryPredicate o = Predicates.Or(new t(), new t()); 16 assertEquals(true, o.test(null, null)); 17 } 19 public void test2() 20 { 21 BinaryPredicate o = Predicates.Or(new f(), new t()); 22 assertEquals(true, o.test(null, null)); 23 } 25 public void test3() 26 { 27 BinaryPredicate o = Predicates.Or(new t(), new f()); 28 assertEquals(true, o.test(null, null)); 29 } 31 public void test4() 32 { 33 BinaryPredicate o = Predicates.Or(new f(), new f()); 34 assertEquals(false, o.test(null, null)); 35 } } | Popular Tags |