How do you name your unit test methods?

Viewed 517

What is your general rule in naming your unit test methods? I am sure a lot of people out there also wonder about this question. Suppose, a method under test is

public Customer GetCustomerById(int id)

How would you name your unit test methods?

GetCustomerById?
GetCustomerByIdTest?
GetCustomerByIdShouldReturnCustomer?
GetCustomerByIdShoudReturnCustomerWhenItSucceeds?
GetCustomerByIdShouldReturnNullWhenNotFound?
Get_Customer_By_Id?

..and so on and so forth.

Any thoughts? Thanks.

1 Answers
Related