On Sunday, August 4, 2013 11:25:28 AM UTC-4, Mike Meisinger wrote:
>
> I believe that you want the original "ref" argument to be passed to the *
> Do* delegate
> Does that sound right?
>
*Exactly *
Would it be correct to assume that you have a scenario where the mocked
> object is being used (or called) from a different class (or mock) that is
> calling the method you are setting the expectation on?
>
*Yes*
> Would it also be correct to assume that this "different class (or mock)"
> is responsible for instantiating the "ref" argument?
>
*Yes*
> Out of curiosity, what not just set the "ref" argument?
>
*Sorry, no idea that you trying to say here. Can you explain? (explanation
in C# is always **better than in English**)*
>
> On Wednesday, July 10, 2013 4:03:45 PM UTC-4, Tarpan wrote:
>>
>> Hi all,
>>
>> I cannot make "Do" work in the same sentence with "Ref" because "Ref"
>> takes a second argument "ReturnValue" and passes it into "Do". As so "Do"
>> cannot get access to the original value of the argument.
>>
>> Here is the example (forgive some syntax errors, don't have Visual Studio
>> with me)
>>
>>
>> var stub = MockRepository.GenerateStub<MyInterface>();
>> stub.Stub(x => x.Method(Arg<DataTable>.Ref(Is.Anything(), *null*
>> ).Dummy)).Do(DoAction)
>>
>> ...
>>
>> private void DoAction(DataTable table)
>> {
>> // guess what? table is always *null *!
>> }
>>
>>
>> Anybody had the same issue before? Please help.
>>
>> Why ReturnValue is a required parameter? It should be optional.
>>
>> Alex
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/groups/opt_out.