> For the complete documentation index, see [llms.txt](https://dotnetweb30-ke.gitbook.io/ke/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dotnetweb30-ke.gitbook.io/ke/verification/automated-testing-principles-patterns-and-practices/fixture-setup-patterns.md).

# Fixture setup patterns

## Fresh Fixture

### Inline setup

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

![](/files/-Lk8trVvO9Ccj-B1aBGe)

To execute an automated test, we require a text fixture that is well understood and completely deterministic. We can use the Fresh Fixture approach to build a Minimal Fixture for the use of this one test. Setting up the test fixture on an in-line basis in each test is the most obvious way to build it.

### Delegated setup

Each Test Method creates its own Fresh Fixture by calling Creation Methods from within the Test Methods.

![](/files/-Lk8uJqmeWeZ1Okmenjw)

### Implicit setup

We build the test fixture common to several tests in the setUp method.

![](/files/-Lk8v0isJ5WuOgDqVfye)

## Shared Fixture

### Prebuilt fixture

We build the Shared Fixture separately from running the tests.

![](/files/-Lk8vQibNeyy_K97mt3w)

### Lazy setup

We use Lazy Initialization of the fi xture to create it in the fi rst test that needs it.

![](/files/-Lk8vq0VihSdSmHMLnrr)

### SuiteFixture setup

We build/destroy the shared fi xture in special methods called by the Test Automation Framework before/after the fi rst/last Test Method is called.

![](/files/-Lk8w2d3IFW0mpwEN3vF)

### Setup Decorator

We wrap the test suite with a Decorator that sets up the shared test fixture before running the tests and tears it down after all tests are done.

![](/files/-Lk8x_DhegLqcdYm5v5n)

### Chained tests

We let the other tests in a test suite set up the test fixture.

![](/files/-Lk8xqiy7gHfOlQWvzLr)

Chained Tests offer a way to reuse the test fixture left over from one test and the Shared Fixture of a subsequent test.
