DEV Community

Discussion on: How do you name your tests?

Collapse
 
haidv profile image
HaiDV

I choose Should_[ExpectedBehavior]When[TestedState] way to describe my test because when I come back and read my test, I feel this way make the test more readability, naturenality

Collapse
 
n_develop profile image
Lars Richter

Readability is key. And yes, this pattern is readable.
That's why I do like the Given_[Preconditions]_When_[TestedState]_Then_[ExpectedBehavior] pattern. It also reads like a normal sentence.