Exemplo n.º 1
0
        private IDictionary <IDependency, IInstantiationPoint> GetServiceMap()
        {
            var points = _registry.GetAllRegisteredPoints();
            var map    = _resolver.ResolveAll(points);

            return(map);
        }
        public void Should_create_constructor_instantiation_point_for_each_constructor_info()
        {
            _registry.Register <ClassWithMultipleResolvableConstructors>();

            var pointLists = _registry.GetAllRegisteredPoints().ToArray();

            pointLists.ShouldNotBeEmpty();

            var points = pointLists.First().Value;

            points.ShouldNotBe(null);
            points.Count().ShouldBe(2);

            var transientItems = points.Select(p => p as TransientInstantiationPoint).Where(p => p != null)
                                 .ToArray();

            transientItems.All(t => t.ActualPoint is Constructor)
            .ShouldBe(true);
        }