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; }
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); }
public void Setup() { _fakeTimer = Substitute.For <ITimerWrapper>(); _fakeWatcher = Substitute.For <IFileSystemWatcherWrapper>(); _uut = new FileMonitor(_fakeWatcher, _fakeTimer); }
public FileMonitor(IFileSystemWatcherWrapper watcher, ITimerWrapper timer) : base(watcher) { _timer = timer; }
public Form1(ITimerWrapper timerWrapper) { InitializeComponent(); this._timerWrapper = timerWrapper; // of course this is done via dependency injection this._timerWrapper.Interval = 1000; }
private TimeManager CreateTimeManager(ITimerWrapper timer) { return(new TimeManager(timer)); }
public TimeManager(ITimerWrapper timer) { _timer = timer; _timer.Interval = DefaultTimerInterval; }