protected override void StoreDeserializedData(IEnumerable <object> data)
 {
     _scenarioDbContext.WaitForIndexesAfterSaveChanges();
     base.StoreDeserializedData(data);
     _scenarioDbContext.SaveChanges();
     _scenarioDbContext.WaitForIndexesToBeFresh();
 }
        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);
        }