Metadata for Test Initialization and Cleanup

The UTF provides attributes that allow you to specify methods that should be run before and after test execution. You can provide methods that are executed once for each test assembly, once for each test class, and once for each test method. The order in which methods decorated with each particular attribute are run is presented in Figure 24.4.

Image

FIGURE 24.4 Test execution order is affected by initialization and cleanup metadata.

AssemblyInitialize Attribute

The AssemblyInitialize attribute identifies a method that contains code to be used before all tests in an assembly are run, and to allocate resources ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.