O'Reilly logo

xUnit Test Patterns: Refactoring Test Code by Gerard Meszaros

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required