1 3 package test.jmock.expectation; 4 5 import junit.framework.TestCase; 6 import org.jmock.expectation.Null; 7 8 9 public class NullTest extends TestCase 10 { 11 12 public void testEquals() { 13 assertEquals("Should be same value", new Null(), new Null()); 14 assertEquals("Should be same hashCode", new Null().hashCode(), new Null().hashCode()); 15 16 assertEquals("Should be same value", new Null("one"), new Null("two")); 17 assertEquals("Should be same hashCode", new Null("one").hashCode(), new Null("two").hashCode()); 18 19 assertEquals("Not equal to something else", false, new Null("one").equals("one")); 21 assertEquals("Not equal to something else", false, new Null().equals(new Integer (2))); 22 } 23 24 public void testDescription() { 25 assertEquals("Description", "what it is", new Null("what it is").toString()); 26 } 27 } 28 | Popular Tags |