Write unit test for message passing