Last night i wrote a unit test that to verify that a server component i was writing could accept a remote connection. This test seamed to infinitly block a thread inside NUnit which i think is the result of a Join call on a background thread, whatever the reason, the thread blocks, which is fine in itself, but if you try and stop the blocking test using the NUnit GUI, the UI dies.
This is probably a sign that I should be using mock objects for things like Socket, I haven’t yet properly investigated mocks but i think if I get into situations like this more often they will be valuable.
The test now passes, it was a threading issue, I went temporarily insane and forgot to use any kind of syncronisation when accessing resources.
Moral of this story:”Don’t write sockets code at 2 AM.