开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜