public DataTransferService(IRemoteDataServiceFactory remoteDataServiceFactory,
     ICallCopyServiceFactory callCopyServiceFactory,
     ITimerWrapper timer, IConfigurationManagerWrapper configurationManager)
 {
     InitializeComponent();
     _remoteDataServiceFactory = remoteDataServiceFactory;
     _timer = timer;
     _configurationManager = configurationManager;
     _transferer = new Transferer(callCopyServiceFactory.Construct(configurationManager));
 }
        public FileSystemSyncWhenScheduled(IOneWaySynchronizer oneWaySynchronizer, ITimerWrapper timer)
        {
            if (oneWaySynchronizer == null)
                throw new ArgumentNullException(nameof(oneWaySynchronizer));

            if (timer == null)
                throw new ArgumentNullException(nameof(timer));

            _oneWaySynchronizer = oneWaySynchronizer;
            _timer = timer;

            _timer.Elapsed += TimerOnElapsed;
        }
Ejemplo n.º 3
0
        public FileSystemWatcherAdapter(FileSystemWatcher fileSystemWatcher, ITimerWrapper timerWrapper, IFileLockHelper fileLockHelper)
        {
            if (fileSystemWatcher == null)
                throw new ArgumentNullException(nameof(fileSystemWatcher));

            if (timerWrapper == null)
                throw new ArgumentNullException(nameof(timerWrapper));

            if (fileLockHelper == null)
                throw new ArgumentNullException(nameof(fileLockHelper));

            _timerWrapper = timerWrapper;
            _fileLockHelper = fileLockHelper;

            _timerWrapper.Interval = BlockingInterval;
            _timerWrapper.Elapsed += TimerOnElapsed;

            SetupFileSystemWatcher(fileSystemWatcher);
        }
Ejemplo n.º 4
0
 public void Setup()
 {
     _fakeTimer   = Substitute.For <ITimerWrapper>();
     _fakeWatcher = Substitute.For <IFileSystemWatcherWrapper>();
     _uut         = new FileMonitor(_fakeWatcher, _fakeTimer);
 }
Ejemplo n.º 5
0
 public FileMonitor(IFileSystemWatcherWrapper watcher, ITimerWrapper timer) : base(watcher)
 {
     _timer = timer;
 }
Ejemplo n.º 6
0
 public Form1(ITimerWrapper timerWrapper)
 {
     InitializeComponent();
     this._timerWrapper          = timerWrapper; // of course this is done via dependency injection
     this._timerWrapper.Interval = 1000;
 }
Ejemplo n.º 7
0
 private TimeManager CreateTimeManager(ITimerWrapper timer)
 {
     return(new TimeManager(timer));
 }
Ejemplo n.º 8
0
 public TimeManager(ITimerWrapper timer)
 {
     _timer          = timer;
     _timer.Interval = DefaultTimerInterval;
 }