What is the difference between ISpecimenBuilder and ICustomization #1449
-
I would like to know what is the difference between a Customization and SpecimenBuilder and an example when one would be used instead of the other. To me they both seem to do the same thing? I am not sure how they differ any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@alban-ameti the interfaces have very different meaning in AutoFixture. To better understand what they're doing, you need to first understand the way the Fixture object works. You can read the wiki article, about the internal architecture. In short, when creating an object of a certain type, the fixture will break it down into its composing pieces (members/dependencies). Each piece will run through the pipeline as a distinct request. The process will run recursively until the initial request is broken down into requests for primitive values, that the fixture knows how to instantiate. The instantiation of these primitive request, is usually delegated to objects implementing The Obviously this is an oversimplification of the process. If you wish to know more, see the resources specified in the Documentation section, of the readme. As a user you'll usually implement |
Beta Was this translation helpful? Give feedback.
@alban-ameti the interfaces have very different meaning in AutoFixture. To better understand what they're doing, you need to first understand the way the Fixture object works. You can read the wiki article, about the internal architecture.
In short, when creating an object of a certain type, the fixture will break it down into its composing pieces (members/dependencies). Each piece will run through the pipeline as a distinct request. The process will run recursively until the initial request is broken down into requests for primitive values, that the fixture knows how to instantiate. The instantiation of these primitive request, is usually delegated to objects implementing
ISpecimenBuilder
.…