Interaction Testing using Moles RRS feed

  • Question

  • Hello, How can you verify interaction test using Moles. For example the following test is written using rhino mock. Can anyone please tell me how can I achive the same using moles? Is there anything like verify for moles? [Test] public void MyTest() { MockRepository mocks = new MockRepository(); ILogger mockLogger = mocks.StrictMock< ILogger>(); using(mocks.Record()) { mockLogger .Log("this is my error"); } MyClass mc = new MyClass (mockLogger); mc.MyFunc("abcd"); mocks.Verify(mockLogger); } class MyClass { private ILogger logger; public MyClass(ILogger logger) { this.logger = logger; } public void MyFunc(string str) { logger.log("this is my error"); } } I would really appreciate your help.
    • Edited by tkl33 Thursday, November 3, 2011 4:45 PM
    Thursday, November 3, 2011 4:43 PM