DEV Community

Discussion on: How to setup methods which return a built-in type and implement IEnumerable interface in Moq ?

Collapse
 
rajmondburgaj profile image
Rajmond Burgaj • Edited

Hi Justin, sorry for the late response. In my case I would have changed it to be IEnumrable but did not want to do so because I had to change many things in the services which I did not want for the moment. Maybe a later a refactoring task might fix this. In reality there might be a reason why you don't/cant change to IEnumerable because you might want to use some extra functionalities provided by the class(in this case DbRawSqlQuery) without having to cast first. But I agree with the fact it is better where possible to keep as less dependencies as possible.