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); }
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); }
public void AddSetting(string name, string value, ConfigurationSettingValueType valueType) { _settings.Add(new ConfigurationSetting(name, value, valueType)); }
public ConfigurationSetting(string name, string value, ConfigurationSettingValueType valueType) { Name = name; Value = value; ValueType = valueType; }