Having gone through the net forums, still unable to rectify this error in my unit testing for the below line.
SetupResult.For
(strategyFactory.RuleByMailRoomProcess(null, out isMailRoomRequired, out currentAndMailRoom))
.IgnoreArguments()
.Return(currentAndMailRoom, isMailRoomRequired, currentAndMailRoom);
Initially, it worked fine, but the line was like below:
SetupResult.For(strategyFactory.RuleByMailRoomProcess(null))
.IgnoreArguments()
.Return(currentAndMailRoom, isMailRoomRequired, currentAndMailRoom);
I had to add two out parameters and I did. But it throws the error as below:
Error 166 The type arguments for method 'Rhino.Mocks.SetupResult.For(T)' cannot be inferred from the usage. Try specifying the type arguments explicitly. C:\Me\ControllerBaseTests.cs 473 13 UnitTests
Could someone help me please, I am new to this.
If you just want to make it compile, simply add the type explicitly:
If you want it to be inferred successfully, you have to investigate why the inference fails. Most likely RuleByMailRoomProcess is overloaded and can return multiple types.