Tl dr
This is a very correct question. The difference between them is priority, that is, the order in which they are given the opportunity to process requests. Settings are made first, while Residue Collectors are the last.
AutoFixture, in essence, consists of Chain of Responsibility , where each node in the pipeline is called an instance creator. These builders are organized into three categories that determine their position in the chain:
- Adaptations
- Engine
- Residue Collectors
Sample creators located higher in the chain first process incoming requests, in fact redefining those that are lower.
Settings are usually special sample collectors created by the user to process specific requests in a specific order. Therefore, they are given the highest priority.
The engine is the built-in samplers that come with AutoFixture. They handle all primitive types, such as strings, numbers, and dates.
Residue collectors are sample collectors with the lowest priority and will catch requests that cannot be handled by any other builder. They are commonly used as a return strategy.
source share