可以在 Visual Studio 2010 中使用 Microsoft Fakes 吗?

编程入门 行业动态 更新时间:2024-10-28 06:24:46
本文介绍了可以在 Visual Studio 2010 中使用 Microsoft Fakes 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我们有使用 Visual Studio 2010 专业版的开发人员和一些试用 Visual Studio 2012 的开发人员.两个版本之间的项目兼容性很好.

We have developers using Visual Studio 2010 professional and some trying out Visual Studio 2012. Project compatibility between the two versions has been good.

如果我们为单元测试引入新的 Fakes 框架,Visual Studio 项目是否仍然与 2010 兼容?

Will a Visual Studio project still be compatible with 2010 if we introduce the new Fakes Framework for unit testing?

推荐答案

目前 Microsoft Fakes 在 VS 2010 中不起作用.但是项目将编译使用 Fakes 的测试抛出 NotSupportedException 并带有以下堆栈跟踪.

Currently Microsoft Fakes does not work in VS 2010. Project will compile however tests which use Fakes throw NotSupportedException with following stack trace.

at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InvokeEvent(T value, Action`1 eh)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.OnAttachedUnsupportedMethod(MethodBase method)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.CheckInstrumentation(MethodBase method)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InternalAttachDetour(Object optionalReceiver, MethodBase method, Delegate detourDelegate)
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.AttachDetour(Object optionalReceiver, MethodBase method, Delegate detourDelegate)

我建议使用 Moles,这是 Microsoft Fakes 的先前版本.这里很棒 文章 关于从 Moles 转向 Fakes.

I would suggest to use Moles, which is the prior version of Microsoft Fakes. Here is great article about moving from Moles to Fakes.

这篇关于可以在 Visual Studio 2010 中使用 Microsoft Fakes 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 11:19:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1154198.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Studio   Visual   Fakes   Microsoft

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!