public void StorageFiresEventTest() { string filename = Path.GetFullPath(myConfigTestFile); bool fileExists = File.Exists(filename); Assert.IsTrue(fileExists); bool loaded = configFile.Load(filename); Assert.IsTrue(loaded); using (IConfigurationChangeWatcher watcher = configFile.CreateFileWatcher()) { ((ConfigurationChangeFileWatcher)watcher).SetPollDelayInMilliseconds(100); watcher.ConfigurationChanged += new ConfigurationChangedEventHandler(OnConfigurationChanged); watcher.StartWatching(); Thread.Sleep(150); FileUtility.OpenAndChangeFile(myConfigTestFile); for (int wait = 0; wait < 10 && eventFiredCount == 0; ++wait) { Thread.Sleep(500); } } Assert.AreEqual(1, eventFiredCount); }