Hi Jess,
I normally name my tests shouldDoXXXX
where the test name describes what it should do for all similar contexts. So I might say shouldAddUpTwoNumbersCorrectly
. This is a bit different to the way a lot of BDDers do it - the Ruby crowd particularly seem to like shouldAddTwoPlusTwoToMakeFour
, so repeating the particular example they use. Whichever works for you!
Inside the test, I often write comments as Given / When / Then:
public void ShouldAddUpTwoNumbersCorrectly()
{
// Given two numbers
// When I give them to the summer
// Then the result should be the sum of the two numbers
}
Then I fill in the code between the comments. If the test is very simple I may skip the comments.
I don't bother with English-readable frameworks for a class test, because the audience is technical and capable of reading code. The BDD frameworks which do Given / When / Then were created largely to help with conversations with non-technical stakeholders, and to encourage developers to use their language. I don't find them useful at a class level. YMMV.