public void Init()
 {
     _coreDataRepository = new CoreDataRepository();
     _loggingRepository = new LoggingRepository();
     AutoMapperConfig.RegisterMappings();
     batchId = Guid.NewGuid();
 }
 public WorkerTestBase()
 {
     CoreDataRepository = new CoreDataRepository();
     LoggingRepository = new LoggingRepository();
     JobRepository = new UploadJobRepository();
     ErrorRepository = new UploadJobErrorRepository();
 }
 public UploadManager(IFusUploadRepository fusUploadRepository, CoreDataRepository coreDataRepository,
     LoggingRepository loggingRepository)
 {
     _fusUploadRepository = fusUploadRepository;
     _coreDataRepository = coreDataRepository;
     _loggingRepository = loggingRepository;
     _profilesReader = ReaderFactory.GetProfilesReader();
     var config = new MapperConfiguration(c => c.CreateMap<CoreDataSet, CoreDataSetArchive>().ReverseMap());
 }
        private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (inProgress)
            {
                return;
            }

            inProgress = true;

            Init();

            try
            {
                _fusUploadRepository = new UploadJobRepository();
                _coreDataRepository = new CoreDataRepository();
                _loggingRepository = new LoggingRepository();
                _uploadManager = new UploadManager(_fusUploadRepository, _coreDataRepository, _loggingRepository);
                _logger.Debug("...");
            }
            catch (Exception ex)
            {
                LogException(ex);
                _logger.Info("--- Initialisation failed ---");
                inProgress = false;
                return;
            }


            try
            {
                _uploadManager.ProcessUploadJobs();
            }
            catch (Exception ex)
            {
                LogException(ex);
                _logger.Info("--- Process jobs failed ---");
            }
            finally
            {
                _fusUploadRepository = null;
                _coreDataRepository = null;
                _loggingRepository = null;
                _uploadManager = null;
                ReaderFactory.DisposeStatic();
            }

            inProgress = false;

        }
 public SimpleWorksheetDataProcessor(CoreDataRepository coreDataRepository, LoggingRepository loggingRepository)
 {
     _coreDataRepository = coreDataRepository;
     _loggingRepository = loggingRepository;
 }