Exemplo n.º 1
0
        public void LoadSingle(string content, string expectedName, string expectedValue, ConfigurationSettingValueType expectedValueType) {
            var settings = new List<IConfigurationSetting>();

            using (var sr = new StreamReader(ToStream(content))) {
                var cp = new ConfigurationParser(sr);
                while (true) {
                    var s = cp.ReadSetting();
                    if (s == null) {
                        break;
                    }
                    settings.Add(s);
                }
            }
            settings.Should().HaveCount(1);
            settings[0].Name.Should().Be(expectedName);
            settings[0].Value.Should().Be(expectedValue);
            settings[0].ValueType.Should().Be(expectedValueType);
        }
Exemplo n.º 2
0
        public void LoadSingle(string content, string expectedName, string expectedValue, ConfigurationSettingValueType expectedValueType)
        {
            var settings = new List <IConfigurationSetting>();

            using (var sr = new StreamReader(ToStream(content))) {
                var cp = new ConfigurationParser(sr);
                while (true)
                {
                    var s = cp.ReadSetting();
                    if (s == null)
                    {
                        break;
                    }
                    settings.Add(s);
                }
            }
            settings.Should().HaveCount(1);
            settings[0].Name.Should().Be(expectedName);
            settings[0].Value.Should().Be(expectedValue);
            settings[0].ValueType.Should().Be(expectedValueType);
        }
Exemplo n.º 3
0
 public void AddSetting(string name, string value, ConfigurationSettingValueType valueType) {
     _settings.Add(new ConfigurationSetting(name, value, valueType));
 }
Exemplo n.º 4
0
 public ConfigurationSetting(string name, string value, ConfigurationSettingValueType valueType) {
     Name = name;
     Value = value;
     ValueType = valueType;
 }
Exemplo n.º 5
0
 public ConfigurationSetting(string name, string value, ConfigurationSettingValueType valueType)
 {
     Name      = name;
     Value     = value;
     ValueType = valueType;
 }
Exemplo n.º 6
0
 public void AddSetting(string name, string value, ConfigurationSettingValueType valueType)
 {
     _settings.Add(new ConfigurationSetting(name, value, valueType));
 }