2006-09-30 Marek Sieradzki <marek.sieradzki@gmail.com>
[mono.git] / mcs / nunit20 / mocks / IMock.cs
1 using System;
2
3 namespace NUnit.Mocks
4 {
5         /// <summary>
6         /// Summary description for IMock.
7         /// </summary>
8         public interface IMock : IVerify, ICallHandler
9         {
10                 /// <summary>
11                 /// The name of this mock - used in messages
12                 /// </summary>
13                 string Name { get; }
14         
15                 /// <summary>
16                 /// True if unexpected calls should cause an error, false to ignore them
17                 /// </summary>
18                 bool Strict { get; set; }
19
20                 /// <summary>
21                 /// Set up to expect a call to a method with a set of arguments
22                 /// </summary>
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 );
26
27                 void Expect( string MethodName );
28
29                 /// <summary>
30                 /// Set up expectation that the named method will not be called
31                 /// </summary>
32                 /// <param name="methodName">The name of the method</param>
33                 void ExpectNoCall( string methodName );
34
35                 /// <summary>
36                 /// Set up to expect a call to a method with a set of arguments.
37                 /// The specified value will be returned.
38                 /// </summary>
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 );
43
44                 /// <summary>
45                 /// Set up to expect a call to a method with a set of arguments.
46                 /// The specified exception will be thrown.
47                 /// </summary>
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 );
52
53                 /// <summary>
54                 /// Set value to return for a method or property called with any arguments
55                 /// </summary>
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 );
59         }
60 }