Refactored test to better check method calls