In many situations, it’s hard for me to come up with good unit test names for classes and methods. I usually try to follow the form:
public class TestContext
{
[Fact]
public void WhenThis_DoThat()
{
}
}
Some put the words Given, When, and Then on parts that need to be explicit. I like it because it seems that unit test makes it clearer what it is testing. Besides looking at BDD toolkits, I need to know how this can work with the usual old xUnit tools.
It’s especially hard for me to work with scripts like this:
When the application starts, the main form loads, and the user sees a list of links that the user can click.
or perhaps it is better to use a use case:
The user can select a link from the list of links.
, , . unit test.
, , ?