title: Moq - Checking method call on concrete class
body: <p>Here is a very simplistic example of what I'm trying to do:</p>
  
  <pre><code>public class Bar
  {
      public void SomeMethod(string param)
      {
          //whatever
      }
  }
  
  public interface IBarRepository
  {
      List&lt;Bar&gt; GetBarsFromStore();
  }
  
  public class FooService
  {
      private readonly IBarRepository _barRepository;
  
      public FooService(IBarRepository barRepository)
      {
          _barRepository = barRepository;
      }
  
      public List&lt;Bar&gt; GetBars()
      {
          var bars = _barRepository.GetBarsFromStore();
          foreach (var bar in bars)
          {
              bar.SomeMethod("someValue");
          }
          return bars;
      }
  }
  </code></pre>
  
  <p>In my test, I'm mocking IBarRepository to return a concrete List defined in the unit test and passing that mocked repository instance to the FooService constructor. </p>
  
  <p>I want to verify in the FooService method GetBars that SomeMethod was called for each of the Bars returned from the repository. I'm using Moq. Is there any way to do this without mocking the list of Bars returned (if even possible) and not having to put some hacky flag in Bar (yuck) ?. </p>
  
  <p>I'm following an example from a DDD book, but I'm starting to think it smells because I'm challenged in testing the implementation....</p>