Improved unit test when using socket message exchange