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
Find out the most user friendly pojo tester api for testing #68
Comments
Maybe something like this will be cool:
Although it's splitted to two lines but BDD structured is preserved. |
I like the second approach
But @jerckov has right. You wrote about given-when-then and you had empty section when. He introduced PojoResult and this seems a little strange to me. Maybe BDD is not applicable for PojoTester. If you want to chose than the second proposition is better. |
I think the second option is more natural for me.
|
Have you considered annotation based approach? You could annotate the pojos you want to test with |
BTW |
…dly-pojo-tester-api-for-testing #68 - API implementation
What is the most
user friendly
/given-when-then convention compatible
way to invoke pojo tests?OR
EXPLANATION
Currently
test
andtestAll
methods throw exception when pojo has invalidequals
,hashcode
ortoString
method implementation.NESTED CLASSES
You can also define nested classes to change in your main class e.g.
KIND OF TESTS
There is no option to choose which tests should be run (
equals
,hashcode
ortoString
).How do you want to provide it? E.g.
new PojoTester(EQUALS | HASHCODE | TO_STRING)
or
new PojoTester().addTesters(new EqualsTester(), ...)
or
assertThat(class).using(new HashCodeTester()).hasWellImplemented...();
CHANGING FIELDS
At this moment you can provide you own
fieldsValuesChanger
that should change field of specific type e.g.Coffee
.In order to do this you have to extend
AbstractFieldsValuesChanger
class and implement some methods.If you do not specify your own
fields values changer
and pojo tester could not change field value then it sets it either tonull
orclass.instantiate()
The text was updated successfully, but these errors were encountered: