I just tried your code on Rhino.Mocks 3.5 using the following BidProposal class:
using System;
namespace SimpleLibrary
{
public class BidProposal
{
public virtual int BidYear { get { return DateTime.Now.Year; } }
}
}
And it worked fine (in the test, it returned 2011).
---
Patrick Steele
http://weblogs.asp.net/psteele
On Fri, Jun 18, 2010 at 11:37 AM, epitka <[email protected]> wrote:
> I cannot figure out how to set this up. This is what I tried:
>
> var bidProposal = _mockRepository.PartialMock<BidProposal>();
> bidProposal.Expect(x =>
> x.BidYear).Return(DateTime.Now.AddYears(1).Year);
> _mockRepository.ReplayAll();
>
> but code always runs actual code in a BidYear property, not what I
> setup. BidYear is a virtual mapped property that internally just does
> return Bid.Year;
>
>
> --
> 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.