I'm running VS 2012 Premium and have written a few tests using Fakes. A member of my team is running VS 2010 Professional. After importing my unit tests, he's receiving compilation errors on that the references to both the Fakes assembly - Microsoft.QualityTools.Testing.Fakes
- and the generated Fakes assembly from the project reference - MyProject.Fakes
- don't exist.
Is there to share unit tests with Fakes with a developer who is not running VS Premium or Ultimate? At least so the solution compiles in his IDE?
It's not a good solution, but workaround to exclude only Fakes tests by specifying FAKES_NOT_SUPPORTED conditional constant in the projects on local machines.
Because Fakes are available only in VS Premium/Ultimate editions 2012/2013 and Enterprise 2015(i.e not available in Community and Professional Editions) I wrapped the test methods using shims in #if !FAKES_NOT_SUPPORTED conditions, to allow easily exclude them on Community and Professional Editions
#if !FAKES_NOT_SUPPORTED
[ TestMethod()]
public void TestWithShim()
{
}
#endif //!FAKES_NOT_SUPPORTED
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With