📄 nulltest.java
字号:
/* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -