17

We have developers using Visual Studio 2010 professional and some trying out Visual Studio 2012. Project compatibility between the two versions has been good.

Will a Visual Studio project still be compatible with 2010 if we introduce the new Fakes Framework for unit testing?

Dan Sorensen
  • 11,403
  • 19
  • 67
  • 100
  • My hypothesis is that it will work under 2010 if all of the dependent references are included in the project, but that 2010 will not have any of the UI or Intellisense for the Fakes Framework, which requires VS 2012 Premium or better. – Dan Sorensen Jun 16 '12 at 05:57
  • Fakes even requires VS.Net 2012 Ultimate, according to http://www.microsoft.com/visualstudio/eng/products/compare – R. Schreurs Jan 07 '13 at 13:34

1 Answers1

10

Currently Microsoft Fakes does not work in VS 2010. Project will compile however tests which use Fakes throw NotSupportedException with following stack trace.

at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InvokeEvent(T value, Action`1 eh)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.OnAttachedUnsupportedMethod(MethodBase method)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.CheckInstrumentation(MethodBase method)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InternalAttachDetour(Object optionalReceiver, MethodBase method, Delegate detourDelegate)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.AttachDetour(Object optionalReceiver, MethodBase method, Delegate detourDelegate)

I would suggest to use Moles, which is the prior version of Microsoft Fakes. Here is great article about moving from Moles to Fakes.

k0stya
  • 4,267
  • 32
  • 41
  • 1
    By doesn't work, do you mean, "project will not compile" or do you mean that the tooling and testing are just unavailable? – Dan Sorensen Jun 24 '12 at 20:02