为hashcode,equals和toString方法生成单元测试 [英] Generate unit tests for hashcode,equals and toString methods
本文介绍了为hashcode,equals和toString方法生成单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何工具/库可以自动生成我的hashcode的测试,并且等于查看这些方法中涉及的实例变量的方法?
Is there any tool/library which can automatically generate the tests for my hashcode and equals methods looking at the instance variables involved in these methods?
推荐答案
Guava使用这个测试构建器测试等于
和 hashCode
。
Guava uses this test builder to test equals
and hashCode
.
这篇关于为hashcode,equals和toString方法生成单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文