So i have a mocked object which has generic method
public virtual void SendMessage<T>(T reply) where T : IRequest
I have multiple classes which implement all IRequest.
In code i am testing method gets called multiple times like:
switch(type)
{
case Class1:
{
SendMessage(new Class1() );
break;
}
case Class2:
{
SendMessage(new Class2() );
break;
}
case Class3:
{
SendMessage(new Class3() );
break;
}
//and so on...
}
I want to make sure NONE of this methods is called.
But if i make m_provider.AssertWasNotCalled(x =>
x.SendMessage(Arg<IRequest>.Is.Anything), o => o.IgnoreArguments());
This doesnt assert right.
Because if i call SendMessage(new Class1()) and then
m_provider.AssertWasCalled(x => x.SendMessage(Arg<IRequest>.Is.Anything), o
=> o.IgnoreArguments());
this failes but this
m_provider.AssertWasCalled(x => x.SendMessage(Arg<Class1>.Is.Anything>()),
o => o.IgnoreArguments());
passes
IgnoreArguments here is overkill, i know
So how do you assert none of the generic method instances was called?
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rhinomocks/-/x-12icZMwnYJ.
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.