5

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?

gooddeeds
  • 53
  • 5
  • If all you want to do is to have him be able to build and run the main app, without the need to run the unit tests, a workaround is to have him turn off the build for the unit tests project in the configuration manager. He would then be able to build / run the app, but not the unit tests. – user469104 Aug 06 '14 at 16:16
  • @user469104 Great idea, but the whole team needs to be able to develop and run unit tests. – gooddeeds Aug 06 '14 at 17:34
  • Fakes is only available on Visual Studio Premium and Ultimate. http://www.visualstudio.com/products/compare-visual-studio-products-vs – Arthur Rizzo Aug 21 '14 at 21:19

1 Answers1

1

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
Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170