public void SetUp() { _source = new PropertyBag(); _source.Add("key", "val1"); _source.Add("key", "val2"); _source.Add("meaningOfLife", 42); _adapter = new PropertyBagAdapter(_source); }
public static T Get <T>(this PropertyBagAdapter properties, string key, T defaultValue = default(T)) { var result = properties.Get(key); if (result != null) { return((T)result); } return(defaultValue); }