title: How to set a maximum/upper bound for method calls in RhinoMocks with the Times() method?
body: <p>I'm trying to test that a method is called between 3 and 4 times:</p>
  
  <pre><code>using Microsoft.VisualStudio.TestTools.UnitTesting;
  using Rhino.Mocks;
  using StructureMap.AutoMocking;
  
  namespace AutoMockPlayground
  {
      [TestClass]
      public class SomeTests
      {
          [TestMethod]
          public void Bara_ShouldBeCalledThreeOrFourTimes()
          {
              var autoMocker = new RhinoAutoMocker&lt;Foo&gt;(MockMode.AAA);
  
              var barMock = autoMocker.Get&lt;IBar&gt;();
  
              // Bara() should not be called more than four times
              barMock.Stub(bar =&gt; bar.Bara()).Repeat.Times(3, 4);
  
              autoMocker.ClassUnderTest.DoSomeThing();
  
              barMock.VerifyAllExpectations();
          }
      }
  
      public interface IBar
      {
          void Bara();
      }
  
      public class Foo
      {
          private readonly IBar _bar;
  
          public Foo(IBar bar)
          {
              _bar = bar;
          }
  
          public void DoSomeThing()
          {
              _bar.Bara();
              _bar.Bara();
              _bar.Bara();
              _bar.Bara();
              _bar.Bara();
          }
      }
  }
  </code></pre>
  
  <p>I'm using the <code>Repeat.Times(int min, int max)</code>, but the <code>max</code> argument does not seem to have any effect.
  This test passes although <code>Bara()</code> is called 5 times.</p>
  
  <p>How can I express in my test that <code>Bara()</code> should be called between 3 and 4 times?</p>