I am trying to use autofixture to create an object but there are certain properties that I want to always be defaulted (while the rest could be auto generated). However, wheneve
This looks like it's by design:
Note that the Build method chain is best understood as a one-off Customization. It bypasses all Customizations on the
Fixture
instance. Instead, it allows fine-grained control when building a specific specimen. However, in most cases, adding a convention-basedICustomization
is a better, more flexible option.
...from the Build()
method's documentation.
I appreciate that this is probably not an ideal answer. However, the documentation does provide a hint as to how you might arrive at one.