Add integrated unit test.
Refactor unit test.