test lab ~ triangle test by using junit and coverage

时间:2023-03-09 05:19:04
test lab ~ triangle test by using junit and coverage

first set up a new folder as your test class place, and then let your package in test class folder be the same name with your src folder. in the package of src folder,you can code the entity class, and in the test folder, write test class. here is the file strcture

test lab ~ triangle test by using junit and coverage

and I use suite to finish many test case in one test.

here is a entrance class

test lab ~ triangle test by using junit and coverage

here us the test parametered class

test lab ~ triangle test by using junit and coverage

here is the coverage answer :

test lab ~ triangle test by using junit and coverage

you can see src test case is 100%

tools we need are eclemma ,junit.jar,hamcrest.jar