public void ShouldGetEnumerableTargetAfterRegisterMultipleOfDifferentTypesWithCommonBase()
        {
            ITargetContainer targets = CreateTargets();

            targets.RegisterMultiple(new[] { Target.ForType <NoCtor>(), Target.ForType <DefaultCtor>() }, typeof(NoCtor));

            var result = Assert.IsType <EnumerableTarget>(targets.Fetch(typeof(IEnumerable <NoCtor>)));

            Assert.False(result.UseFallback);
            Assert.Equal(2, result.Targets.Count());
        }
Example #2
0
 private static void RegisterMultiple(ITargetContainer targets)
 {
     targets.RegisterMultiple(
         new[]
     {
         Target.ForType <SimpleAdapterOne>(),
         Target.ForType <SimpleAdapterTwo>(),
         Target.ForType <SimpleAdapterThree>(),
         Target.ForType <SimpleAdapterFour>(),
         Target.ForType <SimpleAdapterFive>()
     },
         typeof(ISimpleAdapter));
     targets.RegisterType <ImportMultiple1>();
     targets.RegisterType <ImportMultiple2>();
     targets.RegisterType <ImportMultiple3>();
 }