KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > uk > co > jezuk > mango > BinaryNotTest


1 package uk.co.jezuk.mango;
2
3 import junit.framework.*;
4
5 public class BinaryNotTest extends TestCase
6 {
7   public BinaryNotTest(String JavaDoc 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 JavaDoc(7), new Integer JavaDoc(7)));
14     assertEquals(false, t.test(t, t));
15     assertEquals(false, t.test(new String JavaDoc("brainfart"), new String JavaDoc("brainfart")));
16   } // test1
17

18   public void test2()
19   {
20     BinaryPredicate t = Predicates.Not(Predicates.EqualTo());
21     assertEquals(true, t.test(t, new Integer JavaDoc(7)));
22     assertEquals(true, t.test(t, null));
23     assertEquals(true, t.test(new String JavaDoc("brainfart"), new String JavaDoc("brainfart and chips")));
24   } // test2
25

26 } // BianryNotTest
27
Popular Tags