title: Failing to substitude
body: <pre><code>[Theory]
  [InlineData("12345678901","bob")]
  [InlineData("12345678902", "alice")]
  public void Customer_Registration_Should_Succeed(string identityId, string name)
  {
      Customer customer = new Customer(identityId, name);
  
      _customerRepository.Add(customer).Returns(customer);
  
      var customerService = new CustomerService(_customerRepository);
  
      var expectedCustomer = customerService.Register(identityId, name);
  
      Assert.Equal(expectedCustomer, customer);
  
  }
  </code></pre>
  
  <p>I have the above test code.</p>
  
  <p>Here is the service:</p>
  
  <pre><code>public class CustomerService : ICustomerService
  {
      readonly ICustomerRepository _customerRepository;
      public CustomerService(ICustomerRepository customerRepository)
      {
          _customerRepository = customerRepository;
      }
  
      public Customer Register(IdentityId identityId, Name name)
      {
          var customer = new Customer(identityId, name);
          var newCustomer = _customerRepository.Add(customer);
  
          return newCustomer;
      }
  }
  </code></pre>
  
  <p>And below is the repository:</p>
  
  <pre><code>public class CustomerRepository : ICustomerRepository
  {
      IList&lt;Customer&gt; _customers;
  
      public CustomerRepository()
      {
          _customers = new List&lt;Customer&gt;();
      }
  
      public Customer Add(Customer customer)
      {
          _customers.Add(customer);
  
          return customer;
      }
  }
  </code></pre>
  
  <p>But I get null reference exception. </p>
  
  <pre><code>Assert.Equal(expectedCustomer, customer);
  </code></pre>
  
  <p>and assertion fails. Why?</p>