i wonder if it is possible to auto mock
a container in MOQ without any additions to the MOQ lib.
I am having problems finding a clean way to automock an IList.
Thanks in advance!
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.
Answer to your question: No.
Do you really need to mock IList?
Mocks are typically used to:
You could for example mock a repository that access a database. Normally your tests would not mock a list but rather have a mocked object return a list with the data that you need for your test.
ie:
It might help clarify your question if you specify why you need to mock a container.