public interface IConsole  {
        void Print(string s);
    }

    [TestFixture]
    public class SomeTestFixture
    {
        public void MethodToTest(IConsole console)
        {
            console.Print("a");
            console.Print("b");
        }

        [Test]
        public void Test()
        {
            var mockConsole = MockRepository.GenerateMock<IConsole>();
            mockConsole.Expect(x => x.Print("a"));
            MethodToTest(mockConsole);
            mockConsole.VerifyAllExpectations();
        }
    }

In this example, the only expectation I have is to call Print with
argument "a". But the code under test calls it with "a" and then with
"b". I thought that the VerifyAllExpectations assertion would fail.
But it does not. Is this a problem or am I doing something wrong ?

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