public void SetSettingsWorksAsExpected() { // --- Arrange const string KEY = "TypeResolverBackup"; var settings = new TypeResolverConfigurationSettings(new List <string> { "System" }, new List <string> { "TypeResolution" }); var provider = new AppConfigProvider(); // --- Act provider.SetSetting(KEY, settings); // --- Assert ConfigurationManager.RefreshSection(KEY); var config = ConfigurationManager.GetSection(KEY) as XElement; config.ShouldNotBeNull(); settings = new TypeResolverConfigurationSettings(config); settings.AssemblyNames.ShouldHaveCountOf(1); settings.AssemblyNames[0].ShouldEqual("System"); settings.Namespaces.ShouldHaveCountOf(1); settings.Namespaces[0].ShouldEqual("TypeResolution"); }
public void SetSettingsWorksAsExpected() { // --- Arrange const string KEY = "TypeResolverBackup"; var settings = new TypeResolverConfigurationSettings(new List<string> { "System" }, new List<string> { "TypeResolution" }); var provider = new AppConfigProvider(); // --- Act provider.SetSetting(KEY, settings); // --- Assert ConfigurationManager.RefreshSection(KEY); var config = ConfigurationManager.GetSection(KEY) as XElement; config.ShouldNotBeNull(); settings = new TypeResolverConfigurationSettings(config); settings.AssemblyNames.ShouldHaveCountOf(1); settings.AssemblyNames[0].ShouldEqual("System"); settings.Namespaces.ShouldHaveCountOf(1); settings.Namespaces[0].ShouldEqual("TypeResolution"); }