refactored assert in unit test