add unit test for encoding redis protocol