public void SetPropertiesList() { TestConfigurationClass configuration = new TestConfigurationClass { Name = "name", Sex = MySexEnum.Female }; List <MyConfigurationProperty> configurationProperties = MyConfigManager.GetConfigurationProperties(configuration); Assert.That(configurationProperties.Count, Is.EqualTo(4)); foreach (MyConfigurationProperty property in configurationProperties) { Console.WriteLine("Property: {0}={1} ({2})", property.Name, property.Value, property.Type); } Console.WriteLine("Updated configuration"); configurationProperties[0].Value = "new value"; configurationProperties[3].Value = "new title"; TestConfigurationClass updatedConfiguration = MyConfigManager.CreateConfiguration <TestConfigurationClass>(configurationProperties); Assert.That(updatedConfiguration.Name, Is.EqualTo("new value")); Assert.That(updatedConfiguration.SubClass.Title, Is.EqualTo("new title")); List <MyConfigurationProperty> updatedConfigurationProperties = MyConfigManager.GetConfigurationProperties(updatedConfiguration); foreach (MyConfigurationProperty property in updatedConfigurationProperties) { Console.WriteLine("Property: {0}={1} ({2})", property.Name, property.Value, property.Type); } }
public void GetPropertiesList() { TestConfigurationClass configuration = new TestConfigurationClass { Name = "name", Sex = MySexEnum.Female }; List <MyConfigurationProperty> configurationProperties = MyConfigManager.GetConfigurationProperties(configuration); foreach (MyConfigurationProperty property in configurationProperties) { Console.WriteLine("Property: {0}={1} ({2})", property.Name, property.Value, property.Type); } Assert.That(configurationProperties.Count, Is.EqualTo(4)); }