问题描述
是否有可能使用分配的起订量输出/ ref参数(3.0)?
Is it possible to assign an out/ref parameter using Moq (3.0)?
我看用回调()
,但动作<>
不支持ref参数,因为它是基于仿制药。我也preferably喜欢把一个约束( It.Is
)的 REF的输入
参数,虽然我能做到这一点的回调。
I've looked at using Callback()
, but Action<>
does not support ref parameters because it's based on generics. I'd also preferably like to put a constraint (It.Is
) on the input of the ref
parameter, though I can do that in the callback.
我知道犀牛嘲笑支持此功能,但我工作的项目已经在使用起订量。
I know that Rhino Mocks supports this functionality, but the project I'm working on is already using Moq.
推荐答案
好像是不可能的开箱。貌似某人试图解决
Seems like it is not possible out of the box. Looks like someone attempted a solution
看到这个论坛的帖子
<一href=\"http://$c$c.google.com/p/moq/issues/detail?id=176\">http://$c$c.google.com/p/moq/issues/detail?id=176
这个问题
http://stackoverflow.com/questions/726630/verify-value-of-reference-parameter-with-moq
这篇关于在起订量分配输出/ ref参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!