2011-06-10 48 views

回答

3
Func<Dto, OtherDto> returnOtherDto = dto => new OtherDto { Parent = dto }; 
_service 
    .Stub(s => s.Method(Arg<Dto>.Is.Anything)) 
    .Do(returnOtherDto); 
+0

这是否真的工作,不要抱怨缺少调用'Return'? – 2011-06-10 09:43:34

+0

@Daniel Hilgarth,是的,这工作非常好。 – 2011-06-10 09:44:18

+0

很酷,学到了新东西! – 2011-06-10 09:44:49

相关问题