I have this method:
public bool CanExecute()
And after 70 commits, I added an extra parameter
public bool CanExecute(IStation target)
Now the problem is I have 7 unit tests covering this CanExecute methods testing various nulls/property combinations.
Adding this simple parameter required a fix of those 7 unit tests. The fix is simple but...
Is there a best practice and/or pattern to avoid this kind of hand-refactor required to update unit tests?
Suppose I know an extra parameter might be added in the near future, how'd I code the unit test to account for that? Is it just overkill or is there an idiom/pattern/something to follow?
EDIT: I could not simply add an overload because the IStation dependency is not optional. I was fixing a bug where an IStation instance was expected but none was available so it must be supplied via CanExecute... you see.
Refactoring tools seem to be the way to go. Thanks!