Refactor commit unit tests