You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases we need to verify if the value on the table is the same value of the expected and the expected value can be null. Then isEqualTo(null) should work if the actual and the expected is null too.
example:
Application application = new Application();
application.setName = null;
dao.save(application);
Table applicationTable = new Table(dataSource, DatabaseHelper.APPLICATION_TABLE_NAME);
assertThat(applicationTable).row(0).column("name").value().isEqualTo(application.getName());
In this case I dont want to use isNull because I can modify the name attribute from null to a valid value later and my tests still passing.
An another example that can use this feature:
To DRY my test code I can create a generic method assertion for each table too, and use it on various tests with valid or null values on each field.
example:
The equality of null=null is not satisfied because of NOT_IDENTIFIED type and on the isEqualTo methods there is a verification on valueType without the type NOT_IDENTIFIED.
example:
Just to discuss: I think that the behavior of isAfterOrEqualTo and isBeforeOrEqualTo (I didn't remember if there were more methods like these) are wrong too because it shoud be able to verify if null=null too.
Note that it will never be possible to use directly isEqualTo(null) because there is conflict : Java don't know which method is called. But it is possible to implement isEqualTo(Object) and after call it with isEqualTo((Object) null)
Activity
otoniel-isidoro commentedon Aug 31, 2015
An another example that can use this feature:
To DRY my test code I can create a generic method assertion for each table too, and use it on various tests with valid or null values on each field.
example:
otoniel-isidoro commentedon Aug 31, 2015
The equality of null=null is not satisfied because of NOT_IDENTIFIED type and on the isEqualTo methods there is a verification on valueType without the type NOT_IDENTIFIED.
example:
regis1512 commentedon Aug 31, 2015
Understood. It is not an urgent bug but it is more than an enhancement
otoniel-isidoro commentedon Sep 2, 2015
Just to discuss: I think that the behavior of isAfterOrEqualTo and isBeforeOrEqualTo (I didn't remember if there were more methods like these) are wrong too because it shoud be able to verify if null=null too.
regis1512 commentedon Sep 3, 2015
I started to work on this.
I do isEqualTo and isNotEqualTo
For other methods, i do not the real interest for the moment so i think to let like that
isEqualTo(null) should be possible #21 (#21)
regis1512 commentedon Sep 6, 2015
Note that it will never be possible to use directly isEqualTo(null) because there is conflict : Java don't know which method is called. But it is possible to implement isEqualTo(Object) and after call it with isEqualTo((Object) null)
isEqualTo(null) should be possible #21 (#21)
regis1512 commentedon Sep 6, 2015
Please, give me your test results but for me it is closed
otoniel-isidoro commentedon Sep 9, 2015
It's ok thx!