I’m creating a class that needs to parse user contact info to determine if the presented user already exists in the db. Because the source is unvalidated, user generated data I have to test for matches under a variety of conditions.
The content is presented in 3 fields – Name (first & last are combined); Company Name; Email
I need to return a result based on each of these possible match conditions:
Exact Match Email Match Domain Name Only Full Name Exact Last Name Only Institution Match
I have a rough idea of how I’d go about coding this and am sure that the result would be inferior to what would be produced by a formal TDD approach. My TDD learning curve is just past the very basics but I don’t have the depth to see how the above scenario is staged and developed thru the full lifecycle.
I’d like some help structuring the project from an architectural point of view.
thx
Seems like tou already listed the primary positive test cases in your list of match types. So take those from the top, write a small test for the first case (exact match), warch it fail, make it pass, iterate until exact match works. Then do the same for the other match types.