C
C#2y ago
shivam51

❔ 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
Becquerel
Becquerel2y ago
does the component depend against the service class directly, or against an interface that the service implements? typically you mock interfaces
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
shivam51
shivam51OP2y ago
This is correct. I am mocking the interface now.
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server