---
title: Customizations catalog
description: Package reusable fixture setup with ICustomization, CompositeCustomization, and team profiles.
---

When several tests share the same fixture setup — AutoMoq, string prefixes, behaviors — package that setup as **ICustomization** types instead of repeating `Register` and `Customize` calls in every test.

## Example scenario

Your team uses AutoMoq for mocks and a string prefix rule for readable test output. You want both customizations applied whenever a test creates a new fixture.

## ICustomization

The interface has one method — apply your setup to a fixture:

```csharp
public interface ICustomization
{
    void Customize(IFixture fixture);
}
```

Implement it with the same APIs you use inline: `Register`, `Customize<T>`, `Behaviors.Add`, and so on.

```csharp
public sealed class StringPrefixCustomization : ICustomization
{
    public void Customize(IFixture fixture)
    {
        fixture.Customize<string>(composer => composer
            .FromSeed(seed => $"doc-{seed}"));
    }
}
```

```csharp
var fixture = new Fixture().Customize(new StringPrefixCustomization());

var text = fixture.Create<string>();

Assert.StartsWith("doc-", text);
```

See [Customizations](/docs/fundamentals/customizations) for `Register`, `With`, `FromFactory`, and `FromSeed`.

Built-in packages ship their own implementations — for example [`AutoMoqCustomization`](/docs/integrations/automoq) and [`NoAutoPropertiesCustomization`](/api/autofixture/5-0-0-rc-1/autofixture.noautopropertiescustomization).

## CompositeCustomization

Run several customizations in one call. Each child runs in order on the same fixture:

```csharp
var fixture = new Fixture().Customize(
    new CompositeCustomization(
        new AutoMoqCustomization(),
        new StringPrefixCustomization()));

var text = fixture.Create<string>();
var service = fixture.Create<OrderService>();

Assert.StartsWith("doc-", text);
Assert.NotNull(service);
```

Order matters when later customizations override earlier ones.

## Subclass CompositeCustomization

For a fixed team profile, subclass and pass the bundle to the base constructor:

```csharp
public sealed class TeamFixtureCustomization : CompositeCustomization
{
    public TeamFixtureCustomization()
        : base(
            new AutoMoqCustomization(),
            new StringPrefixCustomization())
    {
    }
}
```

```csharp
var fixture = new Fixture().Customize(new TeamFixtureCustomization());

var service = fixture.Create<OrderService>();

Assert.NotNull(service);
Assert.StartsWith("doc-", fixture.Create<string>());
```

One type name documents the standard test fixture for your project. Reuse it from a [custom AutoData attribute](/docs/integrations/xunit3#custom-autodata-attribute).

## How it works

- **`ICustomization`** — encapsulates fixture setup in `Customize(IFixture fixture)`
- **`CompositeCustomization`** — runs multiple `ICustomization` instances in order; it is itself an `ICustomization`
- **Subclassing `CompositeCustomization`** — names a fixed bundle of customizations for reuse across tests and test attributes

## Next steps

- [Customizations](/docs/fundamentals/customizations)
- [AutoMoq](/docs/integrations/automoq)
- [AutoNSubstitute](/docs/integrations/autonsubstitute)
- [AutoFakeItEasy](/docs/integrations/autofakeiteasy)
- [Custom AutoData attribute](/docs/integrations/xunit3#custom-autodata-attribute)

## API

- [`ICustomization`](/api/autofixture/5-0-0-rc-1/autofixture.icustomization)
- [`CompositeCustomization`](/api/autofixture/5-0-0-rc-1/autofixture.compositecustomization)
