Ejemplo n.º 1
0
 public void MonitorDoesNotDetectWhenPaused()
 {
     ResetFile();
     var monitor = new FileMonitor(this.file);
     monitor.Pause();
     var signal = new ManualResetEventSlim();
     monitor.FileChanged += (o, s) => { signal.Set(); };
     Assert.That(signal.IsSet, Is.False);
     ChangeFile();
     signal.Wait(600);
     Assert.That(signal.IsSet, Is.False);
 }
Ejemplo n.º 2
0
 public void MonitorWorksAfterStopAndStart()
 {
     ResetFile();
     var monitor = new FileMonitor(this.file);
     monitor.Pause();
     monitor.Unpause();
     var signal = new ManualResetEventSlim();
     monitor.FileChanged += (o, s) => { signal.Set(); };
     Assert.That(signal.IsSet, Is.False);
     ChangeFile();
     signal.Wait(600);
     Assert.That(signal.IsSet, Is.True);
 }