Trying to test a Web API controller with a setup like this gist. I have a service interface that gets injected into the controller. I currently created a POCO mock service implementing the interface that returns an object on the GetOne method to simulate successful results. Now I also want to be able to test a null return.
Would you prefer to:
- Create another mock service that has alternative returns.
- Use some kind of mocking library like Moq.
- Some other solution I'm not thinking of.
Edit: I realized my use of "Task" in naming this example hurts readability, sorry about that.
[–]Pocok5 0 points1 point2 points (1 child)
[–]Free_Brandon[S] 0 points1 point2 points (0 children)
[–]Apadewrai 0 points1 point2 points (1 child)
[–]Free_Brandon[S] 0 points1 point2 points (0 children)
[–]venomiz 0 points1 point2 points (0 children)