refactors the assertEqual method