public void SetUp() { var system = new FileSystem(); system.WriteStringToFile("a.txt", "something"); system.WriteStringToFile("b.txt", "else"); system.WriteStringToFile("c.txt", "altogether"); theWatcher = new FileChangePollingWatcher(); action1 = MockRepository.GenerateMock<System.Action>(); action2 = MockRepository.GenerateMock<System.Action>(); action3 = MockRepository.GenerateMock<System.Action>(); theWatcher.WatchFile("a.txt", action1); theWatcher.WatchFile("b.txt", action2); theWatcher.WatchFile("c.txt", action3); }
public void StartWatchingAll() { _watcher = new FileChangePollingWatcher(); _fileGraph.AllFiles().Each(file => { _watcher.WatchFile(file.FullPath, () => _listener.Changed(file)); }); _watcher.StartWatching(_settings.MonitoringIntervalTime); }
public void SetUp() { var system = new FileSystem(); system.WriteStringToFile("a.txt", "something"); system.WriteStringToFile("b.txt", "else"); system.WriteStringToFile("c.txt", "altogether"); Thread.Sleep(1000); theWatcher = new FileChangePollingWatcher(); action1 = MockRepository.GenerateMock <System.Action>(); action2 = MockRepository.GenerateMock <System.Action>(); action3 = MockRepository.GenerateMock <System.Action>(); theWatcher.WatchFile("a.txt", action1); theWatcher.WatchFile("b.txt", action2); theWatcher.WatchFile("c.txt", action3); }