Just out of interest, but why are we developing against Record/Replay?
On Tuesday, March 20, 2012 1:38:07 PM UTC, honggoff wrote:
>
> Hi,
> while tracking down an error in a unit test, I came across some (IMO) odd
> behavior of BackToRecordAll. I boiled it down to the following test case:
>
> public interface IDummy
> {
> bool GetValue();
> }
>
> [Test]
> public void TestBackTorecordAll()
> {
> MockRepository mock = new MockRepository();
> IDummy test = mock.StrictMock<IDummy>();
>
> using (mock.Unordered())
> {
> Expect.Call(test.GetValue())
> .Return(true)
> .Repeat.AtLeastOnce();
> }
> mock.ReplayAll();
>
> Assert.IsTrue(test.GetValue());
> mock.VerifyAll();
>
> mock.BackToRecordAll(BackToRecordOptions.All);
> Expect.Call(test.GetValue())
> .Return(false)
> .Repeat.AtLeastOnce();
>
> mock.ReplayAll();
> Assert.IsFalse(test.GetValue());
>
> mock.VerifyAll();
> }
>
> This test case fails. Is this the expected behavior? If so, why does the
> test succeed, if i remove the mock.Unordered() call?
>
> Maybe I'm misunderstanding what BackToRecordAll does. I expected it to go
> back to record mode and reset all expectations.
>
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rhinomocks/-/7j08Q5EjRk8J.
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.