Skip to content

Instantly share code, notes, and snippets.

@christopherbauer
Created July 2, 2015 18:34
Show Gist options
  • Save christopherbauer/07d44ee4157d65a9ad50 to your computer and use it in GitHub Desktop.
Save christopherbauer/07d44ee4157d65a9ad50 to your computer and use it in GitHub Desktop.
[Test]
public void then_should_return_users()
{
// Arrange
var reader = new ConfigurationReader();
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
string a = "A";
string b = "B";
config.AppSettings.Settings.Remove(a);
config.AppSettings.Settings.Remove(b);
config.AppSettings.Settings.Add(new KeyValueConfigurationElement(a, "A"));
config.AppSettings.Settings.Add(new KeyValueConfigurationElement(b, "B"));
config.Save(ConfigurationSaveMode.Modified, true);
ConfigurationManager.RefreshSection("appSettings");
// Act
var users = reader.GetUsers();
// Assert
Assert.That(users, Is.EqualTo("A,B"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment