"Invalid expectation on a non-overridable member"

166 views
Skip to first unread message

tgmdbm

unread,
Mar 28, 2008, 11:36:19 PM3/28/08
to Moq Discussions
Is it possible to mock a non-overridable method?

Is this a limitation of Castle?

Can we get this to work?

Daniel Cazzulino

unread,
Mar 29, 2008, 12:02:59 AM3/29/08
to moq...@googlegroups.com
We use castle for interception, and castle uses code generation (a derived class of the mocked type).

So, non-overridable methods are not mock-able, unless they are from a class that inherits from MarshalByRefObject, in which case Moq switches automatically to remoting proxies, allowing you to mock pretty much everything.
Reply all
Reply to author
Forward
0 new messages