Refactor test codes.
Merge pull request #8 from larrylv/refactor-tests

Refactor test codes.