I am wondering if anyone knows of tools or techniques to automatically inject common faults into a running .NET program. Stuff like...
Typemock Isolator seems to be your best bet.
Here's what you can do, if you want to throw a FileNotFoundException to simulate testing.
In your production code, you have such method
public static Project OpenProject(string filePath)
And in your test code, you can fake the OpenProject call like this
Isolate.WhenCalled(()=>Project.OpenProject(nulll)).WillThrow(new FileNotFoundException());
And when your code hit OpenProject, a FileNotFoundException will be thrown.