| ▲ | RHSeeger 2 days ago | |
The question was less about speed and more about not having the same code duplicated over and over across tests. Which is how I read the article talking about it. Allowing one test to "depend" on another makes it clear they use the same setup (presumably with the second test going "a bit further", but not necessarily). I wouldn't have a problem with something like
The format is awful, but the idea is that most tests are of the form
And, in that context, the GIVEN frequently contains noise not directly related to understanding what is being tested.I actually use the GIVEN/WHEN/THEN keywords in my tests, to make them easier to read | ||