nulltest.java
来自「不管是测试驱动开发或者是其它的开发模式」· Java 代码 · 共 28 行
JAVA
28 行
/* Copyright (c) 2000-2004 jMock.org
*/
package test.jmock.expectation;
import junit.framework.TestCase;
import org.jmock.expectation.Null;
public class NullTest extends TestCase
{
public void testEquals() {
assertEquals("Should be same value", new Null(), new Null());
assertEquals("Should be same hashCode", new Null().hashCode(), new Null().hashCode());
assertEquals("Should be same value", new Null("one"), new Null("two"));
assertEquals("Should be same hashCode", new Null("one").hashCode(), new Null("two").hashCode());
// Compare with other objects to assert that they are not equal
assertEquals("Not equal to something else", false, new Null("one").equals("one"));
assertEquals("Not equal to something else", false, new Null().equals(new Integer(2)));
}
public void testDescription() {
assertEquals("Description", "what it is", new Null("what it is").toString());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?