title: Dependency Injection using NSubstitute
body: <p>I have got a service class that has a constructor injection that takes IAppConfig. IAppConfig has couple of properties with just getters. And I would like to create an instance of this service class in my test project.</p>
  
  <p>My Service class</p>
  
  <pre><code>IAppConfig _appConfig;
  public class PeopleService(IAppConfig appConfig)
  {
     _appConfig = appConfig;
  }
  </code></pre>
  
  <p>AppConfig Interface</p>
  
  <pre><code>public interface IAppConfig
  {
     string BaseURL {get;}
     string AnotherProperty {get;}
  }
  </code></pre>
  
  <p>How do I use NSubstitute to mock the IAppConfig to create an instance of PeopleService.</p>
  
  <p>I have tried the below code, but the properties that I set are empty string.</p>
  
  <pre><code>var _appConfig = Substitute.For&lt;IAppConfig&gt;();
  _appConfig.BaseURL.Returns("http://localhost");
  new PeopleService(_appConfig);
  </code></pre>
  
  <p>But the property set in the _appConfig is not working. I appreciate if someone can help me.  </p>