可以在 Visual Studio 2010 中使用 Microsoft Fakes 吗? [英] Can Microsoft Fakes be used in Visual Studio 2010?

查看:34
本文介绍了可以在 Visual Studio 2010 中使用 Microsoft Fakes 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有使用 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屋!

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