.NET Moles Stub Fallthrough Behaviour

2020-04-15 20:50发布

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

标签: moles
1条回答
Ridiculous、
2楼-- · 2020-04-15 21:00

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.

查看更多
登录 后发表回答