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 TestAppConfig() { TestConfigurationClass configuration = new TestConfigurationClass { Name = "name", Sex = MySexEnum.Female }; ConfigManager.SaveConfiguration <TestConfigurationClass>(configuration, m_configurationFileName); TestConfigurationClass loadedConfig = ConfigManager.LoadConfiguration <TestConfigurationClass>(m_configurationFileName); Assert.That(loadedConfig.Name, Is.EqualTo("name")); Assert.Pass(); }
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)); }