title: Using Nsubstitute for mocking but getting an error
body: <p>I am new to unit testing, so pardon me if I am unable to explain this question properly. I am reading a book "The art of Unit Testing 2nd Edition" and trying to implement unit testing in my project. I am currently stuck or confused when testing using mocking (using NSubstitute as the mocking framework).</p>
  
  <p>Here is my scenario:</p>
  
  <p>I have two interfaces <code>ICommand</code> and <code>IUser</code></p>
  
  <pre><code> public interface ICommand
   {
          string execute();
   }
  
   public interface IUserCalendar
   {
      string LoadCalendar();
   }
  </code></pre>
  
  <p>I have a class <code>LoadCalendar</code> which implements <code>ICommand</code>:</p>
  
  <pre><code>public class LoadCalendar : ICommand
  {
      private IUserCalendar user;
  
          public string execute()
          {
              return this.user.LoadCalendar();
          }
  
          public LoadCalendar(IUserCalendar obj)
          {
              this.user = obj;
          }
  }
  </code></pre>
  
  <p><code>ViewCalendar</code> implements <code>IUserCalendar</code>:</p>
  
  <pre><code>public class Viewer : IUserCalendar
  {    
          public string LoadCalendar()
          {
              return "Viewer Load Calendar Called";
          }  
  }
  </code></pre>
  
  <p>Using an agent class I am invoking command for specific request. (Here I am showing only one request <code>LoadCalendar</code> for one user viewer but I have more command and more users)</p>
  
  <p>My client has an invoker object that invokes the command for specific user. </p>
  
  <pre><code> public class Client
   {    
          public Client()
          { }  
  
          public string LoadCalendar(ICommand cmd)
          {
              Invoker invoker = new Invoker(cmd);
              return invoker.execute();
          }    
  }
  </code></pre>
  
  <p>Now I like to test the client class that when it calls for specific user it should return proper object or message. </p>
  
  <pre><code>[Test]
  public void client_Load_Calendar_Administrator()
  {
              IUserCalendar calanedar = Substitute.For&lt;IUserCalendar&gt;();
              ICommand cmd = Substitute.For&lt;ICommand&gt;(calanedar);
  
              Client c = new Client();
              c.LoadCalendar(cmd, calanedar).Returns(Arg.Any&lt;string&gt;());
  }
  </code></pre>
  
  <p>I don't know where I am doing wrong and it's throwing an error. </p>
  
  <blockquote>
    <p>NSubstitute.Exceptions.SubstituteException : Can not provide constructor arguments when substituting for an interface.</p>
  </blockquote>
  
  <p>Any help is really appreciated. Sorry for long question.</p>