This week I have begun learning JUNIT4 using Kindle book “Mastering Unit Testing Using Mockito and JUnit” by Sujoy Acharay.
Here is the process I have been following:
- Using Eclipse, coded all the examples in chapter 2, ran the tests, and debugged as needed.
- Added all test classes to TestSuite class so that all tests can be executed easily.
- Added comments so that I can better understand the code and because it is the right thing to do.
- Added some other tests for practice and for better understanding.
- Renamed some of the classes and methods to be more meaningful.
When done I will have some sample test code which I can use as models for any testing I do in the future.
Work in progress in which I am adding all the tests to TestSuite class and adding comments:
Work in progress in which I am adding comments to classes: