Chapter 19xUnit Basics Patterns

Patterns in This Chapter

Test Definition

      Test Method 348

            Four-Phase Test 358

      Assertion Method 362

            Assertion Message 370

      Testcase Class 373

Test Execution

      Test Runner 377

      Testcase Object 382

      Test Suite Object 387

      Test Discovery 393

      Test Enumeration 399

      Test Selection 403

Test Method

Where do we put our test code?

We encode each test as a single Test Method on some class.

image

Fully Automated Tests (see page 26) consist of test logic. That logic has to live somewhere before we can compile and execute it.

How It Works

We define each test as a ...

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.