Skip to content

GOAL: Derived Class Use Customizations for Base Class #1335

Answered by aivascu
mwasson74 asked this question in Q&A
Discussion options

You must be logged in to vote

@mwasson74 there is no "nice" way of doing it using the postprocess composer (aka .Customize<>()) however you can always create a builder tree that does what you require.

var node = new FilteringSpecimenBuilder(
    new FixedBuilder(false),
    new AndRequestSpecification(
        new PropertySpecification(typeof(bool), nameof(MyBaseClass.IsDeleted)),
        new MemberOwnerSpecification(
            new BaseTypeSpecification(typeof(MyBaseClass)))));

Note that I created two custom request specifications for this tree MemberOwnerSpecification that helps identify the owner of the currently processed member and BaseTypeSpecification which validates the type as a child type of a given type.

p…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mwasson74
Comment options

@MisinformedDNA
Comment options

@MisinformedDNA
Comment options

@aivascu
Comment options

Answer selected by mwasson74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants