Unit-testing FileSystemWatcher: How to programatically fire a changed event?
问题 I have a FileSystemWatcher watching a directory for changes, and when there's a new XML file in it, it parses that file and does something with it. I have a few sample XML files in my project that I am using for unit-testing purposes for the parser I wrote. I'm looking for a way to use the sample XML files also to test the FileSystemWatcher . Is it possible to programatically create an event (somehow involving the XML file) in order to trigger the FSW.Changed event? 回答1: I think that you are