private void AddExpectedCall(string methodName, object returnVal, Exception exception, object[] args)
        {
            IMethod method = (IMethod)methods[methodName];

            if (method == null)
            {
                method = new MockMethod(methodName);
                methods[methodName] = method;
            }

            Type[]          argTypes  = MethodSignature.GetArgTypes(args);
            MethodSignature signature = new MethodSignature(this.Name, methodName, argTypes);

            method.Expect(new MockCall(signature, returnVal, exception, args));
        }
Example #2
0
		public void SetReturnValue( string methodName, object returnVal )
		{
			methods[methodName] = new MockMethod( methodName, returnVal );
		}
Example #3
0
		public void ExpectNoCall( string methodName )
		{
			methods[methodName] = new MockMethod( methodName, null, 
				new AssertionException("Unexpected call to method " + methodName) );
		}
Example #4
0
		private void AddExpectedCall( string methodName, object returnVal, Exception exception, object[] args )
		{
			IMethod method = (IMethod)methods[methodName];
			if ( method == null )
			{
				method = new MockMethod( methodName );
				methods[methodName] = method;
			}

			Type[] argTypes = MethodSignature.GetArgTypes( args );
			MethodSignature signature = new MethodSignature( this.Name, methodName, argTypes );

			method.Expect( new MockCall( signature, returnVal, exception, args ) );
		}
 public void ExpectNoCall(string methodName)
 {
     methods[methodName] = new MockMethod(methodName, null,
                                          new AssertionException("Unexpected call to method " + methodName));
 }
 public void SetReturnValue(string methodName, object returnVal)
 {
     methods[methodName] = new MockMethod(methodName, returnVal);
 }