Mark,

Please tell me what version of NUnit are you running?

Tim

On Wed, Aug 25, 2010 at 2:06 AM, Mark Whitfeld <[email protected]>wrote:

> Oh, before I forget to mention. I am using Rhino.Mocks 3.6
>
> Thanks for your reply.
> Yeah, I tried that as well. It doesn't work either...
> I get:
>
> System.InvalidOperationException : No expectations were setup to be
> verified, ensure that the method call in the action is a virtual
> (C#) / overridable (VB.Net) method call
> at
>
> Rhino.Mocks.RhinoMocksExtensions.AssertExactlySingleExpectaton(MockRepository
> mocks, T mockToRecordExpectation)
> at Rhino.Mocks.RhinoMocksExtensions.GetExpectationsToVerify(T mock,
> Action`1 action, Action`1 setupConstraints)
> at Rhino.Mocks.RhinoMocksExtensions.AssertWasNotCalled(T mock,
> Action`1 action, Action`1 setupConstraints)
> at Rhino.Mocks.RhinoMocksExtensions.AssertWasNotCalled(T mock,
> Action`1 action)
> at Habanero.Templates.Test.Processor.TestMocking.Test_ShouldWork
>
> It fails in the same place. Could it be an issue with Castle do you
> think?
> I hope I don't have to use a different mocking framework just because
> it doesn't work on my machine!
>
> On Aug 24, 3:43 pm, Tuna Toksoz <[email protected]> wrote:
> > [TestFixture]
> > public class TestMocking
> > {
> >        [Test]
> >        public void Test_AssertWasNotCalled_ShouldWork()
> >        {
> >                var bob = MockRepository.GenerateMock<IBob>();
> >                bob.AssertWasNotCalled(o => o.Action());
> >        }
> >
> > }
> >
> > Can you try that?
> >
> > Tuna Toksöz
> > Eternal sunshine of the open source mind.
> >
> >
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
> >
> > On Tue, Aug 24, 2010 at 3:30 AM, Mark Whitfeld <[email protected]
> >wrote:
> >
> > > OK, I'm so stumped about this one!
> > > I have been using Rhino Mocks for years and it has never given me
> > > problems.
> > > I run the following simple code and it gives this error message:
> >
> > > (on the line with AssertWasNotCalled)
> > > System.InvalidOperationException : No expectations were setup to be
> > > verified, ensure that the method call in the action is a virtual
> > > (C#) / overridable (VB.Net) method call
> >
> > > Stack Trace:
> > > at Rhino.Mocks.RhinoMocksExtensions.AssertExactlySingleExpectaton[T]
> > > (MockRepository mocks, T mockToRecordExpectation)
> > > at Rhino.Mocks.RhinoMocksExtensions.GetExpectationsToVerify[T](T mock,
> > > Action`1 action, Action`1 setupConstraints)
> > > at Rhino.Mocks.RhinoMocksExtensions.AssertWasNotCalled[T](T mock,
> > > Action`1 action, Action`1 setupConstraints)
> > > at Rhino.Mocks.RhinoMocksExtensions.AssertWasNotCalled[T](T mock,
> > > Action`1 action)
> > > at Habanero.Templates.Test.Processor.TestMocking.Test_ShouldWork()
> >
> > > Here is the code (I know its testing the mocking framework, that's the
> > > point):
> >
> > > [TestFixture]
> > > public class TestMocking
> > > {
> > >        [Test]
> > >        public void Test_AssertWasNotCalled_ShouldWork()
> > >        {
> > >                var bob = MockRepository.GenerateStub<IBob>();
> > >                bob.AssertWasNotCalled(o => o.Action());
> > >        }
> > > }
> >
> > > public interface IBob
> > > {
> > >        void Action();
> > > }
> >
> > > The project is compiled for AnyCPU (and I have tried all the others)
> > > and .NET 3.5.
> > > This fails on my PC, but works on every other PC. Aaaargh!
> >
> > > My PC is as follows:
> > > Intel Core i7 CPU 860 @ 2.80GHz
> > > 8.00 GB RAM
> > > Windows 7 64-bit OS
> >
> > > I have restarted Visual Studio, and the PC as well as run the tests
> > > from Resharper and the nunit test runner.
> > > All have the same result: It fails!
> >
> > > Please help!
> >
> > > --
> > > 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]<rhinomocks%[email protected]>
> <rhinomocks%[email protected]<rhinomocks%[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]<rhinomocks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>


-- 
Tim Barcz
Microsoft C# MVP
Microsoft ASPInsider
http://timbarcz.devlicio.us
http://www.twitter.com/timbarcz

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