It seems to me that some code is easier to unit test than others. I love writing unit tests for highly functional code (by this, I'm referring to functions that primarily operate on their arguments and return computed results).
But, when the code is much more about it's side effects, testing it becomes much harder. For example, a socket class I use at work has a method declared like this:
void Socket::Create( void );
It takes no arguments, and returns no results. On error it throws, but the direct result of the underlying call (socket()) is hidden by the class itself.
Can anyone recommend techniques or perhaps a book, or a website to learn more advanced techniques for unit testing code that is mostly about its side effects?