I am trying to create a customization that allows me to specify that the properties of types that are not in a certain namespace should not be populated.
Basically, I am trying to change this:
fixture.Customize<Window>(c => c.OmitAutoProperties());
fixture.Customize<ContentControl>(c => c.OmitAutoProperties());
fixture.Customize<TextBlock>(c => c.OmitAutoProperties());
// Many many more...
to this:
fixture.Customize(t => !t.Namespace.StartsWith("MyProject"),
c => c.OmitAutoProperties());
How to achieve this?
I actually only care for the result, not for the fictious API shown here, so implementing my own ISpecimenBuilder
or ICustomization
is not a problem.