Explain how you can write a simple JUnit test case?

devquora
devquora

Posted On: Feb 22, 2018

 

The simplest way to write a JUnit test case is:
  • Determine a subclass of TestCase
  • To initialize object(s) under test, override the setup() method
  • To release object(s) under test override the teardown() method

Determine one or more public test XYZ() methods that exercise the objects under test and assert expected results.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JUnit Interview Questions

    Explain what is JUnit?

    JUnit is a testing framework for unit testing.  It uses Java as a programming platform, and it is an Open Source Softw..

    JUnit Interview Questions

    Mention what is the difference between JUnit and TestNG?

    JUnit TestNGIn JUnit the naming convention for annotation is a bit complicated for, e.g., “Before”, “After”..

    JUnit Interview Questions

    Mention different methods of exception handling in JUnit?

    Exceptional or analogous conditions during program execution require special processing methods and this exception hand..