Manning. JUnit in Action 文摘-2

来源:互联网 发布:招聘网络推广专员 编辑:程序博客网 时间:2024/05/22 02:22
chapter 3:
Testing for exceptions:
1 Insert a statement that should throw an exception.
2 Follow it with a fail statement (in case the exception isn’t thrown).
3 Catch the exception you expect, naming the exception "expected" so the reader can easily guess that the exception is expected!
4 Proceed normally
原创粉丝点击