Chapter 20Fixture Setup Patterns

Patterns in This Chapter

Fresh Fixture Setup

      In-line Setup 408

      Delegated Setup 411

            Creation Method 415

      Implicit Setup 424

Shared Fixture Construction

      Prebuilt Fixture 429

      Lazy Setup 435

      Suite Fixture Setup 441

      Setup Decorator 447

      Chained Tests 454

In-line Setup

How do we construct the Fresh Fixture?

Each Test Method creates its own Fresh Fixture by calling the appropriate constructor methods to build exactly the test fixture it requires.

image

To execute an automated test, we require a text fixture that is well understood and completely deterministic. We can ...

Get xUnit Test Patterns: Refactoring Test Code 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.