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
-
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
result
in the//Act
step comes back with theTryOptionAsync
in 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
IEnumerable
return 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
IEnumerable
is an issue.Beta Was this translation helpful? Give feedback.
All reactions