1 package uk.co.jezuk.mango; 2 3 import junit.framework.*; 4 5 public class BinaryNotTest extends TestCase 6 { 7 public BinaryNotTest(String name) { super(name); } 8 public static Test suite() { return new TestSuite(BinaryNotTest.class); } 9 10 public void test1() 11 { 12 BinaryPredicate t = Predicates.Not(Predicates.EqualTo()); 13 assertEquals(false, t.test(new Integer (7), new Integer (7))); 14 assertEquals(false, t.test(t, t)); 15 assertEquals(false, t.test(new String ("brainfart"), new String ("brainfart"))); 16 } 18 public void test2() 19 { 20 BinaryPredicate t = Predicates.Not(Predicates.EqualTo()); 21 assertEquals(true, t.test(t, new Integer (7))); 22 assertEquals(true, t.test(t, null)); 23 assertEquals(true, t.test(new String ("brainfart"), new String ("brainfart and chips"))); 24 } 26 } | Popular Tags |