8
什麼是ReplayAll()和VerifyAll()在RhinoMocks
[Test]
public void MockAGenericInterface()
{
MockRepository mocks = new MockRepository();
IList<int> list = mocks.Create Mock<IList<int>>();
Assert.IsNotNull(list);
Expect.Call(list.Count).Return(5);
mocks.ReplayAll();
Assert.AreEqual(5, list.Count);
mocks.VerifyAll();
}
什麼是這個代碼ReplayAll()
和VerifyAll()
的目的是什麼?