public void StoppingPollingDoesNotThrowException() { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(PollingThreadExceptionCatcher); using (ConfigurationChangeFileWatcher watcher = new ConfigurationChangeFileWatcher("MyFile.Test", "MySection")) { watcher.StartWatching(); Thread.Sleep(100); watcher.StopWatching(); Thread.Sleep(1000); } AppDomain.CurrentDomain.UnhandledException -= new UnhandledExceptionEventHandler(PollingThreadExceptionCatcher); Assert.IsNull(pollingException); }