public async Task <Unit> Handle(UpdateAccountLevyDeclarationTransactionBalancesCommand request, CancellationToken cancellationToken, RequestHandlerDelegate <Unit> next)
        {
            var task   = LevyDeclarationSagaTask.CreateUpdateAccountTransactionBalancesTask(request.SagaId, request.AccountId);
            var result = await Run(task, next);

            return(result);
        }
        public RunProcessLevyDeclarationsSagaTaskCommandHandlerTestsFixture()
        {
            Now = DateTime.UtcNow;
            AccountPayeSchemeId = 1;
            AccountId           = 2;
            ImportPayeSchemeLevyDeclarationsCommand = new ImportPayeSchemeLevyDeclarationsCommand(SagaId, Now, AccountPayeSchemeId);
            UpdateAccountLevyDeclarationTransactionBalancesCommand = new UpdateAccountLevyDeclarationTransactionBalancesCommand(SagaId, AccountId);
            Db       = new EmployerFinanceDbContext(new DbContextOptionsBuilder <EmployerFinanceDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options);
            Handler  = new RunLevyDeclarationSagaTaskCommandHandler(Db);
            NextTask = new Mock <RequestHandlerDelegate <Unit> >();

            NextTask.Setup(t => t()).Callback(() => NextTaskInvoked = DateTime.UtcNow).ReturnsAsync(Unit.Value);
        }
 public UpdateAccountTransactionBalancesCommandHandlerTestsFixture()
 {
     Command  = new UpdateAccountLevyDeclarationTransactionBalancesCommand(1, 2);
     Mediator = new Mock <IMediator>();
     Handler  = new UpdateAccountTransactionBalancesCommandHandler(Mediator.Object);
 }