Instead of this, split in several tests. In each test, apply the logic needed without adding a new function. You can mockup the function needed in every case.