I have two test cases to test a fix to code that is using the wrong criteria for selecting objects from a collection:
- Given one object in the collection matching the bad criteria, ensure that no object is returned.
- Given two objects in the collection, with the later one matching the bad criteria, ensure that the earlier object is retrned.
Right now, both of these tests will fail.
The problem is, as soon as I make the fix, both tests will pass.
Is this ok? I thought we needed a single failing unit test before writing the code. I haven't heard it's ok to have multiple failing unit tests before writing code.