Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rhino mocks usage of AssertWasNotCalled

I made following stub

    _Service.Stub(s => s.Login(Arg<string>.Is.Anything, Arg<string>.Is.Anything, Arg<int>.Is.Anything, out ggg)).OutRef(55);

the last parameter is a out parameter of type int.

I want to make following Assert

    _Service.AssertWasNotCalled(s => s.Login(Arg<string>.Is.Anything, Arg<string>.Is.Anything,Arg<int>.Is.Anything , ??????? ));

But how I note out parameter here ?

like image 877
Night Walker Avatar asked Jan 15 '23 22:01

Night Walker


1 Answers

"Simply" use:

_Service.AssertWasNotCalled(s => s.Login(
    Arg<string>.Is.Anything,
    Arg<string>.Is.Anything,
    Arg<int>.Is.Anything ,
    out Arg<int>.Out(10).Dummy
));

The value passed to Out method is irrelevant (.Dummy call is the important one).

like image 59
k.m Avatar answered Jan 23 '23 12:01

k.m