alexstyl / contactstore

A modern, strongly-typed contacts API for Android.
https://alexstyl.github.io/contactstore
Apache License 2.0
440 stars 15 forks source link

Introduce samePropertiesAs() matcher to compare two contacts losely #46

Closed alexstyl closed 2 years ago

alexstyl commented 2 years ago

This PR introduces the samePropertiesAs() matcher, which matches when the examining object is logically equal to the passing Contact, minus any ids or lookup keys.

As an example, two contacts that both contain the same phone number will match, even if their contactIds or phone ids are different.

This is useful when you cannot know expected ids in advance, such as setting up contacts in Android connected Tests