willowtreeapps / assertk

assertions for kotlin inspired by assertj
MIT License
757 stars 84 forks source link

Assert on map should have keys() and values() functions #527

Open dalewking opened 4 months ago

dalewking commented 4 months ago

There are good assertions on individual items in maps but not a clean way to do assertions on all keys or all values in a map. So i propose the following methods be added:

fun <K> Assert<Map<K, *>>.keys() : Assert<Set<K>> = ...

fun <V> Assert<Map<*, V>>.values() : Assert<Collection<V>> = ...
JakeWharton commented 4 months ago

These will probably be havingKeys() and havingValues() based on the discussion in #522 and #521.

dalewking commented 4 months ago

These will probably be havingKeys() and havingValues() based on

Makes sense. I care about the functionality, not the name.