2011-06-10 44 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

相關問題