Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 Update 4 Changes MSFakes Shim Object Default Behaviour

We have a suite of unit tests some of which use MS Fakes. Prior to Update 4 they ran successfully. After applying Update 4 the tests that instantiate a shimmed type fail with a ShimNotImplemented exception. This has been confirmed by executing the same codebase on two different machines, one with Update 4 the other without.

I understand that it's possible to change the behaviour of a shimmed type between DefaultValue and NotImplemented but from what I can determine prior to Update 4 the default behaviour was DefaultValue. Naively this seems like a breaking change. We will have to change a number of tests to accomodate this.

A brief look through the MSDN article on the release of Update 4 makes no mention of changes to MS Fakes.

Incidentally we have encountered this issue as well and have amended our references. Again there was no mention of this in the release documentation.

Can anyone confirm that the default behaviour of a MS Fakes shim object has changed with VS Update 4 and if so why it has changed?

Thanks

Richard

like image 240
R W Avatar asked Dec 19 '14 13:12

R W


1 Answers

I had the same issues, surprised to not see anyon else reporting it. I resovled by calling Microsoft.QualityTools.Testing.Fakes.Shims.ShimBehaviors.BehaveAsDefaultValue(); in the test Setup.

like image 114
David Churchland Avatar answered Oct 29 '22 17:10

David Churchland