Setting up TryOptionAsync in unit tests #1137
Unanswered
speterson-zoll
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a data service like so:
This is called by a service:
I have a unit test:
However, I'm getting the error:
The
resultin the//Actstep comes back with theTryOptionAsyncin a failed state.I looked this up but didn't find anything that directly addressed my issue. I have other methods and tests that do not deal with
IEnumerablereturn types. In those cases, I set up my TryOptionAsync this way:Tests using this setup work fine; the mock returns the expected TryOptionAsync value and all is well. I'm uncertain why my setup with an
IEnumerableis an issue.Beta Was this translation helpful? Give feedback.
All reactions