Refactored unit test cases