title: Is it possible/supported in AutoFixture with NSubstitute to return automatic values from proxy interfaces
body: <p>Recently when trying out <a href="http://blog.ploeh.dk/2013/01/09/NSubstituteAuto-mockingwithAutoFixture/" rel="nofollow">AutoFixture as an NSubstitute auto-mocking container</a> I ran into what seems to be a surprising deficit in the implementation. Although substitutes to appear to be automatically generated for constructor/factory parameters that are specified as interfaced types, the generated substitutes/mocks do not appear to be automatically configured to return automatic values specified through the fixture as I would have expected.</p>
  
  <p>To illustrate what I thought would work out of the box I've created a simple test below.</p>
  
  <pre><code>    [Test]
      public void MyClass_WhenAskedToDoSomething_ShouldReturnANumberFromSomeService()
      {
          // Arrange
          var fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
          var expectedNumber = fixture.Freeze&lt;int&gt;();
  
          var sut = fixture.Create&lt;MyClass&gt;();
  
          // Act
          var number = sut.AskToDoSomething();
  
          // Assert
          Assert.IsTrue(number == expectedNumber);
      }
  
      public class MyClass
      {
          private readonly IMyInterface _myInterface;
  
          public MyClass(IMyInterface myInterface)
          {
              _myInterface = myInterface;
          }
  
          public int AskToDoSomething()
          {
              return _myInterface.GetService().GetNumber();
          }
      }
  
      public interface IMyInterface
      {
          ISomeService GetService();
      }
  
      public interface ISomeService
      {
          int GetNumber();   
      }
  </code></pre>
  
  <p>In the case that I'm expecting something that just isn't included in the AutoNSubstituteCustomization implementation, would something like this be difficult to pull off. Has anybody else treaded in this direction. Any pointers would help.</p>