❔ How can I mock a Service class being used in Component class?
The service also initializes a dapr component in it's constructor.
I want to unit test a function of the controller class.
Happy to share more info.
4 Replies
does the component depend against the service class directly, or against an interface that the service implements?
typically you mock interfaces
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
This is correct. I am mocking the interface now.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.