JUnit Test Case is the framework’s basic class. You may build a test case with TestCase. (However, in JUnit 4.4, the TestCase class is no longer supported.)
The fixture to execute numerous tests is defined by a test case. In order to create a test case, you must first specify what you want to test.
- Implement a TestCase subclass.
- Define instance variables to keep track of the fixture’s current state.
- Override setUp to initialize the fixture state.
- Override tearDown to clean up after a test.
There can be no side effects because each test runs in its own fixture.