.NET Moles Stub Fallthrough Behaviour

天涯浪子 提交于 2019-12-31 03:23:40

问题


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

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

MMyInstance.InstanceBehavior = MoleBehaviors.Fallthrough;

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

I'm using version 0.94

Thanks Hugo Pais


回答1:


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};  

or

stub.CallBase = true;

Hope this help.



来源:https://stackoverflow.com/questions/6682031/net-moles-stub-fallthrough-behaviour

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!