Visual Studio 2013 Update 4 更改 MSFakes Shim 对象默认行为 [英] Visual Studio 2013 Update 4 Changes MSFakes Shim Object Default Behaviour

查看:42
本文介绍了Visual Studio 2013 Update 4 更改 MSFakes Shim 对象默认行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一套单元测试,其中一些使用 MS Fakes.在更新 4 之前,它们成功运行.应用更新 4 后,实例化填充类型的测试失败,并出现 ShimNotImplemented 异常.这已经通过在两台不同的机器上执行相同的代码库得到证实,一台带有 Update 4,另一台没有.

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.

我知道可以在 DefaultValue 和 NotImplemented 之间更改填充类型的行为,但根据我在更新 4 之前可以确定的默认行为是 DefaultValue.天真地,这似乎是一个突破性的变化.我们将不得不更改一些测试以适应这一点.

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.

简要浏览关于更新 4 发布的MSDN 文章没有提及更改为 MS Fakes.

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

顺便说一下,我们遇到了 this 问题,并修改了我们的参考.再次在发布文档中没有提到这一点.

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

任何人都可以确认 MS Fakes shim 对象的默认行为在 VS Update 4 中发生了变化,如果是这样,为什么会发生变化?

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?

谢谢

理查德

推荐答案

我遇到了同样的问题,很惊讶没有其他人报告它.我通过调用 Microsoft.QualityTools.Testing.Fakes.Shims.ShimBehaviors.BehaveAsDefaultValue(); 来解决问题.在测试设置中.

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.

这篇关于Visual Studio 2013 Update 4 更改 MSFakes Shim 对象默认行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆