Microsoft Moles 没有为多种方法创建鼹鼠
我在获取类中的几个静态方法进行建模以及识别 .moles 文件中的 Diagnostics 属性时遇到问题。
我的环境:
- Visual Studio 2008
- Pex/Moles 版本 0.94.51023.0
我需要的一种方法的签名,但无法获得 moled 引用:
private static List<MaxBet> GetByPaytableDenom(int? paytableDenomId, int? paytableId, int? denomId, int? instanceId)
我什至尝试将其更改为 public static
或 private
(非静态)并重新编译后根本无法显示。它是同一方法的 5 个重载签名之一。这一位和另一位都没有受到改造。
因此,我尝试在 .mole 文件中打开诊断和详细程度:
<Moles xmlns="http://schemas.microsoft.com/moles/2010/" Diagnostic="true" Verbosity="Noisy">
当我检查“输出”窗口并选择下拉框以转到“摩尔”输出时,我只得到以下信息:
-- Moles vs build action build started
adding 2 assemblies
adding C:\WMS_2008\Development 4.X\BugFixes\Main 4.X\SourceNG\TestProjects\UnitTestProjects\BusinessLayerUnitTests\MolesAssemblies\WMS.NG.SSG.BusinessLayer.Moles.dll
adding C:\WMS_2008\Development 4.X\BugFixes\Main 4.X\SourceNG\TestProjects\UnitTestProjects\BusinessLayerUnitTests\MolesAssemblies\WMS.NG.SSG.DataLayer.Moles.dll
-- Moles update finished
什么给出了?我似乎无法弄清楚这一点。
辛迪
I am having a problem getting a couple of the static methods in my class to be moled, as well as getting the Diagnostics attribute in the .moles file to be recognized.
My environment:
- Visual Studio 2008
- Pex/Moles version 0.94.51023.0
The signature of the one method in particular that I need and can't get a moled reference to:
private static List<MaxBet> GetByPaytableDenom(int? paytableDenomId, int? paytableId, int? denomId, int? instanceId)
I have even tried changing it to public static
or private
(not static) and recompiled and can't get it to show up at all. It is one of 5 overloaded signatures of the same method. This one and one other aren't getting moled.
So I then tried turning on Diagnostics and Verbosity in my .mole file:
<Moles xmlns="http://schemas.microsoft.com/moles/2010/" Diagnostic="true" Verbosity="Noisy">
And when I check the Output window and select the drop-down box to go to the Moles output, I am only getting this:
-- Moles vs build action build started
adding 2 assemblies
adding C:\WMS_2008\Development 4.X\BugFixes\Main 4.X\SourceNG\TestProjects\UnitTestProjects\BusinessLayerUnitTests\MolesAssemblies\WMS.NG.SSG.BusinessLayer.Moles.dll
adding C:\WMS_2008\Development 4.X\BugFixes\Main 4.X\SourceNG\TestProjects\UnitTestProjects\BusinessLayerUnitTests\MolesAssemblies\WMS.NG.SSG.DataLayer.Moles.dll
-- Moles update finished
What gives? I can't seem to figure this one out.
Cindy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在知道非静态方法显示在 moled 类的 AllInstances 属性中。
谢谢,
辛迪
I know now that the non-static methods show up in the AllInstances property of the moled class.
Thanks,
Cindy