问题
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