title: Stub one method of class and let other real methods use this stubbed one
body: <p>I have a <code>TimeMachine</code> class which provides me current date/time values. The class looks like this:</p>
  
  <pre><code>public class TimeMachine
  {
      public virtual DateTime GetCurrentDateTime(){ return DateTime.Now; };
      public virtual DateTime GetCurrentDate(){ return GetCurrentDateTime().Date; };
      public virtual TimeSpan GetCurrentTime(){ return GetCurrentDateTime().TimeOfDay; };
  }
  </code></pre>
  
  <p>I'd like to use <code>TimeMachine</code> stub in my tests in such way that I'd just stub the <code>GetCurrentDateTime</code> method and let the other 2 methods use the stubbed <code>GetCurrentDateTime</code> method so as I don't have to stub all the three methods. I tried to do write the test like this:</p>
  
  <pre><code>var time = MockRepository.GenerateStub&lt;TimeMachine&gt;();
  time.Stub(x =&gt; x.GetCurrentDateTime())
      .Return(new DateTime(2009, 11, 25, 12, 0, 0));
  Assert.AreEqual(new DateTime(2009, 11, 25), time.GetCurrentDate());
  </code></pre>
  
  <p>But the test fails. <code>GetCurrentDate</code> returns <code>default(DateTime)</code> instead of using <code>GetCurrentDateTime</code> stub internally.</p>
  
  <p>Is there any approach I could use to achieve such behavior or is it just some basic conceptual feature of RhinoMocks I don't catch at the moment? I know I could just get a rid of those two <code>GetDate</code>/<code>Time</code> methods and inline the <code>.Date</code>/<code>.TimeOfDay</code> usage, but I'd like to understand whether this is possible at all.</p>