How to create a stub function for a stub

37 views
Skip to first unread message

n17...@gmail.com

unread,
May 25, 2016, 7:47:11 AM5/25/16
to Rhino.Mocks
In Rhino Mock, I create a stub function of 'AFunction' for 'AnObject', like this:

var aStub = Mock.GenerateStub<AnObject>();
aStub .Stub(b => b.AFunction(Arg<IArg>.Is.Anything)).Return(something);

// Act
TestSomething()

And in TestSomething(), it will call AnObject.AFunction(b);

I expect it will return 'something'
but what I get when I debug in chrome debugger is 'undefined'

Can you please tell me why my stub 'b => b.AFunction(Arg<IArg>.Is.Anything)).Return(something)' did not get called?

but I get 'undefined' instead?

Jake Khusanov

unread,
May 25, 2016, 10:39:02 AM5/25/16
to Rhino.Mocks

Are you passing aStub object into TestSomething?


--
You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rhinomocks+...@googlegroups.com.
To post to this group, send email to rhino...@googlegroups.com.
Visit this group at https://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages