Skip to content

Generating logical equivalence assertions #184

Open
@npepinpe

Description

@npepinpe

In our project, we have a module which defines an API - it's essentially a bunch of interfaces which are meant to be implemented elsewhere, possibly multiple times. We use the assertion generator plugin to generate asserts for these, which works great, but it becomes tedious if you want to assert multiple properties. We don't want to use the recursive comparator since this uses fields, not the properties as defined by the interfaces.

Is it possible to have the generator also generate a method which essentially chains all the generated single property asserts against an actual object of the same interface type? I feel like that should be possible, but maybe I'm missing something. That way you get the nice error messages from the single assertions without having to manually type all of this.

(bonus points if it can do it recursively (i.e. a nested interface which also has a generated assertion class for it would be reused), but I get that that would increase the complexity, and it's something we can easily glue ourselves)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions