6 /// Summary description for IMock.
8 public interface IMock : IVerify, ICallHandler
11 /// The name of this mock - used in messages
16 /// True if unexpected calls should cause an error, false to ignore them
18 bool Strict { get; set; }
21 /// Set up to expect a call to a method with a set of arguments
23 /// <param name="methodName">The name of the method</param>
24 /// <param name="args">Arguments for this call</param>
25 void Expect( string methodName, params object[] args );
27 void Expect( string MethodName );
30 /// Set up expectation that the named method will not be called
32 /// <param name="methodName">The name of the method</param>
33 void ExpectNoCall( string methodName );
36 /// Set up to expect a call to a method with a set of arguments.
37 /// The specified value will be returned.
39 /// <param name="methodName">The name of the method</param>
40 /// <param name="returnVal">The value to be returned</param>
41 /// <param name="args">Arguments for this call</param>
42 void ExpectAndReturn( string methodName, object returnVal, params object[] args );
45 /// Set up to expect a call to a method with a set of arguments.
46 /// The specified exception will be thrown.
48 /// <param name="methodname">The name of the method</param>
49 /// <param name="exception">The exception to throw</param>
50 /// <param name="args">Arguments for this call</param>
51 void ExpectAndThrow( string methodname, Exception exception, params object[] args );
54 /// Set value to return for a method or property called with any arguments
56 /// <param name="methodName">The name of the method</param>
57 /// <param name="returnVal">The value to be returned</param>
58 void SetReturnValue( string methodName, object returnVal );