title: Optional parameters with a stub in RhinoMock
body: <p>I want to stub a function that receive 2 boolean parameters. The first is required and the second is optional. If I try to send Arg.Is.Anything to the first but without information for the second, I receive an error:</p>
  
  <p>System.InvalidOperationException : When using Arg, all arguments must be defined using Arg.Is, Arg.Text, Arg.List, Arg.Ref or Arg.Out. 2 arguments expected, 1 have been defined.</p>
  
  <p>Here is a sample of my class to stub:</p>
  
  <pre><code>   public interface IOptionalParameterTester
     {
        bool IsValid(bool mustCheck, bool checkInDatabase = true);
     }
  
     public class OptionalParameterTester : IOptionalParameterTester
     {
        public bool IsValid(bool mustCheck, bool checkInDatabase = true)
        {
           if (checkInDatabase)
              return true;
           else
              return false;
        } 
     }
  </code></pre>
  
  <p>And here is a sample of the test:</p>
  
  <pre><code>  [Test]
    public void ValidateProducerTest()
    {
       IOptionalParameterTester optionalParameter = MockRepository.GenerateStub&lt;IOptionalParameterTester&gt;();
  
       optionalParameter.Stub(x =&gt; x.IsValid(Arg&lt;bool&gt;.Is.Anything)).Return(true);
    }
  </code></pre>
  
  <p>In this case, if I want the test to pass without error, I must define the same information that for the first (Arg.Is.Anything) or a specific boolean value like true or false.</p>
  
  <p>If I set anything other than Arg.Is.Anything for the first parameter, I don't have any error.</p>
  
  <p>Is it a bug?</p>
  
  <p>Can I setup an option in RhinoMock to don't have to define a value for each optional parameter?</p>
  
  <p>If there is no setup, is there a better thing to do to handle this case (Best practice, pattern, etc.)?</p>
  
  <p>Thank you.</p>