❔ Should I test my mediator class ?
Hello,
Should I Test my mediator class ? I ask the question because it manage interaction between domaines services.
PS : I don't use MediatR
6 Replies
Is this a self-made mediator that does roughly what MediatR does?
If so, I'd expect you to have tests in place that validate order of operations and transactional security etc
I never test médiatR. To be exact, I confuse observer pattern and mediator pattern. My implémentation has two functions. Notify() and subscribe()
Okay, so its a message bus?
I mean, yeah write some basic tests that verify that it does what it should.
ie, register a subscription for X, verify that when Notify(X) is called, the subscriber gets informed
Yes a message bus. Do you think that I should rename the interface IMediator to IMessageBus
¯\_(ツ)_/¯
Your call
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.