Quoth Manish Jethani:
[...]
> Actually I am writing a client app for a proprietary service.
> The server is not under my control, so I can't make it behave in
> a way that will cause every part of my client code to be tested.
> As I mentioned, for example, I have a function to handle a
> server-disconnect. But the server rarely ever disconnects of
> its own, so the function never gets called in reality. Can I
> unit test this function easily?
Mock objects are the usual approach to this kind of problem.
(Google can tell you more.)
--
Steven Taschuk
Receive them ignorant; dispatch them confused. (Weschler's Teaching Motto)