public void Ayende_View_On_Mocking() { MockRepository mocks = new MockRepository(); ISomeSystem mockSomeSystem = mocks.StrictMock <ISomeSystem>(); using (mocks.Record()) { Expect.Call(mockSomeSystem.GetFooFor <ExpectedBar>("foo")) .Return(new List <ExpectedBar>()); } Assert.Throws <ExpectationViolationException>( @"ISomeSystem.GetFooFor<Rhino.Mocks.Tests.FieldsProblem.UnexpectedBar>(""foo""); Expected #1, Actual #1. ISomeSystem.GetFooFor<Rhino.Mocks.Tests.FieldsProblem.ExpectedBar>(""foo""); Expected #1, Actual #0.", () => { using (mocks.Playback()) { ExpectedBarPerformer cut = new ExpectedBarPerformer(mockSomeSystem); cut.DoStuffWithExpectedBar("foo"); } } ); }
public void DoStuffWithExpectedBar(string p) { IList <UnexpectedBar> list = system.GetFooFor <UnexpectedBar>(p); }