The documented behavior does not work for ICollection<> types. All other enumerable types are ok.
[Fact]
public void collection_types_are_all_possible_by_default()
{
// NOTE that we do NOT make any explicit registration of
// IList<IWidget>, IEnumerable<IWidget>, ICollection<IWidget>, or IWidget[]
var container = new Container(_ =>
{
_.For<IWidget>().Add<AWidget>();
_.For<IWidget>().Add<BWidget>();
_.For<IWidget>().Add<CWidget>();
});
// ICollection<T> <-- Does not validate
container.GetInstance<ICollection<IWidget>>()
.Select(x => x.GetType())
.ShouldHaveTheSameElementsAs(typeof(AWidget), typeof(BWidget), typeof(CWidget));
}
https://structuremap.github.io/the-container/working-with-enumerable-types/
The documented behavior does not work for ICollection<> types. All other enumerable types are ok.
tested with versions: 4.7.0 & 4.7.1