Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UnitTest how do you organise your testing files?

Currently, I am splitting all my tests by package (projects). So if I have 12 projects, I will create 1 more project for Unit Test with 12 classes that will test all my package.

Do you do the same way or do you have 1 testing class by class? How do you organize all your test?

like image 867
Patrick Desjardins Avatar asked Nov 19 '08 13:11

Patrick Desjardins


People also ask

How do I organize my test folder?

One way to organize elements could be to have a folder for each application you are testing and then create a subfolder under there for each page of the application. Elements can be easily moved to different folders by dragging and dropping them. You can also move them to another folder by using the more menu.

Where should test files go?

By convention, Go testing files are always located in the same folder, or package, where the code they are testing resides.

How do you organize junit tests?

The easiest way to organize your tests is to place them directly alongside your production code, in the same package and source tree. If you do this, all the code you need to compile is in one directory structure, simplifying your build process.


1 Answers

In a Java/Maven setting:

project/src/main/java/Package/Class.java
project/src/test/java/Package/ClassTest.java
project/src/main/resources/Package/resource.properties
project/src/test/resources/Package/test_resource.properties
like image 62
boutta Avatar answered Sep 30 '22 15:09

boutta