MEF [ImportMany] is not importing with Mocking

Jun 19, 2011 at 4:40 AM

Hi, I am trying to Verify a method call. So my project struct is like this

public interface IChannel
{  List<string> PassToSender(string message); }

public interface ISender
{  List<string> Send(string message); }

public class Channel : IChannel

  [ImportMany]
  public IEnumerable<ISender> Senders {get; private set;}

  public Channel()
  {
  }
  List<string> PassToSender(string message)
  {
    Senders.ForEach(s=>s.Send(message);
  }
}
public class SenderA : ISender
{
  public  List<string> Send(string message){..///....;}
}

public class SenderB : ISender
{
  public  List<string> Send(string message){...***///....;}
}

How to test SenderA and SenderB methods using mocking. How can I create a mock for  "IEnumerable<ISender> Senders", whenever I try to create it gets me a object without SenderA or SenderB. Any idea on this guys?