开发者

good practice to write junit test

i'm not really familiar with junit4, so what are the good practice to write a gui test tha开发者_Go百科t verify some actions in the GUI. write the methode in Methode.java then write the testmethdoe in TestMethode.java? could you give me an example please ? thanks,


For unit tests, one of the possible solutions is to have a different source folder.

so you have a folder called src/java or something like that for your code, and a folder src/tests for your unit tests.

Next, both of your folders can have the same package structure, and the class names in your test folder can be the original class name + Test

Next, a test class could contain the same methods as the original class, for which the names are again appended with the word Test

This gives you a good structure for your unit tests. Be aware that this is not the only possible solution, but just one I like to use...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜