Beispiel #1
0
        public void should_Clear()
        {
            Assert.True(_context.TempMasterPatientIndices.AsNoTracking().Any());
            Assert.True(_context.MasterPatientIndices.AsNoTracking().Any());

            _repository.Clear().Wait();

            _context = TestInitializer.ServiceProvider.GetService <ExtractsContext>();
            Assert.False(_context.TempMasterPatientIndices.AsNoTracking().Any());
            Assert.False(_context.MasterPatientIndices.AsNoTracking().Any());
        }
        public async Task Clean(Guid extractId)
        {
            _historyRepository.ClearHistory(extractId);

            DomainEvents.Dispatch(new CbsNotification(new ExtractProgress(nameof(MasterPatientIndex), "clearing...")));
            DomainEvents.Dispatch(new CbsStatusNotification(extractId, ExtractStatus.Clearing));

            await _repository.Clear();


            DomainEvents.Dispatch(new CbsStatusNotification(extractId, ExtractStatus.Cleared));
        }