alexpat
14 years agoOccasional Contributor
Best practice for this scenario?
I have a test that checks that a specific error message shows up if either an invalid email address is entered or if the email address entered already exists in the database and passes.
What would be the "best practice" way of re-using the test so that if I passed in data that I know is correct (specifically an email that isn't in the database and is formatted correctly) that the test still passes.
Would you recommend a separate test or I was thinking that I could pass in a value which would either be True or False depending on what I would want the test to do and change the way the logic in the test works?
Are there any benefits of choosing on way over the other?
What would be the "best practice" way of re-using the test so that if I passed in data that I know is correct (specifically an email that isn't in the database and is formatted correctly) that the test still passes.
Would you recommend a separate test or I was thinking that I could pass in a value which would either be True or False depending on what I would want the test to do and change the way the logic in the test works?
Are there any benefits of choosing on way over the other?