C
C#17mo ago
OukiShogun

❔ 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
Pobiega
Pobiega17mo ago
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
OukiShogun
OukiShogunOP17mo ago
I never test médiatR. To be exact, I confuse observer pattern and mediator pattern. My implémentation has two functions. Notify() and subscribe()
Pobiega
Pobiega17mo ago
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
OukiShogun
OukiShogunOP17mo ago
Yes a message bus. Do you think that I should rename the interface IMediator to IMessageBus
Pobiega
Pobiega17mo ago
¯\_(ツ)_/¯ Your call
Accord
Accord17mo 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