add tests for protocol