Add simple unittest for protocol