コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
 public void AddSetting(string name, string value, ConfigurationSettingValueType valueType) {
     _settings.Add(new ConfigurationSetting(name, value, valueType));
 }
コード例 #4
0
 public ConfigurationSetting(string name, string value, ConfigurationSettingValueType valueType) {
     Name = name;
     Value = value;
     ValueType = valueType;
 }
コード例 #5
0
 public ConfigurationSetting(string name, string value, ConfigurationSettingValueType valueType)
 {
     Name      = name;
     Value     = value;
     ValueType = valueType;
 }
コード例 #6
0
 public void AddSetting(string name, string value, ConfigurationSettingValueType valueType)
 {
     _settings.Add(new ConfigurationSetting(name, value, valueType));
 }