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
  • PrintPrint
Share this Page URL
Help

Chapter 22. Unit Testing > Metadata and Assertions

Metadata and Assertions

As you have seen, attributes are used to identify test classes and methods. Attributes can also be used to provide other metadata information to the UTF. This section examines each of the UTF attributes in greater detail and provides descriptions of their usage, purpose, and effect on test execution.

TestClass Attribute

The TestClass attribute indicates that a class contains test methods.

TestMethod Attribute

The TestMethod attribute indicates that a method should be included in the suite of tests. The Ignore attribute can be used to temporarily exclude a test method from the suite of tests. Methods decorated with the TestMethod attribute should be public and have a void return type.

Metadata for Test Initialization and Cleanup


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


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