I don't like those type of tests, since the one you are talking about is tied to the implementation.
As you say that's good to put clear contracts between classes, but I don't see the purpose of that even when I think having clear interfaces is important.
Instead I prefer to test how each function answers with different parameters and edge cases.
Thanks for sharing and making me think about testing.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.