I just had a quick look through my unit tests for place where I test a private method.
I have a method which looks through an array for a pair of adjacent variables, with a particular property (they have p < V1 > V2 < n for variables V1 and V2, relating to the previous variable and next variable, and where < is a more complicated operator).
Anyway, this gets used lots of times by my algorithm. However, I added some unit tests because I wanted to make sure that the obvious corner cases (beginning and end of array, not occurring) get checked correctly. Hopefully these cases are hit by my input data, but it is hard to construct input data that has particular properties.
I could pull this out into another class, but the method is actually fairly small and not used anywhere else, so that seems like a bit of a waste really.
On checking you get a null reference when you pass null into a method. I make this part of the API of some of my functions (in my case C++, so null pointer actually). I want to check that actually happens, as opposed to some nasty crash. Isn't that checking for behaviour? What else should I do instead?