# Anatomy of a test fixture

We already saw that a test fixture is a class decorated with the `TestFixture` attribute and tests are public methods decorated with the `Test` attribute.

Even by most conservative estimations, test fixture classes tend to be multiple times bigger than the tested component. For this reason, it's better to structure the test fixtures to increase readibility.

Following the common C# coding style, a test fixture should be structured as follow

* private fields
* test fixture constructor
* test fixture set up methods
* tests targeting constructors of the system under test
* tests targeting methods of the system under tests, grouped by method
* tests targeting properties of the system under tests, grouped by properties
* test fixture tear-down methods

Additionally, local helper methods should be placed next to the method using it. If a helper method is shared by multiple tests, it should be placed at the end of the class.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.educationsmediagroup.com/unit-testing-csharp/nunit/anatomy-of-a-test-fixture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
