adding tests for write and writeSync methods