I was surprised when I discovered that this test fails with a
NotImplementedException originating from
"Castle.MicroKernel.SubSystems.Conversion.GenericListConverter.PerformConversion".
Why isn't it implemented? Too tricky? Not useful? Just didn't get
around to it?
Am I really the only one to ever create a class that requires a generic list?

        [TestFixture]
        public class ResolveGenericListTest
        {
                [Test]
                public void ResolveGenericList()
                {
                        var container = new WindsorContainer();
                        container.AddComponent<RequiresGenericList>();

                        var foos = new List<Foo>
                                        {
                                                new Foo {Id = 1},
                                                new Foo {Id = 2},
                                                new Foo {Id = 3}
                                        };

                        container.Resolve<RequiresGenericList>(new { dependency 
= foos });
                }
        }

        public class Foo
        {
                public int Id;
        }

        public class RequiresGenericList
        {
                private IList<Foo> _dependency;

                public RequiresGenericList(IList<Foo> dependency)
                {
                        _dependency = dependency;
                }

                public Foo GetById(int id)
                {
                        return _dependency.ToList().Find(f => f.Id == id);
                }
        }


Thanks,

--Stuart

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to