1.

How To Write A Simple Junit Test Class?

Answer»

To write a test case, follow these steps:

  1. Define a subclass of TestCase.
  2. Override the SETUP() METHOD to initialize object(s) under test.
  3. Optionally override the tearDown() method to RELEASE object(s) under test.

Define one or more public testXYZ() METHODS that exercise the object(s) under test and ASSERT expected results.

To write a test case, follow these steps:

Define one or more public testXYZ() methods that exercise the object(s) under test and assert expected results.



Discussion

No Comment Found