les鼠将装配添加到错误的项目 [英] Moles adding assembly to wrong project
问题描述
我正尝试使用 Microsoft Moles 入门能够模拟我的扩展方法,但我没能做到.
I'm trying to get started with Microsoft Moles in order to be able to mock my extension methods, but I'm falling short.
我已经在工作站上成功安装了Moles,但是当我转到测试项目(引用NUnit的类库项目,而不是MSTest项目)时,向下浏览引用",右键单击要存根的程序集(在这种情况下为NHibernate),然后单击添加摩尔组件...",NHibernate.moles文件将显示在我的解决方案中一个完全不同的项目中.唯一的内容是
I've successfully installed Moles on my workstation, but when I go to my test project (a class library project referencing NUnit, not an MSTest project), navigate down through References, right-click the assembly I want to stub (NHibernate in this case) and click "Add moles assembly...", the NHibernate.moles file shows up in an entirely different project in my solution. It's only content is
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="NHibernate" />
</Moles>
这似乎并没有带我到任何地方.我希望能够按照Dime Casts的此截屏视频进行操作,但是我不知道截屏视频中没有显示测试的分子和存根"项目模板.
This doesn't seem to get me anywhere. I expected to be able to follow this screencast from Dime Casts to get started, but I don't have the "Moles and Stubs for Testing" item template shown in the screencast.
我似乎无法从这里到达任何地方.我需要怎么做才能获得那些模板?以及为什么痣组装"以错误的项目结束?我如何从这里着手才能开始使用Moles?
I don't seem to be able to get anywhere from here. What do I need to do to get those templates? And why does the moles "assembly" end up in the wrong project? How do I proceed from here to be able to start using Moles?
推荐答案
mole程序集不会出现在引用"文件夹的开头.生成项目,单击显示所有文件",您将看到一个MolesAssemblies文件夹,其中包含您生成的Mole程序集.
The mole assemblies don't show up at the beginning in your References folder. Build the project, click "Show All Files" and you'll see a MolesAssemblies folder containing your generated Mole assemblies.
这篇关于les鼠将装配添加到错误的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!