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

On Thu, Dec 11, 2008 at 9:26 PM, Berryl Hesh <[email protected]> wrote:

>
> I wish! That example is on a mocked interface, but I am trying to do
> it on a stubbed class, so I get:
>
> 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).
> at Rhino.Mocks.LastCall.GetOptions<T>()
> at Rhino.Mocks.RhinoMocksExtensions.Expect<T,R>(T mock, Function`2
> action)
> at Rhino.Mocks.RhinoMocksExtensions.Stub<T,R>(T mock, Function`2
> action)
> at Rhino.Mocks.RhinoMocksExtensions.Stub<T>(T mock, Action`1 action)
> at Rhino.Mocks.RhinoMocksExtensions.GetEventRaiser<TEventSource>
> (TEventSource mockObject, Action`1 eventSubscription)
> at Rhino.Mocks.RhinoMocksExtensions.Raise<TEventSource>(TEventSource
> mockObject, Action`1 eventSubscription, Object sender, EventArgs args)
> at
>
> Smack.Core.Tests.GUI.Widgets.Button.ButtonWidgetBaseTest.Click_Command_CallsCommandExecute_Rhino
> () in ButtonWidgetBaseTest.cs: line 79
>
> On this test
> [Test]
>        public void Click_Command_CallsCommandExecute_Rhino() {
>            var tc = MockRepository.GenerateStub<EventTestingClass>();
>            var button = MockRepository.GenerateStub<ButtonWidgetBase>
> (new TestCommand());
>
>            button.Raise(x => x.Click += null, this, EventArgs.Empty);
>
>            Assert.That(tc.HelloMessage, Is.EqualTo
> (EventTestingClass.HELLO));
>         }
> >
>

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