Complete testing read() and write()
Add test cases