Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuerySingleOrDefault cannot return null #73

Open
goliat26 opened this issue Oct 7, 2021 · 1 comment
Open

QuerySingleOrDefault cannot return null #73

goliat26 opened this issue Oct 7, 2021 · 1 comment

Comments

@goliat26
Copy link

goliat26 commented Oct 7, 2021

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:
obraz
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
obraz

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?

@simonpinn
Copy link

Similar to #54 - also having an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants