JUNIT testing void methods

后端 未结 7 905
遇见更好的自我
遇见更好的自我 2020-11-27 02:41

I have a java class full of void methods, and I want to make some unit test to get maximal code coverage.

For example I have this method :

protected          


        
相关标签:
7条回答
  • 2020-11-27 03:39

    If it is possible in your case, you could make your methods method1(arg1) ... method7() protected instead of private so they could be accesible from test class within the same package. Then you can simply test all theese methods separately.

    0 讨论(0)
提交回复
热议问题