我存根使用犀牛制品的方法的返回值。不过,我想回到的传入的任何参数相同的虚值。
我如何做到这一点没有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.
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());
上一篇:如何将 HTTP 标头添加到 SOAP 客户端如何将、客户端、HTTP、SOAP
下一篇:如何使用 CSOM 从/向 SharePoint 2013 下载/上传文件?如何使用、上传文件、SharePoint、CSOM