I have problem. I want to use mock of IDbConnection with setup of QuerySingleOrDefault to return null. I cant do this because i get error "Non-static method requires a target".
This is my sample test code:
Test class is simple class with 1 property.
I have downloaded the nugget code and check what gives this error. Every "Queryxxx" method is setup by the same way. Returns value is converted to DataTable in every configuration and at the end of this function you added elements to DataTable
But if element is null, an error appears. Why you dont make simple if element is null then continue? Is any reason to dont do this?
I have problem. I want to use mock of IDbConnection with setup of QuerySingleOrDefault to return null. I cant do this because i get error "Non-static method requires a target". This is my sample test code: Test class is simple class with 1 property.
I have downloaded the nugget code and check what gives this error. Every "Queryxxx" method is setup by the same way. Returns value is converted to DataTable in every configuration and at the end of this function you added elements to DataTable
But if element is null, an error appears. Why you dont make simple if element is null then continue? Is any reason to dont do this?