Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating logical equivalence assertions #184

Open
npepinpe opened this issue Aug 5, 2021 · 0 comments
Open

Generating logical equivalence assertions #184

npepinpe opened this issue Aug 5, 2021 · 0 comments

Comments

@npepinpe
Copy link

npepinpe commented Aug 5, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant