我完全糊涂了如何编写测试用例的第一个条件就是this==tgp
,并且同样提到如下:如何写JUnit测试用例代码给出
public boolean equals(Object tjp) {
if (this == tjp) {
return true;
}
if (tjp == null) {
return false;
}
if (getClass() != tjp.getClass()) {
return false;
}
Fun other = (Fun) tjp;
if (getId() == null) {
if (other.getId() != null) {
return false;
}
} else if (!getId().equals(other.getId())) {
return false;
}
return true;
}
assertTrue(testObject.equals(的TestObject))这样; – Arkadiy