I would use:
session.Stub(s=>s.GetFromSession<Profile>("profile_object")).Return(p
rofile);
I believe (but could be wrong) that SetupResult.For() is part of the
old Record/Replay syntax
On Mar 20, 9:15 pm, rroman81 <[email protected]> wrote:
> Bill,
> thanks. I did miss the virtual on profile.Pin property definition.
> I do have another issue though.
> I have an operation on IUserSession interface as following:
> public interface IUserSession {
> T GetFromSession<T>(string key);}
>
> I defined session as following in the test method:
> IUserSession session = MockRepository.GenerateStub<IUserSession>();
>
> My arrange statement is the following, which blows up:
> SetupResult.For(session.GetFromSession<Profile>("profile_object")).Return(profile);
>
> I get a InvalidOperation exception, stating
> "System.InvalidOperationException: Invalid call, the last call has
> been used or no call has been made (make sure that you are calling a
> virtual (C#) / Overridable (VB) method)."
>
> thank you very much,
>
> Roman.
>
--
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.