1 package uk.co.jezuk.mango; 2 3 import junit.framework.*; 4 5 public class GreaterThanTest extends TestCase 6 { 7 java.util.List list; 8 9 public GreaterThanTest(String name) { super(name); } 10 public static Test suite() { return new TestSuite(GreaterThanTest.class); } 11 12 private BinaryPredicate p_; 13 14 protected void setUp() 15 { 16 p_ = Predicates.GreaterThan(); 17 } 19 public void test1() 20 { 21 assertEquals(false, p_.test(new Integer (1), new Integer (3))); 22 } 24 public void test2() 25 { 26 assertEquals(false, p_.test("hello", "zibignew")); 27 } 29 public void test3() 30 { 31 assertEquals(true, p_.test(new Integer (3), new Integer (1))); 32 } 34 public void test4() 35 { 36 assertEquals(true, p_.test("hello", "aerosol")); 37 } 39 public void test5() 40 { 41 assertEquals(false, p_.test(new Integer (3), new Integer (3))); 42 } 44 public void test6() 45 { 46 assertEquals(false, p_.test("hello", "hello")); 47 } 49 public void test7() 50 { 51 assertEquals(false, p_.test(null, null)); 52 } 54 public void test8() 55 { 56 assertEquals(false, p_.test(null, "word")); 57 } 59 public void test9() 60 { 61 assertEquals(true, p_.test("word", null)); 62 } 64 } | Popular Tags |