예제 #1
0
        /// <summary>
        /// Configures the configurable part of the service manager from the
        /// specified section
        /// </summary>
        /// <param name="sectionName">Name of the configuration section</param>
        public static void ConfigureFrom(string sectionName)
        {
            var registry = new DefaultServiceRegistry();

            if (AppConfigurationManager.IsSectionDefined(sectionName))
            {
                registry.GetConfigurableContainer().ConfigureFrom(AppConfigurationManager
                                                                  .GetSettings <ServiceContainerSettings>(sectionName));
            }
            ServiceRegistry = registry;
        }
예제 #2
0
        public void SetRegistryWorksWithDoubleRegistration()
        {
            // --- Arrange
            var registry = new DefaultServiceRegistry();

            // --- Act
            DataAccessFactory.SetRegistry(registry);
            DataAccessFactory.SetRegistry(registry);

            // --- Assert
            registry.ShouldEqual(DataAccessFactory.ServiceRegistry);
        }