Visual Studio 2013 Update 4 Changes MSFakes Shim Object Default Behaviour

风流意气都作罢 提交于 2019-12-12 10:59:49

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/27567577/visual-studio-2013-update-4-changes-msfakes-shim-object-default-behaviour

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!