November 15, 2009 RhinoMocks
November 15, 2009 RhinoMocks
If you see this error when testing with RhinoMocks
ensure that method on which you setuped expectation is virtual.
Actually this should be all you need.
I faced this when doing test like this:
As you see I’m trying to verify that method Initialize was called after Start was triggered. Signature of method looks like:
After I changed it to:
My test passed ok.
I want to mention that when testing with RhinoMocks you always need to pay attention on things like virtual methods, using interfaces instead of classes, also using protected instead of private to have possibility test those stuff with RhinoMocks.
code
more code
~~~~