You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: