Questions from the field: what are Microsoft fakes?
Posted: (EET/GMT+2)
I today received an interesting email question from the field about basically "What is Microsoft Fakes"? Since other developers and testers might have the same question, I decided to blog the answer here as well.
The "fakes" in Microsoft terminology refer, shortly put, into classes that you can use a substitute either for your custom classes (that are perhaps not yet implemented), or classes that are part of the .NET Framework itself.
Using fakes is related to unit testing, and there fakes serve a useful purpose: you don't need to actually access real classes that have system-wide side effects (such as writing to a file), but you can instead use a lightweight fake class that lets you unit test your application logic. Fakes work best when you are using interfaces inside your own code instead of concrete implementation classes.
For a longer answer, check this nice page on MSDN. You will also learn about shims and stubs along the way.
Happy testing!