Add tests for receive-message function.