相关疑难解决方法(0)

您如何命名单元测试方法?

命名单元测试方法的一般规则是什么?我相信很多人都对这个问题感到疑惑.假设,一个被测试的方法是

public Customer GetCustomerById(int id)
Run Code Online (Sandbox Code Playgroud)

您如何命名单元测试方法?

GetCustomerById
GetCustomerByIdTest
GetCustomerByIdShouldReturnCustomer
GetCustomerByIdShoudReturnCustomerWhenItSucceeds
GetCustomerByIdShouldReturnNullWhenNotFound
Get_Customer_By_Id

..等等等等.

有什么想法吗?谢谢.

unit-testing

3
推荐指数
1
解决办法
329
查看次数

标签 统计

unit-testing ×1