VS 2012 RC – Fakes Bugs Fixed

In a previous post about the MS Fakes framework, I made mention of some bugs that appeared in the Beta. I finally had some time to test out the same code in the RC, and I am pleased to tell you that the bugs have been fixed (well, the ones I found anyway!).

Upgrading Gotcha

The only gotcha I came across appears to be a snag when you open in the RC a test project that was created in the Beta. I initially simply opened up the code that I had from the Beta, updated references to TeamFoundation dlls from version 10 to version 11, regenerated the fakes and tried to run the tests. FAIL – the tests were failing with “ShimNotSupportedExceptions”. After trying various things, I noticed some text in the Output window from the “Tests” section (the Show output from dropdown):

Failed to configure settings for runsettings plugin ‘Fakes’ as it threw following exception:
‘Object reference not set to an instance of an object’
Please contact the plugin author.

image

For some reason, the Fakes framework wasn’t generating fakes for the v 11 assemblies correctly. I eventually created a new Test project in VS 2012 RC, copied across the code and re-added references and fakes, and voila, everything is working great!

I’m not sure if this is a bug or not, so if you’re getting this error, my suggestion is to just create a new Test project in the RC and copy the code across.

Now back to (fake) testing…


© 2021. All rights reserved.