开发者

(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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜