Hi Daniele,
Thanks for the compliments.
As for your question - it looks like you need a mock object for the MsgHandler.
From the code you posted it looks like that shouldn't be too hard to do manually (MsgHandler, or some version of it, is part of the test code and you can put test specific code in there). It's not clear whether this is a simplified version of your real code where that is not so easy?
Assuming you can do that the next challenge is to deal with the asynchronisity. Obviously at this point we're not dealing with a unit test (you could mock your NetMessageDispatcher too, but that would probably defeat the purpose). As long as you accept that it's fine.
So you'd probably need to introduce some sort of signaling mechanism that that OnMsgEventConnect could raise and the test case code could wait on. I don't know what threading APIs you have available to your project, although I see you're using POCO, which has its own threading support so you'd probably be using that. I'm not familiar enough with POCO to advise there - but you'd probably want to be able to specify a timeout too.
So then the next line in your test case code would be to wait on that signal and check the status of your MsgHandler mock (or fail if it times out - you can use the explicit FAIL macro for that).
HTH,
Phil