Ejemplo n.º 1
0
        public virtual bool CheckConsumerSuccessfullyConsumed()
        {
            _scenarioDbContext.WaitForIndexesAfterSaveChanges();
            var result = _inMemoryTestHarness.Consumed.Select <TEvent>(s => s.Exception == null).Any();

            _groupTransactionExecutionService.OnError  = null;
            _groupTransactionExecutionService.OnError += (object sender, Exception exception) =>
            {
                result = false;
            };

            bool executed = false;

            while (!executed)
            {
                executed = _groupTransactionExecutionService.Execute();
            }

            _scenarioDbContext.SaveChanges();
            _scenarioDbContext.WaitForIndexesToBeFresh();
            return(result);
        }
Ejemplo n.º 2
0
        public void ThenStartProcessingTheMessages()
        {
            var       handlerSuccessfullyExecuted = true;
            Exception exception = null;

            _groupTransactionExecutionService.OnError  = null;
            _groupTransactionExecutionService.OnError += (object sender, Exception ex) =>
            {
                handlerSuccessfullyExecuted = false;
                exception = ex;
            };
            bool executed = false;

            while (!executed)
            {
                executed = _groupTransactionExecutionService.Execute();
            }
        }
Ejemplo n.º 3
0
        public Task Execute(IJobExecutionContext context)
        {
            _transactionExecutionService.Execute();

            return(Task.CompletedTask);
        }