示例#1
0
        /// <summary>
        /// Use with caution!  Does a full environment test of the configuration of this container.  Will try to create every configured
        /// instance and afterward calls any methods marked with the [ValidationMethod] attribute
        /// </summary>
        public void AssertConfigurationIsValid()
        {
            var session = new ValidationBuildSession(_pipelineGraph, _interceptorLibrary);

            session.PerformValidations();

            if (!session.Success)
            {
                throw new StructureMapConfigurationException(session.BuildErrorMessages());
            }
        }
示例#2
0
        private ValidationBuildSession validatedSession(Action <Registry> action)
        {
            var registry = new Registry();

            action(registry);

            PluginGraph graph   = registry.Build();
            var         session = new ValidationBuildSession(graph);

            session.PerformValidations();

            return(session);
        }