public class MyClass {
public static Func<string, string>
GetConfigValue = s => ConfigurationManager.AppSettings[s];
//...
Normal use:
string connectionString = MyClass.GetConfigValue("myConfigValue");
Custom (e.g. Unit Testing) use:
MyClass.GetConfigValue = s => s == "myConfigValue" ? "Hi", "string.Empty";