title: How Structure Map Automocker Inject works?
body: <p>I have constructor containing IEnumerable parameter. When I try to Inject concrete object to automocker it is not used. </p>
  
  <p>When I use wrapper class containing IEnumerable property all works as expected.</p>
  
  <p>How can I test TestClass1?</p>
  
  <h2>IEnumerable parameter</h2>
  
  <pre><code>public class TestClass1
  {
      public TestClass1(IEnumerable&lt;IItem&gt; items)
      {
          Items = items;
      }
  
      public IEnumerable&lt;IItem&gt; Items { get; private set; }
  }
  
  [TestMethod]
  public void TestClass1Constructor()
  {
      RhinoAutoMocker&lt;TestClass1&gt; autoMocker = new RhinoAutoMocker&lt;TestClass1&gt;();
  
      IEnumerable&lt;IItem&gt; items = new[] { MockRepository.GenerateMock&lt;IItem&gt;() };
      autoMocker.Inject(items);
  
      Assert.AreEqual(1, autoMocker.ClassUnderTest.Items.Count());
  }
  </code></pre>
  
  <p>Result of the test is: </p>
  
  <blockquote>
    <p>Assert.AreEqual failed. Expected:&lt;1>. Actual:&lt;0>.</p>
  </blockquote>
  
  <h2>Wrapper class parameter</h2>
  
  <pre><code>public class TestClass2
  {
      public TestClass2(WrapperClass numbersWrapper)
      {
          Items = numbersWrapper.Items;
      }
  
      public IEnumerable&lt;IItem&gt; Items { get; private set; }
  }
  
  [TestMethod]
  public void TestClass2Constructor()
  {
      RhinoAutoMocker&lt;TestClass2&gt; autoMocker = new RhinoAutoMocker&lt;TestClass2&gt;();
  
      WrapperClass numbers = new WrapperClass(new[] { MockRepository.GenerateMock&lt;IItem&gt;() });
      autoMocker.Inject(numbers);
  
      Assert.AreEqual(1, autoMocker.ClassUnderTest.Items.Count());
  }
  </code></pre>
  
  <p>Result of the test is: </p>
  
  <blockquote>
    <p>Success.</p>
  </blockquote>