/// <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; }
public void SetRegistryWorksWithDoubleRegistration() { // --- Arrange var registry = new DefaultServiceRegistry(); // --- Act DataAccessFactory.SetRegistry(registry); DataAccessFactory.SetRegistry(registry); // --- Assert registry.ShouldEqual(DataAccessFactory.ServiceRegistry); }