Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 2. Exploring core JUnit > Exploring core JUnit

2.1. Exploring core JUnit

The CalculatorTest program from chapter 1, shown in listing 2.1, defines a test class with a single test method testAdd.

The requirements to define a test class are that the class must be public and contain a zero-argument constructor. In our example, because we don’t define any other constructors, we don’t need to define the zero-argument constructor; Java creates it for us implicitly.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint