您的位置:首页 > 其它

How to test ArrayList using JUnit

2011-11-25 09:43 337 查看
In practice, we may need write test case to test List.

Sometimes we need to overwrite the inner objects' hashCode() and equals().

If the List only contains String object, we can write test cases as http://www.java2s.com/Code/Java/Development-Class/SimpleuseofJUnittotestArrayList.htm.

For user-defined objects, we should overwrite its methods.

http://stackoverflow.com/questions/3236880/assert-list-in-junit

http://www.vogella.de/articles/JUnit/article.html
本文出自 “IcerSummer” 博客,请务必保留此出处http://icersummer.blog.51cto.com/1049418/724075
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: