Modify TestWriter

Adding some test methods
Merge pull request #44 from Doha2012/master

Modify TestWriter