.NET Moles存根跌倒行为 [英] .NET Moles Stub Fallthrough Behaviour

查看:94
本文介绍了.NET Moles存根跌倒行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET Moles框架中是否可以像处理Mole类型一样在存根类型中使用掉线行为?

Is it possible in the .NET Moles framework to use the Fallthrough Behavior in Stub Types as we do with Mole Types?

我可以通过执行以下操作来覆盖Mole实例的默认行为:

I can override the default behavior of a Mole instance by doing:

MMyInstance.InstanceBehavior = MoleBehaviors.Fallthrough;

但是对于存根实例,我在BehavedBehaviors类中找不到相应的行为.

However for a Stub Instance i can´t find in the BehavedBehaviors class the corresponding behavior.

我正在使用0.94版

谢谢 雨果·佩斯(Hugo Pais)

Thanks Hugo Pais

推荐答案

在手册部分存根"中对其进行了说明.您想要的是CallBase,它是Moles Stubs of Moles的属性:

It is explained in the manual at "Partial Stubs". What you want is CallBase, which is a property of Stubs of Moles :

var stub = new SMyInstance() {CallBase = true};  

stub.CallBase = true;

希望获得帮助.

这篇关于.NET Moles存根跌倒行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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