I rarely use the record/replay semantics, but I don't see why the
behavior of the mock would be different.  Oh well, at least you got it
working!

---
Patrick Steele
http://weblogs.asp.net/psteele



On Fri, Feb 24, 2012 at 8:22 PM, Rob Hammond <[email protected]> wrote:
> 1) getmailboxentryids is a virtual method that returns type object. The
> signature is (enum,enum,string)
>
> 2) I was using AAA style to generate the mock (MockRepository.GenerateMock
> static method) .
>
> I found that switching to the using() style syntax made the mock behave as
> expected.   Are mocks generated from the static method supposed to behave
> differently?
>
>
> Sent via the Samsung Galaxy S™ II Skyrocket™, an AT&T 4G LTE smartphone.
>
>
>
> -------- Original message --------
> Subject: Re: [RhinoMocks] Mocked COM objects return ObjectProxy instances
> instead of the object I want to return
> From: Patrick Steele <[email protected]>
> To: [email protected]
> CC:
>
>
> There's a few things to check:
>
> 1. "files" is an object (as defined by your code).  Why not use var
> (to get the implicit string[])?
> 2. What's the signature of GetMailboxEntryIDs?
> 3. Is GetMailboxEntryIDs virtual?
> 4. Can you show the code where you create the mock?
>
> ---
> Patrick Steele
> http://weblogs.asp.net/psteele
>
>
>
> On Fri, Feb 24, 2012 at 2:07 PM, Rob Hammond <[email protected]> wrote:
>> Hi,
>>
>> Are COM objects / interfaces treated differently by Rhino Mocks when
>> you set up expectations?  Here is a sample expectation I am setting
>> up, note _mockDomain is a mocked COM object:
>>
>>   object files = new[] { "Core", "Device", "Xact", "SettingsFull",
>> "Settings", "DataStore", "Sync", "Unknown" };
>>   _mockDomain
>>           .Stub(m => m.GetMailboxEntryIDs(Arg<string>.Is.Anything,
>> Arg<tAHDMailboxType>.Is.Anything, Arg<bool>.Is.Anything))
>>           .Return(files);
>>
>> When I get to the 'Act' portion of the test, Rhino Mocks returns an
>> instance of ObjectProxy instead of the string[] 'files' I have defined
>> in my test.
>>
>> Thanks,
>>
>> Rob Hammond
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Rhino.Mocks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/rhinomocks?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.

Reply via email to