yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

Added toString to ValuesStorage to ease debugging in Mockito tests. #276

Closed rkaercher closed 7 years ago

rkaercher commented 7 years ago

When testing with mockito and expecting an entity generated from a tablespec one currently gets the following error from mockito (and most likely other expecting frameworks, too) if an argument does not match the expected values:

Actual invocation has different arguments: myDao.save( MyFromSpecEntity set values: com.yahoo.squidb.android.ContentValuesStorage@43ccf00c values: null

);

This is not a real problem when running in the IDE but causes extra effort when getting such an error in a CI test. I therefore simply added a toString that outputs all fields from the ValueStorage to ease debugging.

sbosley commented 7 years ago

This makes sense, thanks for this! Just a couple minor suggestions but it'll be great to get this in. We're planning on releasing a second beta of 4.0 soon so we'll make sure this is included in that.

sbosley commented 7 years ago

LGTM too, thanks @rkaercher!