PartialStubs ?

2 views
Skip to first unread message

izik.sh...@gmail.com

unread,
Dec 13, 2009, 1:33:36 PM12/13/09
to Rhino.Mocks
Is there a way to stub a single method from an abstract class and
leave all other virtual methods to invoke the original implemented
method ?

for instance in the following class :

public abstract class A
{
public virtual int Meth1()
{
}
}

izik.sh...@gmail.com

unread,
Dec 13, 2009, 1:36:10 PM12/13/09
to Rhino.Mocks
return Meth2() + 1;
}
public abstract int Meth2();
}

I want to stub the Meth2 method and test for the result of Meth1.

Thanks,
Izik Shmulewitz

p.s.
sorry about the double post had some wrong clicks on the keyboard (Tab
and then space posted it.... :))

Fabien Arcellier

unread,
Dec 13, 2009, 2:32:01 PM12/13/09
to Rhino.Mocks
You can use the method option CallOriginalMethod to declare the method
you won't mock :

Expect.Call(view.Ask(null,null)).CallOriginalMethod();

I don't know a method to apply this option on every method by defaut.

Fabien Arcellier

On 13 déc, 18:36, "izik.shmulew...@gmail.com"
Reply all
Reply to author
Forward
0 new messages