Multiple asserts in single test?

Posted by Gern Blandston on Stack Overflow See other posts from Stack Overflow or by Gern Blandston
Published on 2009-05-06T19:45:46Z Indexed on 2010/04/16 22:43 UTC
Read the original article Hit count: 224

Filed under:
|
|
|

Let's say I want to write a function that validates an email address with a regex. I write a little test to check my function and write the actual function. Make it pass.

However, I can come up with a bunch of different ways to test the same function ([email protected]; [email protected]; test.test.com, etc).

Do I put all the incantations that I need to check in the same, single test with several ASSERTS or do I write a new test for every single thing I can think of?

Thanks!

© Stack Overflow or respective owner

Related posts about TDD

Related posts about best-practices