Beispiel #1
0
        public void TestFileChanged()
        {
            string file1, file2;

            monitor.Start();
            file1 = Path.Combine(tmpDir, "test1");
            file2 = Path.Combine(tmpDir, "test2");
            File.OpenWrite(file1).Close();
            // Ugly as hell...
            System.Threading.Thread.Sleep(100);
            Assert.AreEqual(1, addedChanged);
            Assert.AreEqual(0, deletedChanged);
            File.Move(file1, file2);
            System.Threading.Thread.Sleep(100);
            Assert.AreEqual(2, addedChanged);
            Assert.AreEqual(1, deletedChanged);
            File.Delete(file2);
            System.Threading.Thread.Sleep(100);
            Assert.AreEqual(2, addedChanged);
            Assert.AreEqual(2, deletedChanged);
            monitor.Stop();
        }
Beispiel #2
0
 private void buttonStop_Click(object sender, EventArgs e)
 {
     _monitor.Stop();
 }