Improved unittest of protocol