Test cases for writeAll()