forked from elsa-workflows/elsa-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestHandler.cs
26 lines (21 loc) · 738 Bytes
/
TestHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Notifications;
namespace Elsa.IntegrationTests.Scenarios.ActivityNotificationsMiddleware;
public class TestHandler : INotificationHandler<ActivityExecuting>, INotificationHandler<ActivityExecuted>
{
private readonly Spy _spy;
public TestHandler(Spy spy)
{
_spy = spy;
}
public Task HandleAsync(ActivityExecuting notification, CancellationToken cancellationToken)
{
_spy.ActivityExecutingWasCalled = true;
return Task.CompletedTask;
}
public Task HandleAsync(ActivityExecuted notification, CancellationToken cancellationToken)
{
_spy.ActivityExecutedWasCalled = true;
return Task.CompletedTask;
}
}