Ok. Perhaps this should be stated more clearly as a breaking change in the documentation, rather than the one liner "Dynamic mocks and stubs will now assume that a call is match by any number of expectation" at http://ayende.com/Blog/archive/2009/09/01/rhino-mocks-3.6.aspx. It is only suggested as a breaking change by a follow up post. Thanks.
On Oct 14, 11:07 am, Ayende Rahien <[email protected]> wrote: > Yes, this is an known breaking change in 3.6 > > > > > > On Wed, Oct 14, 2009 at 12:00 PM, dansm77 <[email protected]> wrote: > > > Today I upgraded to Rhino Mocks 3.6, and a series of our tests now > > fail. Here is a simple example that succeeded with 3.5, and fails with > > 3.6. > > > [Test] > > public void OrderedTest() > > { > > var mockFoo = MockRepository.GenerateMock<IFoo>(); > > > using (mockFoo.GetMockRepository().Ordered()) > > { > > mockFoo.Expect(x => x.Value).Return("abc"); > > mockFoo.Expect(x => x.Value).Return("xyz"); > > } > > > Assert.That(mockFoo.Value, Is.EqualTo("abc")); > > Assert.That(mockFoo.Value, Is.EqualTo("xyz")); > > } > > > public interface IFoo > > { > > string Value > > { > > get; > > } > > } > > > The last assert fails. This is also the case with the old style, i.e. > > using an explicit MockRepository instance, and using the old static > > method syntax. > > > If I put a "Repeat.Once()" on my expectations, i.e. "mockFoo.Expect(x > > => x.Value).Return("abc").Repeat.Once()", it works. Now we will have > > to go through our tests and fix them if we want the lastest version. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
