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

New Testgenerator #93

Open
almondtools opened this issue Dec 16, 2018 · 1 comment
Open

New Testgenerator #93

almondtools opened this issue Dec 16, 2018 · 1 comment

Comments

@almondtools
Copy link
Owner

The current test generator (matcher generator) is appropriate for small objects, but does not really scale up:

  • unprecise test failure locations
  • hard to understand mismatch messages

Yet this problem seems to be partly caused by the complexity of the problem. We have to support following data types

  • primitive data types (easy)
  • simple composite data types (easy)
    • primitive data types
    • simple composite data types
  • list composite data types (harder)
    • containing primitive data types
    • simple composite data types
    • list or array types
  • map composite data types (hard)
    • containing primitive data types
    • simple composite data types
    • list or array types
    • map or set types

The assertions of these types are

  • immediate assertions on the value in case of primitive data types
  • assertions on (possibly long) path expressions in case of simple composite data types
  • assertions on path expressions with index selectors in case of list composite data types
  • no idea for map composite data types
    While simple composite types can be asserted through long path expressions
@almondtools
Copy link
Owner Author

Solution with assertj:

  • primitive and composite types should work out of the box
    • assertThat ... isEqualTo ...
    • assertThat ... extracting ... isEqualTo ...
    • assertThat ... extracting ... satisfies ...
  • list types
    • assertThat ... element... isEqualTo ...
    • assertThat ... element... satisfies ...
  • set types
    • assertThat ... contains ...
    • assertThat ... anySatisfies ...
  • map types
    • assertThat ... containsEntry ...
    • assertThat ... extracting ... isEqualTo
    • assertThat ... extracting ... satisfies
    • assertThat ... anySatisfies (if provided)

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

No branches or pull requests

1 participant