# Quick glance at AutoFixture

AutoFixture is a library focused on test data generation so that unit tests can focus on the behavior to be tested rather than on the plumbing needed to get the test to run.

There is an exhaustive cheat sheet available [here](https://github.com/AutoFixture/AutoFixture/wiki/Cheat-Sheet) for quick reference.

Note: at the time of writing, the latest version of AutoFixture is the 4.13.

## Quick sample

This is the simplest usage of AutoFixture

```csharp
[Test]
public void Echo_should_return_incoming_message()
{
    // ARRANGE
    var fixture = new Fixture();
    var sut = fixture.Create<EchoService>();
    var message = fixture.Create<string>();

    // ACT
    var result = sut.Echo(message);

    // ASSERT
    Assert.That(result, Is.EqualTo(message));
}
```

In the snippet above, 1. we create an instance of `Fixture` 2. we use the fixture to create an instance of the system under test, the service EchoService 3. we use the fixture to create a sample message 4. we exert the system under test by passing the sample message 5. we assert that the output is equal to the input


---

# 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/autofixture/quick-glance-at-autofixture.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.
