Adds unit tests for readMessage().