How to use the Arg<> matcher from the Stub() in the Return()?
Here's what i'd like to do :
_service.Stub(s => s.Method(Arg<Dto>.Is.Anything)开发者_如何学Python).Return(new OtherDto { Parent = #My Arg# });
How can i replace #My Arg# with the Arg ? If it is even possible ?
Thanks
Func<Dto, OtherDto> returnOtherDto = dto => new OtherDto { Parent = dto };
_service
.Stub(s => s.Method(Arg<Dto>.Is.Anything))
.Do(returnOtherDto);
精彩评论