So how do you write a test for a case you couldn't foresee?
You don't, but once you discover it, you write a regression test to make sure it doesn't come back.
However, IANATDD, I am not a test-driven developer - I don't see any reason to be dogmatic, but I do think unit tests can be extremely valuable. So this answer might not be TDD-approved.
You don't, but once you discover it, you write a regression test to make sure it doesn't come back.
However, IANATDD, I am not a test-driven developer - I don't see any reason to be dogmatic, but I do think unit tests can be extremely valuable. So this answer might not be TDD-approved.