public void Should_properly_order_dependencies_not_including_existing_ones()
        {
            var convention = new ConcreteTypeRegistrationConvention();

            var testContainer = new TestContainer(typeof(Sibling));

            RegistrationCatalog catalog = new ContainerRegistrationCatalog(convention, testContainer);

            catalog.GetRegistration(typeof(Parent));

            RegistrationFactory[] dependencies = catalog.Registrations.ToArray();

            Assert.AreEqual(
                new[] {typeof(GrandChild), typeof(Child), typeof(GrandParent), typeof(Parent)},
                dependencies.Select(x => x.RegistrationType));
        }
        public void Should_use_the_provider_factory()
        {
            var testContainer = new TestContainer();

            var convention = new ConcreteTypeRegistrationConvention();

            RegistrationCatalog catalog = new ContainerRegistrationCatalog(convention, testContainer);

            var factory = new ConstructorFactory<ISomething>(() => new Something());

            Registration registration = new ClosedTypeRegistration<ISomething>(factory);

            var registrationFactory = new ClosedTypeRegistrationFactory<ISomething>(() => factory);

            catalog.AddRegistration(registrationFactory);

            RegistrationFactory[] dependencies = catalog.Registrations.ToArray();

            Assert.AreEqual(new[] {typeof(ISomething)}, dependencies.Select(x => x.RegistrationType));
        }