由网友(我不是弱者因为我姓王)分享简介:我存根使用犀牛制品的方法的返回值。不过,我想回到的传入的任何参数相同的虚值。我如何做到这一点没有pre-登记每个输入返回相同的输出?解决方案 _testHelper是你正在返回从GetMethodValue一个虚值辅助类()。你必须在你的_testHelper类写GetMethodValue()。Setu$p$ps...![怎样让word按1,1,2,2,3,3,4,4,编号,就是一个号编两次,谢谢啦](https://p.xsw88.cn/allimgs/daicuo/20230906/1218.png)
我存根使用犀牛制品的方法的返回值。不过,我想回到的传入的任何参数相同的虚值。
我如何做到这一点没有pre-登记每个输入返回相同的输出?
解决方案_testHelper是你正在返回从GetMethodValue一个虚值辅助类()。你必须在你的_testHelper类写GetMethodValue()。
Setu$p$psult.For(_Repository.MethodName(null)).IgnoreArguments().Return(_testHelper.GetMethodNameResultValue());I am stubbing the return value of a method using rhino mocks. However, I want to return the same dummy value for any argument that is passed in.
![怎样让word按1,1,2,2,3,3,4,4,编号,就是一个号编两次,谢谢啦](https://p.xsw88.cn/allimgs/daicuo/20230906/1218.png)
How do I do this without pre-registering every input to return the same output?
解决方案_testHelper is helper class where you are returning a dummy value from GetMethodValue(). you have to write GetMethodValue() in your _testHelper class.
SetupResult.For(_Repository.MethodName(null)).IgnoreArguments().Return(_testHelper.GetMethodNameResultValue());
相关推荐
最新文章