-
Notifications
You must be signed in to change notification settings - Fork 425
Use InMemoryEventBus as scoped and use InMemoryEventBus in integration tests #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
9446fbf
daabec0
7536d50
d68a0ac
eae74a0
c023fb8
cf501d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace EvolutionaryArchitecture.Fitnet.IntegrationTests.Common.Events.EventBus.InMemory; | ||
|
||
using Fitnet.Common.Events; | ||
using Fitnet.Common.Events.EventBus; | ||
using MediatR; | ||
|
||
internal class NotificationDecorator<TNotification>(IEventBus eventBus, INotificationHandler<TNotification>? innerHandler) | ||
anddrzejb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
: INotificationHandler<TNotification> | ||
where TNotification : INotification | ||
{ | ||
public async Task Handle(TNotification notification, CancellationToken cancellationToken) | ||
{ | ||
var @event = notification as IIntegrationEvent; | ||
await eventBus.PublishAsync(@event!, cancellationToken); | ||
|
||
if (innerHandler is not null) | ||
{ | ||
await innerHandler.Handle(notification, cancellationToken); | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.