Hello all, I am using rhino 3.6 and have a question:
I am trying to test an object that wraps a Queue<T>.
I have a wrapper around the Queue.Enqueue method that I need to test.
here is the setup Code:
_mockRepository = new MockRepository();
_mockMessage = (IMessage)_mockRepository.StrictMock(typeof(IMessage));
_mockSystemQueue =
(Queue<IMessage>)_mockRepository.StrictMock(typeof(Queue<IMessage>));
_testObject =
(MessageQueue)_mockRepository.StrictMock(typeof(MessageQueue), new
object[] { _mockSystemQueue });
and here is the expectation statements I have tried:
_mockSystemQueue.Expect(q => q.Enqueue(_mockMessage));
and
Expect.Call(delegate { _mockSystemQueue.Enqueue(_mockMessage); });
Both of these give me the same error:
"Invalid call, the last call has been used or no call has been made
(make sure that you are calling a virtual (C#) / Overridable (VB)
method)."
Any Ideas?
Thanks
Tal
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhinomocks?hl=en.