add test for writing a Message