(Re)naming test conditions in database unit test
When adding testconditions to a Visual Studio 2010 database unit test (for SQL Server 2008), these conditions are called e.g. rowCountCondition1, rowCountCondition2, scalarValueCondition1, scalarValueCondition2 and so on.
Do you guys rename these default condition names or do you just 开发者_StackOverflow中文版leave them as is...?
Rename them so that when they fail and you open the test results file it is more immediately obvious what went wrong.
For example, which error message is more useful:
ScalarValueCondition Condition (scalarValueCondition1) Failed: ResultSet 1 Row 1 Column 1: values do not match, actual '0' expected '1'.
Or:
ScalarValueCondition Condition (MyImportantFunction_TestBusinessLogicResult) Failed: ResultSet 1 Row 1 Column 1: values do not match, actual '0' expected '1'.
Additionally I would recommend establishing a naming convention for test names / test condition names.
精彩评论