public void SavesChangesToConfigurationObject() { DbProviderMapping sourceElement = new DbProviderMapping("name", typeof(bool)); List <ConfigurationSetting> settings = new List <ConfigurationSetting>(1); DatabaseSettingsWmiMapper.GenerateDbProviderMappingWmiObjects(sourceElement, settings); Assert.AreEqual(1, settings.Count); ProviderMappingSetting setting = settings[0] as ProviderMappingSetting; Assert.IsNotNull(setting); setting.DatabaseType = typeof(int).AssemblyQualifiedName; setting.Commit(); Assert.AreEqual(typeof(int).AssemblyQualifiedName, sourceElement.DatabaseTypeName); }
public void SavesChangesToConfigurationObject() { DatabaseSettings sourceElement = new DatabaseSettings(); sourceElement.DefaultDatabase = "foo database"; List <ConfigurationSetting> settings = new List <ConfigurationSetting>(1); DatabaseSettingsWmiMapper.GenerateWmiObjects(sourceElement, settings); Assert.AreEqual(1, settings.Count); DatabaseBlockSetting setting = settings[0] as DatabaseBlockSetting; Assert.IsNotNull(setting); setting.DefaultDatabase = "bar database"; setting.Commit(); Assert.AreEqual("bar database", sourceElement.DefaultDatabase); }