Make the property virtual.

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



On Wed, May 12, 2010 at 4:37 AM, Varun Bhargava
<[email protected]> wrote:
> Hi There,
>
> I have a property that i want to stub
>
>
>                public List<Record> Records
>                {
>                        get
>                        {
>                                PopulateRecords();
>                                return records;
>                        }
>                }
>
> internal virtual void PopulateRecords()
>                {
>                        records = new List<Record>();
>                        .....
>                }
>
> If in my stub i say mockResult.Stub(r => r.Records).Return(new
> List<Record>());
> I get an error like 'doesn't match the return type 'System.Void' for
> method 'Result.PopulateEndecaRecords();''
>
>
> How do i solve this?

-- 
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