DEV Community

Jose Martin
Jose Martin

Posted on

Simple Test Case template

Hello Dev community!

I’m looking for a simple test case template I can use to write test cases. I found some in google but those are not good enough.

Hope you guys help. Thanks in advance

Top comments (1)

Collapse
 
miniscruff profile image
miniscruff

I like to follow the BDD terminology.
Given: The pre-work you need to have done before you do the work
When: When you call a method or do something
Then: The assertions for what should or should not be

You can have as many givens or thens but you should really only have one when.
Also, you can not bounce, once you go from given to when, you can not go back.

I hope this is what you were looking for.