I am new to unit testing.
I have a method
public List<Employee> GetEmployeeList()
{
}
How to write unite test for the above method. whether the list is returning any data?
Please….
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the method obtains its data from a database (as you mention in your comment), then either it’s an integration test, or you need to mock out the database access, which might well be pointless if all the method does is retrieve the data without transforming it in any way.