I would like to write junit tests for my java classes
The objective is to read contents from a text file and doing some basic operations and calculations.
preguntado el 01 de febrero de 12 a las 22:02
Read the documentation on JUnit - Brian Roach has given you a link in the comments.
Decide what your classes are supposed to do. Think about how they could go wrong, and how they should deal with bad input.
For each thing that they should do, and each thing they should not do, write a test method that proves that they behave correctly.
If your test becomes long and complicated, that is often a sign that your original code is not structured well enough. Fix it.