添加假货装配选项缺失 [英] Add Fakes Assembly option missing

查看:21
本文介绍了添加假货装配选项缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的解决方案中设置的单元测试项目中启动并运行 Microsoft Fakes.

出于某种原因,缺少 Add Fakes Assembly 选项,这意味着我无法创建程序集模型.由于这是添加 Microsoft.QualityTools.Testing.Fakes 程序集的唯一替代方法,因此我也无法使用 Shim 功能.

我最近安装了 Visual Studio 2012 Professional 并安装了 update 3,这是 Visual Studio 2012 中的第一次.而且我没有更改任何设置.虽然我已经安装了 ReSharper,但这可能是罪魁祸首吗?

解决方案

Visual Studio 2019 和 2017 仅在企业版中有此功能(它们都有 3 个主要版本:社区版、专业版和企业版.)

如果您只需要 Stub 功能,那么您可以简单地选择其他模拟框架.您提到了 Shims,这是一项高级功能.我听说过一些模拟框架可以接近高级.

我听说过 Prig(

<小时>

Visual Studio 2017 功能矩阵 - 只有企业提供假货:

<小时>

Visual Studio 2015:Microsoft Fakes 提供高级版及更高版本.

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2919309-provide-microsoft-fakes-with-all-visual-studio-edi

I'm trying to get the Microsoft Fakes up and running in a Unit test project that I've set up in my solution.

For some reason the Add Fakes Assembly option is missing which means I can't create mockups of assemblies. And since this is the only alternative to add the Microsoft.QualityTools.Testing.Fakes assembly I can't use the Shim functionality either.

I've recently installed Visual Studio 2012 Professional and installed update 3 and this is the first go in Visual Studio 2012. And I haven't changed any settings. Although I have installed ReSharper, could this be the culprit?

解决方案

Both Visual Studio 2019 and 2017 only has this feature in the Enterprise edition (they both have 3 main editions: Community, Professional and Enterprise.)

If you'd only need the Stub functionality, then you could simply pick other mocking frameworks. You mention Shims, which is an advanced functionality. I have heard some mock frameworks which can be close to that advanced.

I've heard of Prig (https://marketplace.visualstudio.com/items?itemName=sug.Prig-OpenSourceAlternativetoMicrosoftFakes), but I haven't ever tried it. @neaGaze says it's not supported in VS 2017.

The newest screenshot of the feature matrix's (https://visualstudio.microsoft.com/vs/compare/) related section:


Visual Studio 2017 feature matrix - only Enterprise offers Fakes:


Visual Studio 2015: Microsoft Fakes is available in Premium Edition and up.

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2919309-provide-microsoft-fakes-with-all-visual-studio-edi

这篇关于添加假货装配选项缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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